musubix 3.3.3 → 3.3.5

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 (92) 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/musubix-adr-generation/SKILL.md +209 -0
  15. package/.github/skills/musubix-best-practices/SKILL.md +315 -0
  16. package/.github/skills/musubix-c4-design/SKILL.md +162 -0
  17. package/.github/skills/musubix-code-generation/SKILL.md +237 -0
  18. package/.github/skills/musubix-domain-inference/SKILL.md +196 -0
  19. package/.github/skills/musubix-ears-validation/SKILL.md +161 -0
  20. package/.github/skills/musubix-sdd-workflow/SKILL.md +217 -0
  21. package/.github/skills/musubix-technical-writing/SKILL.md +444 -0
  22. package/.github/skills/musubix-test-generation/SKILL.md +212 -0
  23. package/.github/skills/musubix-traceability/SKILL.md +141 -0
  24. package/AGENTS.md +1065 -0
  25. package/LICENSE +21 -0
  26. package/README.ja.md +296 -0
  27. package/README.md +305 -50
  28. package/bin/musubix-mcp.js +15 -0
  29. package/bin/musubix.js +9 -1
  30. package/docs/API-REFERENCE.md +1425 -0
  31. package/docs/GITHUB-ACTIONS-NPM-SETUP.md +132 -0
  32. package/docs/INSTALL-GUIDE.ja.md +459 -0
  33. package/docs/INSTALL-GUIDE.md +459 -0
  34. package/docs/MIGRATION-v3.0.md +324 -0
  35. package/docs/MUSUBI-enhancement_roadmap_20260105.md +651 -0
  36. package/docs/MUSUBIX-v3.0-User-Guide.md +1357 -0
  37. package/docs/MUSUBIXv2.2.0-Manual-outline.md +136 -0
  38. package/docs/MUSUBIXv2.2.0-Manual.md +3123 -0
  39. package/docs/MUSUBIXv2.3.5-Refactering.md +1310 -0
  40. package/docs/MUSUBIv1.6.1-enhancement_roadmap_20260105.md +291 -0
  41. package/docs/MUSUBIv2.2.0-USERGUIDE.md +2079 -0
  42. package/docs/ROADMAP-v1.5.md +116 -0
  43. package/docs/SwarmCoding.md +1284 -0
  44. package/docs/Test-prompt.md +105 -0
  45. package/docs/USER-GUIDE-v1.8.0.md +2371 -0
  46. package/docs/USER-GUIDE.ja.md +2147 -0
  47. package/docs/USER-GUIDE.md +3022 -0
  48. package/docs/YATA-GLOBAL-GUIDE.ja.md +750 -0
  49. package/docs/YATA-GLOBAL-GUIDE.md +595 -0
  50. package/docs/YATA-LOCAL-GUIDE.ja.md +989 -0
  51. package/docs/YATA-LOCAL-GUIDE.md +730 -0
  52. package/docs/adr/0001-real-time-pattern-learning-architecture-for-v1-5-0.md +75 -0
  53. package/docs/adr/0002-pattern-sharing-protocol-for-cross-team-collaborat.md +79 -0
  54. package/docs/adr/0003-owl-2-rl-implementation-strategy-for-advanced-infe.md +90 -0
  55. package/docs/enterprise-knowledge-management.md +1737 -0
  56. package/docs/evolution-from-musubi-to-musubix.md +2170 -0
  57. package/docs/getting-started-with-sdd.md +1602 -0
  58. package/docs/moodle-refactering-codegraph-musubix.md +391 -0
  59. package/docs/moodle-refactering-codegraph.md +278 -0
  60. package/docs/overview/MUSUBIX-CodeGraph.md +322 -0
  61. package/docs/overview/MUSUBIX-Core.md +671 -0
  62. package/docs/overview/MUSUBIX-Decisions.md +494 -0
  63. package/docs/overview/MUSUBIX-FormalVerify.md +566 -0
  64. package/docs/overview/MUSUBIX-Knowledge.md +1231 -0
  65. package/docs/overview/MUSUBIX-Learning.md +837 -0
  66. package/docs/overview/MUSUBIX-MCP-Server.md +535 -0
  67. package/docs/overview/MUSUBIX-Overview.md +264 -0
  68. package/docs/overview/MUSUBIX-Phase1-Complete.md +271 -0
  69. package/docs/overview/MUSUBIX-Phase2-Complete.md +310 -0
  70. package/docs/overview/MUSUBIX-Policy.md +477 -0
  71. package/docs/overview/MUSUBIX-Roadmap-v2.md +399 -0
  72. package/docs/overview/MUSUBIX-Security-Plan.md +939 -0
  73. package/docs/overview/MUSUBIX-Security-v2.1.md +668 -0
  74. package/docs/overview/MUSUBIX-Security.md +891 -0
  75. package/docs/overview/MUSUBIX-YATA.md +666 -0
  76. package/docs/overview/MUSUBIX-v2.2.0-Advanced-Learning.md +513 -0
  77. package/docs/overview/Neuro-SymbolicAI.md +159 -0
  78. package/docs/packages/knowledge.md +594 -0
  79. package/docs/qiita-linux-kernel-knowledge-graph.md +596 -0
  80. package/package.json +55 -51
  81. package/scripts/generate-quality-gate-report.ts +106 -0
  82. package/scripts/postinstall.js +94 -0
  83. package/steering/.musubi-version +1 -0
  84. package/steering/product.ja.md +572 -0
  85. package/steering/project.yml +66 -0
  86. package/steering/rules/constitution.md +491 -0
  87. package/steering/structure.ja.md +503 -0
  88. package/steering/tech.ja.md +208 -0
  89. package/dist/index.d.ts +0 -25
  90. package/dist/index.d.ts.map +0 -1
  91. package/dist/index.js +0 -74
  92. package/dist/index.js.map +0 -1
