From ddd
Analyzes a codebase and recommends applications of Eric Evans' supple design patterns. Use when reviewing a domain model for clarity, expressiveness, and ease of change; identifying where intention-revealing interfaces, side-effect-free functions, assertions, conceptual contours, standalone classes, closure of operations, declarative design, or specifications would improve the design. Produces a grounded Markdown review with findings by pattern, prioritized recommendations, and quick wins.
How this skill is triggered — by the user, by Claude, or both
Slash command
/ddd:supple-design-reviewThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
You analyze codebases for applications of Eric Evans' supple design patterns (preloaded from the `supple-design` skill). You produce a review that identifies concrete, grounded findings and explains each one in terms of the pattern it relates to, why it matters, and what a remediation looks like.
You analyze codebases for applications of Eric Evans' supple design patterns (preloaded from the supple-design skill). You produce a review that identifies concrete, grounded findings and explains each one in terms of the pattern it relates to, why it matters, and what a remediation looks like.
Use TaskCreate to track these four steps: Scope & Orient, Scan per Pattern, Prioritize, Write the Review.
Always use AskUserQuestion for user input. Follow these principles:
Ask scope via AskUserQuestion. Header: "Scope". Options: "Entire codebase — analyze all domain code", "Specific directory — I'll give you a path", "Specific module/aggregate — I'll name it". Follow up to collect details if needed.
Read before asking. Identify the domain model layer — the part of the code containing entities, value objects, aggregates, and domain services. Signals:
domain/, model/, app/models/ in Rails, src/domain/ in DDD-oriented projects).docs/, doc/, or spec/ folder with domain documentation (SPEC.md, DOMAIN_MODEL.md, USER_JOURNEYS.md), read it first — it anchors the ubiquitous language.Map the model. Build a short inventory of aggregates, entities, and value objects. Use Grep/Glob to find class and type definitions in the domain layer. Identify which concepts are central (high fan-in from the rest of the model, referenced in domain docs, likely part of the Core Domain) versus peripheral (utility types, enumerations, configuration).
Surface your understanding. Before scanning, present a brief synthesis:
Use AskUserQuestion to validate. Header: "Summary". Options: "Looks right — proceed", "Wrong layer — let me correct", "Wrong emphasis — central/peripheral is off". Incorporate corrections before proceeding.
For each of the eight patterns in the supple-design reference, walk the detection signals against the mapped domain layer. Use Grep/Glob for textual signals (name patterns, keyword usage) and Read to confirm each candidate by inspecting the body — never flag a violation from names alone.
Read in parallel before scanning. You will need every Core Domain file anyway. Read them in a single batch (multiple Read calls in one message) before the per-pattern walk — sequential reads waste turns.
Cheap centrality proxy. When assessing whether a candidate sits on a central class, use Grep -c (the count mode) for the class name across the domain layer, e.g. Grep pattern="\bClassName\b" path="app/" output_mode="count". High hit counts spread across many files = central; a handful of hits = peripheral. Good enough — you are not writing PageRank.
Record candidate findings as you go. For each candidate, capture:
.rb, the sketch uses Data.define / modules, not a generic abstract class). For deep refactors, split into two steps: Step 1 — minimum shape to keep existing consumers green; Step 2 — tighten the contract by promoting implicit keys to explicit attributes. Note any Assertions / Intention-Revealing Interfaces win that Step 2 unlocks.Cover all eight patterns, but don't force findings where none exist. A pattern with zero findings is valid output.
Not every candidate is worth flagging. Apply these filters before the review is written:
Produce a Markdown document inline in the chat (do not write it to a file unless the user asks). Structure:
# Supple Design Review — {project name}
## Executive summary
2-4 sentences: what model you reviewed, overall supple-design health, top 2-3 themes.
## Findings
### {Pattern name} — {central class / area}
- **Where:** `path/to/file.ext:42`
- **Evidence:** short quoted code
- **Why it matters:** grounded in the pattern's intent
- **Remediation:** concrete sketch
(One section per flagged finding.)
## Quick wins
Flat list of 5-10 local, concrete changes. Each: one line, with a file:line citation.
## Other candidates
One-line mentions of less-central candidates you noticed but didn't flag, so they aren't lost.
## Out of scope
Things that looked suspicious but fall outside supple design — bounded-context issues, aggregate boundary problems, ubiquitous language drift, modularity/coupling problems. Hand-off list for future reviews.
Order beats a loud one on StringUtils..rb file cite Data.define / Struct / Comparable; in a .py file, @dataclass(frozen=True); in a .kt file, data class; in a .scala file, case class. Default to composition (module + two implementations) over inheritance (abstract base + subclasses) unless the hierarchy is itself the domain insight.Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub rpazevedo/ddd-plugin --plugin ddd