skills/src/design-doc/SKILL.md
Creates or reviews a design document (mode=create|review). Create mode: iterative dialogue producing design docs and ADRs. Review mode: independent sub-agent verification of an approved design doc. Use this skill whenever a feature, API, architecture, or data model change would benefit from written design before coding — even if the user doesn't explicitly say "design doc". When in doubt, invoke this skill first.
npx skillsauth add shuymn/dotfiles design-docInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
<skill-root> means the directory containing this SKILL.md.scripts/... and references/... relative to <skill-root>, not the caller's current working directory.<skill-root>/scripts/....Determine the execution mode from $ARGUMENTS:
$ARGUMENTS is exactly review, or $ARGUMENTS contains --review or mode=review → Review Mode: read references/review-mode.md and follow its instructions.# Design Doc Creation)Create design documents through iterative dialogue with the user, capturing design decisions as Architecture Decision Records (ADRs).
- **Key**: value).Do NOT take any of these actions until the design doc is explicitly approved by the user:
decompose-plan skilldocs/Reason: premature artifacts create sunk-cost pressure that biases design feedback — it is far cheaper to change a design doc than to revert code written against an unapproved design.
No exceptions. Not even "just setting up the structure" or "a quick prototype to validate."
For breaking changes or staged migrations, the design doc must specify lifecycle closure, not only end-state architecture.
## Compatibility & Sunset section.Temporary Mechanism Index with stable IDs (TEMPxx) and lifecycle-record pointers.Sunset Closure Checklist row for every TEMPxx (required even when lifecycle record details are in ADR).TEMPxx, choose a lifecycle record:
Temporary Mechanism Index row must define:
TEMPxx checklist row must define:
Compatibility & Sunset and include a matching ADR Sunset Clause.Owner and Target milestone/date are required only when coordination or handoff risk exists (for solo development, keep them optional).TEMPxx index row, checklist row, or closure fields is a design gap, not an implementation detail.TEMPxx IDs are lifecycle-governance artifacts; downstream planning should track them in trace artifacts, not as standalone task-list entries.Default to a single design doc. Use root/sub split only when structural conditions require it.
Split Decision: single## Decomposition Strategy.### Boundary Inventory for every design, even when Split Decision: single.### Boundary Inventory must use exactly these columns: Boundary, Owns Requirements/AC, Primary Verification Surface, TEMP Lifecycle Group, Parallel Stream, Depends On.Owns Requirements/AC to record the owned ID range/summary for boundary-owned rows; use Integration-only for root-only integration rows.Parallel Stream values yes or no; use Depends On as comma-separated boundary names or none; use TEMP Lifecycle Group as a shared lifecycle label or none.Split is required if any of these are true:
TEMPxx lifecycle differs by domain.requirements -> tasks traceability unambiguous.Split is discouraged (keep single) if any of these are true:
If Split Decision: root-sub, require:
### Boundary Inventory must map 1:1 to Sub-Doc Index Owned Boundary.When the design modifies existing behavior, APIs, runtime paths, or tests, do not treat design as greenfield.
## Existing Codebase Constraints section in the design doc.only, must not, remove, retire, no fallback, fail-closed, 唯一, 廃止, 禁止. Include both:
BLOCKED and request missing context before finalizing design.Classify change areas by defect-impact severity. Risk tiers are defined by humans, not auto-inferred by agents. The tier definitions below describe semantic characteristics — the exact areas that qualify depend on the product and domain context.
| Tier | Semantic Characteristics | Downstream Effect |
|------|-------------------------|-------------------|
| Critical | A defect would cause irreversible damage, security breach, data loss, financial harm, or compliance violation. The blast radius extends beyond the immediate component to users, external systems, or regulatory boundaries. Common examples (not exhaustive): authentication, billing, access control, encryption, PII handling. | Change Rationale required. adversarial-verify mandatory after dod-recheck. |
| Sensitive | A defect would silently corrupt state, break contractual interfaces, or require coordinated rollback across multiple components. The failure mode is typically delayed or hidden rather than immediately visible. Common examples (not exhaustive): DB schema, API contracts, state management, external integrations. | Change Rationale required. Heightened dod-recheck scrutiny applies. |
| Standard | A defect would be caught by normal testing or cause a visible, locally-contained failure with straightforward rollback. Common examples (not exhaustive): feature components, tests, documentation, configuration. | Normal DoD verification. |
## Risk Classification section of the design doc.## Risk Classification is mandatory when either condition is true:
Defect Impact: [what breaks on defect] / Blast Radius: [scope of impact].Not Critical: [reason] / Not Sensitive: [reason].design-doc → decompose-plan (task-level tier inheritance) → execute-plan (verification intensity).Default to the Core Profile. Add sections only when triggered.
Core Profile (always include): Overview, Goals, Non-Goals, Proposed Solution, Detailed Design, Acceptance Criteria. Add Background only when extra context is needed.
Non-Goals quality rule: list only things a reader could reasonably infer are in scope after reading Goals, but are actually excluded. Test: "would a reasonable engineer assume this is included?" — if yes, state it is out of scope. Omit anything with no logical connection to the goals, regardless of how it came up: casual conversation mentions, reference-doc features dismissed as unneeded, or "we won't do X" rejections that no one would have inferred were in scope.
Default-prohibited sections — add only when trigger is met:
| Section | Trigger |
|---|---|
| Compatibility & Sunset | Breaking change or staged migration (see Lifecycle Contract for required TEMPxx details) |
| Operational Considerations | 2+ teams impacted, or monitoring/rollout changes required |
| root-sub decomposition | Meets Decomposition Strategy Contract conditions |
| Risk Classification | Design is non-greenfield, or greenfield touching Critical domains (auth, billing, access control, encryption, PII) |
Verification Plan, Alternatives Considered, and Risks & Mitigations are optional — include when they add value; omit otherwise.
Size guideline (non-blocking): Target 600–1500 words, up to 2 diagrams. If exceeded, before continuing: (1) state in one line why the additional length is necessary, (2) re-evaluate single vs root-sub split.
Quality is judged by Acceptance Criteria clarity, trade-off coverage, and verifiability — not word count. Avoid cargo-cult overhead (release signoff checklists, committee-style gates, extensive ops runbooks) unless requested.
Before writing anything, understand the landscape:
docs/plans/<topic>/docs/adr/<topic>/ — use a tiered reading strategy:
ls docs/adr/<topic>/ 2>/dev/null) to get an overviewTEMPxx and choose lifecycle record mode (ADR or in-doc ledger).single or root-sub) using the Decomposition Strategy Contract, and draft the ### Boundary Inventory that justifies the choice.Before drafting the design, remove requirement ambiguity explicitly.
questions array (up to 4); ask dependent/blocking decisions in a separate call.Q1, Q2, ...); require response format QID: <answer> and allow QID: OTHER(<concise detail>) when no option fits.resolved (explicit answer exists)assumed (no answer yet, but safe temporary assumption documented; requires finalization trigger)blocked (cannot continue without answer)blocked item remains.TEMPxx checklist row or missing retirement trigger/verification/removal scope for any TEMPxx as blocked.blocked.
## Risk Classification is empty or missing for a non-greenfield design, add it as a clarification item (blocked until the user defines risk tiers).## Risk Classification as blocked.## Clarifications with:
assumed: what condition or event will convert this to resolved)resolved or assumed)## Decomposition Strategy with Decision Basis grounded in ### Boundary Inventory signals, and keep boundary naming consistent across root/sub artifacts.## Existing Codebase Constraints and map constraints to design choices.schema (data shape validation), api-contract (API interface compliance), cli-contract (CLI behavior compliance), behavioral (logic/state behavior), none (no specific contract). Default to behavioral when uncertain.docs/plans/<topic>/design.md
mkdir -p docs/plans/<topic>Split Decision: root-sub, also create sub docs at:
docs/plans/<topic>/<subtopic>-design.mdRepeat until the user explicitly approves the design:
Key behaviors in this loop:
When a significant design decision is made, record it as an ADR.
Output path: docs/adr/<topic>/<subject>.md
Path rules:
mkdir -p docs/adr/<topic>adopt-grpc-for-public-api.md)ADR format: See design-templates.md.
ADR quality bar (derived from proven ADR templates/examples):
Status, Date, and Deciders (if known).Context and Problem Statement with concrete forces, constraints, and requirement links.Decision Drivers and Considered Options (at least two unless truly single-option).Decision Outcome to name the chosen option and explain why it wins.Consequences, capture positive/negative/neutral impacts plus concrete follow-up work.Validation to describe how success is measured (metric/test/review checkpoint).Links to related ADRs, tickets, PRs, and docs.TEMPxx), include a Sunset Clause (TEMP ID, retirement trigger, retirement verification, removal scope).ADR lifecycle rules:
Supersedes / Superseded by.Proposed -> Accepted -> Deprecated/Superseded/Rejected).When to create an ADR:
When NOT to create an ADR:
TEMPxx has:
Temporary Mechanism Index entry,Sunset Closure Checklist row with retirement trigger, retirement verification, and removal scope.## Decomposition Strategy is complete and consistent with produced design files:
### Boundary Inventory exists and uses the required fixed columns.Split Decision: root-sub, verify:
### Boundary Inventory row appears exactly once in Sub-Doc Index Owned Boundary, and vice versa.Sub-Doc Index file path exists.Root Coverage entry references a valid sub ID or Integration.Root Coverage exists in Sub-Doc Index.Split Decision: single, verify no unnecessary root/sub scaffolding remains.skit split-check <design-file> before finalizing. If it reports FAIL, mark the design as BLOCKED; if it reports advisories, tighten Decision Basis or boundary ownership before approval.skit temp-lifecycle-check <design-file>. If it reports FAIL, mark the design as BLOCKED.Supersedes/Superseded by are reciprocal where applicable).appropriate, reasonable, adequate, sufficient, timely, properly, correctly, as needed, if possible, 適切な, 十分な, 適宜, 必要に応じて, 正しく, それなりの, しかるべき.BLOCKED and request the user to revise the AC before approval.Goals section, verify that at least one ACxx in Acceptance Criteria has a Requirement Sentence that validates the realization of that goal. If any goal has zero AC coverage, mark the design as BLOCKED and request the user to add missing ACs.skit verification-cmd-check <design-file>.
SKIP: no AC table found — proceed.PASS (with advisories): all commands valid; TBD-at-plan entries are advisory — decompose-plan resolves them.FAIL: one or more ACs have an empty or unresolvable command — mark as BLOCKED and fix before approval.design-doc review (independent sub-agent verification) before proceeding to the decompose-plan skillskit risk-format-check <design-file>.
SKIP: no Risk Classification section — only acceptable for greenfield without Critical domains; otherwise mark as BLOCKED.FAIL: format violations found — mark as BLOCKED and fix.See design-templates.md for the full template. Adapt sections as needed — not every section is required for every design.
development
Simplifies recently changed code by running three parallel reviews (reuse, quality, efficiency) and applying only behavior-preserving fixes. Use when the user asks to simplify, clean up, reduce duplication, improve code reuse, or optimize recently changed code, a staged diff, a branch diff, or explicitly listed files. Also use when the user says things like 'simplify this', 'まとめて整理して', 'コードをスリムにして', or invokes `/simplify`.
tools
Use when the user invokes /workflow. Injects project workflow methodology as context. Accepts argument: plan, exec, review (default: all).
development
Processes AI reviewer feedback and applies only verified fixes. Works in two modes: (1) fetches comments from a PR URL or current branch, (2) processes feedback pasted directly into the conversation. Trigger when the user wants to bulk-process or apply AI review suggestions — from a GitHub PR or pasted text. Do NOT trigger for single questions about what a bot said, or general code review discussion.
testing
Prepares .ralph/ runtime state from an approved and reviewed plan bundle. Syncs plan tasks into prd.json and updates prompt.run.md with project-specific context and quality gates. Use after plan approval, decompose-plan review PASS, and ralph init.