identify-bounded-contexts
Identify probable bounded contexts in a codebase using Eric Evans-style Domain-Driven Design heuristics. Use when Codex needs to map domain boundaries, evaluate module ownership, prepare a context map, review whether a service or package split matches the business model, or explain where ubiquitous language changes across folders, services, events, schemas, repositories, handlers, or teams.
- License 许可
- MIT
- 最近更新
- 2026-07-16
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- identify-bounded-contexts
- description
- Identify probable bounded contexts in a codebase using Eric Evans-style Domain-Driven Design heuristics. Use when Codex needs to map domain boundaries, evaluate module ownership, prepare a context map, review whether a service or package split matches the business model, or explain where ubiquitous language changes across folders, services, events, schemas, repositories, handlers, or teams.
02 资源文件 2
- 参考文档agents/openai.yaml230 B
- 参考文档references/evans-bounded-context-signals.md1.9 KB
03 SKILL.md 正文
Identify Bounded Contexts
Overview
Identify bounded contexts from source code, tests, docs, events, schemas, and naming patterns. Ground the analysis in Eric Evans concepts: ubiquitous language, model consistency, context boundaries, relationships between contexts, and translation at integration points.
Workflow
-
Inspect the codebase shape first. Use
rg --files,rg, package trees, module manifests, event names, schema names, ADRs, docs, and test folders to find domain seams before proposing any contexts. -
Extract the domain language. List recurring nouns, verbs, aggregates, policies, workflows, commands, events, and external actors. Look for places where the same word means different things or where different words refer to the same concept.
-
Propose candidate bounded contexts. Group code by consistent model plus business purpose, not by technical layer alone. A candidate context should have a coherent language, core workflows, invariants, and integration surface.
-
Test each boundary. For every candidate context, ask:
- Does the model stay internally consistent?
- Are invariants and business rules mostly local to this area?
- Does the language shift when crossing into adjacent code?
- Is translation needed at events, APIs, persistence mappings, or adapters?
- Would merging this area with its neighbor create contradictory meanings?
-
Identify relationships between contexts. Look for upstream/downstream flows, published language, anti-corruption layers, conformist integrations, shared kernels, or open host style interfaces. Name the relationship only when the evidence is strong.
-
Report confidence and uncertainty. Mark each proposed context as strong, medium, or weak confidence. If the evidence is ambiguous, present alternatives instead of forcing a single partition.
Heuristics
Prefer business capability boundaries over folder boundaries. The folder tree is evidence, not truth.
Prefer language changes over dependency graph changes. If two areas use the same entity name with different rules or meanings, that is a strong boundary signal.
Prefer local invariants over shared data shape. Shared IDs or tables do not prove a single context if the rules, use cases, and meaning diverge.
Prefer translation seams. Mappers, adapters, event translators, DTO conversion, and handoff objects often indicate context boundaries.
Prefer team and ownership clues when available. Separate teams, release cycles, and roadmaps often align with bounded contexts, but business language still wins over org charts.
Treat persistence and transport models carefully. Mongo collections, SQL tables, protobufs, and event payloads can cross context boundaries and should not define the domain model by themselves.
Do not mistake technical layers for contexts.
domain, application, infra, api, and bootstrap are architecture layers, not bounded contexts.
Do not carve out value objects or shared utilities as standalone contexts unless they carry an independent model with their own language and rules.
Output Format
When presenting the result, include:
-
Candidate bounded contexts. For each one, provide name, purpose, main concepts, key files or modules, confidence, and why it is separate.
-
Boundary evidence. Show the concrete code or naming signals that support the split: terms, events, repositories, handlers, schemas, packages, adapters, or tests.
-
Context relationships. Describe likely upstream/downstream flows and where translation happens.
-
Ambiguities and alternative cuts. If the codebase is mid-refactor or the model is inconsistent, say so clearly.
-
Recommendations. Suggest the smallest next steps to clarify the model, such as renaming terms, moving handlers, isolating repositories, or introducing translation objects.
Evidence Threshold
Do not claim a bounded context from one weak signal. Prefer a combination of language, rules, workflows, ownership, and integration boundaries. If the codebase is too thin to support a confident answer, say that you found candidate contexts rather than established ones.
Reference
Read references/evans-bounded-context-signals.md when you need a deeper checklist of signals, anti-signals, and relationship patterns.
04 同仓库更多 Skills
to-prompt-opus
Use when preparing or rewriting prompts for Claude Opus 4.8, Anthropic API agents, XML-structured prompts, long-context document work, coding agents, research synthesis, frontend/design tasks, or model-specific prompt optimization. Do not use for GPT/OpenAI prompts or raw context packaging without Opus-specific tuning.
to-prompt-gpt
Use when preparing or rewriting prompts for GPT-5.5, OpenAI API agents, Responses workflows, coding agents, research synthesis, support assistants, or model-specific prompt optimization. Do not use for Claude/Opus prompts or raw context packaging without GPT-specific tuning.
plan-refactor-qa
Plans and runs qa-report before executing Compozy refactor tasks. Use when the user provides a refactor or issue slug and wants Codex to inspect the matching .compozy/tasks directory, related PRD/TechSpec/ADR/task artifacts, affected code, and existing tests, then invoke $qa-report with a repository-grounded prompt. Do not use to run tests, execute qa-execution, implement code, or perform post-refactor verification.
multi-tool-branch-review
Orchestrates a multi-tool branch review of the current git branch against a base branch. By default it runs two independent thermo-nuclear maintainability audits, one on Codex GPT-5.5 xhigh and one on Claude Opus xhigh, then consolidates the findings into a single remediation plan via writing-plans. If the user explicitly asks for native reviews, it can add the Claude native review pass, the Codex native review pass, or both. Use when the user wants a deep cross-model review of a branch or PR before merge, or asks to review this branch with multiple tools or models. Encodes known infra failure modes and their fixes (missing Claude ACP adapter, Codex MCP auth hangs, false-positive report files, long jobs orphaned inside subagents). Do not use for reviewing a single uncommitted snippet, for non-git work, for running only one reviewer, or when the user only wants a quick lint or test run.
create-pr-with-template
Create a GitHub Pull Request with gh CLI and prefer repository PR templates automatically. Use this whenever the user asks to open/create a PR, especially when template compliance is needed. If multiple templates exist, ask the user which template to use.
ui-craft
Provides guardrails for user-facing UI work: usability heuristics, accessibility floors, design-system discipline, component states, microcopy, motion, dark mode, responsive behavior, and human-AI UX. Use when designing, generating, reviewing, or refactoring visible product surfaces such as components, pages, dashboards, forms, dialogs, loading/empty/error states, or AI interfaces. Do not use for backend-only work, infrastructure, CLI/TUI design, or pure documentation editing.