/planning:design [library|module|data|integration|system] [status|thread <name>|discuss|terminology|handoff]from planning
Resolves design decisions (types, contracts, package topology, module boundaries) in rounds before planning. Use for type modeling, domain modeling, or structuring abstractions.
Ships in planning. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Arguments. [library|module|data|integration|system] [status|thread <name>|discuss|terminology|handoff]. e.g., /planning:design library, /planning:design module, /planning:design status, /planning:design discuss,
/planning:design handoff
Arguments: $ARGUMENTS
Design answers what before /planning:plan answers how: types, boundaries and package topology the user has validated through discussion. Exploration maps existing code, research gathers external
facts, this skill turns both into a design. When the problem is still rough and no approach is
chosen, diverge first via /planning:brainstorm (cheapest→most-ambitious candidates, user
reacts), then design the direction that resonated.
Level this skill decides: interfaces and contracts, the types, boundaries and module shapes
other code depends on; behavior is the interview's Brief, and files and symbols are
/planning:plan's.
Depth scales to the work:
design-resolution.md with outcome: early-exit, tier C,
and reason. Then invoke /planning:design-handoff via the Skill tool, which writes PLAN.md's
one-line ## Design record and hands off to /planning:planThe stage always runs; early-exit is a valid outcome. Gate artifact: Tier C and light Tier B
early-exits MUST produce design-resolution.md in the topic's design slice
(<memory_dir>/<topic-slug>/design/, default .work/) so /planning:plan's prerequisite check
can verify the gate without conversation memory.
---
outcome: early-exit
tier: C
reason: <one line, e.g. single-file bugfix, docs-only>
---
Tier B (required): the type sketch, inline or as a link to type-inventory.md.
/planning:design-handoff quotes it into PLAN.md's `### Contracts`.
These hold after a compaction re-attach. Later sections say how to carry them out.
${CLAUDE_PLUGIN_ROOT}/reference/variation-points.md
"Autonomy".Basis: line: verified with the file:line, tool output,
or URL it rests on, or judgment (non-consequential only). A consequential one (cross-repo,
shared infrastructure, irreversible, or security) is grounded before it is presented; one
research cannot settle is withheld, recorded as a deferred thread whose research tag names
the evidence that would settle it.Parse $ARGUMENTS for scope and action:
| Argument | Action |
|---|---|
| (empty) | Auto-detect. Read the PLAN.md Brief + conversation to determine scope and phase. Resume if design artifacts exist. Ask if ambiguous |
library | Library/API design. Packages, types, contracts, dependency graph |
module | Module design. Domain model, boundaries, contracts. Suggest a domain-event workshop (e.g. EventStorming) when the environment provides one |
data | Data model design. Entities, relationships, schema decisions |
integration | Integration design. Cross-system contracts, sequence flows, error handling |
system | System design. Components, communication patterns, deployment topology |
status | Status report. Resolution state per thread and question |
thread <name> | Deep-dive. One design thread |
discuss | Discussion round. Systematic gap-finding across all artifacts |
terminology | Naming review. Cross-cutting naming pass over the full type inventory (see "Terminology pass") |
handoff | Handoff gate. Delegates to /planning:design-handoff (see "Handoff gate") |
Phases may interleave. Track which have produced artifacts and which have open questions.
All artifacts live in <memory_dir>/<topic-slug>/design/ (default .work/), never committed;
/planning:plan's gate reads the gate files (design-threads.md, design-resolution.md) from
there. Placement:
${CLAUDE_PLUGIN_ROOT}/reference/artifact-protocol.md.
/planning:design-handoff writes the durable content (module layout, contracts, variation
verdicts, conventions followed) into PLAN.md's ## Design, the copy that reaches the plan, the
implementer's brief, and the pull request body or linked issue where PLAN.md is published. Derive
<topic-slug> from the task or branch name (git branch --show-current; the task alone when that fails), kebab-case, ≤40 chars, shared with /planning:interview and /planning:plan. Skip
artifact creation for read-only actions (status).
Read the Brief's ### Problem before decomposing; absent, start from the Problem, Intent (why, in the user's words) and Chosen direction lines of <memory_dir>/<topic-slug>/brainstorm.md's
## Handoff block when it exists; with neither, establish it:
${CLAUDE_PLUGIN_ROOT}/context/problem-framing.md. Its
time_units user layer is ${user_config.time_units} (unexpanded means unset).
Then read the consumer's standards whose Applies when matches the design's concerns, resolved through the "Resolution ladder" section of ${CLAUDE_PLUGIN_ROOT}/reference/standards-contract.md, and list each one applied under conventions followed. Read guidance through the binding's "Guidance layer (every rung)" paragraph: advice below every standard.
Scan the whole problem space broadly before diving into any single capability. For each capability or concern:
When the work adds a requirement to existing code, ask before Phase 3: had this requirement been known when the code was first written, which types and boundaries would it have? Take that answer as the target shape, not the current shape with the requirement bolted on.
Produce: capability-matrix.md (library scope) or equivalent per scope.
Identify cross-cutting decisions that affect multiple capabilities. For each thread: name the decision, list concrete options with tradeoffs, and resolve through discussion or defer with rationale + research tag. Status: resolved (decision made), directional (direction agreed, details deferred), deferred (needs research).
Two-candidate step. Take it when the codebase has nothing to copy for the thread, more than one approach is workable, and the decision is hard to reverse (a public contract, a stored format, a boundary other modules will build on):
design-threads.md.When the thread is about how a screen or interaction looks or feels, invoke
/prototype:explore-directions (if enabled) via the Skill tool. When the
candidates differ in logic or state (the rules, a state machine, a data model, an API surface) and
a run can settle the fork, invoke /prototype:pressure-test observe (if enabled) via the Skill tool, because running each candidate on the same inputs shows which one
holds where arguing them only predicts it. The test: name the event sequence or record that the
criteria turn on; when nobody can yet say with confidence how each candidate handles it, a run
settles the fork (pstack's exhaust-the-design-space principle). Confirm the scope of the
throwaway with the user before either route. When neither route applies or its skill is
unavailable, run the three steps here, describing each candidate in prose.
Open these threads when their trigger holds:
/testing:plan (if enabled); cite it, or without that plugin
apply standard test-design judgment. The sketch is input, not the decision: /planning:plan's
Test strategy names the test boundaries from it and its Step 5 approval settles them; a seam the
design needs as a contract still goes in Contracts.Round one names each of these threads whose trigger holds; test-seam's holds for any feature with a testable surface. One waiting on an unresolved thread is named with it and asked once that thread resolves.
Variation-point pass. Always for integration, module, and system; for library and
data, when the design touches an external system or a domain category. List every variation
point (every external integration is one), ask the two questions (likelihood of a second variant,
cost of change after shipping), and open one thread per point that resolves to a verdict: abstract
now, contain now and abstract later (the default for anything external), or leave inline (internal
one-offs only). Run the leak test on every abstraction and contained boundary, and place seams
where the solution's existing architecture style already puts them. Questions, verdicts, leak test,
autonomy rule, and sources:
${CLAUDE_PLUGIN_ROOT}/reference/variation-points.md.
A variation-intent answer from /planning:interview is settled, never re-asked.
Collaborative canvas mode. When a thread's question is structural (module boundaries,
topology, a data shape, a flow) and the person is present, offer once to work it out on a live
canvas through /visualization:visualize (if enabled) in collaborative canvas mode. Offer it on no
other question. When the canvas closes, ask for the fenced form: the written design artifact stays the record.
Produce: design-threads.md
system scope only: read reference/system-scope.md "System-scope steps".
The phase ends with a type-inventory.md in which every type traces to a call site that needs it,
and each type's shape is set by the operations its busiest paths run on it. Two checks prove it:
Apply reference/type-discipline.md: Phase 3 meets each of its
situations while it fills type-inventory.md, so find the row that matches and make its decision.
The inventory covers:
/domain-driven-design:ubiquitous-language curate (if enabled) via the Skill tool
the moment a domain term resolves, so the glossary owner applies the consumer's format,
placement, and context routing; without it, record the resolved term and rejected synonyms in
the design artifactsProduce: type-inventory.md
Close Phase 3 by auditing the inventory: for each type, follow one value from where it is made to where it is read. A fault at any stop sends that type back to the design threads.
Once type modeling stabilizes, run the terminology action over the whole inventory; per-type
naming during modeling does not replace it.
When the work adds, splits, merges or moves a module or its interface, invoke
/architecture:principles (if enabled) via the Skill tool before writing the topology, and name
modules, interfaces, seams and adapters in its terms. For modules that already exist, name
/architecture:improve (if enabled) as the step that finds which ones to reshape; this skill scans
no code. When the architecture plugin is not enabled, say once that it would supply the
module-design vocabulary and the friction scan, and proceed from
design-principles.md.
Produce: library-topology.md (library scope) or equivalent per scope.
When the dependency graph reads more clearly visually, optionally also emit a self-contained HTML
topology view to the OS temp directory, never beside library-topology.md, which stays the record.
Rules:
${CLAUDE_PLUGIN_ROOT}/reference/artifact-protocol.md.
Resolve medium first per
${CLAUDE_PLUGIN_ROOT}/reference/rendered-view.md
"Other optional views", with this plugin's medium option ${user_config.medium}, or "" when that
reads empty or unsubstituted (never put a ${user_config.*} string in a shell command), and follow
its result, which names the report line to print.
Each round:
/planning:plan Step 5
documents): public contracts, data shapes, and user-facing surfaces lead; settled-looking
mechanical threads sit at the bottom. Order only; thread dependencies still govern what can
resolve when./corrections:codify (if enabled) is among the
available skills, hand it the choice of mechanism; it picks the strongest rung of the
enforcement ladder that can decide the rule and proves the check. Call it as
/corrections:codify "<the principle>" (if enabled). When the corrections plugin is not
enabled, propose the strongest mechanism that can
decide the rule: a change that makes the mistake impossible first, then a check that blocks it,
then a test, and an instruction only when nothing a machine runs can decide it. Say that
the corrections plugin was not available, so the proposal is unproven. When codify stops with no
proposal, as it does below its recurrence threshold, propose the same way and say that it
stopped.Continue until no new gaps surface, then run the handoff action.
Skip on early-exit, status, or trivial single-file work. Otherwise call each significant decision
a one-way or two-way door, prompt an ADR for each one-way door, and scale investment by subdomain
and quality bar: reference/reversibility.md.
The round that first calls a decision a one-way door recommends, in that question, an ADR once
the thread resolves: /architecture:adr (if enabled), otherwise one the person writes.
terminology action)Over the full type inventory, once type modeling stabilizes:
Result<T> when the
stack already ships one)type-inventory.md/domain-driven-design:ubiquitous-language curate (if enabled) via the Skill tool to sync resolved
terms and rejected synonyms into the project's glossary; the table above is the standalone
fallbackhandoff action)Invoke /planning:design-handoff via the Skill tool. It is the only gate implementation: it checks
design-threads.md (or the design-resolution.md early-exit artifact) and on PASS emits the
plan-ready summary and resume prompt. This skill carries no gate criteria of its own; criteria changes land in
/planning:design-handoff only.
On PASS, offer an interactive design view of PLAN.md's ## Design (its sections, a tick for each one
the reader questions, a copy-out of the reply, sent to this session when connected). PLAN.md stays the
record. Build it only with ${CLAUDE_PLUGIN_ROOT}/scripts/build-view.mjs from that record, never
hand-written; it runs the shared medium resolver and publish gate with this plugin's medium option
${user_config.medium}, or "" when that reads empty or unsubstituted (never put a
${user_config.*} string in a shell command), and you print the report line it prints. Procedure:
${CLAUDE_PLUGIN_ROOT}/reference/rendered-view.md.
Stub files (scaffold_stubs). Before invoking the gate, resolve scaffold_stubs, lowest layer
first: the default false; the plugin's user config (${user_config.scaffold_stubs}, where a
literal unexpanded value means unset); then the scaffold_stubs key of the repository's
docs/conventions/planning.yaml, which wins when set, read only when the working directory's git
root is neither $HOME nor an ancestor of it. Only the bare booleans true and false are valid:
any other value, a quoted "true" included, is named with its file (or user config), key and
value, and that layer is dropped, so a valid higher layer still wins and otherwise the key is
false. Report one line naming the value and its layer, e.g.
scaffold_stubs: true (docs/conventions/planning.yaml). Keys and layers:
${CLAUDE_PLUGIN_ROOT}/reference/config.md.
With true, add a ## Stub scaffold section to design-threads.md (or to design-resolution.md
on an early exit) listing every new file the design introduces, each with the signatures it will
declare (types, function and method signatures, exported constants), from the resolved type
inventory and contracts. Each stub body is the language's ordinary not-implemented form, with no
per-language reference file. After the gate passes, the handoff output names those files and
signatures so /planning:plan can place the stub phase. With false, write no such section and name no stubs.
| Scope | Primary artifacts | Typed artifact | Dialect |
|---|---|---|---|
library | capability-matrix.md, type-inventory.md, library-topology.md, design-threads.md | none | none (no typed artifact, so no scope label) |
module | domain-model.md, module-boundary.md, contracts.md, design-threads.md | none | none (no typed artifact, so no scope label) |
data | entity-relationships.md, schema-decisions.md, design-threads.md | entity-relationships.md | mermaid erDiagram by default; DBML when diagram_dialect.data resolves to dbml |
integration | contract-spec.md, sequence-flows.md, design-threads.md | sequence-flows.md, contract-spec.md | mermaid sequenceDiagram for the flows; an OpenAPI 3.1 sketch for the contract spec |
system | component-map.md, communication-patterns.md, design-threads.md | component-map.md, and only when diagram_dialect.system names a dialect | a C4 container view in LikeC4 or C4-PlantUML, never Mermaid's C4 diagrams |
design-threads.md is common across all scopes.
For a scope whose row names a typed artifact, read ${CLAUDE_SKILL_DIR}/reference/typed-artifacts.md. Its <plugin-root> is ${CLAUDE_PLUGIN_ROOT} and its <project-root> is ${CLAUDE_PROJECT_DIR} (unexpanded or empty means unset).
AskUserQuestion only when the plugin's
use_ask_user_question user config (${user_config.use_ask_user_question}; unexpanded or empty means off) is on and the round
is independent questions that fit one AskUserQuestion call (the per-call question limit:
https://code.claude.com/docs/en/agent-sdk/user-input#limitations). Inline prose otherwise/discovery:explore (if enabled) and /discovery:research (if enabled). A recommendation that changes is
restated as old → new → why. Contract:
${CLAUDE_PLUGIN_ROOT}/context/recommendation-basis.md${CLAUDE_PLUGIN_ROOT}/context/self-answer.md: a fact it settles
is stated with its basis and source tag, not asked/corrections:codify (if enabled) the choice of
mechanism; it picks the strongest rung of the enforcement ladder that can decide the rule and
proves the check. Call it as /corrections:codify "<the principle>" (if enabled). When the corrections plugin is not enabled, propose the
strongest mechanism that can decide the rule: a change that makes the mistake impossible first,
then a check that blocks it, then a test, and an instruction only when nothing a machine runs
can decide it. Say that the corrections plugin is not enabled, so the proposal is unproven.
When codify stops with no proposal, as it does below its recurrence threshold, propose the same
way and say that it stoppeddesign-threads.md and peers) from disk before
every write, since another turn or agent may have changed them, and prefer appending or refining
over wholesale rewrites/planning:plan can
sequence phases/discovery:research (if enabled) for a deferred item needing
external research, and the terminology then handoff actions at the session taillibrary, module, data, integration,
and system scopes, when discussion touches configurability, extension points, observability,
or testability, open a design thread for it. Extension points start from the Phase 2
variation-point pass. Skip on early-exit, status, or trivial single-file work. Apply
reference/design-defaults.md first (quality bar, consumer
standards, the Brief's quality requirements, generalize-now-or-wait, per-tenant configurability
as vendor guidance), then recommend from every principle
design-principles.md lists./planning:plan (phases, sanity checks, file-level work items)/visualization:visualize (if enabled), else the plainest correct form is emitted/user-experience:shape (if enabled); look and response are /user-interface:design (if enabled)/planning:prd (problem, users, success metrics)/planning:interview (goal, constraints, acceptance criteria)## Design for the plan.| Skill | Relationship |
|---|---|
/planning:interview | Before. Locks the brief (scope + constraints); design explores the solution space within them |
/domain-driven-design:ubiquitous-language curate (if enabled) | During. Owns project-glossary updates when design resolves domain language; not type or boundary design |
/visualization:visualize (if enabled) | During. Owns visual-form choice and mermaid craft for a typed artifact's fenced block |
/naming:name-it-better (if enabled) | During. Proposes candidates for a name the design leaves undecided; the human picks, and the pick is recorded in the terminology table |
/architecture:principles (if enabled) | During. Supplies the module-design terms the topology uses when the work changes module structure (Phase 4) |
/architecture:improve (if enabled) | Before. Finds which existing modules to reshape; design decides the new shape |
/architecture:adr (if enabled) | During. Records the ADR for a one-way door when its thread resolves (reference/reversibility.md) |
/work-items:decompose (if enabled) | After. Reads a typed artifact's scope and dialect label to inline it into the spec container with a provenance note, and quotes each slice's part of PLAN.md's ## Design into that slice's body |
/discovery:explore (if enabled) | Before. Maps existing code; design creates what should exist |
/discovery:research (if enabled) | Before + parallel. Gathers external facts; deferred research items can run in parallel |
/planning:design-handoff | The gate. Owns the design→plan gate criteria and the plan-ready summary |
/planning:plan | After the handoff gate. Produces HOW; when design artifacts exist it consumes them instead of re-deriving design |
evals/evals.json (opens in a new tab)reference/design-defaults.md (opens in a new tab)reference/reversibility.md (opens in a new tab)reference/system-scope.md (opens in a new tab)reference/type-discipline.md (opens in a new tab)reference/typed-artifacts.md (opens in a new tab)templates/design-view.html (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
11 skills in this plugin
/audit-answersAudit answersRe-check a filled /planning:interview ledger with fresh-context subagents blind to answer rationales; only doubtful answers return. Use to validate answers, auto-answer, or second-guess ('audit my interview answers', 'have agents check the answers', 'verify the ledger'). Not for plans: /planning:devils-advocate; new: /planning:interview./brainstormDiverge before scoping: turn rough engineering problem into codebase-grounded candidate approaches (cheapest to ambitious), pick what resonates, hand off scoped. Use for problem ideas, intervene, how could we approach/what could we do, no locked scope ('brainstorm', 'what are my options', 'explore some approaches'). Not for locked/visuals./npx claudepluginhub melodic-software/claude-code-plugins --plugin planningOther plugins' skills for the same job