testdouble/han/ddd-analysis
Claude Code and agent skill by testdouble/han
- community
Checking that the SKILL.md file is still in the repository.
"Analyzes an existing codebase using strategic Domain-Driven Design to discover bounded contexts, surface ubiquitous language and semantic collisions, find places where code boundaries diverge from domain boundaries, and produce an evidence-backed domain and context map. Use when the goal is DDD-specific: bounded context discovery, ubiquitous language analysis, domain model discovery, or mapping contested ownership and responsibility. The entire repository is a valid scope; no module or directo…
Install
npx vskill@latest install testdouble/han/ddd-analysisSKILL.md
The same SKILL.md was published earlier as majiayu000/claude-skill-registry/ddd-analysis.
Project Context
- git installed: !
which git 2>/dev/null || echo "not installed" - CLAUDE.md: !
find . -maxdepth 1 -name "CLAUDE.md" -type f - project-discovery.md: !
find . -maxdepth 3 -name "project-discovery.md" -type f - personal config directory: !
bash "${CLAUDE_PLUGIN_ROOT}/scripts/han-config-dir.sh" 2>/dev/null || echo "$HOME/.claude" - project .han/config.md: !
cat .han/config.md 2>/dev/null || echo ""
As your first action, use the Read tool on .han/config.md inside the personal config directory path above. A read that returns no file is no personal configuration: continue silently. When that file or the project .han/config.md probe supplies content, apply it per config-rule.md, which governs precedence between the two files, relative-path resolution, and what to do with a file that reads but cannot be used.
Operating Principles
Read these before dispatching anything. They constrain every step below.
- The entire repository is a valid scope. No focus area is required. If the user names a module or directory,
restrict the analysis to it; otherwise, scope is the full repository. Do not ask for a focus area when none was given.
- Discovery and context model only. No migration plans. This skill characterizes what the domain structure is.
It does not produce recommendations for service splits, migration steps, or refactoring work. When the context model surfaces a decision the team wants to act on, the right next step is han-planning:plan-a-feature (to specify a change) or han-coding:architectural-analysis (for a code-level view of a specific module). The context model informs those steps; it does not replace them.
- Analysis surface partitions organize agent work, not context proposals. The inventory step identifies
tractable areas for structural and behavioral analysis. These partitions are analytical conveniences — they must never be mentioned in any agent brief as context candidates or suggested boundaries.
- The agents own the judgment; the skill orchestrates. The skill resolves scope, surveys the surface, classifies
depth, briefs the agents, collects their output, and renders the report. It does not produce DL#, CAP#, OWN#, S#, B#, or BCM# findings itself.
- Negative results are valuable. A module with no domain events and only CRUD operations is evidence, not a gap.
Agents must not fabricate findings to fill sections.
- Exactly one revision loop. The skill dispatches bounded-context-modeler, then bounded-context-critic, then
bounded-context-modeler once more with the critique. The loop is closed after the revision pass. The skill does not self-escalate or repeat this cycle.
- **The report template lives at
references/ddd-analysis-report-template.md.** The skill renders that template by synthesizing agent output into each section following the template's placeholder instructions. It does not invent a structure inline.
- The synthesized prose is written for a named reader. As the skill writes each section, it invokes
han-communication:readability-guidance and applies the shared standard, holding one audience above the writing: the engineer or product manager reading the context model and deciding what to do next.
Run a DDD Analysis
Step 1: Resolve Scope and Load Project Context
Bind `$size`. If the user passed small, medium, or large as the first positional argument, bind $size to it. If $size is none provided and the project config supplies a default-swarm-size value via config-rule.md, adopt that value as $size and note the config as the source. If no value is available from either source, set $size to medium.
Resolve the focus area. Take the remaining argument and conversation context as the focus area. If a focus area was supplied, confirm it resolves to real files using Glob and Read. If it does not resolve to actual files, stop and ask the user to clarify before proceeding. If no focus area was supplied, the scope is the entire repository — do not ask for one.
Resolve project context. If CLAUDE.md is present (see Project Context), read its ## Project Discovery section for language, framework, and convention signals. Fall back to project-discovery.md if present. If neither exists, discovery agents will infer from surrounding code — note this in every agent brief.
Note git availability. Read the git installed value from Project Context. If it is empty or reads not installed, git is unavailable: note this in the agent briefs and in the report.
State the driving concern, if any. If the user named a concern ("I think billing and subscriptions overlap", "we need to understand where auth ends and identity begins"), capture it. Pass it to each discovery agent as a directing note — it biases attention without narrowing scope.
Resolve the run folder. Determine where this run's artifacts will land before dispatching any agent:
- Configured `output-directory`: When the config read above supplied an
output-directory, resolve it per
config-rule.md (relative path resolves against the file that declared it; ~/ expands to home; full path is used as-is). Write the run folder beneath that resolved base.
- No configured value: Write outside the repository — use
${TMPDIR:-/tmp}as the base. This keeps an
unconfigured analysis out of version control, matching the same principle that governs code-overview.
Run date +%Y%m%d-%H%M%S via Bash to obtain a timestamp suffix. Name the run folder ddd-analysis-{timestamp} inside the resolved base. If that directory already exists, check for -2, -3 suffixes until the name is free. Run mkdir -p {run_folder}/discovery {run_folder}/synthesis to create the full directory tree. Set $run_folder to the absolute resolved path — this value threads through every subsequent step.
If the resolved base cannot be written (permission error, path does not exist), fall back to ${TMPDIR:-/tmp}/ddd-analysis-{timestamp} and record the failed path so Step 12 can name it.
Step 2: Inventory the Analysis Surface
Survey the repository structure within the resolved scope. Use Bash and Glob to identify:
- Top-level layout: the first two directory levels of the source tree
(find {scope} -maxdepth 2 -type d | head -60)
- Entry points: files named
main.*,index.*,app.*,server.*,cli.*, orbootstrap.* - Persistence: directories and files named
model,models,entity,entities,schema,schemas,
migration, migrations, repository, repositories
- APIs and integrations: directories named
routes,controllers,handlers,api,endpoints,
resolvers, clients, adapters, connectors, external, integrations
- Jobs, workers, and events: directories and files containing
job,worker,task,queue,consumer,
subscriber, event, Event
Record the inventory as a compact list of paths — this is context for later briefs, not a finding.
For large repositories: If the resolved scope is the entire repository and the top-level source tree contains more than ten distinct application areas by directory, identify 3-5 meaningful partitions based on the directory structure and names (for example: billing, fulfillment, identity). Include these partitions in the han-core:structural-analyst and han-core:behavioral-analyst briefs in Step 4 to keep those analyses tractable. These partitions are not context candidates and must not be named as such.
Step 3: Classify Depth
Depth bands control the calibration directive passed to the discovery agents. They do not change which agents are dispatched; this skill always dispatches exactly five discovery agents.
- Small — surface scan. For language, capability, and ownership agents: highest-frequency terms, most
obvious collisions, commands and domain events only, authority mapping and obvious contestation only. For structural and behavioral agents: top-level module boundaries and primary entry points only. Appropriate for an initial orientation pass or a very large repository.
- Medium _(default)_ — full analysis. All dimensions for language, capability, and ownership agents; full
static structure and behavioral analysis. Appropriate for most repositories.
- Large — exhaustive pass. All dimensions for language, capability, and ownership agents with emphasis on
cross-module collision detection, workflow discovery, and contestation. For structural and behavioral agents: full analysis with emphasis on inter-module coupling, cross-module data flow, and integration boundaries. Appropriate for large, long-lived repositories or when the team needs a comprehensive model before a major architectural decision.
Step 4: Announce and Dispatch Discovery Agents
Announce in one line before dispatching:
Scope: {entire repository | focus area path}. Depth: {small | medium | large}. Dispatchinghan-ddd:domain-language-analyst,han-ddd:business-capability-analyst,han-ddd:domain-ownership-analyst,han-core:structural-analyst, andhan-core:behavioral-analystinparallel. Git {available | unavailable}.
State any driving concern the user supplied. Proceed without a blocking confirmation — this analysis is read-only and re-runnable.
Dispatch all five agents with concurrent `Agent` calls. Each agent reads the codebase independently.
Brief for han-ddd:domain-language-analyst:
- The resolved scope and the instruction to work across the full scope.
- The inventory summary from Step 2.
- Calibration: small — highest-frequency terms and most obvious collisions only; medium — full vocabulary
inventory and all six dimensions; large — all six dimensions with emphasis on exhaustive cross-module semantic collision detection.
- The resolved project-context conventions, or a note that none were found.
- The driving concern, if any.
- Reminder: language-signal evidence only — no bounded-context proposals, no service-split recommendations.
- Ask the agent to prefix findings
DL1,DL2, … exactly. - Artifact path: write complete findings to
$run_folder/discovery/domain-language.mdand return only the path
written, the total DL# count, and a two-sentence summary of the highest-value signals.
Brief for han-ddd:business-capability-analyst:
- The resolved scope and the instruction to work across the full scope.
- The inventory summary from Step 2.
- Calibration: small — commands and domain events only; medium — all six dimensions; large — all six dimensions
with emphasis on cross-module workflow discovery and capability-boundary ambiguity.
- The resolved project-context conventions, or a note that none were found.
- The driving concern, if any.
- Reminder: capability evidence only — no bounded-context proposals, no service-split recommendations.
- Ask the agent to prefix findings
CAP1,CAP2, … exactly. - Artifact path: write complete findings to
$run_folder/discovery/business-capabilities.mdand return only the
path written, the total CAP# count, and a two-sentence summary of the strongest behavioral signals.
Brief for han-ddd:domain-ownership-analyst:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckinghan-ddd/skills/ddd-analysis/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/testdouble/han/ddd-analysis)