musubix 2.1.1 → 2.2.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/README.md +44 -310
- package/bin/musubix.js +4 -12
- package/dist/index.d.ts +25 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +73 -0
- package/dist/index.js.map +1 -0
- package/package.json +49 -70
- package/.github/AGENTS.md +0 -242
- package/.github/prompts/sdd-change-apply.prompt.md +0 -283
- package/.github/prompts/sdd-change-archive.prompt.md +0 -241
- package/.github/prompts/sdd-change-init.prompt.md +0 -269
- package/.github/prompts/sdd-design.prompt.md +0 -250
- package/.github/prompts/sdd-implement.prompt.md +0 -387
- package/.github/prompts/sdd-requirements.prompt.md +0 -193
- package/.github/prompts/sdd-review.prompt.md +0 -155
- package/.github/prompts/sdd-security.prompt.md +0 -228
- package/.github/prompts/sdd-steering.prompt.md +0 -269
- package/.github/prompts/sdd-tasks.prompt.md +0 -255
- package/.github/prompts/sdd-test.prompt.md +0 -230
- package/.github/prompts/sdd-validate.prompt.md +0 -304
- package/.github/skills/musubix-adr-generation/SKILL.md +0 -209
- package/.github/skills/musubix-best-practices/SKILL.md +0 -315
- package/.github/skills/musubix-c4-design/SKILL.md +0 -162
- package/.github/skills/musubix-code-generation/SKILL.md +0 -229
- package/.github/skills/musubix-domain-inference/SKILL.md +0 -196
- package/.github/skills/musubix-ears-validation/SKILL.md +0 -161
- package/.github/skills/musubix-sdd-workflow/SKILL.md +0 -210
- package/.github/skills/musubix-test-generation/SKILL.md +0 -212
- package/.github/skills/musubix-traceability/SKILL.md +0 -141
- package/AGENTS.md +0 -622
- package/LICENSE +0 -21
- package/README.ja.md +0 -302
- package/bin/musubix-mcp.js +0 -19
- package/docs/API-REFERENCE.md +0 -1425
- package/docs/GITHUB-ACTIONS-NPM-SETUP.md +0 -132
- package/docs/INSTALL-GUIDE.ja.md +0 -459
- package/docs/INSTALL-GUIDE.md +0 -459
- package/docs/MUSUBI-enhancement_roadmap_20260105.md +0 -651
- package/docs/MUSUBIv1.6.1-enhancement_roadmap_20260105.md +0 -291
- package/docs/ROADMAP-v1.5.md +0 -116
- package/docs/SwarmCoding.md +0 -1284
- package/docs/Test-prompt.md +0 -105
- package/docs/USER-GUIDE-v1.8.0.md +0 -2371
- package/docs/USER-GUIDE.ja.md +0 -2147
- package/docs/USER-GUIDE.md +0 -2652
- package/docs/adr/0001-real-time-pattern-learning-architecture-for-v1-5-0.md +0 -75
- package/docs/adr/0002-pattern-sharing-protocol-for-cross-team-collaborat.md +0 -79
- package/docs/adr/0003-owl-2-rl-implementation-strategy-for-advanced-infe.md +0 -90
- package/docs/evolution-from-musubi-to-musubix.md +0 -2168
- package/docs/getting-started-with-sdd.md +0 -1602
- package/docs/overview/MUSUBIX-Core.md +0 -671
- package/docs/overview/MUSUBIX-FormalVerify.md +0 -566
- package/docs/overview/MUSUBIX-Learning.md +0 -837
- package/docs/overview/MUSUBIX-MCP-Server.md +0 -535
- package/docs/overview/MUSUBIX-Overview.md +0 -264
- package/docs/overview/MUSUBIX-Phase1-Complete.md +0 -271
- package/docs/overview/MUSUBIX-Phase2-Complete.md +0 -310
- package/docs/overview/MUSUBIX-Roadmap-v2.md +0 -399
- package/docs/overview/MUSUBIX-Security-Plan.md +0 -939
- package/docs/overview/MUSUBIX-Security.md +0 -891
- package/docs/overview/MUSUBIX-YATA.md +0 -666
- package/docs/overview/Neuro-SymbolicAI.md +0 -159
- package/scripts/generate-quality-gate-report.ts +0 -106
- package/scripts/postinstall.js +0 -94
- package/steering/.musubi-version +0 -1
- package/steering/product.ja.md +0 -572
- package/steering/project.yml +0 -66
- package/steering/rules/constitution.md +0 -412
- package/steering/structure.ja.md +0 -503
- package/steering/tech.ja.md +0 -208
package/AGENTS.md
DELETED
|
@@ -1,622 +0,0 @@
|
|
|
1
|
-
# MUSUBIX - Neuro-Symbolic AI Integration System
|
|
2
|
-
|
|
3
|
-
> **AI Coding Agent向け**: このファイルはAIエージェント(GitHub Copilot、Claude等)がMUSUBIXプロジェクトを理解するためのガイドです。
|
|
4
|
-
|
|
5
|
-
## 🎯 プロジェクト概要
|
|
6
|
-
|
|
7
|
-
**MUSUBIX**は、**Neural(LLM)** と **Symbolic(Knowledge Graph)** 推論を統合した次世代AIコーディングシステムです。MUSUBI SDD方法論とYATA知識グラフ推論を組み合わせ、高品質なソフトウェア開発を支援します。
|
|
8
|
-
|
|
9
|
-
| 項目 | 詳細 |
|
|
10
|
-
|------|------|
|
|
11
|
-
| **バージョン** | 2.0.0 (Deep Symbolic + Advanced Learning) |
|
|
12
|
-
| **言語** | TypeScript |
|
|
13
|
-
| **ランタイム** | Node.js >= 20.0.0 |
|
|
14
|
-
| **パッケージマネージャ** | npm >= 10.0.0 |
|
|
15
|
-
| **ビルドシステム** | モノレポ(npm workspaces) |
|
|
16
|
-
| **テストフレームワーク** | Vitest |
|
|
17
|
-
| **テスト数** | 1660+ (全合格) |
|
|
18
|
-
| **パッケージ数** | 19 |
|
|
19
|
-
| **Agent Skills** | 12 (Claude Code対応) |
|
|
20
|
-
|
|
21
|
-
---
|
|
22
|
-
|
|
23
|
-
## 📦 アーキテクチャ
|
|
24
|
-
|
|
25
|
-
### パッケージ構成
|
|
26
|
-
|
|
27
|
-
```
|
|
28
|
-
packages/
|
|
29
|
-
├── core/ # @nahisaho/musubix-core
|
|
30
|
-
├── mcp-server/ # @nahisaho/musubix-mcp-server
|
|
31
|
-
├── security/ # @nahisaho/musubix-security
|
|
32
|
-
├── formal-verify/ # @nahisaho/musubix-formal-verify
|
|
33
|
-
├── yata-client/ # @nahisaho/musubix-yata-client
|
|
34
|
-
├── yata-local/ # @nahisaho/yata-local
|
|
35
|
-
├── yata-global/ # @nahisaho/yata-global
|
|
36
|
-
├── yata-ui/ # @nahisaho/yata-ui
|
|
37
|
-
├── yata-scale/ # @nahisaho/yata-scale (v2.0.0 NEW!)
|
|
38
|
-
├── pattern-mcp/ # @nahisaho/musubix-pattern-mcp
|
|
39
|
-
├── ontology-mcp/ # @nahisaho/musubix-ontology-mcp
|
|
40
|
-
├── wake-sleep/ # @nahisaho/musubix-wake-sleep
|
|
41
|
-
├── sdd-ontology/ # @nahisaho/musubix-sdd-ontology
|
|
42
|
-
├── dfg/ # @nahisaho/musubix-dfg (v2.0.0 NEW!)
|
|
43
|
-
├── lean/ # @nahisaho/musubix-lean (v2.0.0 NEW!)
|
|
44
|
-
├── library-learner/# @nahisaho/musubix-library-learner (v2.0.0 NEW!)
|
|
45
|
-
├── neural-search/ # @nahisaho/musubix-neural-search (v2.0.0 NEW!)
|
|
46
|
-
└── synthesis/ # @nahisaho/musubix-synthesis (v2.0.0 NEW!)
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
| パッケージ | npm | 役割 |
|
|
50
|
-
|-----------|-----|------|
|
|
51
|
-
| `packages/core/` | `@nahisaho/musubix-core` | コアライブラリ - CLI、EARS検証、コード生成、設計パターン |
|
|
52
|
-
| `packages/mcp-server/` | `@nahisaho/musubix-mcp-server` | MCPサーバー - 19ツール、3プロンプト |
|
|
53
|
-
| `packages/security/` | `@nahisaho/musubix-security` | セキュリティ分析 - 脆弱性検出、シークレット検出、テイント解析 |
|
|
54
|
-
| `packages/formal-verify/` | `@nahisaho/musubix-formal-verify` | 形式検証 - Z3統合、Hoare検証、EARS→SMT変換 |
|
|
55
|
-
| `packages/yata-client/` | `@nahisaho/musubix-yata-client` | YATAクライアント - 知識グラフ連携 |
|
|
56
|
-
| `packages/yata-local/` | `@nahisaho/yata-local` | YATA Local - SQLiteベースローカル知識グラフ |
|
|
57
|
-
| `packages/yata-global/` | `@nahisaho/yata-global` | YATA Global - 分散型知識グラフプラットフォーム |
|
|
58
|
-
| `packages/yata-ui/` | `@nahisaho/yata-ui` | YATA UI - Web可視化・管理インターフェース |
|
|
59
|
-
| `packages/yata-scale/` | `@nahisaho/yata-scale` | **YATA Scale** - 分散シャーディング・キャッシュ (v2.0.0 NEW!) |
|
|
60
|
-
| `packages/pattern-mcp/` | `@nahisaho/musubix-pattern-mcp` | パターン学習 - 抽出・圧縮・ライブラリ |
|
|
61
|
-
| `packages/ontology-mcp/` | `@nahisaho/musubix-ontology-mcp` | オントロジー - N3Store・推論エンジン |
|
|
62
|
-
| `packages/wake-sleep/` | `@nahisaho/musubix-wake-sleep` | Wake-Sleep学習サイクル |
|
|
63
|
-
| `packages/sdd-ontology/` | `@nahisaho/musubix-sdd-ontology` | SDD方法論オントロジー |
|
|
64
|
-
| `packages/dfg/` | `@nahisaho/musubix-dfg` | **DFG/CFG抽出** - データフロー・制御フロー解析 (v2.0.0 NEW!) |
|
|
65
|
-
| `packages/lean/` | `@nahisaho/musubix-lean` | **Lean 4統合** - 定理証明・EARS変換 (v2.0.0 NEW!) |
|
|
66
|
-
| `packages/library-learner/` | `@nahisaho/musubix-library-learner` | **ライブラリ学習** - APIパターン抽出 (v2.0.0 NEW!) |
|
|
67
|
-
| `packages/neural-search/` | `@nahisaho/musubix-neural-search` | **ニューラル検索** - 意味的コード検索 (v2.0.0 NEW!) |
|
|
68
|
-
| `packages/synthesis/` | `@nahisaho/musubix-synthesis` | **プログラム合成** - ニューラル誘導合成 (v2.0.0 NEW!) |
|
|
69
|
-
|
|
70
|
-
### Core パッケージモジュール
|
|
71
|
-
|
|
72
|
-
```
|
|
73
|
-
packages/core/src/
|
|
74
|
-
├── auth/ # 認証・認可
|
|
75
|
-
├── cli/ # CLIインターフェース
|
|
76
|
-
├── codegen/ # コード生成・解析
|
|
77
|
-
├── design/ # 設計パターン・C4モデル
|
|
78
|
-
├── error/ # エラーハンドリング
|
|
79
|
-
├── explanation/ # 説明生成・可視化
|
|
80
|
-
├── learning/ # 自己学習システム
|
|
81
|
-
├── requirements/ # 要件分析・分解
|
|
82
|
-
├── symbolic/ # シンボリック推論(v1.2.0 NEW!)
|
|
83
|
-
├── traceability/ # トレーサビリティ
|
|
84
|
-
├── types/ # 型定義
|
|
85
|
-
├── utils/ # ユーティリティ
|
|
86
|
-
└── validators/ # EARS検証
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
---
|
|
90
|
-
|
|
91
|
-
## 🛠️ CLI コマンド
|
|
92
|
-
|
|
93
|
-
```bash
|
|
94
|
-
# プロジェクト初期化
|
|
95
|
-
npx musubix init [path] [--name <name>] [--force]
|
|
96
|
-
|
|
97
|
-
# 要件分析(EARS形式)
|
|
98
|
-
npx musubix requirements analyze <file> # 自然言語 → EARS変換
|
|
99
|
-
npx musubix requirements validate <file> # EARS構文検証
|
|
100
|
-
npx musubix requirements map <file> # オントロジーマッピング
|
|
101
|
-
npx musubix requirements search <query> # 関連要件検索
|
|
102
|
-
|
|
103
|
-
# 設計生成
|
|
104
|
-
npx musubix design generate <file> # 要件から設計生成
|
|
105
|
-
npx musubix design patterns <context> # パターン検出
|
|
106
|
-
npx musubix design validate <file> # SOLID準拠検証
|
|
107
|
-
npx musubix design c4 <file> # C4ダイアグラム生成
|
|
108
|
-
npx musubix design adr <decision> # ADR生成
|
|
109
|
-
|
|
110
|
-
# コード生成
|
|
111
|
-
npx musubix codegen generate <file> # 設計からコード生成
|
|
112
|
-
npx musubix codegen analyze <file> # 静的解析
|
|
113
|
-
npx musubix codegen security <path> # セキュリティスキャン
|
|
114
|
-
|
|
115
|
-
# テスト
|
|
116
|
-
npx musubix test generate <file> # テスト生成
|
|
117
|
-
npx musubix test coverage <dir> # カバレッジ測定
|
|
118
|
-
|
|
119
|
-
# トレーサビリティ
|
|
120
|
-
npx musubix trace matrix # トレーサビリティマトリクス
|
|
121
|
-
npx musubix trace matrix -p <project> # 指定プロジェクトのマトリクス
|
|
122
|
-
npx musubix trace impact <id> # 影響分析
|
|
123
|
-
npx musubix trace validate # リンク検証
|
|
124
|
-
npx musubix trace sync # トレースマトリクス自動更新 (v1.6.7 NEW!)
|
|
125
|
-
npx musubix trace sync --dry-run # プレビューのみ
|
|
126
|
-
|
|
127
|
-
# 説明生成
|
|
128
|
-
npx musubix explain why <id> # 決定理由の説明
|
|
129
|
-
npx musubix explain graph <id> # 推論グラフ生成
|
|
130
|
-
|
|
131
|
-
# 自己学習システム
|
|
132
|
-
npx musubix learn status # 学習状態ダッシュボード
|
|
133
|
-
npx musubix learn feedback <id> # フィードバック記録
|
|
134
|
-
npx musubix learn patterns # パターン一覧表示
|
|
135
|
-
npx musubix learn add-pattern <name> # パターン手動登録
|
|
136
|
-
npx musubix learn remove-pattern <id> # パターン削除
|
|
137
|
-
npx musubix learn recommend # コンテキストベースの推奨
|
|
138
|
-
npx musubix learn decay # 未使用パターンの減衰
|
|
139
|
-
npx musubix learn export # 学習データエクスポート
|
|
140
|
-
# オプション: --output <file>, --privacy-filter, --patterns-only, --feedback-only, --min-confidence <n>
|
|
141
|
-
npx musubix learn import <file> # 学習データインポート
|
|
142
|
-
# オプション: --merge-strategy <skip|overwrite|merge>, --dry-run, --patterns-only, --feedback-only
|
|
143
|
-
|
|
144
|
-
# オントロジー操作 (v1.4.1 NEW!)
|
|
145
|
-
npx musubix ontology validate -f <file> # 知識グラフ整合性検証
|
|
146
|
-
npx musubix ontology check-circular -f <file> # 循環依存チェック
|
|
147
|
-
npx musubix ontology stats -f <file> # 統計表示
|
|
148
|
-
|
|
149
|
-
# Interactive REPL (v1.5.0 NEW!)
|
|
150
|
-
npx musubix repl # 対話的シェルを起動
|
|
151
|
-
npx musubix repl --history <file> # カスタム履歴ファイル
|
|
152
|
-
npx musubix repl --no-color # 色なしモード
|
|
153
|
-
|
|
154
|
-
# KGPR - Knowledge Graph Pull Request (v1.6.4 NEW!)
|
|
155
|
-
npx musubix kgpr create -t "title" # KGPR作成
|
|
156
|
-
npx musubix kgpr diff # 差分プレビュー
|
|
157
|
-
npx musubix kgpr list # KGPR一覧
|
|
158
|
-
npx musubix kgpr submit <id> # KGPR送信
|
|
159
|
-
npx musubix kgpr show <id> # KGPR詳細表示
|
|
160
|
-
npx musubix kgpr close <id> # KGPRクローズ
|
|
161
|
-
# オプション: --namespace <ns>, --entity-types <types>, --privacy <strict|moderate|none>
|
|
162
|
-
|
|
163
|
-
# SDDプロジェクトスキャフォールド (v1.6.7 NEW!)
|
|
164
|
-
npx musubix scaffold domain-model <name> # DDDプロジェクト生成
|
|
165
|
-
npx musubix scaffold domain-model <name> -e "Entity1,Entity2" # エンティティ指定
|
|
166
|
-
npx musubix scaffold domain-model <name> -d DOMAIN # ドメイン接頭辞指定
|
|
167
|
-
npx musubix scaffold minimal <name> # 最小構成プロジェクト
|
|
168
|
-
|
|
169
|
-
# ヘルプ
|
|
170
|
-
npx musubix --help
|
|
171
|
-
npx musubix help <command>
|
|
172
|
-
```
|
|
173
|
-
|
|
174
|
-
---
|
|
175
|
-
|
|
176
|
-
## 🔌 MCP Server
|
|
177
|
-
|
|
178
|
-
### 起動方法
|
|
179
|
-
|
|
180
|
-
```bash
|
|
181
|
-
npx @nahisaho/musubix-mcp-server
|
|
182
|
-
npx musubix-mcp --transport stdio
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
### ツール一覧(24ツール)
|
|
186
|
-
|
|
187
|
-
#### SDD基本ツール(9ツール)
|
|
188
|
-
|
|
189
|
-
| ツール名 | 説明 |
|
|
190
|
-
|---------|------|
|
|
191
|
-
| `sdd_create_requirements` | EARS形式の要件ドキュメント作成 |
|
|
192
|
-
| `sdd_validate_requirements` | 要件のEARS検証・憲法準拠チェック |
|
|
193
|
-
| `sdd_create_design` | C4モデル設計ドキュメント作成 |
|
|
194
|
-
| `sdd_validate_design` | 設計の要件トレーサビリティ検証 |
|
|
195
|
-
| `sdd_create_tasks` | 設計から実装タスク生成 |
|
|
196
|
-
| `sdd_query_knowledge` | YATA知識グラフへのクエリ |
|
|
197
|
-
| `sdd_update_knowledge` | 知識グラフの更新 |
|
|
198
|
-
| `sdd_validate_constitution` | 9憲法条項への準拠検証 |
|
|
199
|
-
| `sdd_validate_traceability` | 要件↔設計↔タスクのトレーサビリティ検証 |
|
|
200
|
-
|
|
201
|
-
#### パターン統合ツール(7ツール)- v1.3.0 NEW!
|
|
202
|
-
|
|
203
|
-
| ツール名 | 説明 |
|
|
204
|
-
|---------|------|
|
|
205
|
-
| `pattern_extract` | コードからパターンを抽出 |
|
|
206
|
-
| `pattern_compress` | パターンの抽象化・圧縮 |
|
|
207
|
-
| `pattern_store` | パターンライブラリへの保存 |
|
|
208
|
-
| `pattern_query` | パターンの検索・取得 |
|
|
209
|
-
| `pattern_consolidate` | 類似パターンの統合 |
|
|
210
|
-
| `ontology_query` | オントロジーグラフへのクエリ |
|
|
211
|
-
| `ontology_infer` | オントロジーによる推論実行 |
|
|
212
|
-
|
|
213
|
-
#### オントロジー検証ツール(3ツール)- v1.4.1 NEW!
|
|
214
|
-
|
|
215
|
-
| ツール名 | 説明 |
|
|
216
|
-
|---------|------|
|
|
217
|
-
| `consistency_validate` | 知識グラフの整合性検証 |
|
|
218
|
-
| `validate_triple` | 単一トリプルの事前検証 |
|
|
219
|
-
| `check_circular` | 循環依存の検出 |
|
|
220
|
-
|
|
221
|
-
#### KGPRツール(5ツール)- v1.6.4 NEW!
|
|
222
|
-
|
|
223
|
-
| ツール名 | 説明 |
|
|
224
|
-
|---------|------|
|
|
225
|
-
| `kgpr_create` | KGPR作成(ローカルKGからドラフト作成) |
|
|
226
|
-
| `kgpr_diff` | 差分プレビュー |
|
|
227
|
-
| `kgpr_list` | KGPR一覧表示 |
|
|
228
|
-
| `kgpr_submit` | KGPR送信(レビュー用) |
|
|
229
|
-
| `kgpr_review` | KGPRレビュー(approve/changes_requested/commented) |
|
|
230
|
-
|
|
231
|
-
### プロンプト一覧(3プロンプト)
|
|
232
|
-
|
|
233
|
-
| プロンプト名 | 説明 |
|
|
234
|
-
|-------------|------|
|
|
235
|
-
| `sdd_requirements_analysis` | 機能説明からEARS形式要件を生成 |
|
|
236
|
-
| `sdd_requirements_review` | 要件の完全性・憲法準拠レビュー |
|
|
237
|
-
| `sdd_design_generation` | 要件からC4モデル設計を生成 |
|
|
238
|
-
|
|
239
|
-
---
|
|
240
|
-
|
|
241
|
-
## 📋 9憲法条項(Constitutional Articles)
|
|
242
|
-
|
|
243
|
-
すべての開発活動を統治する不変のルールです。
|
|
244
|
-
|
|
245
|
-
| 条項 | 名称 | 概要 |
|
|
246
|
-
|-----|------|------|
|
|
247
|
-
| **I** | Library-First | 機能は独立ライブラリとして開始 |
|
|
248
|
-
| **II** | CLI Interface | すべてのライブラリはCLI公開必須 |
|
|
249
|
-
| **III** | Test-First | Red-Green-Blueサイクルでテスト先行 |
|
|
250
|
-
| **IV** | EARS Format | 要件はEARS形式で記述 |
|
|
251
|
-
| **V** | Traceability | 要件↔設計↔コード↔テストの100%追跡 |
|
|
252
|
-
| **VI** | Project Memory | steering/を参照してから決定 |
|
|
253
|
-
| **VII** | Design Patterns | 設計パターン適用の文書化 |
|
|
254
|
-
| **VIII** | Decision Records | すべての決定をADRで記録 |
|
|
255
|
-
| **IX** | Quality Gates | フェーズ移行前の品質検証 |
|
|
256
|
-
|
|
257
|
-
**詳細**: [steering/rules/constitution.md](steering/rules/constitution.md)
|
|
258
|
-
|
|
259
|
-
---
|
|
260
|
-
|
|
261
|
-
## 📁 プロジェクトメモリ(Steering)
|
|
262
|
-
|
|
263
|
-
AIエージェントは決定前に必ずこれらのファイルを参照してください。
|
|
264
|
-
|
|
265
|
-
| ファイル | 内容 |
|
|
266
|
-
|---------|------|
|
|
267
|
-
| `steering/structure.ja.md` | アーキテクチャパターン、レイヤー構造 |
|
|
268
|
-
| `steering/tech.ja.md` | 技術スタック(TypeScript, Node.js 20+) |
|
|
269
|
-
| `steering/product.ja.md` | プロダクトコンテキスト |
|
|
270
|
-
| `steering/rules/constitution.md` | 9憲法条項 |
|
|
271
|
-
| `steering/project.yml` | プロジェクト設定 |
|
|
272
|
-
|
|
273
|
-
---
|
|
274
|
-
|
|
275
|
-
## 📂 ストレージ構造
|
|
276
|
-
|
|
277
|
-
| パス | 内容 |
|
|
278
|
-
|-----|------|
|
|
279
|
-
| `storage/specs/` | 要件(REQ-*)、設計(DES-*)、タスク(TSK-*) |
|
|
280
|
-
| `storage/design/` | 設計ドキュメント、C4ダイアグラム |
|
|
281
|
-
| `storage/traceability/` | トレーサビリティマトリクス |
|
|
282
|
-
| `storage/reviews/` | コードレビュー、検証結果 |
|
|
283
|
-
| `storage/changes/` | 変更履歴 |
|
|
284
|
-
| `storage/archive/` | アーカイブ |
|
|
285
|
-
|
|
286
|
-
---
|
|
287
|
-
|
|
288
|
-
## 🧪 開発コマンド
|
|
289
|
-
|
|
290
|
-
```bash
|
|
291
|
-
# 依存関係インストール
|
|
292
|
-
npm install
|
|
293
|
-
|
|
294
|
-
# 全パッケージビルド
|
|
295
|
-
npm run build
|
|
296
|
-
|
|
297
|
-
# テスト実行
|
|
298
|
-
npm run test # 全テスト
|
|
299
|
-
npm run test:unit # ユニットテスト
|
|
300
|
-
npm run test:integration # 統合テスト
|
|
301
|
-
npm run test:coverage # カバレッジ計測
|
|
302
|
-
|
|
303
|
-
# コード品質
|
|
304
|
-
npm run lint # ESLint
|
|
305
|
-
npm run lint:fix # ESLint 自動修正
|
|
306
|
-
npm run typecheck # TypeScript型チェック
|
|
307
|
-
|
|
308
|
-
# クリーンアップ
|
|
309
|
-
npm run clean
|
|
310
|
-
```
|
|
311
|
-
|
|
312
|
-
---
|
|
313
|
-
|
|
314
|
-
## 🔑 主要機能
|
|
315
|
-
|
|
316
|
-
### 1. Neuro-Symbolic統合(REQ-INT-001〜003準拠)
|
|
317
|
-
- **Neural(LLM)**: 創造的なコード生成、自然言語理解
|
|
318
|
-
- **Symbolic(YATA)**: 知識グラフによる精密な推論、一貫性検証
|
|
319
|
-
- **信頼度評価ルール** (REQ-INT-002):
|
|
320
|
-
| シンボリック結果 | ニューラル信頼度 | 最終決定 |
|
|
321
|
-
|-----------------|-----------------|---------|
|
|
322
|
-
| invalid | - | ニューラル結果を棄却 |
|
|
323
|
-
| valid | ≥0.8 | ニューラル結果を採用 |
|
|
324
|
-
| valid | <0.8 | シンボリック結果を優先 |
|
|
325
|
-
|
|
326
|
-
### 2. EARS要件分析
|
|
327
|
-
5つのEARSパターンで要件を形式化(REQ-RA-001準拠):
|
|
328
|
-
|
|
329
|
-
| パターン | 構文 | 用途 |
|
|
330
|
-
|---------|------|------|
|
|
331
|
-
| Ubiquitous | `THE [system] SHALL [requirement]` | システムが常に満たすべき要件 |
|
|
332
|
-
| Event-driven | `WHEN [event], THE [system] SHALL [response]` | 特定イベント発生時の要件 |
|
|
333
|
-
| State-driven | `WHILE [state], THE [system] SHALL [response]` | 特定状態における要件 |
|
|
334
|
-
| Unwanted | `THE [system] SHALL NOT [behavior]` | 回避すべき動作の要件 |
|
|
335
|
-
| Optional | `IF [condition], THEN THE [system] SHALL [response]` | 条件付き要件 |
|
|
336
|
-
|
|
337
|
-
**要件総数**: 41要件(REQ-MUSUBIX-001定義)
|
|
338
|
-
**優先度**: P0(必須)、P1(重要)、P2(任意)
|
|
339
|
-
|
|
340
|
-
### 3. C4モデル設計
|
|
341
|
-
4つのレベルで設計を構造化:
|
|
342
|
-
- **Context**: システム境界と外部アクター
|
|
343
|
-
- **Container**: 技術選択とコンテナ構成
|
|
344
|
-
- **Component**: コンテナ内部構造
|
|
345
|
-
- **Code**: 実装詳細
|
|
346
|
-
|
|
347
|
-
**C4コード生成** (v1.0.12 NEW!):
|
|
348
|
-
```bash
|
|
349
|
-
# C4設計ドキュメントからTypeScriptスケルトンコードを自動生成
|
|
350
|
-
npx musubix codegen generate <design.md> --output src/
|
|
351
|
-
```
|
|
352
|
-
- 設計パターン(Repository, Service, Factory等)を自動検出
|
|
353
|
-
- コンポーネントごとにTypeScriptファイル生成
|
|
354
|
-
- 設計との完全なトレーサビリティを維持
|
|
355
|
-
|
|
356
|
-
### 4. 完全なトレーサビリティ
|
|
357
|
-
```
|
|
358
|
-
要件(REQ-*) → 設計(DES-*) → タスク(TSK-*) → コード → テスト
|
|
359
|
-
```
|
|
360
|
-
|
|
361
|
-
### 5. 自己学習システム(REQ-LEARN-001〜006準拠)
|
|
362
|
-
- **フィードバック収集**: accept/reject/modifyの記録と分析
|
|
363
|
-
- **パターン抽出**: 繰り返しパターンの自動検出・登録
|
|
364
|
-
- **適応的推論**: 学習済みパターンに基づく推論調整
|
|
365
|
-
- **プライバシー保護**: 機密情報の自動フィルタリング(ローカルストレージのみ)
|
|
366
|
-
|
|
367
|
-
```
|
|
368
|
-
フィードバック → パターン候補 → 閾値超過 → パターン登録 → 推論に適用
|
|
369
|
-
```
|
|
370
|
-
|
|
371
|
-
### 6. Wake-Sleep学習サイクル(v1.3.0 NEW!)
|
|
372
|
-
|
|
373
|
-
Wake-Sleepアルゴリズムに基づいた継続的学習システム:
|
|
374
|
-
|
|
375
|
-
| フェーズ | 処理内容 |
|
|
376
|
-
|---------|----------|
|
|
377
|
-
| **Wake** | コード観察 → パターン抽出 → 知識グラフ更新 |
|
|
378
|
-
| **Sleep** | パターン統合 → 類似パターン圧縮 → メモリ最適化 |
|
|
379
|
-
|
|
380
|
-
```
|
|
381
|
-
Wake Phase: observe() → extractPatterns() → updateKnowledge()
|
|
382
|
-
Sleep Phase: consolidate() → compress() → optimize()
|
|
383
|
-
```
|
|
384
|
-
|
|
385
|
-
**主要コンポーネント**:
|
|
386
|
-
- `WakeSleepCycle`: 学習サイクル全体の制御
|
|
387
|
-
- `PatternLibrary`: 学習済みパターンの永続化管理
|
|
388
|
-
- `PatternOntologyBridge`: パターン↔オントロジー相互変換
|
|
389
|
-
- `N3Store`: RDF/OWLベースの知識グラフストレージ
|
|
390
|
-
|
|
391
|
-
---
|
|
392
|
-
|
|
393
|
-
## 📚 学習済みベストプラクティス(v1.1.10 Updated!)
|
|
394
|
-
|
|
395
|
-
Project-07〜14の実装から学習したパターンです。
|
|
396
|
-
|
|
397
|
-
### コードパターン
|
|
398
|
-
|
|
399
|
-
| ID | 名称 | 概要 | 信頼度 |
|
|
400
|
-
|----|------|------|--------|
|
|
401
|
-
| BP-CODE-001 | Entity Input DTO | エンティティ作成にInput DTOオブジェクトを使用 | 95% |
|
|
402
|
-
| BP-CODE-002 | Date-based ID Format | PREFIX-YYYYMMDD-NNN形式でIDを生成 | 90% |
|
|
403
|
-
| BP-CODE-003 | Value Objects | ドメイン概念にValue Objectを使用 | 90% |
|
|
404
|
-
| BP-CODE-004 | Function-based Value Objects | クラスではなくinterface+factory関数でVO実装 | 95% |
|
|
405
|
-
| BP-CODE-005 | Result Type | 失敗可能な操作にResult<T, E>を使用 | 95% |
|
|
406
|
-
|
|
407
|
-
**Function-based Value Object例**:
|
|
408
|
-
```typescript
|
|
409
|
-
// ✅ 推奨: Interface + Factory Function
|
|
410
|
-
interface Price {
|
|
411
|
-
readonly amount: number;
|
|
412
|
-
readonly currency: 'JPY';
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
function createPrice(amount: number): Result<Price, ValidationError> {
|
|
416
|
-
if (amount < 100 || amount > 1_000_000) {
|
|
417
|
-
return err(new ValidationError('Price must be between 100 and 1,000,000 JPY'));
|
|
418
|
-
}
|
|
419
|
-
return ok({ amount, currency: 'JPY' });
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
// ❌ 非推奨: クラスベース(構造的型付けと相性が悪い)
|
|
423
|
-
class Price {
|
|
424
|
-
private constructor(readonly amount: number) {}
|
|
425
|
-
static create(amount: number): Price { ... }
|
|
426
|
-
}
|
|
427
|
-
```
|
|
428
|
-
|
|
429
|
-
### 設計パターン
|
|
430
|
-
|
|
431
|
-
| ID | 名称 | 概要 | 信頼度 |
|
|
432
|
-
|----|------|------|--------|
|
|
433
|
-
| BP-DESIGN-001 | Status Transition Map | 有効なステータス遷移をMapで定義 | 95% |
|
|
434
|
-
| BP-DESIGN-002 | Repository Async Pattern | 将来のDB移行に備えてasync化 | 85% |
|
|
435
|
-
| BP-DESIGN-003 | Service Layer with DI | リポジトリをDIしたService層 | 90% |
|
|
436
|
-
| BP-DESIGN-004 | Optimistic Locking | 同時編集検出のためのversion管理 | 90% |
|
|
437
|
-
| BP-DESIGN-005 | AuditService | データ変更の監査ログ記録 | 85% |
|
|
438
|
-
| BP-DESIGN-006 | Entity Counter Reset | テスト用のresetXxxCounter()関数を提供 | 95% |
|
|
439
|
-
| BP-DESIGN-007 | Expiry Time Logic | 有効期限をexpiresAtフィールドで明示管理 | 90% |
|
|
440
|
-
|
|
441
|
-
**Status Transition Map例**:
|
|
442
|
-
```typescript
|
|
443
|
-
const validStatusTransitions: Record<Status, Status[]> = {
|
|
444
|
-
draft: ['active', 'cancelled'],
|
|
445
|
-
active: ['completed', 'cancelled'],
|
|
446
|
-
completed: [],
|
|
447
|
-
cancelled: [],
|
|
448
|
-
};
|
|
449
|
-
```
|
|
450
|
-
|
|
451
|
-
### テストパターン
|
|
452
|
-
|
|
453
|
-
| ID | 名称 | 概要 | 信頼度 |
|
|
454
|
-
|----|------|------|--------|
|
|
455
|
-
| BP-TEST-001 | Test Counter Reset | beforeEachでIDカウンターをリセット | 95% |
|
|
456
|
-
| BP-TEST-002 | Verify API Before Test | テスト前にAPIシグネチャを確認 | 80% |
|
|
457
|
-
| BP-TEST-003 | Vitest ESM Configuration | Vitest + TypeScript ESM構成 | 85% |
|
|
458
|
-
| BP-TEST-004 | Result Type Test Pattern | isOk()/isErr()で両方のケースをテスト | 95% |
|
|
459
|
-
| BP-TEST-005 | Status Transition Testing | 有効・無効な遷移を網羅的にテスト | 90% |
|
|
460
|
-
|
|
461
|
-
**Result Type Test例**:
|
|
462
|
-
```typescript
|
|
463
|
-
describe('createPrice', () => {
|
|
464
|
-
it('should create valid price', () => {
|
|
465
|
-
const result = createPrice(1000);
|
|
466
|
-
expect(result.isOk()).toBe(true);
|
|
467
|
-
if (result.isOk()) {
|
|
468
|
-
expect(result.value.amount).toBe(1000);
|
|
469
|
-
}
|
|
470
|
-
});
|
|
471
|
-
|
|
472
|
-
it('should reject price below minimum', () => {
|
|
473
|
-
const result = createPrice(50);
|
|
474
|
-
expect(result.isErr()).toBe(true);
|
|
475
|
-
if (result.isErr()) {
|
|
476
|
-
expect(result.error.message).toContain('100');
|
|
477
|
-
}
|
|
478
|
-
});
|
|
479
|
-
});
|
|
480
|
-
```
|
|
481
|
-
|
|
482
|
-
### CLIでベストプラクティスを表示
|
|
483
|
-
|
|
484
|
-
```bash
|
|
485
|
-
# 全ベストプラクティス表示
|
|
486
|
-
npx musubix learn best-practices
|
|
487
|
-
|
|
488
|
-
# カテゴリ別フィルタ
|
|
489
|
-
npx musubix learn best-practices --category code
|
|
490
|
-
npx musubix learn best-practices --category design
|
|
491
|
-
npx musubix learn best-practices --category test
|
|
492
|
-
|
|
493
|
-
# 高信頼度パターンのみ
|
|
494
|
-
npx musubix learn best-practices --high-confidence
|
|
495
|
-
|
|
496
|
-
# Markdown出力
|
|
497
|
-
npx musubix learn best-practices --format markdown
|
|
498
|
-
```
|
|
499
|
-
|
|
500
|
-
---
|
|
501
|
-
|
|
502
|
-
## �📚 ドキュメント
|
|
503
|
-
|
|
504
|
-
| ドキュメント | 説明 |
|
|
505
|
-
|-------------|------|
|
|
506
|
-
| [docs/INSTALL-GUIDE.md](docs/INSTALL-GUIDE.md) | インストールガイド |
|
|
507
|
-
| [docs/USER-GUIDE.md](docs/USER-GUIDE.md) | ユーザーガイド |
|
|
508
|
-
| [docs/API-REFERENCE.md](docs/API-REFERENCE.md) | APIリファレンス |
|
|
509
|
-
| [README.md](README.md) | 英語版README |
|
|
510
|
-
| [README.ja.md](README.ja.md) | 日本語版README |
|
|
511
|
-
|
|
512
|
-
---
|
|
513
|
-
|
|
514
|
-
## 🤝 AI Agent向けガイドライン
|
|
515
|
-
|
|
516
|
-
### コード生成時の注意点
|
|
517
|
-
|
|
518
|
-
1. **憲法条項の遵守**: 9条項を必ず確認
|
|
519
|
-
2. **steering/参照**: 決定前にproject memoryを確認
|
|
520
|
-
3. **EARS形式**: 要件は必ずEARS形式で記述
|
|
521
|
-
4. **トレーサビリティ**: コードコメントに要件IDを記載
|
|
522
|
-
5. **テスト先行**: Red-Green-Blueサイクルを遵守
|
|
523
|
-
6. **モノレポ構造**: パッケージ間の依存関係に注意
|
|
524
|
-
|
|
525
|
-
### 推奨ワークフロー
|
|
526
|
-
|
|
527
|
-
> **⚠️ 重要ルール**: Phase 1〜3(要件定義・設計・タスク分解)は、**承認可能な状態になるまでレビューと修正を繰り返すこと**。ユーザーから明示的な承認を得るまで次フェーズに進んではならない。
|
|
528
|
-
|
|
529
|
-
```
|
|
530
|
-
【Phase 1: 要件定義】 ※承認まで繰り返し
|
|
531
|
-
┌─────────────────────────────────────────────────────────────┐
|
|
532
|
-
│ 1. steering/ を読む │
|
|
533
|
-
│ 2. 要件定義書を作成(EARS形式) │
|
|
534
|
-
│ 3. ユーザーに提示 → フィードバック待ち │
|
|
535
|
-
│ │
|
|
536
|
-
│ ┌─────────────────────────────────────────────────────────┐ │
|
|
537
|
-
│ │ 4. レビュー実施 │ │
|
|
538
|
-
│ │ - 既存実装との整合性チェック │ │
|
|
539
|
-
│ │ - EARS形式の検証 │ │
|
|
540
|
-
│ │ - 要件の網羅性・完全性確認 │ │
|
|
541
|
-
│ │ │ │
|
|
542
|
-
│ │ 5. 問題あり? ─Yes→ 修正して4へ戻る │ │
|
|
543
|
-
│ │ └No─→ 6へ進む │ │
|
|
544
|
-
│ └─────────────────────────────────────────────────────────┘ │
|
|
545
|
-
│ │
|
|
546
|
-
│ 6. 「承認」確認 → Phase 2へ │
|
|
547
|
-
└─────────────────────────────────────────────────────────────┘
|
|
548
|
-
|
|
549
|
-
【Phase 2: 設計】 ※承認まで繰り返し
|
|
550
|
-
┌─────────────────────────────────────────────────────────────┐
|
|
551
|
-
│ 1. 設計書を作成(C4モデル) │
|
|
552
|
-
│ 2. ユーザーに提示 → フィードバック待ち │
|
|
553
|
-
│ │
|
|
554
|
-
│ ┌─────────────────────────────────────────────────────────┐ │
|
|
555
|
-
│ │ 3. レビュー実施 │ │
|
|
556
|
-
│ │ - 既存実装との型・インターフェース整合性 │ │
|
|
557
|
-
│ │ - 要件トレーサビリティ(REQ-* → DES-*) │ │
|
|
558
|
-
│ │ - 設計パターン・SOLID原則の適用確認 │ │
|
|
559
|
-
│ │ - 後方互換性・移行パスの確認 │ │
|
|
560
|
-
│ │ │ │
|
|
561
|
-
│ │ 4. 問題あり? ─Yes→ 修正して3へ戻る │ │
|
|
562
|
-
│ │ └No─→ 5へ進む │ │
|
|
563
|
-
│ └─────────────────────────────────────────────────────────┘ │
|
|
564
|
-
│ │
|
|
565
|
-
│ 5. 「承認」確認 → Phase 3へ │
|
|
566
|
-
└─────────────────────────────────────────────────────────────┘
|
|
567
|
-
|
|
568
|
-
【Phase 3: タスク分解】 ※承認まで繰り返し
|
|
569
|
-
┌─────────────────────────────────────────────────────────────┐
|
|
570
|
-
│ 1. タスク分解書を作成(設計→実装タスク) │
|
|
571
|
-
│ 2. ユーザーに提示 → フィードバック待ち │
|
|
572
|
-
│ │
|
|
573
|
-
│ ┌─────────────────────────────────────────────────────────┐ │
|
|
574
|
-
│ │ 3. レビュー実施 │ │
|
|
575
|
-
│ │ - 設計との対応確認(DES-* → TSK-*) │ │
|
|
576
|
-
│ │ - タスクサイズの適切性 │ │
|
|
577
|
-
│ │ - 依存関係・実行順序の妥当性 │ │
|
|
578
|
-
│ │ - 工数見積もりの現実性 │ │
|
|
579
|
-
│ │ │ │
|
|
580
|
-
│ │ 4. 問題あり? ─Yes→ 修正して3へ戻る │ │
|
|
581
|
-
│ │ └No─→ 5へ進む │ │
|
|
582
|
-
│ └─────────────────────────────────────────────────────────┘ │
|
|
583
|
-
│ │
|
|
584
|
-
│ 5. 「承認」確認 → Phase 4へ │
|
|
585
|
-
└─────────────────────────────────────────────────────────────┘
|
|
586
|
-
|
|
587
|
-
【Phase 4: 実装】
|
|
588
|
-
┌─────────────────────────────────────────────────────────────┐
|
|
589
|
-
│ タスクごとに: │
|
|
590
|
-
│ 1. テスト作成(Red) │
|
|
591
|
-
│ 2. 実装(Green) │
|
|
592
|
-
│ 3. リファクタリング(Blue) │
|
|
593
|
-
│ 4. ユニットテスト実行・合格確認 │
|
|
594
|
-
│ 5. 必要に応じて統合テスト │
|
|
595
|
-
└─────────────────────────────────────────────────────────────┘
|
|
596
|
-
|
|
597
|
-
【Phase 5: 完了】
|
|
598
|
-
┌─────────────────────────────────────────────────────────────┐
|
|
599
|
-
│ 1. CHANGELOG.md を更新 │
|
|
600
|
-
│ 2. 必要に応じてその他ドキュメント更新 │
|
|
601
|
-
│ 3. Git コミット・プッシュ │
|
|
602
|
-
└─────────────────────────────────────────────────────────────┘
|
|
603
|
-
```
|
|
604
|
-
|
|
605
|
-
### レビュー観点チェックリスト
|
|
606
|
-
|
|
607
|
-
| フェーズ | チェック項目 |
|
|
608
|
-
|---------|-------------|
|
|
609
|
-
| **要件定義** | ☐ EARS形式準拠 ☐ 優先度設定 ☐ 受け入れ基準明確 ☐ 既存機能との整合性 |
|
|
610
|
-
| **設計** | ☐ C4モデル完備 ☐ 型定義整合性 ☐ REQ→DESトレース ☐ 移行パス明記 |
|
|
611
|
-
| **タスク分解** | ☐ DES→TSKトレース ☐ 依存関係明確 ☐ サイズ適切 ☐ 工数現実的 |
|
|
612
|
-
|
|
613
|
-
### 承認キーワード
|
|
614
|
-
|
|
615
|
-
ユーザーが以下のキーワードを使用した場合、次フェーズへ進む:
|
|
616
|
-
- `承認` / `approve` / `LGTM` / `進める` / `OK` / `実装`
|
|
617
|
-
|
|
618
|
-
---
|
|
619
|
-
|
|
620
|
-
**Agent**: GitHub Copilot / Claude
|
|
621
|
-
**Last Updated**: 2026-01-08
|
|
622
|
-
**Version**: 2.0.0
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
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.
|