musubix 3.6.0 → 3.7.3

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.
Files changed (123) hide show
  1. package/.github/AGENTS.md +949 -0
  2. package/.github/prompts/sdd-change-apply.prompt.md +283 -0
  3. package/.github/prompts/sdd-change-archive.prompt.md +241 -0
  4. package/.github/prompts/sdd-change-init.prompt.md +269 -0
  5. package/.github/prompts/sdd-design.prompt.md +250 -0
  6. package/.github/prompts/sdd-implement.prompt.md +387 -0
  7. package/.github/prompts/sdd-requirements.prompt.md +193 -0
  8. package/.github/prompts/sdd-review.prompt.md +155 -0
  9. package/.github/prompts/sdd-security.prompt.md +228 -0
  10. package/.github/prompts/sdd-steering.prompt.md +269 -0
  11. package/.github/prompts/sdd-tasks.prompt.md +255 -0
  12. package/.github/prompts/sdd-test.prompt.md +230 -0
  13. package/.github/prompts/sdd-validate.prompt.md +304 -0
  14. package/.github/skills/build-fix/SKILL.md +124 -0
  15. package/.github/skills/checkpoint/SKILL.md +131 -0
  16. package/.github/skills/codemap/SKILL.md +120 -0
  17. package/.github/skills/codemap/templates/codemap-index.md +142 -0
  18. package/.github/skills/codemap/templates/package-codemap.md +160 -0
  19. package/.github/skills/context-optimizer/SKILL.md +109 -0
  20. package/.github/skills/context-optimizer/contexts/dev.md +40 -0
  21. package/.github/skills/context-optimizer/contexts/research.md +55 -0
  22. package/.github/skills/context-optimizer/contexts/review.md +49 -0
  23. package/.github/skills/e2e-runner/SKILL.md +145 -0
  24. package/.github/skills/eval-harness/SKILL.md +111 -0
  25. package/.github/skills/eval-harness/examples/capability-eval.md +158 -0
  26. package/.github/skills/eval-harness/examples/human-grader-template.md +326 -0
  27. package/.github/skills/eval-harness/examples/regression-eval.md +228 -0
  28. package/.github/skills/learning-hooks/SKILL.md +101 -0
  29. package/.github/skills/learning-hooks/templates/learned-skill-template.md +79 -0
  30. package/.github/skills/musubix-adr-generation/SKILL.md +74 -0
  31. package/.github/skills/musubix-best-practices/SKILL.md +85 -0
  32. package/.github/skills/musubix-c4-design/SKILL.md +86 -0
  33. package/.github/skills/musubix-code-generation/SKILL.md +90 -0
  34. package/.github/skills/musubix-domain-inference/SKILL.md +82 -0
  35. package/.github/skills/musubix-ears-validation/SKILL.md +74 -0
  36. package/.github/skills/musubix-sdd-workflow/SKILL.md +95 -0
  37. package/.github/skills/musubix-technical-writing/SKILL.md +108 -0
  38. package/.github/skills/musubix-test-generation/SKILL.md +88 -0
  39. package/.github/skills/musubix-traceability/SKILL.md +94 -0
  40. package/.github/skills/refactor-cleaner/SKILL.md +105 -0
  41. package/.github/skills/session-manager/SKILL.md +119 -0
  42. package/.github/skills/session-manager/scripts/session-end.sh +175 -0
  43. package/.github/skills/session-manager/scripts/session-start.sh +87 -0
  44. package/.github/skills/verification-loop/SKILL.md +111 -0
  45. package/.github/skills/verification-loop/scripts/verify.sh +305 -0
  46. package/AGENTS.md +333 -0
  47. package/LICENSE +21 -0
  48. package/README.ja.md +313 -0
  49. package/README.md +315 -50
  50. package/bin/musubix-mcp.js +15 -0
  51. package/bin/musubix.js +9 -1
  52. package/docs/API-REFERENCE.md +1425 -0
  53. package/docs/CODEMAPS/CODEMAP.md +1 -0
  54. package/docs/GITHUB-ACTIONS-NPM-SETUP.md +132 -0
  55. package/docs/INSTALL-GUIDE.ja.md +459 -0
  56. package/docs/INSTALL-GUIDE.md +459 -0
  57. package/docs/MIGRATION-v3.0.md +324 -0
  58. package/docs/MUSUBI-enhancement_roadmap_20260105.md +651 -0
  59. package/docs/MUSUBIX-v3.0-User-Guide.md +1357 -0
  60. package/docs/MUSUBIXv2.2.0-Manual-outline.md +136 -0
  61. package/docs/MUSUBIXv2.2.0-Manual.md +3123 -0
  62. package/docs/MUSUBIXv2.3.5-Refactering.md +1310 -0
  63. package/docs/MUSUBIv1.6.1-enhancement_roadmap_20260105.md +291 -0
  64. package/docs/MUSUBIv2.2.0-USERGUIDE.md +2079 -0
  65. package/docs/ROADMAP-v1.5.md +116 -0
  66. package/docs/SwarmCoding.md +1284 -0
  67. package/docs/Test-prompt.md +105 -0
  68. package/docs/USER-GUIDE-v1.8.0.md +2371 -0
  69. package/docs/USER-GUIDE.ja.md +2147 -0
  70. package/docs/USER-GUIDE.md +3022 -0
  71. package/docs/YATA-GLOBAL-GUIDE.ja.md +750 -0
  72. package/docs/YATA-GLOBAL-GUIDE.md +595 -0
  73. package/docs/YATA-LOCAL-GUIDE.ja.md +989 -0
  74. package/docs/YATA-LOCAL-GUIDE.md +730 -0
  75. package/docs/adr/0001-real-time-pattern-learning-architecture-for-v1-5-0.md +75 -0
  76. package/docs/adr/0002-pattern-sharing-protocol-for-cross-team-collaborat.md +79 -0
  77. package/docs/adr/0003-owl-2-rl-implementation-strategy-for-advanced-infe.md +90 -0
  78. package/docs/adr/ADR-v3.4.0-001-deep-research-architecture.md +217 -0
  79. package/docs/adr/ADR-v3.4.0-002-search-provider-selection.md +308 -0
  80. package/docs/adr/ADR-v3.4.0-003-lm-api-integration.md +475 -0
  81. package/docs/adr/ADR-v3.7.0-001-everything-claude-code-integration.md +102 -0
  82. package/docs/enterprise-knowledge-management.md +1737 -0
  83. package/docs/evolution-from-musubi-to-musubix.md +2170 -0
  84. package/docs/experiments/EXPERIMENT-ASSISTANT-AXIS-DRIFT-DETECTION.md +155 -0
  85. package/docs/getting-started-with-sdd.md +1602 -0
  86. package/docs/moodle-refactering-codegraph-musubix.md +391 -0
  87. package/docs/moodle-refactering-codegraph.md +278 -0
  88. package/docs/overview/MUSUBIX-CodeGraph.md +322 -0
  89. package/docs/overview/MUSUBIX-Core.md +671 -0
  90. package/docs/overview/MUSUBIX-Decisions.md +494 -0
  91. package/docs/overview/MUSUBIX-FormalVerify.md +566 -0
  92. package/docs/overview/MUSUBIX-Knowledge.md +1231 -0
  93. package/docs/overview/MUSUBIX-Learning.md +837 -0
  94. package/docs/overview/MUSUBIX-MCP-Server.md +535 -0
  95. package/docs/overview/MUSUBIX-Overview.md +264 -0
  96. package/docs/overview/MUSUBIX-Phase1-Complete.md +271 -0
  97. package/docs/overview/MUSUBIX-Phase2-Complete.md +310 -0
  98. package/docs/overview/MUSUBIX-Policy.md +477 -0
  99. package/docs/overview/MUSUBIX-Roadmap-v2.md +399 -0
  100. package/docs/overview/MUSUBIX-Security-Plan.md +939 -0
  101. package/docs/overview/MUSUBIX-Security-v2.1.md +668 -0
  102. package/docs/overview/MUSUBIX-Security.md +891 -0
  103. package/docs/overview/MUSUBIX-YATA.md +666 -0
  104. package/docs/overview/MUSUBIX-v2.2.0-Advanced-Learning.md +513 -0
  105. package/docs/overview/Neuro-SymbolicAI.md +159 -0
  106. package/docs/packages/knowledge.md +594 -0
  107. package/docs/qiita/musubix-v3.6.0-fastrender-insights.md +625 -0
  108. package/docs/qiita-linux-kernel-knowledge-graph.md +596 -0
  109. package/docs/qiita-musubix-assistant-axis.md +380 -0
  110. package/package.json +58 -52
  111. package/scripts/generate-quality-gate-report.ts +106 -0
  112. package/scripts/postinstall.js +94 -0
  113. package/scripts/register-release-knowledge.ts +127 -0
  114. package/steering/.musubi-version +1 -0
  115. package/steering/product.ja.md +572 -0
  116. package/steering/project.yml +66 -0
  117. package/steering/rules/constitution.md +491 -0
  118. package/steering/structure.ja.md +503 -0
  119. package/steering/tech.ja.md +208 -0
  120. package/dist/index.d.ts +0 -25
  121. package/dist/index.d.ts.map +0 -1
  122. package/dist/index.js +0 -74
  123. 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,124 @@