@@ -0,0 +1,324 @@
1
+ # MUSUBIX v3.0 マイグレーションガイド
2
+
3
+ このドキュメントは MUSUBIX v2.x から v3.0 への移行手順を説明します。
4
+
5
+ ## 概要
6
+
7
+ MUSUBIX v3.0.0 では **Git-Native Knowledge System** を導入し、YATA(Yet Another Temporal Architecture)を廃止しました。
8
+
9
+ ### 主な変更点
10
+
11
+ | 項目 | v2.x | v3.0 |
12
+ |------|------|------|
13
+ | 知識ストレージ | YATA (SQLite/分散) | Git-friendly JSON |
14
+ | ストレージパス | `.yata/` | `.knowledge/` |
15
+ | 知識グラフAPI | YATAClient | FileKnowledgeStore |
16
+ | ポリシー検証 | 手動 | PolicyEngine (9憲法条項) |
17
+ | ADR管理 | 手動 | DecisionManager |
18
+
19
+ ---
20
+
21
+ ## Step 1: パッケージ更新
22
+
23
+ ### package.json の更新
24
+
25
+ ```diff
26
+ {
27
+ "dependencies": {
28
+ - "@nahisaho/musubix-yata-client": "^2.4.2",
29
+ - "@nahisaho/yata-local": "^2.4.6",
30
+ - "@nahisaho/yata-global": "^2.4.4",
31
+ + "@musubix/knowledge": "^3.0.0",
32
+ + "@musubix/policy": "^3.0.0",
33
+ + "@musubix/decisions": "^3.0.0"
34
+ }
35
+ }
36
+ ```
37
+
38
+ ### インストール
39
+
40
+ ```bash
41
+ npm install @musubix/knowledge @musubix/policy @musubix/decisions
42
+ npm uninstall @nahisaho/musubix-yata-client @nahisaho/yata-local @nahisaho/yata-global
43
+ ```
44
+
45
+ ---
46
+
47
+ ## Step 2: 知識グラフ API の移行
48
+
49
+ ### v2.x (YATA)
50
+
51
+ ```typescript
52
+ import { YATAClient } from '@nahisaho/musubix-yata-client';
53
+
54
+ const client = new YATAClient({ dbPath: '.yata/knowledge.db' });
55
+ await client.addNode({ id: 'REQ-001', type: 'requirement', label: 'User Login' });
56
+ await client.addEdge({ from: 'REQ-001', to: 'DES-001', type: 'implements' });
57
+ const nodes = await client.query({ type: 'requirement' });
58
+ ```
59
+
60
+ ### v3.0 (FileKnowledgeStore)
61
+
62
+ ```typescript
63
+ import { createKnowledgeStore } from '@musubix/knowledge';
64
+
65
+ const store = createKnowledgeStore('.knowledge');
66
+ await store.putEntity({ id: 'REQ-001', type: 'requirement', name: 'User Login' });
67
+ await store.addRelation({ from: 'REQ-001', to: 'DES-001', type: 'implements' });
68
+ const entities = await store.query({ type: 'requirement' });
69
+ ```
70
+
71
+ ### API マッピング表
72
+
73
+ | YATA (v2.x) | Knowledge (v3.0) | 説明 |
74
+ |-------------|------------------|------|
75
+ | `addNode()` | `putEntity()` | エンティティ作成/更新 |
76
+ | `getNode()` | `getEntity()` | エンティティ取得 |
77
+ | `deleteNode()` | `deleteEntity()` | エンティティ削除 |
78
+ | `addEdge()` | `addRelation()` | リレーション追加 |
79
+ | `deleteEdge()` | `removeRelation()` | リレーション削除 |
80
+ | `query()` | `query()` | 検索 |
81
+ | `traverse()` | `traverse()` | グラフ走査 |
82
+
83
+ ---
84
+
85
+ ## Step 3: データ移行
86
+
87
+ ### 自動移行スクリプト
88
+
89
+ ```typescript
90
+ // scripts/migrate-yata-to-knowledge.ts
91
+ import Database from 'better-sqlite3';
92
+ import { createKnowledgeStore } from '@musubix/knowledge';
93
+ import * as fs from 'node:fs';
94
+
95
+ async function migrateYataToKnowledge(yataDbPath: string, knowledgePath: string) {
96
+ // 1. Open YATA SQLite database
97
+ const db = new Database(yataDbPath, { readonly: true });
98
+
99
+ // 2. Create Knowledge store
100
+ const store = createKnowledgeStore(knowledgePath);
101
+
102
+ // 3. Migrate nodes → entities
103
+ const nodes = db.prepare('SELECT * FROM nodes').all();
104
+ for (const node of nodes) {
105
+ await store.putEntity({
106
+ id: node.id,
107
+ type: mapNodeType(node.type),
108
+ name: node.label || node.id,
109
+ properties: JSON.parse(node.properties || '{}'),
110
+ });
111
+ }
112
+
113
+ // 4. Migrate edges → relations
114
+ const edges = db.prepare('SELECT * FROM edges').all();
115
+ for (const edge of edges) {
116
+ await store.addRelation({
117
+ from: edge.from_id,
118
+ to: edge.to_id,
119
+ type: mapEdgeType(edge.type),
120
+ });
121
+ }
122
+
123
+ db.close();
124
+ console.log(`Migrated ${nodes.length} entities, ${edges.length} relations`);
125
+ }
126
+
127
+ function mapNodeType(yataType: string): string {
128
+ const mapping: Record<string, string> = {
129
+ 'requirement': 'requirement',
130
+ 'design': 'design',
131
+ 'task': 'task',
132
+ 'code': 'code',
133
+ 'test': 'code',
134
+ 'pattern': 'pattern',
135
+ };
136
+ return mapping[yataType] || 'code';
137
+ }
138
+
139
+ function mapEdgeType(yataType: string): string {
140
+ const mapping: Record<string, string> = {
141
+ 'implements': 'implements',
142
+ 'depends': 'depends_on',
143
+ 'traces': 'traces_to',
144
+ 'uses': 'depends_on',
145
+ };
146
+ return mapping[yataType] || 'depends_on';
147
+ }
148
+
149
+ // 実行
150
+ migrateYataToKnowledge('.yata/knowledge.db', '.knowledge');
151
+ ```
152
+
153
+ ### 手動移行
154
+
155
+ 1. `.yata/` ディレクトリをバックアップ
156
+ 2. 新しい `.knowledge/` ディレクトリを作成
157
+ 3. 既存データを JSON 形式でエクスポート/インポート
158
+
159
+ ---
160
+
161
+ ## Step 4: ポリシー検証の追加
162
+
163
+ v3.0 では9憲法条項をプログラマブルに検証できます。
164
+
165
+ ```typescript
166
+ import { createPolicyEngine } from '@musubix/policy';
167
+
168
+ const engine = createPolicyEngine();
169
+
170
+ // プロジェクト全体の検証
171
+ const report = await engine.validate({ projectPath: '.' });
172
+
173
+ if (!report.passed) {
174
+ for (const violation of report.violations) {
175
+ console.error(`[${violation.policyId}] ${violation.message}`);
176
+ }
177
+ }
178
+
179
+ // 特定ポリシーのみ検証
180
+ const earsReport = await engine.validate(
181
+ { filePath: 'storage/specs/REQ-001.md', content: fileContent },
182
+ ['CONST-004'] // EARS Format のみ
183
+ );
184
+ ```
185
+
186
+ ### 利用可能なポリシー
187
+
188
+ | ID | 名称 | 説明 |
189
+ |----|------|------|
190
+ | CONST-001 | Library-First | 独立ライブラリ化の検証 |
191
+ | CONST-002 | CLI Interface | CLI公開必須の検証 |
192
+ | CONST-003 | Test-First | テスト先行の検証 |
193
+ | CONST-004 | EARS Format | EARS形式準拠の検証 |
194
+ | CONST-005 | Traceability | トレーサビリティの検証 |
195
+ | CONST-006 | Project Memory | steering/参照の検証 |
196
+ | CONST-007 | Design Patterns | 設計パターン適用の検証 |
197
+ | CONST-008 | Decision Records | ADR記録の検証 |
198
+ | CONST-009 | Quality Gates | 品質ゲートの検証 |
199
+
200
+ ---
201
+
202
+ ## Step 5: ADR 管理の追加
203
+
204
+ ```typescript
205
+ import { createDecisionManager } from '@musubix/decisions';
206
+
207
+ const manager = createDecisionManager('docs/decisions');
208
+
209
+ // ADR 作成
210
+ const adr = await manager.create({
211
+ title: 'Use Git-Native Knowledge System',
212
+ context: 'Need simpler knowledge storage that works with Git',
213
+ decision: 'Replace YATA with JSON-based FileKnowledgeStore',
214
+ rationale: 'Git-friendly, no external database required',
215
+ });
216
+
217
+ // ADR 承認
218
+ await manager.accept(adr.id);
219
+
220
+ // ADR 一覧
221
+ const adrs = await manager.list({ status: 'accepted' });
222
+ ```
223
+
224
+ ---
225
+
226
+ ## Step 6: CLI コマンドの更新
227
+
228
+ ### v2.x
229
+
230
+ ```bash
231
+ # YATA 関連コマンドは非推奨
232
+ npx yata-ui
233
+ npx yata-global-server
234
+ ```
235
+
236
+ ### v3.0
237
+
238
+ ```bash
239
+ # Knowledge コマンド
240
+ npx musubix knowledge put REQ-001 requirement "User Login"
241
+ npx musubix knowledge get REQ-001
242
+ npx musubix knowledge link REQ-001 DES-001 implements
243
+ npx musubix knowledge query --type requirement
244
+
245
+ # Policy コマンド
246
+ npx musubix policy validate
247
+ npx musubix policy list
248
+ npx musubix policy check storage/specs/REQ-001.md
249
+
250
+ # Decision コマンド
251
+ npx musubix decision create "Use TypeScript" --context "..." --decision "..."
252
+ npx musubix decision list
253
+ npx musubix decision accept 0001
254
+ npx musubix adr index
255
+ ```
256
+
257
+ ---
258
+
259
+ ## Step 7: MCP ツールの更新
260
+
261
+ ### v2.x MCP ツール (廃止)
262
+
263
+ - `yata_query` → 廃止
264
+ - `yata_add_node` → 廃止
265
+ - `yata_add_edge` → 廃止
266
+
267
+ ### v3.0 MCP ツール (新規)
268
+
269
+ | ツール | 説明 |
270
+ |--------|------|
271
+ | `knowledge_put_entity` | エンティティ作成/更新 |
272
+ | `knowledge_get_entity` | エンティティ取得 |
273
+ | `knowledge_delete_entity` | エンティティ削除 |
274
+ | `knowledge_add_relation` | リレーション追加 |
275
+ | `knowledge_query` | グラフクエリ |
276
+ | `knowledge_traverse` | グラフ走査 |
277
+ | `policy_validate` | ポリシー検証 |
278
+ | `policy_list` | ポリシー一覧 |
279
+ | `policy_get` | ポリシー詳細 |
280
+ | `policy_check_file` | ファイル検証 |
281
+ | `decision_create` | ADR作成 |
282
+ | `decision_list` | ADR一覧 |
283
+ | `decision_get` | ADR詳細 |
284
+ | `decision_accept` | ADR承認 |
285
+ | `decision_deprecate` | ADR廃止 |
286
+ | `decision_search` | ADR検索 |
287
+ | `decision_find_by_requirement` | 要件からADR検索 |
288
+ | `decision_generate_index` | インデックス生成 |
289
+
290
+ ---
291
+
292
+ ## トラブルシューティング
293
+
294
+ ### Q: YATA データベースが見つからない
295
+
296
+ A: `.yata/` ディレクトリが存在しない場合、移行は不要です。新規に `.knowledge/` を作成してください。
297
+
298
+ ### Q: エンティティタイプが一致しない
299
+
300
+ A: v3.0 では以下のタイプのみサポート:
301
+ - `requirement`
302
+ - `design`
303
+ - `task`
304
+ - `code`
305
+ - `pattern`
306
+
307
+ ### Q: リレーションタイプが一致しない
308
+
309
+ A: v3.0 では以下のタイプのみサポート:
310
+ - `implements`
311
+ - `depends_on`
312
+ - `traces_to`
313
+
314
+ ---
315
+
316
+ ## サポート
317
+
318
+ 問題が発生した場合は GitHub Issues で報告してください:
319
+ https://github.com/nahisaho/MUSUBIX/issues
320
+
321
+ ---
322
+
323
+ **Last Updated**: 2026-01-14
324
+ **Version**: v3.0.0