musubix 3.3.10 → 3.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/AGENTS.md +949 -0
- package/.github/prompts/sdd-change-apply.prompt.md +283 -0
- package/.github/prompts/sdd-change-archive.prompt.md +241 -0
- package/.github/prompts/sdd-change-init.prompt.md +269 -0
- package/.github/prompts/sdd-design.prompt.md +250 -0
- package/.github/prompts/sdd-implement.prompt.md +387 -0
- package/.github/prompts/sdd-requirements.prompt.md +193 -0
- package/.github/prompts/sdd-review.prompt.md +155 -0
- package/.github/prompts/sdd-security.prompt.md +228 -0
- package/.github/prompts/sdd-steering.prompt.md +269 -0
- package/.github/prompts/sdd-tasks.prompt.md +255 -0
- package/.github/prompts/sdd-test.prompt.md +230 -0
- package/.github/prompts/sdd-validate.prompt.md +304 -0
- package/.github/skills/musubix-adr-generation/SKILL.md +209 -0
- package/.github/skills/musubix-best-practices/SKILL.md +315 -0
- package/.github/skills/musubix-c4-design/SKILL.md +162 -0
- package/.github/skills/musubix-code-generation/SKILL.md +237 -0
- package/.github/skills/musubix-domain-inference/SKILL.md +196 -0
- package/.github/skills/musubix-ears-validation/SKILL.md +161 -0
- package/.github/skills/musubix-sdd-workflow/SKILL.md +217 -0
- package/.github/skills/musubix-technical-writing/SKILL.md +444 -0
- package/.github/skills/musubix-test-generation/SKILL.md +212 -0
- package/.github/skills/musubix-traceability/SKILL.md +141 -0
- package/AGENTS.md +1134 -0
- package/LICENSE +21 -0
- package/README.ja.md +313 -0
- package/README.md +315 -50
- package/bin/musubix-mcp.js +15 -0
- package/bin/musubix.js +9 -1
- package/docs/API-REFERENCE.md +1425 -0
- package/docs/GITHUB-ACTIONS-NPM-SETUP.md +132 -0
- package/docs/INSTALL-GUIDE.ja.md +459 -0
- package/docs/INSTALL-GUIDE.md +459 -0
- package/docs/MIGRATION-v3.0.md +324 -0
- package/docs/MUSUBI-enhancement_roadmap_20260105.md +651 -0
- package/docs/MUSUBIX-v3.0-User-Guide.md +1357 -0
- package/docs/MUSUBIXv2.2.0-Manual-outline.md +136 -0
- package/docs/MUSUBIXv2.2.0-Manual.md +3123 -0
- package/docs/MUSUBIXv2.3.5-Refactering.md +1310 -0
- package/docs/MUSUBIv1.6.1-enhancement_roadmap_20260105.md +291 -0
- package/docs/MUSUBIv2.2.0-USERGUIDE.md +2079 -0
- package/docs/ROADMAP-v1.5.md +116 -0
- package/docs/SwarmCoding.md +1284 -0
- package/docs/Test-prompt.md +105 -0
- package/docs/USER-GUIDE-v1.8.0.md +2371 -0
- package/docs/USER-GUIDE.ja.md +2147 -0
- package/docs/USER-GUIDE.md +3022 -0
- package/docs/YATA-GLOBAL-GUIDE.ja.md +750 -0
- package/docs/YATA-GLOBAL-GUIDE.md +595 -0
- package/docs/YATA-LOCAL-GUIDE.ja.md +989 -0
- package/docs/YATA-LOCAL-GUIDE.md +730 -0
- package/docs/adr/0001-real-time-pattern-learning-architecture-for-v1-5-0.md +75 -0
- package/docs/adr/0002-pattern-sharing-protocol-for-cross-team-collaborat.md +79 -0
- package/docs/adr/0003-owl-2-rl-implementation-strategy-for-advanced-infe.md +90 -0
- package/docs/adr/ADR-v3.4.0-001-deep-research-architecture.md +217 -0
- package/docs/adr/ADR-v3.4.0-002-search-provider-selection.md +308 -0
- package/docs/adr/ADR-v3.4.0-003-lm-api-integration.md +475 -0
- package/docs/enterprise-knowledge-management.md +1737 -0
- package/docs/evolution-from-musubi-to-musubix.md +2170 -0
- package/docs/getting-started-with-sdd.md +1602 -0
- package/docs/moodle-refactering-codegraph-musubix.md +391 -0
- package/docs/moodle-refactering-codegraph.md +278 -0
- package/docs/overview/MUSUBIX-CodeGraph.md +322 -0
- package/docs/overview/MUSUBIX-Core.md +671 -0
- package/docs/overview/MUSUBIX-Decisions.md +494 -0
- package/docs/overview/MUSUBIX-FormalVerify.md +566 -0
- package/docs/overview/MUSUBIX-Knowledge.md +1231 -0
- package/docs/overview/MUSUBIX-Learning.md +837 -0
- package/docs/overview/MUSUBIX-MCP-Server.md +535 -0
- package/docs/overview/MUSUBIX-Overview.md +264 -0
- package/docs/overview/MUSUBIX-Phase1-Complete.md +271 -0
- package/docs/overview/MUSUBIX-Phase2-Complete.md +310 -0
- package/docs/overview/MUSUBIX-Policy.md +477 -0
- package/docs/overview/MUSUBIX-Roadmap-v2.md +399 -0
- package/docs/overview/MUSUBIX-Security-Plan.md +939 -0
- package/docs/overview/MUSUBIX-Security-v2.1.md +668 -0
- package/docs/overview/MUSUBIX-Security.md +891 -0
- package/docs/overview/MUSUBIX-YATA.md +666 -0
- package/docs/overview/MUSUBIX-v2.2.0-Advanced-Learning.md +513 -0
- package/docs/overview/Neuro-SymbolicAI.md +159 -0
- package/docs/packages/knowledge.md +594 -0
- package/docs/qiita-linux-kernel-knowledge-graph.md +596 -0
- package/package.json +55 -49
- package/scripts/generate-quality-gate-report.ts +106 -0
- package/scripts/postinstall.js +94 -0
- package/steering/.musubi-version +1 -0
- package/steering/product.ja.md +572 -0
- package/steering/project.yml +66 -0
- package/steering/rules/constitution.md +491 -0
- package/steering/structure.ja.md +503 -0
- package/steering/tech.ja.md +208 -0
- package/dist/index.d.ts +0 -25
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -74
- package/dist/index.js.map +0 -1
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
# MUSUBIX Validate Command
|
|
2
|
+
|
|
3
|
+
Validate constitutional compliance and requirements coverage.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Instructions for AI Agent
|
|
8
|
+
|
|
9
|
+
You are executing the `musubix validate [feature-name]` command to validate constitutional compliance.
|
|
10
|
+
|
|
11
|
+
### Command Format
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npx musubix validate authentication
|
|
15
|
+
npx musubix trace validate
|
|
16
|
+
npx musubix trace matrix
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Your Task
|
|
20
|
+
|
|
21
|
+
Perform comprehensive validation of the feature implementation against:
|
|
22
|
+
|
|
23
|
+
1. 9 Constitutional Articles
|
|
24
|
+
2. Requirements coverage (100% traceability)
|
|
25
|
+
3. Code quality standards
|
|
26
|
+
4. Test coverage
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Process
|
|
31
|
+
|
|
32
|
+
### 1. Read All Documentation
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
# Requirements and Design
|
|
36
|
+
storage/specs/REQ-{{FEATURE}}-001.md
|
|
37
|
+
storage/specs/DES-{{FEATURE}}-001.md
|
|
38
|
+
storage/specs/TSK-{{FEATURE}}-001.md
|
|
39
|
+
|
|
40
|
+
# Steering Context
|
|
41
|
+
steering/structure.ja.md
|
|
42
|
+
steering/tech.ja.md
|
|
43
|
+
steering/rules/constitution.md
|
|
44
|
+
|
|
45
|
+
# Source Code
|
|
46
|
+
packages/core/src/{{feature}}/**/*.ts
|
|
47
|
+
packages/core/__tests__/**/*.test.ts
|
|
48
|
+
packages/mcp-server/src/tools/**/*.ts
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
### 2. Constitutional Validation
|
|
54
|
+
|
|
55
|
+
Validate each of the 9 Constitutional Articles:
|
|
56
|
+
|
|
57
|
+
#### Article I: Library-First Principle
|
|
58
|
+
|
|
59
|
+
**Requirement**: Features as independent packages
|
|
60
|
+
|
|
61
|
+
**Validation**:
|
|
62
|
+
- [ ] Feature in `packages/` directory
|
|
63
|
+
- [ ] Has `package.json` (monorepo workspace)
|
|
64
|
+
- [ ] Exports public API via `index.ts`
|
|
65
|
+
- [ ] No circular dependencies
|
|
66
|
+
|
|
67
|
+
```markdown
|
|
68
|
+
### Article I: Library-First Principle
|
|
69
|
+
|
|
70
|
+
**Status**: ✅ PASS / ❌ FAIL
|
|
71
|
+
|
|
72
|
+
**Evidence**:
|
|
73
|
+
- Location: `packages/core/src/{{feature}}/`
|
|
74
|
+
- Public API: `packages/core/src/{{feature}}/index.ts`
|
|
75
|
+
- Exports: {{Feature}}Service, {{Feature}}Options
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
#### Article II: CLI Interface Mandate
|
|
81
|
+
|
|
82
|
+
**Requirement**: CLI interface for all libraries
|
|
83
|
+
|
|
84
|
+
**Validation**:
|
|
85
|
+
- [ ] CLI command exists in `packages/core/src/cli/commands/`
|
|
86
|
+
- [ ] `--help` flag works
|
|
87
|
+
- [ ] Documented in CLI help
|
|
88
|
+
|
|
89
|
+
```markdown
|
|
90
|
+
### Article II: CLI Interface Mandate
|
|
91
|
+
|
|
92
|
+
**Status**: ✅ PASS / ❌ FAIL
|
|
93
|
+
|
|
94
|
+
**Evidence**:
|
|
95
|
+
- CLI: `npx musubix {{feature}}`
|
|
96
|
+
- Help: `npx musubix {{feature}} --help`
|
|
97
|
+
- Registered: packages/core/src/cli/index.ts
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
#### Article III: Test-First Imperative
|
|
103
|
+
|
|
104
|
+
**Requirement**: Tests before implementation (Red-Green-Blue)
|
|
105
|
+
|
|
106
|
+
**Validation**:
|
|
107
|
+
- [ ] Tests in `packages/core/__tests__/unit/`
|
|
108
|
+
- [ ] Tests cover all requirements
|
|
109
|
+
- [ ] Coverage ≥ 80%
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
npm run test:coverage
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
```markdown
|
|
116
|
+
### Article III: Test-First Imperative
|
|
117
|
+
|
|
118
|
+
**Status**: ✅ PASS / ❌ FAIL
|
|
119
|
+
|
|
120
|
+
**Coverage**: XX%
|
|
121
|
+
**Test Files**:
|
|
122
|
+
- packages/core/__tests__/unit/{{feature}}.test.ts
|
|
123
|
+
- packages/core/__tests__/integration/{{feature}}.integration.test.ts
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
#### Article IV: EARS Requirements Format
|
|
129
|
+
|
|
130
|
+
**Requirement**: All requirements in EARS format
|
|
131
|
+
|
|
132
|
+
**Validation**:
|
|
133
|
+
- [ ] All requirements use EARS patterns
|
|
134
|
+
- [ ] Each has unique ID (REQ-XXX-NNN)
|
|
135
|
+
- [ ] Each has acceptance criteria
|
|
136
|
+
|
|
137
|
+
```markdown
|
|
138
|
+
### Article IV: EARS Requirements Format
|
|
139
|
+
|
|
140
|
+
**Status**: ✅ PASS / ❌ FAIL
|
|
141
|
+
|
|
142
|
+
**Requirements Checked**: X
|
|
143
|
+
**EARS Patterns Used**:
|
|
144
|
+
- Ubiquitous: X
|
|
145
|
+
- Event-driven: X
|
|
146
|
+
- State-driven: X
|
|
147
|
+
- Unwanted: X
|
|
148
|
+
- Optional: X
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
#### Article V: Traceability Mandate
|
|
154
|
+
|
|
155
|
+
**Requirement**: 100% traceability REQ↔DES↔TSK↔CODE↔TEST
|
|
156
|
+
|
|
157
|
+
**Validation**:
|
|
158
|
+
|
|
159
|
+
```markdown
|
|
160
|
+
### Article V: Traceability Mandate
|
|
161
|
+
|
|
162
|
+
**Status**: ✅ PASS / ❌ FAIL
|
|
163
|
+
|
|
164
|
+
**Traceability Matrix**:
|
|
165
|
+
|
|
166
|
+
| Requirement | Design | Task | Code | Test |
|
|
167
|
+
|-------------|--------|------|------|------|
|
|
168
|
+
| REQ-XXX-001 | DES-XXX-001 | TSK-XXX-001 | {{feature}}/service.ts | {{feature}}.test.ts |
|
|
169
|
+
|
|
170
|
+
**Coverage**: 100%
|
|
171
|
+
**Unmapped Requirements**: None
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
#### Article VI: Project Memory (Steering)
|
|
177
|
+
|
|
178
|
+
**Requirement**: Consult steering before decisions
|
|
179
|
+
|
|
180
|
+
**Validation**:
|
|
181
|
+
- [ ] Design references steering files
|
|
182
|
+
- [ ] Tech stack matches `steering/tech.ja.md`
|
|
183
|
+
- [ ] Architecture matches `steering/structure.ja.md`
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
#### Article VII: Design Patterns
|
|
188
|
+
|
|
189
|
+
**Requirement**: Document pattern applications
|
|
190
|
+
|
|
191
|
+
**Validation**:
|
|
192
|
+
- [ ] Patterns documented in design
|
|
193
|
+
- [ ] ADRs created for decisions
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
#### Article VIII: Decision Records
|
|
198
|
+
|
|
199
|
+
**Requirement**: All decisions as ADRs
|
|
200
|
+
|
|
201
|
+
**Validation**:
|
|
202
|
+
- [ ] ADRs in design document
|
|
203
|
+
- [ ] Each ADR has: Status, Context, Decision, Consequences
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
#### Article IX: Quality Gates
|
|
208
|
+
|
|
209
|
+
**Requirement**: Validate before phase transitions
|
|
210
|
+
|
|
211
|
+
**Validation**:
|
|
212
|
+
- [ ] Requirements validated before design
|
|
213
|
+
- [ ] Design validated before implementation
|
|
214
|
+
- [ ] Tests pass before deployment
|
|
215
|
+
|
|
216
|
+
---
|
|
217
|
+
|
|
218
|
+
### 3. Generate Validation Report
|
|
219
|
+
|
|
220
|
+
```markdown
|
|
221
|
+
# Validation Report: {{FEATURE_NAME}}
|
|
222
|
+
|
|
223
|
+
**Date**: {{DATE}}
|
|
224
|
+
**Validator**: AI Agent
|
|
225
|
+
|
|
226
|
+
## Summary
|
|
227
|
+
|
|
228
|
+
| Article | Status | Score |
|
|
229
|
+
|---------|--------|-------|
|
|
230
|
+
| I. Library-First | ✅ | 100% |
|
|
231
|
+
| II. CLI Interface | ✅ | 100% |
|
|
232
|
+
| III. Test-First | ✅ | 85% |
|
|
233
|
+
| IV. EARS Format | ✅ | 100% |
|
|
234
|
+
| V. Traceability | ✅ | 100% |
|
|
235
|
+
| VI. Project Memory | ✅ | 100% |
|
|
236
|
+
| VII. Design Patterns | ✅ | 100% |
|
|
237
|
+
| VIII. Decision Records | ✅ | 100% |
|
|
238
|
+
| IX. Quality Gates | ✅ | 100% |
|
|
239
|
+
|
|
240
|
+
**Overall Compliance**: ✅ PASS (97%)
|
|
241
|
+
|
|
242
|
+
## Test Coverage
|
|
243
|
+
|
|
244
|
+
- Unit Tests: XX%
|
|
245
|
+
- Integration Tests: XX%
|
|
246
|
+
- Total: XX%
|
|
247
|
+
|
|
248
|
+
## Traceability Coverage
|
|
249
|
+
|
|
250
|
+
- Requirements → Design: 100%
|
|
251
|
+
- Design → Tasks: 100%
|
|
252
|
+
- Tasks → Code: 100%
|
|
253
|
+
- Code → Tests: 100%
|
|
254
|
+
|
|
255
|
+
## Issues Found
|
|
256
|
+
|
|
257
|
+
### Critical (P0)
|
|
258
|
+
None
|
|
259
|
+
|
|
260
|
+
### High (P1)
|
|
261
|
+
None
|
|
262
|
+
|
|
263
|
+
### Medium (P2)
|
|
264
|
+
- [Issue description]
|
|
265
|
+
|
|
266
|
+
## Recommendations
|
|
267
|
+
|
|
268
|
+
1. [Recommendation 1]
|
|
269
|
+
2. [Recommendation 2]
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
---
|
|
273
|
+
|
|
274
|
+
### 4. MCP Tool Integration
|
|
275
|
+
|
|
276
|
+
Use MUSUBIX MCP tools:
|
|
277
|
+
|
|
278
|
+
```
|
|
279
|
+
sdd_validate_constitution - Validate constitutional compliance
|
|
280
|
+
sdd_validate_traceability - Validate traceability matrix
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
---
|
|
284
|
+
|
|
285
|
+
### 5. Validation Commands
|
|
286
|
+
|
|
287
|
+
```bash
|
|
288
|
+
# Run all validations
|
|
289
|
+
npm test
|
|
290
|
+
npm run typecheck
|
|
291
|
+
npm run lint
|
|
292
|
+
|
|
293
|
+
# Check coverage
|
|
294
|
+
npm run test:coverage
|
|
295
|
+
|
|
296
|
+
# Traceability
|
|
297
|
+
npx musubix trace matrix
|
|
298
|
+
npx musubix trace validate
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
---
|
|
302
|
+
|
|
303
|
+
**MUSUBIX**: https://github.com/nahisaho/MUSUBIX
|
|
304
|
+
**Version**: 1.0.0
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: musubix-adr-generation
|
|
3
|
+
description: Guide for creating Architecture Decision Records (ADRs). Use this when asked to document architecture decisions, technology choices, or design trade-offs.
|
|
4
|
+
license: MIT
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# MUSUBIX ADR Generation Skill
|
|
8
|
+
|
|
9
|
+
This skill guides you through creating Architecture Decision Records following **Article VIII - Decision Records**.
|
|
10
|
+
|
|
11
|
+
## Overview
|
|
12
|
+
|
|
13
|
+
An **ADR (Architecture Decision Record)** documents significant architectural decisions with their context and consequences.
|
|
14
|
+
|
|
15
|
+
## ADR Template
|
|
16
|
+
|
|
17
|
+
```markdown
|
|
18
|
+
# ADR-[NUMBER]: [Decision Title]
|
|
19
|
+
|
|
20
|
+
## ステータス
|
|
21
|
+
[Proposed | Accepted | Deprecated | Superseded by ADR-XXX]
|
|
22
|
+
|
|
23
|
+
## コンテキスト
|
|
24
|
+
[What is the issue that we're seeing that is motivating this decision?]
|
|
25
|
+
|
|
26
|
+
## 決定
|
|
27
|
+
[What is the change that we're proposing and/or doing?]
|
|
28
|
+
|
|
29
|
+
## 選択肢
|
|
30
|
+
|
|
31
|
+
### Option 1: [Name]
|
|
32
|
+
**メリット:**
|
|
33
|
+
- [Advantage 1]
|
|
34
|
+
- [Advantage 2]
|
|
35
|
+
|
|
36
|
+
**デメリット:**
|
|
37
|
+
- [Disadvantage 1]
|
|
38
|
+
- [Disadvantage 2]
|
|
39
|
+
|
|
40
|
+
### Option 2: [Name]
|
|
41
|
+
**メリット:**
|
|
42
|
+
- [Advantage 1]
|
|
43
|
+
|
|
44
|
+
**デメリット:**
|
|
45
|
+
- [Disadvantage 1]
|
|
46
|
+
|
|
47
|
+
## 結果
|
|
48
|
+
[What becomes easier or more difficult to do because of this change?]
|
|
49
|
+
|
|
50
|
+
## トレーサビリティ
|
|
51
|
+
- 関連要件: REQ-XXX-NNN
|
|
52
|
+
- 関連設計: DES-XXX-NNN
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Common ADR Topics
|
|
56
|
+
|
|
57
|
+
### 1. Technology Selection
|
|
58
|
+
|
|
59
|
+
```markdown
|
|
60
|
+
# ADR-001: Use TypeScript for Backend
|
|
61
|
+
|
|
62
|
+
## コンテキスト
|
|
63
|
+
We need to choose a programming language for the backend API.
|
|
64
|
+
|
|
65
|
+
## 決定
|
|
66
|
+
We will use TypeScript with Node.js.
|
|
67
|
+
|
|
68
|
+
## 選択肢
|
|
69
|
+
|
|
70
|
+
### Option 1: TypeScript + Node.js
|
|
71
|
+
**メリット:**
|
|
72
|
+
- Type safety reduces runtime errors
|
|
73
|
+
- Same language as frontend (code sharing)
|
|
74
|
+
- Large ecosystem (npm)
|
|
75
|
+
- Strong async/await support
|
|
76
|
+
|
|
77
|
+
**デメリット:**
|
|
78
|
+
- Slower than compiled languages
|
|
79
|
+
- Type definitions not always available
|
|
80
|
+
|
|
81
|
+
### Option 2: Go
|
|
82
|
+
**メリット:**
|
|
83
|
+
- High performance
|
|
84
|
+
- Strong concurrency support
|
|
85
|
+
|
|
86
|
+
**デメリット:**
|
|
87
|
+
- Different language from frontend
|
|
88
|
+
- Smaller ecosystem for web
|
|
89
|
+
|
|
90
|
+
## 結果
|
|
91
|
+
- Frontend/backend code sharing enabled
|
|
92
|
+
- Need to maintain TypeScript configuration
|
|
93
|
+
- Team can use consistent tooling
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### 2. Architecture Pattern
|
|
97
|
+
|
|
98
|
+
```markdown
|
|
99
|
+
# ADR-002: Layered Architecture with DDD
|
|
100
|
+
|
|
101
|
+
## コンテキスト
|
|
102
|
+
We need to define the overall architecture pattern.
|
|
103
|
+
|
|
104
|
+
## 決定
|
|
105
|
+
We will use Layered Architecture with Domain-Driven Design principles.
|
|
106
|
+
|
|
107
|
+
## 選択肢
|
|
108
|
+
|
|
109
|
+
### Option 1: Layered Architecture
|
|
110
|
+
- Presentation → Application → Domain → Infrastructure
|
|
111
|
+
|
|
112
|
+
### Option 2: Hexagonal Architecture
|
|
113
|
+
- Ports and Adapters pattern
|
|
114
|
+
|
|
115
|
+
## 結果
|
|
116
|
+
- Clear separation of concerns
|
|
117
|
+
- Domain logic isolated from infrastructure
|
|
118
|
+
- Easier testing with dependency injection
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### 3. Database Selection
|
|
122
|
+
|
|
123
|
+
```markdown
|
|
124
|
+
# ADR-003: Use PostgreSQL for Primary Database
|
|
125
|
+
|
|
126
|
+
## コンテキスト
|
|
127
|
+
We need a primary data store for the application.
|
|
128
|
+
|
|
129
|
+
## 決定
|
|
130
|
+
PostgreSQL will be our primary database.
|
|
131
|
+
|
|
132
|
+
## 選択肢
|
|
133
|
+
|
|
134
|
+
### Option 1: PostgreSQL
|
|
135
|
+
**メリット:**
|
|
136
|
+
- ACID compliance
|
|
137
|
+
- JSON support
|
|
138
|
+
- Strong ecosystem
|
|
139
|
+
- Free and open source
|
|
140
|
+
|
|
141
|
+
### Option 2: MongoDB
|
|
142
|
+
**メリット:**
|
|
143
|
+
- Schema flexibility
|
|
144
|
+
- Horizontal scaling
|
|
145
|
+
|
|
146
|
+
**デメリット:**
|
|
147
|
+
- Eventual consistency concerns
|
|
148
|
+
- Complex transactions
|
|
149
|
+
|
|
150
|
+
## 結果
|
|
151
|
+
- Reliable transactional data storage
|
|
152
|
+
- Need to manage schema migrations
|
|
153
|
+
- Can use JSON columns for flexibility
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
## CLI Commands
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
# Generate ADR from decision description
|
|
160
|
+
npx musubix design adr "Use React for frontend"
|
|
161
|
+
|
|
162
|
+
# List all ADRs
|
|
163
|
+
ls storage/design/adr/
|
|
164
|
+
|
|
165
|
+
# Generate ADR interactively
|
|
166
|
+
npx musubix design adr --interactive
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
## ADR Numbering
|
|
170
|
+
|
|
171
|
+
ADRs are numbered sequentially:
|
|
172
|
+
- ADR-001, ADR-002, ADR-003...
|
|
173
|
+
|
|
174
|
+
Never renumber existing ADRs. If an ADR is superseded, mark it as such and reference the new ADR.
|
|
175
|
+
|
|
176
|
+
## Storage Location
|
|
177
|
+
|
|
178
|
+
```
|
|
179
|
+
storage/design/adr/
|
|
180
|
+
├── ADR-001-typescript-backend.md
|
|
181
|
+
├── ADR-002-layered-architecture.md
|
|
182
|
+
├── ADR-003-postgresql-database.md
|
|
183
|
+
└── index.md # ADR index
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
## ADR Index Template
|
|
187
|
+
|
|
188
|
+
```markdown
|
|
189
|
+
# Architecture Decision Records
|
|
190
|
+
|
|
191
|
+
| ADR | Title | Status | Date |
|
|
192
|
+
|-----|-------|--------|------|
|
|
193
|
+
| [ADR-001](./ADR-001-typescript-backend.md) | Use TypeScript for Backend | Accepted | 2026-01-04 |
|
|
194
|
+
| [ADR-002](./ADR-002-layered-architecture.md) | Layered Architecture | Accepted | 2026-01-04 |
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
## When to Write an ADR
|
|
198
|
+
|
|
199
|
+
- Technology selection (language, framework, database)
|
|
200
|
+
- Architecture patterns (layered, hexagonal, microservices)
|
|
201
|
+
- External integrations (APIs, services)
|
|
202
|
+
- Security decisions (authentication, authorization)
|
|
203
|
+
- Performance trade-offs (caching, scaling)
|
|
204
|
+
|
|
205
|
+
## Related Skills
|
|
206
|
+
|
|
207
|
+
- `musubix-c4-design` - Architecture diagrams
|
|
208
|
+
- `musubix-sdd-workflow` - Full development workflow
|
|
209
|
+
- `musubix-traceability` - Link ADRs to requirements
|