A skill for generating and validating SOLID-compliant design documents from approved requirements documents. Core of SDD workflow Phase 2.
Prerequisites
- Phase 1 (Requirements) must be approved
steering/must have been referenced- The requirements document (
storage/specs/REQ-*.md) must exist
Workflow
1. Design document generation
WHEN ユーザーが設計文書の生成を要求する:
1. 要件文書を読み込み(ParsedRequirement[])
2. DesignGenerator.generate() で設計文書を生成
3. SOLIDValidator で SRP/OCP/LSP/ISP/DIP 準拠を検証
4. 各 DES にトレーサビリティリンクを付与
5. ユーザーレビュー ⏸️
CLI: npx musubix design <req-file>
2. C4 diagram generation
WHEN ユーザーが C4 ダイアグラムの生成を要求する:
1. C4Element と C4Relationship を抽出
2. Context / Container / Component レベルの Mermaid 図を生成
3. 設計文書に埋め込み
CLI: npx musubix design:c4 <file> [--level context|container|component]
3. ADR management
WHEN ユーザーが ADR の作成・管理を要求する:
1. DecisionManager.create() で新規 ADR 作成
2. ステータスライフサイクル: proposed → accepted → deprecated → superseded
3. DecisionManager.search() で全文検索
4. DecisionManager.index() でインデクシング
CLI: npx musubix decision <create|list|get|accept|deprecate|search|index>
4. Design validation
WHEN ユーザーが設計文書の検証を要求する:
1. PatternDetector でデザインパターンを検出
2. SOLID 原則への準拠を検証
3. 要件との対応漏れを検出
CLI: npx musubix design:verify <design-file>
Design document format
Each DES specification has the following structure:
### DES-XXX-NNN: タイトル
**トレーサビリティ**: REQ-XXX-NNN
**パッケージ**: `package-name`
**設計概要**:
(自然言語の説明)
(TypeScript インターフェース / Mermaid 図)
**CLI契約**: `npx musubix ...`
ADR Format
# ADR-NNN: タイトル
**ステータス**: proposed | accepted | deprecated | superseded
**日付**: YYYY-MM-DD
## Context
(決定の背景)
## Decision
(決定内容)
## Consequences
(影響と結果)
Quality gates
- All DESs are traceable to at least one REQ
- TypeScript interfaces are defined
- CLI contracts are specified
- There are no violations of SOLID principles
- ADRs are created for important design decisions
Gotchas
- N:M relationship between DES and REQ: A single DES may reference multiple REQs. The reverse is also true. Maintain links in all directions.
- Mermaid notation limitations: classDiagram で
?When using nullable notation, match it with the TypeScript-side| undefined. - ADR status management:
acceptとdeprecateis a state transition. It cannot be set directly tosuperseded(it must always go throughdeprecated).
Script
| Script | Description | Usage |
|---|---|---|
scripts/generate.sh |
Generate design from requirements | ./scripts/generate.sh [args] |
scripts/c4.sh |
C4 diagram generation | ./scripts/c4.sh [args] |
scripts/verify.sh |
Design traceability validation | ./scripts/verify.sh [args] |
scripts/decision.sh |
ADR creation and management | ./scripts/decision.sh [args] |