1
+ ---
2
+ name: build-fix
3
+ description: ビルドエラーを分析し、反復的に修正。TypeScript/ESLint/依存関係エラーに対応。
4
+ license: MIT
5
+ version: 1.1.0
6
+ triggers:
7
+ - ビルドエラー発生
8
+ - /build-fix
9
+ - npm run build 失敗
10
+ ---
11
+
12
+ # Build Fix
13
+
14
+ > **要約**: ビルドエラーを自動分類し、反復的な修正戦略で段階的に解決。
15
+
16
+ ## 🔍 エラー分析 (REQ-BF-001)
17
+
18
+ **WHEN** ビルドエラー発生
19
+ **DO** カテゴリ分類と優先度付け
20
+
21
+ | カテゴリ | 例 | 優先度 |
22
+ |---------|-----|--------|
23
+ | **Type Error** | TS2322, TS2339 | 🔴 高 |
24
+ | **Import Error** | Module not found | 🔴 高 |
25
+ | **Syntax Error** | Unexpected token | 🔴 高 |
26
+ | **Lint Error** | ESLint errors | 🟡 中 |
27
+ | **Config Error** | tsconfig, webpack | 🟡 中 |
28
+ | **Dependency** | Version mismatch | 🟢 低 |
29
+
30
+ ### 分析出力
31
+
32
+ ```
33
+ 🔍 Build Error Analysis
34
+ ━━━━━━━━━━━━━━━━━━━━━━
35
+ Total: 8 errors
36
+
37
+ By Category:
38
+ 🔴 Type Error: 4 (High)
39
+ 🔴 Import Error: 2 (High)
40
+ 🟡 Lint Error: 2 (Medium)
41
+
42
+ Root Cause:
43
+ 1. src/user.ts:45 - Missing 'email' property
44
+ → Causes 2 downstream errors
45
+
46
+ Fix Order:
47
+ 1. src/user.ts:45 (root cause)
48
+ 2. Remaining may resolve automatically
49
+ ```
50
+
51
+ ---
52
+
53
+ ## 🔄 修正ループ (REQ-BF-002)
54
+
55
+ **WHILE** ビルドエラーが存在 (最大10回)
56
+ **DO** 以下のループを実行
57
+
58
+ ```
59
+ 1. エラーリスト取得
60
+
61
+ 2. Root Cause特定(影響範囲最大のエラー)
62
+
63
+ 3. 修正適用(1エラーに集中)
64
+
65
+ 4. ビルド再実行
66
+
67
+ 5. 結果確認
68
+
69
+ エラーあり → 1へ戻る
70
+ ```
71
+
72
+ ### 優先順位
73
+
74
+ 1. **Root Cause First** - 連鎖エラーの根本原因
75
+ 2. **Import/Module First** - コンパイル阻害要因
76
+ 3. **Type Errors** - 下流エラーの原因
77
+ 4. **Syntax Errors** - 局所的だが致命的
78
+ 5. **Lint Errors** - 最後に対応
79
+
80
+ ---
81
+
82
+ ## 📋 TypeScriptエラーリファレンス
83
+
84
+ | コード | 説明 | 解決策 |
85
+ |--------|------|--------|
86
+ | TS2322 | Type not assignable | 型の修正/アサーション |
87
+ | TS2339 | Property not exist | プロパティ追加/型定義修正 |
88
+ | TS2345 | Argument mismatch | 引数の型修正 |
89
+ | TS2304 | Cannot find name | import追加/定義追加 |
90
+ | TS2307 | Module not found | パス修正/インストール |
91
+ | TS2531 | Possibly null | nullチェック追加 |
92
+
93
+ ---
94
+
95
+ ## 📊 Fix Report (REQ-BF-003)
96
+
97
+ **WHEN** 修正完了
98
+ **DO** レポート生成
99
+
100
+ ```
101
+ 🔧 Build Fix Report
102
+ ━━━━━━━━━━━━━━━━━━━━━━━━
103
+ Iterations: 2
104
+ Errors Fixed: 8
105
+
106
+ Changes:
107
+ • src/user.ts (+5 -2)
108
+ • tsconfig.json (+1 -0)
109
+
110
+ Progress:
111
+ Iteration 1: 8 → 4 errors
112
+ Iteration 2: 4 → 0 errors
113
+
114
+ Status: ✅ Build successful
115
+ Remaining Warnings: 3
116
+ ```
117
+
118
+ ---
119
+
120
+ ## トレーサビリティ
121
+
122
+ - REQ-BF-001: Build Error Analysis
123
+ - REQ-BF-002: Iterative Fix Strategy
124
+ - REQ-BF-003: Fix Report
@@ -0,0 +1,131 @@
1
+ ---
2
+ name: checkpoint
3
+ description: セーフポイントの作成・復元・比較。Gitと統合して状態を追跡。
4
+ license: MIT
5
+ version: 1.1.0
6
+ triggers:
7
+ - /checkpoint
8
+ - 危険な操作前
9
+ - マイルストーン達成時
10
+ ---
11
+
12
+ # Checkpoint
13
+
14
+ > **要約**: 開発作業のセーフポイントを提供。作成・復元・比較をサポート。
15
+
16
+ ## 📌 コマンド
17
+
18
+ ### /checkpoint create (REQ-CP-001)
19
+
20
+ **WHEN** `/checkpoint create <name>` 実行
21
+ **DO** 以下を順次実行
22
+
23
+ 1. Quick検証(`/verify quick`)
24
+ 2. Git commit/stash作成
25
+ 3. ログ記録
26
+
27
+ ```bash
28
+ # 未コミット変更がある場合
29
+ git stash push -m "checkpoint: <name>"
30
+ # または
31
+ git add -A && git commit -m "checkpoint: <name>"
32
+ ```
33
+
34
+ **出力**:
35
+ ```
36
+ 📍 Checkpoint: <name>
37
+ ━━━━━━━━━━━━━━━━━━━━
38
+ ✅ Verification: PASS
39
+ ✅ Git: abc1234
40
+ ✅ Logged
41
+ ━━━━━━━━━━━━━━━━━━━━
42
+ Time: 2026-01-25 14:30
43
+ ```
44
+
45
+ ---
46
+
47
+ ### /checkpoint verify (REQ-CP-002)
48
+
49
+ **WHEN** `/checkpoint verify <name>` 実行
50
+ **DO** チェックポイントとの差分を報告
51
+
52
+ | 項目 | 計算 |
53
+ |------|------|
54
+ | 変更ファイル数 | `git diff --stat <sha>..HEAD` |
55
+ | テスト合格率 | 現在 vs チェックポイント時 |
56
+ | カバレッジ | 現在 vs チェックポイント時 |
57
+ | ビルド状態 | 現在のビルド結果 |
58
+
59
+ **出力**:
60
+ ```
61
+ 📊 Verify: <name> (abc1234)
62
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
63
+ | Metric | Checkpoint | Current | Change |
64
+ |----------|------------|---------|--------|
65
+ | Tests | 42/42 | 45/45 | +3 ✅ |
66
+ | Coverage | 85% | 87% | +2% ✅ |
67
+ | Build | PASS | PASS | - |
68
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
69
+ Status: ✅ Quality maintained
70
+ ```
71
+
72
+ ---
73
+
74
+ ### /checkpoint list (REQ-CP-003)
75
+
76
+ **WHEN** `/checkpoint list` 実行
77
+ **DO** 全チェックポイントを表示
78
+
79
+ ```
80
+ 📋 Checkpoints
81
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
82
+ | Name | Time | SHA |
83
+ |-------------------------|------------|---------|
84
+ | feature-auth-complete | 01-25 14:30| abc1234 |
85
+ | before-migration | 01-25 10:00| def5678 |
86
+ | fix-123-done | 01-24 16:45| ghi9012 |
87
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
88
+ ```
89
+
90
+ ---
91
+
92
+ ### /checkpoint restore (REQ-CP-004)
93
+
94
+ **WHEN** `/checkpoint restore <name>` 実行
95
+ **DO** 安全に復元
96
+
97
+ **復元前チェック**:
98
+ - 未コミット変更 → stash/commit確認
99
+ - 復元後 → `/verify quick` 提案
100
+
101
+ ---
102
+
103
+ ## 📁 Storage (REQ-CP-005)
104
+
105
+ | パス | 内容 |
106
+ |------|------|
107
+ | `~/.musubix/checkpoints/checkpoints.log` | メタデータ |
108
+ | 保持数 | 最新10件(超過時は古いものを整理) |
109
+
110
+ **ログ形式**: `YYYY-MM-DD-HH:MM | <name> | <sha>`
111
+
112
+ ---
113
+
114
+ ## 🏷️ 命名規則
115
+
116
+ | パターン | 例 |
117
+ |---------|-----|
118
+ | `feature-<name>-<state>` | `feature-auth-complete` |
119
+ | `fix-<issue>-<state>` | `fix-123-done` |
120
+ | `before-<action>` | `before-migration` |
121
+ | `after-<action>` | `after-refactor` |
122
+
123
+ ---
124
+
125
+ ## トレーサビリティ
126
+
127
+ - REQ-CP-001: Checkpoint Creation
128
+ - REQ-CP-002: Checkpoint Verification
129
+ - REQ-CP-003: Checkpoint Listing
130
+ - REQ-CP-004: Checkpoint Restore
131
+ - REQ-CP-005: Checkpoint Retention & Location
@@ -0,0 +1,120 @@
1
+ ---
2
+ name: codemap
3
+ description: リポジトリ構造を分析し、アーキテクチャドキュメントを自動生成。
4
+ license: MIT
5
+ version: 1.1.0
6
+ triggers:
7
+ - /codemap
8
+ - /map
9
+ - アーキテクチャ可視化
10
+ ---
11
+
12
+ # Codemap
13
+
14
+ > **要約**: コードベースのアーキテクチャを分析し、構造化ドキュメントを自動生成。
15
+
16
+ ## 📌 コマンド
17
+
18
+ | コマンド | 説明 |
19
+ |---------|------|
20
+ | `/codemap generate` | 全体マップ生成 |
21
+ | `/codemap analyze <path>` | 特定パス分析 |
22
+ | `/codemap diff` | 既存との差分表示 |
23
+
24
+ ---
25
+
26
+ ## 🔍 分析内容
27
+
28
+ ### REQ-CM-001: リポジトリ構造
29
+
30
+ 1. **ワークスペース検出**
31
+ ```bash
32
+ cat package.json | jq '.workspaces'
33
+ ```
34
+
35
+ 2. **エントリーポイント識別**
36
+ - `src/index.ts`, `src/main.ts`
37
+ - `bin/` 配下
38
+ - `package.json` の `main`, `exports`
39
+
40
+ 3. **フレームワーク検出**
41
+ - Next.js: `next.config.js`, `app/`
42
+ - Express: `app.ts`, `routes/`
43
+
44
+ ### REQ-CM-002: モジュール分析
45
+
46
+ | 分析項目 | 検索方法 |
47
+ |---------|---------|
48
+ | エクスポート | `grep "^export" src/index.ts` |
49
+ | インポート | `grep "from '" src/*.ts` |
50
+ | APIルート | `ls pages/api/` or `grep router.` |
51
+ | DBモデル | `grep "^model" prisma/schema.prisma` |
52
+
53
+ ---
54
+
55
+ ## 📁 出力構造 (REQ-CM-003)
56
+
57
+ ```
58
+ docs/CODEMAPS/
59
+ ├── INDEX.md # 全体概要
60
+ ├── packages.md # パッケージ一覧
61
+ ├── backend.md # バックエンド構造
62
+ ├── frontend.md # フロントエンド構造
63
+ ├── database.md # DBスキーマ
64
+ └── integrations.md # 外部サービス
65
+ ```
66
+
67
+ ### INDEX.md テンプレート
68
+
69
+ ```markdown
70
+ # Codemap: [Project Name]
71
+
72
+ **Generated:** [日時]
73
+ **Version:** [バージョン]
74
+
75
+ ## Overview
76
+ [プロジェクト概要]
77
+
78
+ ## Structure
79
+ [ディレクトリ構造]
80
+
81
+ ## Packages
82
+ | Package | Description |
83
+ |---------|-------------|
84
+ | core | コア機能 |
85
+ | api | APIサーバー |
86
+
87
+ ## Entry Points
88
+ - `bin/cli.js` - CLI
89
+ - `src/index.ts` - Library
90
+ ```
91
+
92
+ ---
93
+
94
+ ## 📊 Diff Threshold (REQ-CM-004)
95
+
96
+ **WHEN** 既存マップ更新時
97
+ **DO** 差分率を計算し、30%超過時はユーザー承認
98
+
99
+ **出力**:
100
+ ```
101
+ 📊 Codemap Diff
102
+ ━━━━━━━━━━━━━━
103
+ Diff: 35% ⚠️
104
+ New: 5 modules
105
+ Removed: 2 modules
106
+ Changed: 8 modules
107
+ ━━━━━━━━━━━━━━
108
+ Update? (y/n)
109
+ ```
110
+
111
+ **レポート保存**: `.reports/codemap-diff.txt`
112
+
113
+ ---
114
+
115
+ ## トレーサビリティ
116
+
117
+ - REQ-CM-001: Repository Structure Analysis
118
+ - REQ-CM-002: Module Analysis
119
+ - REQ-CM-003: Codemap Generation
120
+ - REQ-CM-004: Codemap Diff Threshold