musubix 3.0.7 → 3.0.14

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 +858 -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 +229 -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 +210 -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 +873 -0
  25. package/LICENSE +21 -0
  26. package/README.ja.md +296 -0
  27. package/README.md +305 -44
  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 +2847 -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 +56 -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
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 nahisaho
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.ja.md ADDED
@@ -0,0 +1,296 @@
1
+ # MUSUBIX - ニューロシンボリックAI統合システム
2
+
3
+ [![npm version](https://img.shields.io/npm/v/musubix.svg)](https://www.npmjs.com/package/musubix)
4
+ [![npm core](https://img.shields.io/npm/v/@nahisaho/musubix-core.svg?label=@nahisaho/musubix-core)](https://www.npmjs.com/package/@nahisaho/musubix-core)
5
+ [![npm mcp](https://img.shields.io/npm/v/@nahisaho/musubix-mcp-server.svg?label=@nahisaho/musubix-mcp-server)](https://www.npmjs.com/package/@nahisaho/musubix-mcp-server)
6
+ [![Node.js Version](https://img.shields.io/badge/node-%3E%3D20.0.0-brightgreen)](https://nodejs.org/)
7
+ [![License](https://img.shields.io/badge/license-MIT-blue)](LICENSE)
8
+ [![TypeScript](https://img.shields.io/badge/TypeScript-5.3-blue)](https://www.typescriptlang.org/)
9
+ [![Tests](https://img.shields.io/badge/tests-1586%20passing-brightgreen)](https://github.com/nahisaho/MUSUBIX)
10
+ [![npm security](https://img.shields.io/npm/v/@nahisaho/musubix-security.svg?label=@nahisaho/musubix-security)](https://www.npmjs.com/package/@nahisaho/musubix-security)
11
+
12
+ > Git-Native知識統合による次世代AIコーディングシステム
13
+ >
14
+ > **v3.0.0** - Git-Native Knowledge System
15
+
16
+ ## 概要
17
+
18
+ MUSUBIXは、**ニューラル(LLM)** と **シンボリック(知識グラフ)** 推論を統合した革新的なAIコーディングシステムです。MUSUBI SDDの方法論とGit-Native知識管理を組み合わせ、高品質なソフトウェア開発を支援します。
19
+
20
+ ### 特徴
21
+
22
+ - 🧠 **ニューロシンボリック統合** - LLMの創造性と知識グラフの厳密性を融合
23
+ - � **シンボリック推論** - 形式検証、幻覚検出、憲法強制
24
+ - 📝 **EARS形式要件分析** - 自然言語から正式な要件への変換・検証
25
+ - 🎨 **設計パターン推奨** - コンテキストに基づくC4モデル・ADR生成
26
+ - ✅ **テスト駆動開発** - Test-First原則による品質保証
27
+ - 🔗 **完全なトレーサビリティ** - 要件からコードまでの追跡可能性
28
+ - 💬 **一問一答形式ヒアリング** - 対話的な要件定義サポート
29
+ - 🌐 **多言語対応(i18n)** - 日本語・英語対応
30
+ - 🔒 **セキュリティスキャン** - 脆弱性検出、シークレットスキャン、OWASPパターン
31
+ - 📚 **自己学習システム** - フィードバック収集とパターン抽出による適応的改善
32
+ - 🏗️ **C4コード生成** - C4設計ドキュメントからTypeScriptスケルトン生成
33
+ - ⚙️ **品質ゲート** - フェーズ移行前の自動品質検証
34
+ - 🔮 **高度推論** - OWL 2 RL推論とDatalog評価 *(v1.4.5)*
35
+ - 🖥️ **対話的REPL** - コマンド補完、履歴管理、セッション変数 *(v1.6.0)*
36
+ - � **Git-Native知識** - ファイルベースの知識グラフ管理 *(v3.0.0)*
37
+ - 🔬 **形式検証** - Z3 SMTソルバー統合、Hoareトリプル検証、EARS→SMT変換 *(v1.7.5)*
38
+ - 🛡️ **セキュリティ分析** - 脆弱性スキャン、シークレット検出、テイント解析、依存関係監査 *(v1.8.0)*
39
+
40
+ ## アーキテクチャ
41
+
42
+ ```mermaid
43
+ flowchart TB
44
+ subgraph MUSUBIX["MUSUBIX System v3.0"]
45
+ subgraph Packages["Packages"]
46
+ Core["@nahisaho/musubix-core"]
47
+ MCP["@nahisaho/musubix-mcp-server"]
48
+ Security["@nahisaho/musubix-security"]
49
+ end
50
+
51
+ Core <--> MCP
52
+ MCP <--> Security
53
+
54
+ subgraph Integration["Neuro-Symbolic Integration"]
55
+ NSI["LLM Creativity + Git-Native Knowledge"]
56
+ end
57
+
58
+ Core --> Integration
59
+ MCP --> Integration
60
+ end
61
+ ```
62
+
63
+ ## プロジェクト構造
64
+
65
+ | パス | 説明 |
66
+ |------|------|
67
+ | `packages/core/` | コアライブラリ(249モジュール) |
68
+ | `packages/core/auth/` | 認証・認可 |
69
+ | `packages/core/cli/` | CLIインターフェース |
70
+ | `packages/core/codegen/` | コード生成・解析 |
71
+ | `packages/core/design/` | 設計パターン・C4モデル |
72
+ | `packages/core/error/` | エラーハンドリング |
73
+ | `packages/core/explanation/` | 説明生成・可視化 |
74
+ | `packages/core/learning/` | 自己学習・パターン抽出 |
75
+ | `packages/core/requirements/` | 要件分析・分解 |
76
+ | `packages/core/symbolic/` | シンボリック推論 |
77
+ | `packages/core/traceability/` | トレーサビリティ |
78
+ | `packages/core/types/` | 型定義 |
79
+ | `packages/core/utils/` | ユーティリティ |
80
+ | `packages/core/validators/` | EARS検証 |
81
+ | `packages/mcp-server/` | MCPサーバー(35 tools, 5 prompts) |
82
+ | `packages/pattern-mcp/` | **パターン学習** |
83
+ | `packages/ontology-mcp/` | **オントロジーエンジン** |
84
+ | `packages/wake-sleep/` | **Wake-Sleep学習** |
85
+ | `packages/sdd-ontology/` | **SDDオントロジー** |
86
+ | `packages/security/` | **セキュリティ分析** |
87
+ | `packages/formal-verify/` | **形式検証** |
88
+ | `steering/` | プロジェクトメモリ |
89
+ | `storage/` | 仕様書・成果物 |
90
+ | `templates/` | テンプレート |
91
+ | `docs/` | ドキュメント |
92
+
93
+ ## 要件
94
+
95
+ - Node.js >= 20.0.0
96
+ - npm >= 10.0.0
97
+ - TypeScript >= 5.3
98
+
99
+ ## インストール
100
+
101
+ ### npm/npx(推奨)
102
+
103
+ ```bash
104
+ # グローバルインストール
105
+ npm install -g musubix
106
+
107
+ # npx で直接実行
108
+ npx musubix init
109
+ npx musubix --help
110
+
111
+ # MCPサーバー起動
112
+ npx @nahisaho/musubix-mcp-server
113
+ npx musubix-mcp --transport stdio
114
+ ```
115
+
116
+ ### スコープ付きパッケージ
117
+
118
+ ```bash
119
+ # 個別パッケージのインストール
120
+ npm install @nahisaho/musubix-core
121
+ npm install @nahisaho/musubix-mcp-server
122
+ npm install @nahisaho/musubix-security
123
+ npm install @nahisaho/musubix-formal-verify
124
+ ```
125
+
126
+ ### ソースからビルド
127
+
128
+ ```bash
129
+ git clone https://github.com/nahisaho/MUSUBIX.git
130
+ cd MUSUBIX
131
+ npm install
132
+ npm run build
133
+ ```
134
+
135
+ ## 開発
136
+
137
+ \`\`\`bash
138
+ # ビルド
139
+ npm run build
140
+
141
+ # テスト実行
142
+ npm test
143
+
144
+ # リント
145
+ npm run lint
146
+
147
+ # 型チェック
148
+ npm run type-check
149
+ \`\`\`
150
+
151
+ ## 主要機能
152
+
153
+ ### 要件定義(Article II準拠)
154
+
155
+ - **EARS検証**: Easy Approach to Requirements Syntax パターン検証
156
+ - **一問一答ヒアリング**: 対話形式での要件収集
157
+ - **要件分解**: 大きな要件を実装単位に分解
158
+ - **関連要件検索**: 類似・依存要件の自動検出
159
+
160
+ ### 設計生成(Article III準拠)
161
+
162
+ - **C4モデル生成**: Context/Container/Component/Code図
163
+ - **ADR生成**: Architecture Decision Records
164
+ - **パターン検出**: デザインパターンの自動検出・推奨
165
+ - **SOLID検証**: SOLID原則準拠チェック
166
+
167
+ ### コード生成・検証
168
+
169
+ - **静的解析**: 品質メトリクス・複雑度計算
170
+ - **セキュリティスキャン**: 脆弱性検出
171
+ - **テスト生成**: ユニット・統合テスト生成
172
+ - **カバレッジレポート**: テストカバレッジ計測
173
+
174
+ ### MCPサーバー
175
+
176
+ 16個のツール(SDD 9個 + パターン 7個)と3つのプロンプトを提供:
177
+
178
+ ```bash
179
+ # MCPサーバー起動
180
+ npx @nahisaho/musubix-mcp-server
181
+ ```
182
+
183
+ ## ドキュメント
184
+
185
+ | 文書 | 説明 |
186
+ |------|------|
187
+ | [要件定義書](storage/specs/REQ-MUSUBIX-001.md) | EARS形式の機能・非機能要件 |
188
+ | [設計書](storage/specs/DES-MUSUBIX-001.md) | C4モデル・ADRベースの設計 |
189
+ | [タスク定義書](storage/specs/TSK-MUSUBIX-001.md) | 56タスクのスプリント計画 |
190
+ | [APIリファレンス](docs/API-REFERENCE.md) | 公開API仕様 |
191
+ | [シンボリック統合](storage/specs/REQ-SYMB-001.md) | Neuro-Symbolic要件(27要件) |
192
+
193
+ ## シンボリック推論モジュール(v1.2.0)
194
+
195
+ 新しいシンボリック推論モジュール:
196
+
197
+ ### Phase 1: 基盤
198
+ - **SemanticCodeFilterPipeline** - LLM出力のセマンティック検証
199
+ - **HallucinationDetector** - 未定義シンボル・無効インポートの検出
200
+ - **ConstitutionRuleRegistry** - 9憲法条項の強制
201
+ - **ConfidenceEstimator** - AST複雑度、要件カバレッジのスコアリング
202
+ - **ConfidenceBasedRouter** - 信頼度ベースのルーティング決定
203
+ - **ErrorHandler** - グレースフルデグラデーション
204
+
205
+ ### Phase 2: 形式検証
206
+ - **EarsToFormalSpecConverter** - EARS → SMT-LIB変換
207
+ - **VerificationConditionGenerator** - 検証条件(VC)生成
208
+ - **Z3Adapter** - Z3 SMTソルバー統合
209
+ - **SecurityScanner** - OWASPパターン、シークレット検出
210
+
211
+ ### Phase 3: 高度機能
212
+ - **CandidateRanker** - 複数基準による候補スコアリング
213
+ - **ResultBlender** - Neural/Symbolic結果統合(3戦略)
214
+ - **ExtensibleRuleConfig** - YAML/JSONルール設定
215
+ - **AuditLogger** - SHA-256ハッシュチェーン改ざん検出
216
+ - **PerformanceBudget** - 段階別予算、SLOメトリクス
217
+ - **QualityGateValidator** - 自動品質ゲート検証
218
+
219
+ ## Wake-Sleep学習サイクル(v1.3.0)
220
+
221
+ Wake-Sleepアルゴリズムに基づく継続的学習システム:
222
+
223
+ | フェーズ | 処理内容 |
224
+ |---------|----------|
225
+ | **Wake** | コード観察 → パターン抽出 → 知識グラフ更新 |
226
+ | **Sleep** | パターン統合 → 類似パターン圧縮 → メモリ最適化 |
227
+
228
+ ### 主要コンポーネント
229
+ - **WakeSleepCycle** - 学習サイクルのオーケストレーション
230
+ - **PatternLibrary** - 学習済みパターンの永続化管理
231
+ - **PatternOntologyBridge** - パターン↔オントロジー相互変換
232
+ - **N3Store** - RDF/OWLベースの知識グラフストレージ
233
+
234
+ ### 新MCPツール(7ツール)
235
+ - `pattern_extract` - コードからパターンを抽出
236
+ - `pattern_compress` - パターンの抽象化・圧縮
237
+ - `pattern_store` - パターンライブラリへの保存
238
+ - `pattern_query` - パターンの検索・取得
239
+ - `pattern_consolidate` - 類似パターンの統合
240
+ - `ontology_query` - オントロジーグラフへのクエリ
241
+ - `ontology_infer` - オントロジーによる推論実行
242
+
243
+ ## 高度推論(v1.4.5)
244
+
245
+ OWL 2 RLプロファイル推論とDatalog評価エンジン:
246
+
247
+ ### 推論コンポーネント
248
+ - **OWL2RLReasoner** - OWL 2 RLプロファイル準拠推論(20+ビルトインルール)
249
+ - **DatalogEngine** - ストラティファイドDatalog評価(否定サポート)
250
+ - **InferenceExplainer** - 人間可読な推論説明生成
251
+ - **ProgressReporter** - リアルタイム進捗フィードバック(500ms間隔)
252
+
253
+ ### OWL 2 RLビルトインルール
254
+ | カテゴリ | ルール | 説明 |
255
+ |----------|-------|------|
256
+ | Class Axioms | cax-sco, cax-eqc | サブクラス、同値クラス推論 |
257
+ | Property | prp-dom, prp-rng | ドメイン、レンジ推論 |
258
+ | Property Characteristics | prp-symp, prp-trp, prp-inv | 対称、推移、逆プロパティ |
259
+ | Equality | eq-ref, eq-sym, eq-trans | sameAs推論 |
260
+
261
+ ### 説明フォーマット
262
+ - `text` - プレーンテキスト説明
263
+ - `markdown` - Markdown形式
264
+ - `html` - HTML形式(エスケープ対応)
265
+
266
+ ## 憲法(9条)
267
+
268
+ MUSUBIXは以下の9条の憲法に準拠しています:
269
+
270
+ 1. **Specification First** - 要件が先、実装は後
271
+ 2. **Design Before Code** - 設計が先、コードは後
272
+ 3. **Single Source of Truth** - プロジェクトメモリが正
273
+ 4. **Traceability** - 要件〜コードの追跡可能性
274
+ 5. **Incremental Progress** - 小さく頻繁にデリバリー
275
+ 6. **Decision Documentation** - 決定はADRで記録
276
+ 7. **Quality Gates** - フェーズ検証必須
277
+ 8. **User-Centric** - ユーザー価値を文書化
278
+ 9. **Continuous Learning** - 振り返りと改善
279
+
280
+ ## ライセンス
281
+
282
+ MIT License - 詳細は [LICENSE](LICENSE) を参照
283
+
284
+ ## 作者
285
+
286
+ nahisaho
287
+
288
+ ## 変更履歴
289
+
290
+ [CHANGELOG.md](CHANGELOG.md) を参照
291
+
292
+ ---
293
+
294
+ **文書ID**: README
295
+ **バージョン**: 1.8.0
296
+ **最終更新**: 2026-01-06
package/README.md CHANGED
@@ -1,65 +1,326 @@
1
- # musubix
1
+ # MUSUBIX - Neuro-Symbolic AI Integration System
2
2
 
3
- MUSUBIX - Neuro-Symbolic AI Integration System for Software Development
3
+ [![CI](https://github.com/nahisaho/MUSUBIX/actions/workflows/ci.yml/badge.svg)](https://github.com/nahisaho/MUSUBIX/actions/workflows/ci.yml)
4
+ [![npm version](https://img.shields.io/npm/v/musubix.svg)](https://www.npmjs.com/package/musubix)
5
+ [![npm core](https://img.shields.io/npm/v/@nahisaho/musubix-core.svg?label=@nahisaho/musubix-core)](https://www.npmjs.com/package/@nahisaho/musubix-core)
6
+ [![npm mcp](https://img.shields.io/npm/v/@nahisaho/musubix-mcp-server.svg?label=@nahisaho/musubix-mcp-server)](https://www.npmjs.com/package/@nahisaho/musubix-mcp-server)
7
+ [![Node.js Version](https://img.shields.io/badge/node-%3E%3D20.0.0-brightgreen)](https://nodejs.org/)
8
+ [![License](https://img.shields.io/badge/license-MIT-blue)](LICENSE)
9
+ [![TypeScript](https://img.shields.io/badge/TypeScript-5.3-blue)](https://www.typescriptlang.org/)
10
+ [![Tests](https://img.shields.io/badge/tests-1600%2B%20passing-brightgreen)](https://github.com/nahisaho/MUSUBIX)
11
+ [![npm security](https://img.shields.io/npm/v/@nahisaho/musubix-security.svg?label=@nahisaho/musubix-security)](https://www.npmjs.com/package/@nahisaho/musubix-security)
12
+ [![npm dfg](https://img.shields.io/npm/v/@nahisaho/musubix-dfg.svg?label=@nahisaho/musubix-dfg)](https://www.npmjs.com/package/@nahisaho/musubix-dfg)
13
+ [![npm lean](https://img.shields.io/npm/v/@nahisaho/musubix-lean.svg?label=@nahisaho/musubix-lean)](https://www.npmjs.com/package/@nahisaho/musubix-lean)
14
+ [![npm synthesis](https://img.shields.io/npm/v/@nahisaho/musubix-synthesis.svg?label=@nahisaho/musubix-synthesis)](https://www.npmjs.com/package/@nahisaho/musubix-synthesis)
15
+ [![npm library-learner](https://img.shields.io/npm/v/@nahisaho/musubix-library-learner.svg?label=@nahisaho/musubix-library-learner)](https://www.npmjs.com/package/@nahisaho/musubix-library-learner)
16
+ [![npm neural-search](https://img.shields.io/npm/v/@nahisaho/musubix-neural-search.svg?label=@nahisaho/musubix-neural-search)](https://www.npmjs.com/package/@nahisaho/musubix-neural-search)
17
+
18
+ > Next-generation AI Coding System powered by Git-Native Knowledge Integration
19
+ >
20
+ > **v3.0.0** - Git-Native Knowledge System
21
+
22
+ **[日本語版 README](README.ja.md)**
23
+
24
+ ## Overview
25
+
26
+ MUSUBIX is an innovative AI coding system that integrates **Neural (LLM)** and **Symbolic (Knowledge Graph)** reasoning. It combines MUSUBI SDD methodology with Git-native knowledge management to support high-quality software development.
27
+
28
+ ### 🎉 v3.0.0 Highlights
29
+
30
+ - **Git-Native Knowledge** - File-based knowledge graph in `.knowledge/`
31
+ - **Policy Engine** - Executable TypeScript policies in `.policies/`
32
+ - **Decision Records** - ADR management in `docs/decisions/`
33
+ - **2100+ tests** passing across 17 packages
34
+
35
+ ### Features
36
+
37
+ - 🧠 **Neuro-Symbolic Integration** - Fusion of LLM creativity and knowledge graph precision
38
+ - 📂 **Git-Native Knowledge** - File-based knowledge graph management *(v3.0.0)*
39
+ - 📊 **DFG/CFG Analysis** - Data flow and control flow graph extraction for TypeScript/JavaScript
40
+ - 🧮 **Lean 4 Integration** - Formal theorem proving with EARS-to-Lean conversion
41
+ - 📚 **Library Learning** - DreamCoder-style hierarchical abstraction and pattern compression
42
+ - 🔍 **Neural Search** - Neural-guided program synthesis with beam search
43
+ - ⚗️ **Program Synthesis** - DSL-based PBE synthesis with witness functions
44
+ - 🔒 **Symbolic Reasoning** - Formal verification, hallucination detection, constitution enforcement
45
+ - 📝 **EARS Requirements Analysis** - Conversion and validation from natural language to formal requirements
46
+ - 🎨 **Design Pattern Recommendations** - Context-based C4 model and ADR generation
47
+ - ✅ **Test-Driven Development** - Quality assurance through Test-First principles
48
+ - 🔗 **Complete Traceability** - Tracking from requirements to code
49
+ - 🛡️ **Security Analysis** - Vulnerability scanning, secret detection, taint analysis *(v1.8.0)*
50
+ - 🔬 **Formal Verification** - Z3 SMT solver integration, Hoare triple verification *(v1.7.5)*
51
+ - 🖥️ **Interactive REPL** - Command completion, history, session variables *(v1.6.0)*
52
+ - 🔮 **Advanced Inference** - OWL 2 RL reasoning and Datalog evaluation *(v1.4.5)*
53
+
54
+ ## Architecture
55
+
56
+ ```mermaid
57
+ flowchart TB
58
+ subgraph MUSUBIX["MUSUBIX System v3.0"]
59
+ subgraph Packages["Packages"]
60
+ Core["@nahisaho/musubix-core"]
61
+ MCP["@nahisaho/musubix-mcp-server"]
62
+ Security["@nahisaho/musubix-security"]
63
+ end
64
+
65
+ Core <--> MCP
66
+ MCP <--> Security
67
+
68
+ subgraph Integration["Neuro-Symbolic Integration"]
69
+ NSI["LLM Creativity + Git-Native Knowledge"]
70
+ end
71
+
72
+ Core --> Integration
73
+ MCP --> Integration
74
+ end
75
+ ```
76
+
77
+ ## Project Structure
78
+
79
+ | Path | Description |
80
+ |------|-------------|
81
+ | `packages/core/` | Core library (249 modules) |
82
+ | `packages/core/auth/` | Authentication & Authorization |
83
+ | `packages/core/cli/` | CLI Interface |
84
+ | `packages/core/codegen/` | Code Generation & Analysis |
85
+ | `packages/core/design/` | Design Patterns & C4 Models |
86
+ | `packages/core/error/` | Error Handling |
87
+ | `packages/core/explanation/` | Explanation Generation & Visualization |
88
+ | `packages/core/learning/` | Self-Learning & Pattern Extraction |
89
+ | `packages/core/requirements/` | Requirements Analysis & Decomposition |
90
+ | `packages/core/symbolic/` | Symbolic Reasoning |
91
+ | `packages/core/traceability/` | Traceability |
92
+ | `packages/core/types/` | Type Definitions |
93
+ | `packages/core/utils/` | Utilities |
94
+ | `packages/core/validators/` | EARS Validation |
95
+ | `packages/mcp-server/` | MCP Server (35 tools, 5 prompts) |
96
+ | `packages/pattern-mcp/` | Pattern Learning |
97
+ | `packages/ontology-mcp/` | Ontology Engine |
98
+ | `packages/wake-sleep/` | Wake-Sleep Learning |
99
+ | `packages/sdd-ontology/` | SDD Ontology |
100
+ | `packages/security/` | Security Analysis |
101
+ | `packages/formal-verify/` | Formal Verification |
102
+ | `packages/dfg/` | DFG/CFG Extraction - Data Flow Analysis |
103
+ | `packages/lean/` | Lean 4 Integration - Theorem Proving |
104
+ | `packages/library-learner/` | Library Learning - DreamCoder-style |
105
+ | `packages/neural-search/` | Neural Search - Guided Synthesis |
106
+ | `packages/synthesis/` | Program Synthesis - DSL/PBE |
107
+ | `steering/` | Project Memory |
108
+ | `storage/` | Specifications & Artifacts |
109
+ | `templates/` | Templates |
110
+ | `docs/` | Documentation |
111
+
112
+ ## Requirements
113
+
114
+ - Node.js >= 20.0.0
115
+ - npm >= 10.0.0
116
+ - TypeScript >= 5.3
4
117
 
5
118
  ## Installation
6
119
 
120
+ ### npm/npx (Recommended)
121
+
7
122
  ```bash
8
- npm install musubix
123
+ # Global installation
124
+ npm install -g musubix
125
+
126
+ # Run directly with npx
127
+ npx musubix init
128
+ npx musubix --help
129
+
130
+ # Start MCP Server
131
+ npx @nahisaho/musubix-mcp-server
132
+ npx musubix-mcp --transport stdio
9
133
  ```
10
134
 
11
- This will install all MUSUBIX packages:
12
-
13
- - `@nahisaho/musubix-core` - Core library (CLI, EARS validation, code generation)
14
- - `@nahisaho/musubix-mcp-server` - MCP Server (19 tools, 3 prompts)
15
- - `@nahisaho/musubix-security` - Security analysis
16
- - `@nahisaho/musubix-formal-verify` - Formal verification with Z3
17
- - `@nahisaho/musubix-yata-client` - YATA knowledge graph client
18
- - `@nahisaho/yata-local` - Local SQLite-based knowledge graph
19
- - `@nahisaho/yata-global` - Distributed knowledge graph platform
20
- - `@nahisaho/yata-scale` - Distributed sharding and caching
21
- - `@nahisaho/musubix-pattern-mcp` - Pattern learning MCP
22
- - `@nahisaho/musubix-ontology-mcp` - Ontology reasoning MCP
23
- - `@nahisaho/musubix-wake-sleep` - Wake-Sleep learning cycle
24
- - `@nahisaho/musubix-sdd-ontology` - SDD methodology ontology
25
- - `@nahisaho/musubix-dfg` - Data Flow Graph extraction
26
- - `@nahisaho/musubix-lean` - Lean 4 theorem prover integration
27
- - `@nahisaho/musubix-library-learner` - API pattern learning
28
- - `@nahisaho/musubix-neural-search` - Semantic code search
29
- - `@nahisaho/musubix-synthesis` - Program synthesis
30
-
31
- ## Usage
32
-
33
- ### CLI
135
+ ### Scoped Packages
34
136
 
35
137
  ```bash
36
- npx musubix --help
37
- npx musubix init
38
- npx musubix requirements analyze <file>
39
- npx musubix design generate <file>
138
+ # Install individual packages
139
+ npm install @nahisaho/musubix-core
140
+ npm install @nahisaho/musubix-mcp-server
141
+ npm install @nahisaho/musubix-yata-client
142
+ npm install @nahisaho/musubix-security
143
+ npm install @nahisaho/musubix-formal-verify
144
+
145
+ # Phase 1: Deep Symbolic Integration
146
+ npm install @nahisaho/musubix-dfg
147
+ npm install @nahisaho/musubix-lean
148
+ npm install @nahisaho/yata-scale
149
+
150
+ # Phase 2: Advanced Learning
151
+ npm install @nahisaho/musubix-library-learner
152
+ npm install @nahisaho/musubix-neural-search
153
+ npm install @nahisaho/musubix-synthesis
154
+ ```
155
+
156
+ ### Build from Source
157
+
158
+ ```bash
159
+ git clone https://github.com/nahisaho/MUSUBIX.git
160
+ cd MUSUBIX
161
+ npm install
162
+ npm run build
163
+ ```
164
+
165
+ ## Development
166
+
167
+ ```bash
168
+ # Build
169
+ npm run build
170
+
171
+ # Run tests
172
+ npm test
173
+
174
+ # Lint
175
+ npm run lint
176
+
177
+ # Type check
178
+ npm run type-check
40
179
  ```
41
180
 
42
- ### Library
181
+ ## Key Features
182
+
183
+ ### Requirements Definition (Article II Compliant)
184
+
185
+ - **EARS Validation**: Easy Approach to Requirements Syntax pattern validation
186
+ - **Interactive Q&A Hearing**: Dialogue-based requirements gathering
187
+ - **Requirements Decomposition**: Breaking down large requirements into implementation units
188
+ - **Related Requirements Search**: Automatic detection of similar and dependent requirements
189
+
190
+ ### Design Generation (Article III Compliant)
43
191
 
44
- ```typescript
45
- import { EarsValidator, CodeGenerator } from 'musubix';
46
- import { security, synthesis, neuralSearch } from 'musubix';
192
+ - **C4 Model Generation**: Context/Container/Component/Code diagrams
193
+ - **ADR Generation**: Architecture Decision Records
194
+ - **Pattern Detection**: Automatic detection and recommendation of design patterns
195
+ - **SOLID Validation**: SOLID principle compliance checking
47
196
 
48
- // Core features
49
- const validator = new EarsValidator();
50
- const result = validator.validate(requirement);
197
+ ### Code Generation & Verification
51
198
 
52
- // Advanced features
53
- const synthesizer = synthesis.createEnhancedPBESynthesizer();
54
- const searcher = neuralSearch.createHybridRanker();
199
+ - **Static Analysis**: Quality metrics and complexity calculation
200
+ - **Security Scanning**: Vulnerability detection
201
+ - **Test Generation**: Unit and integration test generation
202
+ - **Coverage Reporting**: Test coverage measurement
203
+
204
+ ### MCP Server
205
+
206
+ Provides 24 tools (9 SDD + 7 Pattern + 3 Ontology + 5 KGPR) and 3 prompts:
207
+
208
+ ```bash
209
+ # Start MCP Server
210
+ npx @nahisaho/musubix-mcp-server
55
211
  ```
56
212
 
57
213
  ## Documentation
58
214
 
59
- - [User Guide](https://github.com/nahisaho/MUSUBIX/blob/main/docs/USER-GUIDE.md)
60
- - [API Reference](https://github.com/nahisaho/MUSUBIX/blob/main/docs/API-REFERENCE.md)
61
- - [AGENTS.md](https://github.com/nahisaho/MUSUBIX/blob/main/AGENTS.md) - For AI coding agents
215
+ | Document | Description |
216
+ |----------|-------------|
217
+ | [Requirements Specification](storage/specs/REQ-MUSUBIX-001.md) | EARS format functional/non-functional requirements |
218
+ | [Design Document](storage/specs/DES-MUSUBIX-001.md) | C4 model and ADR-based design |
219
+ | [Task Definition](storage/specs/TSK-MUSUBIX-001.md) | 56 tasks sprint plan |
220
+ | [API Reference](docs/API-REFERENCE.md) | Public API specification |
221
+ | [Symbolic Integration](storage/specs/REQ-SYMB-001.md) | Neuro-Symbolic requirements (27 requirements) |
222
+
223
+ ## Symbolic Reasoning Module (v1.2.0)
224
+
225
+ The new symbolic reasoning module provides:
226
+
227
+ ### Phase 1: Foundation
228
+ - **SemanticCodeFilterPipeline** - LLM output semantic validation
229
+ - **HallucinationDetector** - Undefined symbol/invalid import detection
230
+ - **ConstitutionRuleRegistry** - 9 Constitution articles enforcement
231
+ - **ConfidenceEstimator** - AST complexity, requirement coverage scoring
232
+ - **ConfidenceBasedRouter** - Confidence-based routing decisions
233
+ - **ErrorHandler** - Graceful degradation
234
+
235
+ ### Phase 2: Formal Verification
236
+ - **EarsToFormalSpecConverter** - EARS → SMT-LIB conversion
237
+ - **VerificationConditionGenerator** - Verification condition (VC) generation
238
+ - **Z3Adapter** - Z3 SMT solver integration
239
+ - **SecurityScanner** - OWASP patterns, secret detection
240
+
241
+ ### Phase 3: Advanced Features
242
+ - **CandidateRanker** - Multi-criteria candidate scoring
243
+ - **ResultBlender** - Neural/Symbolic result integration (3 strategies)
244
+ - **ExtensibleRuleConfig** - YAML/JSON rule configuration
245
+ - **AuditLogger** - SHA-256 hash-chain tamper detection
246
+ - **PerformanceBudget** - Step-level budgets, SLO metrics
247
+ - **QualityGateValidator** - Automated quality gate validation
248
+
249
+ ## Wake-Sleep Learning Cycle (v1.3.0)
250
+
251
+ Continuous learning system based on the Wake-Sleep algorithm:
252
+
253
+ | Phase | Processing |
254
+ |-------|------------|
255
+ | **Wake** | Code observation → Pattern extraction → Knowledge graph update |
256
+ | **Sleep** | Pattern consolidation → Similar pattern compression → Memory optimization |
257
+
258
+ ### Key Components
259
+ - **WakeSleepCycle** - Learning cycle orchestration
260
+ - **PatternLibrary** - Persistent pattern storage management
261
+ - **PatternOntologyBridge** - Pattern ↔ Ontology bidirectional conversion
262
+ - **N3Store** - RDF/OWL-based knowledge graph storage
263
+
264
+ ### New MCP Tools (7 tools)
265
+ - `pattern_extract` - Extract patterns from code
266
+ - `pattern_compress` - Abstraction and compression of patterns
267
+ - `pattern_store` - Save to pattern library
268
+ - `pattern_query` - Search and retrieve patterns
269
+ - `pattern_consolidate` - Consolidate similar patterns
270
+ - `ontology_query` - Query ontology graph
271
+ - `ontology_infer` - Execute ontology-based inference
272
+
273
+ ## Advanced Inference (v1.4.5)
274
+
275
+ OWL 2 RL profile reasoning and Datalog evaluation engine:
276
+
277
+ ### Inference Components
278
+ - **OWL2RLReasoner** - OWL 2 RL profile compliant inference (20+ built-in rules)
279
+ - **DatalogEngine** - Stratified Datalog evaluation with negation support
280
+ - **InferenceExplainer** - Human-readable inference explanation generator
281
+ - **ProgressReporter** - Real-time progress feedback (500ms interval)
282
+
283
+ ### OWL 2 RL Built-in Rules
284
+ | Category | Rules | Description |
285
+ |----------|-------|-------------|
286
+ | Class Axioms | cax-sco, cax-eqc | Subclass, Equivalent class inference |
287
+ | Property | prp-dom, prp-rng | Domain, Range inference |
288
+ | Property Characteristics | prp-symp, prp-trp, prp-inv | Symmetric, Transitive, Inverse |
289
+ | Equality | eq-ref, eq-sym, eq-trans | sameAs inference |
290
+
291
+ ### Explanation Formats
292
+ - `text` - Plain text explanation
293
+ - `markdown` - Markdown format
294
+ - `html` - HTML format with escaping
295
+
296
+ ## Constitutional Articles (9 Articles)
297
+
298
+ MUSUBIX adheres to the following 9 constitutional articles:
299
+
300
+ 1. **Specification First** - Requirements before implementation
301
+ 2. **Design Before Code** - Design before coding
302
+ 3. **Single Source of Truth** - Project memory is authoritative
303
+ 4. **Traceability** - Tracking from requirements to code
304
+ 5. **Incremental Progress** - Small, frequent deliveries
305
+ 6. **Decision Documentation** - Decisions recorded as ADRs
306
+ 7. **Quality Gates** - Phase validation required
307
+ 8. **User-Centric** - Document user value
308
+ 9. **Continuous Learning** - Retrospectives and improvements
62
309
 
63
310
  ## License
64
311
 
65
- MIT
312
+ MIT License - See [LICENSE](LICENSE) for details
313
+
314
+ ## Author
315
+
316
+ nahisaho
317
+
318
+ ## Changelog
319
+
320
+ See [CHANGELOG.md](CHANGELOG.md)
321
+
322
+ ---
323
+
324
+ **Document ID**: README
325
+ **Version**: 1.8.0
326
+ **Last Updated**: 2026-01-06