musubix 3.6.1 → 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.
- package/.github/skills/build-fix/SKILL.md +124 -0
- package/.github/skills/checkpoint/SKILL.md +131 -0
- package/.github/skills/codemap/SKILL.md +120 -0
- package/.github/skills/codemap/templates/codemap-index.md +142 -0
- package/.github/skills/codemap/templates/package-codemap.md +160 -0
- package/.github/skills/context-optimizer/SKILL.md +109 -0
- package/.github/skills/context-optimizer/contexts/dev.md +40 -0
- package/.github/skills/context-optimizer/contexts/research.md +55 -0
- package/.github/skills/context-optimizer/contexts/review.md +49 -0
- package/.github/skills/e2e-runner/SKILL.md +145 -0
- package/.github/skills/eval-harness/SKILL.md +111 -0
- package/.github/skills/eval-harness/examples/capability-eval.md +158 -0
- package/.github/skills/eval-harness/examples/human-grader-template.md +326 -0
- package/.github/skills/eval-harness/examples/regression-eval.md +228 -0
- package/.github/skills/learning-hooks/SKILL.md +101 -0
- package/.github/skills/learning-hooks/templates/learned-skill-template.md +79 -0
- package/.github/skills/musubix-adr-generation/SKILL.md +33 -168
- package/.github/skills/musubix-best-practices/SKILL.md +46 -276
- package/.github/skills/musubix-c4-design/SKILL.md +48 -124
- package/.github/skills/musubix-code-generation/SKILL.md +46 -193
- package/.github/skills/musubix-domain-inference/SKILL.md +54 -168
- package/.github/skills/musubix-ears-validation/SKILL.md +49 -136
- package/.github/skills/musubix-sdd-workflow/SKILL.md +56 -178
- package/.github/skills/musubix-technical-writing/SKILL.md +45 -381
- package/.github/skills/musubix-test-generation/SKILL.md +52 -176
- package/.github/skills/musubix-traceability/SKILL.md +52 -99
- package/.github/skills/refactor-cleaner/SKILL.md +105 -0
- package/.github/skills/session-manager/SKILL.md +119 -0
- package/.github/skills/session-manager/scripts/session-end.sh +175 -0
- package/.github/skills/session-manager/scripts/session-start.sh +87 -0
- package/.github/skills/verification-loop/SKILL.md +111 -0
- package/.github/skills/verification-loop/scripts/verify.sh +305 -0
- package/AGENTS.md +231 -1034
- package/docs/CODEMAPS/CODEMAP.md +1 -0
- package/docs/adr/ADR-v3.7.0-001-everything-claude-code-integration.md +102 -0
- package/package.json +2 -2
|
@@ -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
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
# Codemap Index Template
|
|
2
|
+
|
|
3
|
+
MUSUBIX コードマップのインデックステンプレートです。
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 📍 Entry Points
|
|
8
|
+
|
|
9
|
+
### CLI Commands
|
|
10
|
+
| Command | Location | Description |
|
|
11
|
+
|---------|----------|-------------|
|
|
12
|
+
| `musubix init` | [packages/core/src/cli/commands/init.ts](packages/core/src/cli/commands/init.ts) | プロジェクト初期化 |
|
|
13
|
+
| `musubix requirements` | [packages/core/src/cli/commands/requirements.ts](packages/core/src/cli/commands/requirements.ts) | 要件分析 |
|
|
14
|
+
| `musubix design` | [packages/core/src/cli/commands/design.ts](packages/core/src/cli/commands/design.ts) | 設計生成 |
|
|
15
|
+
| `musubix codegen` | [packages/core/src/cli/commands/codegen.ts](packages/core/src/cli/commands/codegen.ts) | コード生成 |
|
|
16
|
+
|
|
17
|
+
### MCP Tools
|
|
18
|
+
| Tool | Location | Description |
|
|
19
|
+
|------|----------|-------------|
|
|
20
|
+
| `sdd_create_requirements` | [packages/mcp-server/src/tools/](packages/mcp-server/src/tools/) | 要件作成 |
|
|
21
|
+
| `pattern_extract` | [packages/pattern-mcp/src/](packages/pattern-mcp/src/) | パターン抽出 |
|
|
22
|
+
| `knowledge_put_entity` | [packages/knowledge/src/](packages/knowledge/src/) | 知識グラフ操作 |
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## 🔌 Integration Points
|
|
27
|
+
|
|
28
|
+
### External Systems
|
|
29
|
+
```
|
|
30
|
+
┌──────────────────────────────────────────────────────────┐
|
|
31
|
+
│ MUSUBIX System │
|
|
32
|
+
├──────────────────────────────────────────────────────────┤
|
|
33
|
+
│ MCP Server ←→ Claude/Copilot │
|
|
34
|
+
│ Knowledge Store ←→ .knowledge/graph.json │
|
|
35
|
+
│ Policy Engine ←→ steering/rules/ │
|
|
36
|
+
│ Codegraph ←→ TypeScript AST │
|
|
37
|
+
└──────────────────────────────────────────────────────────┘
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Package Dependencies
|
|
41
|
+
```
|
|
42
|
+
core
|
|
43
|
+
├── mcp-server (depends on)
|
|
44
|
+
├── security (depends on)
|
|
45
|
+
└── formal-verify (depends on)
|
|
46
|
+
|
|
47
|
+
knowledge
|
|
48
|
+
├── policy (depends on)
|
|
49
|
+
└── decisions (depends on)
|
|
50
|
+
|
|
51
|
+
agent-orchestrator
|
|
52
|
+
├── workflow-engine (depends on)
|
|
53
|
+
├── skill-manager (depends on)
|
|
54
|
+
└── expert-delegation (depends on)
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## 📊 Key Data Flows
|
|
60
|
+
|
|
61
|
+
### Requirements → Code Flow
|
|
62
|
+
```
|
|
63
|
+
1. Natural Language (User Input)
|
|
64
|
+
↓
|
|
65
|
+
2. EARS Requirements (REQ-*)
|
|
66
|
+
↓ [packages/core/src/validators/ears-validator.ts]
|
|
67
|
+
3. C4 Design (DES-*)
|
|
68
|
+
↓ [packages/core/src/design/]
|
|
69
|
+
4. Implementation Tasks (TSK-*)
|
|
70
|
+
↓ [packages/core/src/codegen/]
|
|
71
|
+
5. Generated Code
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Pattern Learning Flow
|
|
75
|
+
```
|
|
76
|
+
1. Code Observation
|
|
77
|
+
↓
|
|
78
|
+
2. Pattern Extraction [packages/pattern-mcp/]
|
|
79
|
+
↓
|
|
80
|
+
3. Pattern Storage [packages/library-learner/]
|
|
81
|
+
↓
|
|
82
|
+
4. Pattern Query & Reuse
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## 🧩 Core Abstractions
|
|
88
|
+
|
|
89
|
+
### Entities
|
|
90
|
+
- `Requirement`: EARS形式の要件
|
|
91
|
+
- `Design`: C4モデルの設計
|
|
92
|
+
- `Pattern`: 学習済みコードパターン
|
|
93
|
+
- `Entity`: Knowledge Graph のエンティティ
|
|
94
|
+
|
|
95
|
+
### Services
|
|
96
|
+
- `EarsValidator`: EARS構文検証
|
|
97
|
+
- `PatternLibrary`: パターン管理
|
|
98
|
+
- `KnowledgeStore`: 知識グラフ操作
|
|
99
|
+
- `PolicyEngine`: 憲法条項検証
|
|
100
|
+
|
|
101
|
+
### Bridges (Integration)
|
|
102
|
+
- `PatternBridge`: Core ↔ Pattern-MCP
|
|
103
|
+
- `KnowledgeBridge`: Core ↔ Knowledge
|
|
104
|
+
- `QualityGateBridge`: Core ↔ Policy
|
|
105
|
+
- `CodemapBridge`: Core ↔ Codegraph
|
|
106
|
+
- `RefactorCleanerBridge`: Core ↔ Security
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## 🔍 Quick Navigation
|
|
111
|
+
|
|
112
|
+
### "Where is X defined?"
|
|
113
|
+
|
|
114
|
+
| Concept | Location |
|
|
115
|
+
|---------|----------|
|
|
116
|
+
| EARS Patterns | [packages/core/src/validators/ears-patterns.ts](packages/core/src/validators/ears-patterns.ts) |
|
|
117
|
+
| 10 Constitution Articles | [steering/rules/constitution.md](steering/rules/constitution.md) |
|
|
118
|
+
| MCP Tool Definitions | [packages/mcp-server/src/tools/](packages/mcp-server/src/tools/) |
|
|
119
|
+
| Type Definitions | [packages/core/src/types/](packages/core/src/types/) |
|
|
120
|
+
|
|
121
|
+
### "How does Y work?"
|
|
122
|
+
|
|
123
|
+
| Feature | Key Files |
|
|
124
|
+
|---------|-----------|
|
|
125
|
+
| Pattern Learning | `packages/pattern-mcp/src/pattern-library.ts`, `packages/wake-sleep/src/` |
|
|
126
|
+
| Traceability | `packages/core/src/traceability/` |
|
|
127
|
+
| Formal Verification | `packages/formal-verify/src/`, `packages/lean/src/` |
|
|
128
|
+
| Neural Search | `packages/neural-search/src/` |
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## 📝 Update Instructions
|
|
133
|
+
|
|
134
|
+
このファイルを更新する際の手順:
|
|
135
|
+
|
|
136
|
+
1. 新しいパッケージ追加時 → Integration Points セクション更新
|
|
137
|
+
2. 新しい CLI コマンド追加時 → Entry Points セクション更新
|
|
138
|
+
3. 新しい Bridge 追加時 → Core Abstractions セクション更新
|
|
139
|
+
4. 新しい型定義追加時 → Quick Navigation セクション更新
|
|
140
|
+
|
|
141
|
+
**更新者**: 各パッケージのメンテナ
|
|
142
|
+
**頻度**: リリースごと
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
# Package Codemap Template
|
|
2
|
+
|
|
3
|
+
個別パッケージのコードマップテンプレートです。
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Package: `@nahisaho/musubix-{package-name}`
|
|
8
|
+
|
|
9
|
+
### Overview
|
|
10
|
+
|
|
11
|
+
| Property | Value |
|
|
12
|
+
|----------|-------|
|
|
13
|
+
| **Purpose** | {パッケージの目的} |
|
|
14
|
+
| **Version** | {バージョン} |
|
|
15
|
+
| **Dependencies** | {主要依存パッケージ} |
|
|
16
|
+
| **Test Count** | {テスト数} |
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
### Directory Structure
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
packages/{package-name}/
|
|
24
|
+
├── package.json
|
|
25
|
+
├── tsconfig.json
|
|
26
|
+
├── vitest.config.ts
|
|
27
|
+
└── src/
|
|
28
|
+
├── index.ts # Public exports
|
|
29
|
+
├── types.ts # Type definitions
|
|
30
|
+
├── {module}/ # Feature modules
|
|
31
|
+
│ ├── index.ts
|
|
32
|
+
│ ├── {service}.ts
|
|
33
|
+
│ └── __tests__/
|
|
34
|
+
│ └── {service}.test.ts
|
|
35
|
+
└── integration/ # Integration bridges
|
|
36
|
+
├── index.ts
|
|
37
|
+
└── __tests__/
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
### Public API
|
|
43
|
+
|
|
44
|
+
#### Exports from `index.ts`
|
|
45
|
+
|
|
46
|
+
```typescript
|
|
47
|
+
// Main exports
|
|
48
|
+
export { MainService } from './main-service';
|
|
49
|
+
export { HelperFunction } from './helpers';
|
|
50
|
+
|
|
51
|
+
// Types
|
|
52
|
+
export type { MainConfig, MainResult } from './types';
|
|
53
|
+
|
|
54
|
+
// Constants
|
|
55
|
+
export { DEFAULT_CONFIG } from './constants';
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
#### Key Functions
|
|
59
|
+
|
|
60
|
+
| Function | Signature | Description |
|
|
61
|
+
|----------|-----------|-------------|
|
|
62
|
+
| `createService` | `(config: Config) => Service` | サービスインスタンス生成 |
|
|
63
|
+
| `processData` | `(data: Input) => Result<Output, Error>` | データ処理 |
|
|
64
|
+
| `validateInput` | `(input: unknown) => boolean` | 入力検証 |
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
### Internal Modules
|
|
69
|
+
|
|
70
|
+
#### `{module-name}/`
|
|
71
|
+
|
|
72
|
+
**Purpose**: {モジュールの目的}
|
|
73
|
+
|
|
74
|
+
**Key Files**:
|
|
75
|
+
- `service.ts`: {説明}
|
|
76
|
+
- `types.ts`: {説明}
|
|
77
|
+
- `utils.ts`: {説明}
|
|
78
|
+
|
|
79
|
+
**Dependencies**:
|
|
80
|
+
- `../types`: 型定義
|
|
81
|
+
- `external-package`: {用途}
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
### Data Flow
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
Input
|
|
89
|
+
↓ [validate]
|
|
90
|
+
Validated Input
|
|
91
|
+
↓ [process]
|
|
92
|
+
Intermediate State
|
|
93
|
+
↓ [transform]
|
|
94
|
+
Output
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
### Integration Points
|
|
100
|
+
|
|
101
|
+
#### Consumed By
|
|
102
|
+
- `@nahisaho/musubix-{consumer-package}`: {用途}
|
|
103
|
+
|
|
104
|
+
#### Consumes
|
|
105
|
+
- `@nahisaho/musubix-{dependency-package}`: {用途}
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
### Configuration
|
|
110
|
+
|
|
111
|
+
```typescript
|
|
112
|
+
interface Config {
|
|
113
|
+
// Required
|
|
114
|
+
required: string;
|
|
115
|
+
|
|
116
|
+
// Optional with defaults
|
|
117
|
+
optional?: number; // default: 10
|
|
118
|
+
|
|
119
|
+
// Feature flags
|
|
120
|
+
enableFeature?: boolean; // default: false
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
### Error Handling
|
|
127
|
+
|
|
128
|
+
| Error Class | When Thrown | Recovery |
|
|
129
|
+
|-------------|-------------|----------|
|
|
130
|
+
| `ValidationError` | Invalid input | Fix input |
|
|
131
|
+
| `ProcessingError` | Processing failure | Retry |
|
|
132
|
+
| `ConfigError` | Invalid config | Fix config |
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
### Testing Strategy
|
|
137
|
+
|
|
138
|
+
| Type | Coverage Target | Location |
|
|
139
|
+
|------|-----------------|----------|
|
|
140
|
+
| Unit | 80%+ | `src/**/__tests__/*.test.ts` |
|
|
141
|
+
| Integration | Key flows | `src/integration/__tests__/` |
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
### Change History
|
|
146
|
+
|
|
147
|
+
| Version | Changes |
|
|
148
|
+
|---------|---------|
|
|
149
|
+
| v3.7.0 | Initial release |
|
|
150
|
+
| v3.7.1 | Bug fixes |
|
|
151
|
+
| v3.7.2 | Performance improvements |
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
## Update Instructions
|
|
156
|
+
|
|
157
|
+
1. 新しい export 追加時 → Public API セクション更新
|
|
158
|
+
2. 新しいモジュール追加時 → Internal Modules セクション更新
|
|
159
|
+
3. 設定項目追加時 → Configuration セクション更新
|
|
160
|
+
4. 新しいエラー追加時 → Error Handling セクション更新
|