musubix 3.6.0 → 3.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/.github/AGENTS.md +949 -0
  2. package/.github/prompts/sdd-change-apply.prompt.md +283 -0
  3. package/.github/prompts/sdd-change-archive.prompt.md +241 -0
  4. package/.github/prompts/sdd-change-init.prompt.md +269 -0
  5. package/.github/prompts/sdd-design.prompt.md +250 -0
  6. package/.github/prompts/sdd-implement.prompt.md +387 -0
  7. package/.github/prompts/sdd-requirements.prompt.md +193 -0
  8. package/.github/prompts/sdd-review.prompt.md +155 -0
  9. package/.github/prompts/sdd-security.prompt.md +228 -0
  10. package/.github/prompts/sdd-steering.prompt.md +269 -0
  11. package/.github/prompts/sdd-tasks.prompt.md +255 -0
  12. package/.github/prompts/sdd-test.prompt.md +230 -0
  13. package/.github/prompts/sdd-validate.prompt.md +304 -0
  14. package/.github/skills/build-fix/SKILL.md +124 -0
  15. package/.github/skills/checkpoint/SKILL.md +131 -0
  16. package/.github/skills/codemap/SKILL.md +120 -0
  17. package/.github/skills/codemap/templates/codemap-index.md +142 -0
  18. package/.github/skills/codemap/templates/package-codemap.md +160 -0
  19. package/.github/skills/context-optimizer/SKILL.md +109 -0
  20. package/.github/skills/context-optimizer/contexts/dev.md +40 -0
  21. package/.github/skills/context-optimizer/contexts/research.md +55 -0
  22. package/.github/skills/context-optimizer/contexts/review.md +49 -0
  23. package/.github/skills/e2e-runner/SKILL.md +145 -0
  24. package/.github/skills/eval-harness/SKILL.md +111 -0
  25. package/.github/skills/eval-harness/examples/capability-eval.md +158 -0
  26. package/.github/skills/eval-harness/examples/human-grader-template.md +326 -0
  27. package/.github/skills/eval-harness/examples/regression-eval.md +228 -0
  28. package/.github/skills/learning-hooks/SKILL.md +101 -0
  29. package/.github/skills/learning-hooks/templates/learned-skill-template.md +79 -0
  30. package/.github/skills/musubix-adr-generation/SKILL.md +74 -0
  31. package/.github/skills/musubix-best-practices/SKILL.md +85 -0
  32. package/.github/skills/musubix-c4-design/SKILL.md +86 -0
  33. package/.github/skills/musubix-code-generation/SKILL.md +90 -0
  34. package/.github/skills/musubix-domain-inference/SKILL.md +82 -0
  35. package/.github/skills/musubix-ears-validation/SKILL.md +74 -0
  36. package/.github/skills/musubix-sdd-workflow/SKILL.md +95 -0
  37. package/.github/skills/musubix-technical-writing/SKILL.md +108 -0
  38. package/.github/skills/musubix-test-generation/SKILL.md +88 -0
  39. package/.github/skills/musubix-traceability/SKILL.md +94 -0
  40. package/.github/skills/refactor-cleaner/SKILL.md +105 -0
  41. package/.github/skills/session-manager/SKILL.md +119 -0
  42. package/.github/skills/session-manager/scripts/session-end.sh +175 -0
  43. package/.github/skills/session-manager/scripts/session-start.sh +87 -0
  44. package/.github/skills/verification-loop/SKILL.md +111 -0
  45. package/.github/skills/verification-loop/scripts/verify.sh +305 -0
  46. package/AGENTS.md +333 -0
  47. package/LICENSE +21 -0
  48. package/README.ja.md +313 -0
  49. package/README.md +315 -50
  50. package/bin/musubix-mcp.js +15 -0
  51. package/bin/musubix.js +9 -1
  52. package/docs/API-REFERENCE.md +1425 -0
  53. package/docs/CODEMAPS/CODEMAP.md +1 -0
  54. package/docs/GITHUB-ACTIONS-NPM-SETUP.md +132 -0
  55. package/docs/INSTALL-GUIDE.ja.md +459 -0
  56. package/docs/INSTALL-GUIDE.md +459 -0
  57. package/docs/MIGRATION-v3.0.md +324 -0
  58. package/docs/MUSUBI-enhancement_roadmap_20260105.md +651 -0
  59. package/docs/MUSUBIX-v3.0-User-Guide.md +1357 -0
  60. package/docs/MUSUBIXv2.2.0-Manual-outline.md +136 -0
  61. package/docs/MUSUBIXv2.2.0-Manual.md +3123 -0
  62. package/docs/MUSUBIXv2.3.5-Refactering.md +1310 -0
  63. package/docs/MUSUBIv1.6.1-enhancement_roadmap_20260105.md +291 -0
  64. package/docs/MUSUBIv2.2.0-USERGUIDE.md +2079 -0
  65. package/docs/ROADMAP-v1.5.md +116 -0
  66. package/docs/SwarmCoding.md +1284 -0
  67. package/docs/Test-prompt.md +105 -0
  68. package/docs/USER-GUIDE-v1.8.0.md +2371 -0
  69. package/docs/USER-GUIDE.ja.md +2147 -0
  70. package/docs/USER-GUIDE.md +3022 -0
  71. package/docs/YATA-GLOBAL-GUIDE.ja.md +750 -0
  72. package/docs/YATA-GLOBAL-GUIDE.md +595 -0
  73. package/docs/YATA-LOCAL-GUIDE.ja.md +989 -0
  74. package/docs/YATA-LOCAL-GUIDE.md +730 -0
  75. package/docs/adr/0001-real-time-pattern-learning-architecture-for-v1-5-0.md +75 -0
  76. package/docs/adr/0002-pattern-sharing-protocol-for-cross-team-collaborat.md +79 -0
  77. package/docs/adr/0003-owl-2-rl-implementation-strategy-for-advanced-infe.md +90 -0
  78. package/docs/adr/ADR-v3.4.0-001-deep-research-architecture.md +217 -0
  79. package/docs/adr/ADR-v3.4.0-002-search-provider-selection.md +308 -0
  80. package/docs/adr/ADR-v3.4.0-003-lm-api-integration.md +475 -0
  81. package/docs/adr/ADR-v3.7.0-001-everything-claude-code-integration.md +102 -0
  82. package/docs/enterprise-knowledge-management.md +1737 -0
  83. package/docs/evolution-from-musubi-to-musubix.md +2170 -0
  84. package/docs/experiments/EXPERIMENT-ASSISTANT-AXIS-DRIFT-DETECTION.md +155 -0
  85. package/docs/getting-started-with-sdd.md +1602 -0
  86. package/docs/moodle-refactering-codegraph-musubix.md +391 -0
  87. package/docs/moodle-refactering-codegraph.md +278 -0
  88. package/docs/overview/MUSUBIX-CodeGraph.md +322 -0
  89. package/docs/overview/MUSUBIX-Core.md +671 -0
  90. package/docs/overview/MUSUBIX-Decisions.md +494 -0
  91. package/docs/overview/MUSUBIX-FormalVerify.md +566 -0
  92. package/docs/overview/MUSUBIX-Knowledge.md +1231 -0
  93. package/docs/overview/MUSUBIX-Learning.md +837 -0
  94. package/docs/overview/MUSUBIX-MCP-Server.md +535 -0
  95. package/docs/overview/MUSUBIX-Overview.md +264 -0
  96. package/docs/overview/MUSUBIX-Phase1-Complete.md +271 -0
  97. package/docs/overview/MUSUBIX-Phase2-Complete.md +310 -0
  98. package/docs/overview/MUSUBIX-Policy.md +477 -0
  99. package/docs/overview/MUSUBIX-Roadmap-v2.md +399 -0
  100. package/docs/overview/MUSUBIX-Security-Plan.md +939 -0
  101. package/docs/overview/MUSUBIX-Security-v2.1.md +668 -0
  102. package/docs/overview/MUSUBIX-Security.md +891 -0
  103. package/docs/overview/MUSUBIX-YATA.md +666 -0
  104. package/docs/overview/MUSUBIX-v2.2.0-Advanced-Learning.md +513 -0
  105. package/docs/overview/Neuro-SymbolicAI.md +159 -0
  106. package/docs/packages/knowledge.md +594 -0
  107. package/docs/qiita/musubix-v3.6.0-fastrender-insights.md +625 -0
  108. package/docs/qiita-linux-kernel-knowledge-graph.md +596 -0
  109. package/docs/qiita-musubix-assistant-axis.md +380 -0
  110. package/package.json +58 -52
  111. package/scripts/generate-quality-gate-report.ts +106 -0
  112. package/scripts/postinstall.js +94 -0
  113. package/scripts/register-release-knowledge.ts +127 -0
  114. package/steering/.musubi-version +1 -0
  115. package/steering/product.ja.md +572 -0
  116. package/steering/project.yml +66 -0
  117. package/steering/rules/constitution.md +491 -0
  118. package/steering/structure.ja.md +503 -0
  119. package/steering/tech.ja.md +208 -0
  120. package/dist/index.d.ts +0 -25
  121. package/dist/index.d.ts.map +0 -1
  122. package/dist/index.js +0 -74
  123. package/dist/index.js.map +0 -1
@@ -0,0 +1,305 @@
1
+ #!/usr/bin/env bash
2
+ # verify.sh - 6フェーズ検証スクリプト
3
+ # Usage: ./verify.sh [quick|full]
4
+ #
5
+ # トレーサビリティ: REQ-VL-001, DES-VL-001
6
+
7
+ set -e
8
+
9
+ MODE="${1:-full}"
10
+ REPORT_FILE=".reports/verification-$(date +%Y%m%d-%H%M%S).md"
11
+
12
+ # カラー定義
13
+ RED='\033[0;31m'
14
+ GREEN='\033[0;32m'
15
+ YELLOW='\033[1;33m'
16
+ BLUE='\033[0;34m'
17
+ NC='\033[0m' # No Color
18
+
19
+ # 結果を格納する配列
20
+ declare -A RESULTS
21
+ declare -A DETAILS
22
+
23
+ # ヘルパー関数
24
+ log_phase() {
25
+ echo -e "\n${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
26
+ echo -e "${BLUE}Phase: $1${NC}"
27
+ echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
28
+ }
29
+
30
+ log_pass() {
31
+ echo -e "${GREEN}✅ PASS${NC}: $1"
32
+ }
33
+
34
+ log_fail() {
35
+ echo -e "${RED}❌ FAIL${NC}: $1"
36
+ }
37
+
38
+ log_warn() {
39
+ echo -e "${YELLOW}⚠️ WARN${NC}: $1"
40
+ }
41
+
42
+ log_skip() {
43
+ echo -e "${YELLOW}⏭️ SKIP${NC}: $1"
44
+ }
45
+
46
+ # Phase 1: Build
47
+ phase_build() {
48
+ log_phase "1. Build"
49
+
50
+ if [ "$MODE" = "quick" ]; then
51
+ log_skip "Quick mode - skipping build"
52
+ RESULTS[build]="SKIP"
53
+ return 0
54
+ fi
55
+
56
+ if npm run build 2>&1; then
57
+ log_pass "Build succeeded"
58
+ RESULTS[build]="PASS"
59
+ return 0
60
+ else
61
+ log_fail "Build failed"
62
+ RESULTS[build]="FAIL"
63
+ return 1
64
+ fi
65
+ }
66
+
67
+ # Phase 2: Type Check
68
+ phase_types() {
69
+ log_phase "2. Type Check"
70
+
71
+ local output
72
+ output=$(npx tsc --noEmit 2>&1) || true
73
+ local error_count
74
+ error_count=$(echo "$output" | grep -c "error TS" || echo "0")
75
+
76
+ if [ "$error_count" -eq 0 ]; then
77
+ log_pass "No type errors"
78
+ RESULTS[types]="PASS"
79
+ DETAILS[types]="0 errors"
80
+ return 0
81
+ else
82
+ log_fail "$error_count type error(s)"
83
+ RESULTS[types]="FAIL"
84
+ DETAILS[types]="$error_count errors"
85
+ echo "$output" | head -20
86
+ return 1
87
+ fi
88
+ }
89
+
90
+ # Phase 3: Lint
91
+ phase_lint() {
92
+ log_phase "3. Lint"
93
+
94
+ if [ "$MODE" = "quick" ]; then
95
+ log_skip "Quick mode - skipping lint"
96
+ RESULTS[lint]="SKIP"
97
+ return 0
98
+ fi
99
+
100
+ local output
101
+ output=$(npm run lint 2>&1) || true
102
+ local error_count
103
+ error_count=$(echo "$output" | grep -c "error" || echo "0")
104
+ local warn_count
105
+ warn_count=$(echo "$output" | grep -c "warning" || echo "0")
106
+
107
+ if [ "$error_count" -eq 0 ]; then
108
+ if [ "$warn_count" -gt 0 ]; then
109
+ log_warn "$warn_count warning(s)"
110
+ RESULTS[lint]="PASS"
111
+ DETAILS[lint]="$warn_count warnings"
112
+ else
113
+ log_pass "No lint errors or warnings"
114
+ RESULTS[lint]="PASS"
115
+ DETAILS[lint]="clean"
116
+ fi
117
+ return 0
118
+ else
119
+ log_fail "$error_count error(s), $warn_count warning(s)"
120
+ RESULTS[lint]="FAIL"
121
+ DETAILS[lint]="$error_count errors, $warn_count warnings"
122
+ echo "$output" | head -20
123
+ return 1
124
+ fi
125
+ }
126
+
127
+ # Phase 4: Tests
128
+ phase_tests() {
129
+ log_phase "4. Tests"
130
+
131
+ local test_cmd="npm run test"
132
+
133
+ if [ "$MODE" = "quick" ]; then
134
+ # Quick mode: 変更に関連するテストのみ
135
+ test_cmd="npm run test:unit -- --changed"
136
+ fi
137
+
138
+ local output
139
+ if output=$($test_cmd 2>&1); then
140
+ local passed
141
+ passed=$(echo "$output" | grep -oP '\d+ passed' | head -1 || echo "? passed")
142
+ log_pass "Tests $passed"
143
+ RESULTS[tests]="PASS"
144
+ DETAILS[tests]="$passed"
145
+ return 0
146
+ else
147
+ log_fail "Some tests failed"
148
+ RESULTS[tests]="FAIL"
149
+ DETAILS[tests]="failed"
150
+ echo "$output" | tail -30
151
+ return 1
152
+ fi
153
+ }
154
+
155
+ # Phase 5: Security
156
+ phase_security() {
157
+ log_phase "5. Security"
158
+
159
+ if [ "$MODE" = "quick" ]; then
160
+ log_skip "Quick mode - skipping security scan"
161
+ RESULTS[security]="SKIP"
162
+ return 0
163
+ fi
164
+
165
+ local output
166
+ output=$(npm audit --json 2>&1) || true
167
+
168
+ local critical
169
+ critical=$(echo "$output" | jq '.metadata.vulnerabilities.critical // 0' 2>/dev/null || echo "0")
170
+ local high
171
+ high=$(echo "$output" | jq '.metadata.vulnerabilities.high // 0' 2>/dev/null || echo "0")
172
+
173
+ if [ "$critical" -eq 0 ] && [ "$high" -eq 0 ]; then
174
+ log_pass "No critical or high vulnerabilities"
175
+ RESULTS[security]="PASS"
176
+ DETAILS[security]="0 critical, 0 high"
177
+ return 0
178
+ else
179
+ log_fail "$critical critical, $high high vulnerabilities"
180
+ RESULTS[security]="FAIL"
181
+ DETAILS[security]="$critical critical, $high high"
182
+ return 1
183
+ fi
184
+ }
185
+
186
+ # Phase 6: Diff
187
+ phase_diff() {
188
+ log_phase "6. Diff Review"
189
+
190
+ local stats
191
+ stats=$(git diff --stat HEAD~1..HEAD 2>/dev/null || git diff --stat)
192
+
193
+ local files_changed
194
+ files_changed=$(echo "$stats" | tail -1 | grep -oP '\d+ file' | grep -oP '\d+' || echo "0")
195
+ local insertions
196
+ insertions=$(echo "$stats" | tail -1 | grep -oP '\d+ insertion' | grep -oP '\d+' || echo "0")
197
+ local deletions
198
+ deletions=$(echo "$stats" | tail -1 | grep -oP '\d+ deletion' | grep -oP '\d+' || echo "0")
199
+
200
+ echo "$stats"
201
+
202
+ RESULTS[diff]="INFO"
203
+ DETAILS[diff]="$files_changed files, +$insertions -$deletions"
204
+
205
+ return 0
206
+ }
207
+
208
+ # レポート生成
209
+ generate_report() {
210
+ mkdir -p .reports
211
+
212
+ local overall="READY"
213
+ for phase in build types lint tests security; do
214
+ if [ "${RESULTS[$phase]}" = "FAIL" ]; then
215
+ overall="NOT READY"
216
+ break
217
+ fi
218
+ done
219
+
220
+ cat << EOF > "$REPORT_FILE"
221
+ # Verification Report
222
+
223
+ **Date**: $(date +%Y-%m-%d\ %H:%M:%S)
224
+ **Mode**: $MODE
225
+
226
+ ## Results
227
+
228
+ | Phase | Status | Details |
229
+ |-------|--------|---------|
230
+ | Build | ${RESULTS[build]:-N/A} | ${DETAILS[build]:-} |
231
+ | Types | ${RESULTS[types]:-N/A} | ${DETAILS[types]:-} |
232
+ | Lint | ${RESULTS[lint]:-N/A} | ${DETAILS[lint]:-} |
233
+ | Tests | ${RESULTS[tests]:-N/A} | ${DETAILS[tests]:-} |
234
+ | Security | ${RESULTS[security]:-N/A} | ${DETAILS[security]:-} |
235
+ | Diff | ${RESULTS[diff]:-N/A} | ${DETAILS[diff]:-} |
236
+
237
+ ## Overall
238
+
239
+ **Status**: $overall
240
+
241
+ EOF
242
+
243
+ echo ""
244
+ echo "╔════════════════════════════════════════════════════════════╗"
245
+ echo "║ VERIFICATION REPORT ║"
246
+ echo "╠════════════════════════════════════════════════════════════╣"
247
+ echo "║ ║"
248
+ printf "║ Build: [%-4s] %-40s ║\n" "${RESULTS[build]}" ""
249
+ printf "║ Types: [%-4s] %-40s ║\n" "${RESULTS[types]}" "(${DETAILS[types]:-})"
250
+ printf "║ Lint: [%-4s] %-40s ║\n" "${RESULTS[lint]}" "(${DETAILS[lint]:-})"
251
+ printf "║ Tests: [%-4s] %-40s ║\n" "${RESULTS[tests]}" "(${DETAILS[tests]:-})"
252
+ printf "║ Security: [%-4s] %-40s ║\n" "${RESULTS[security]}" "(${DETAILS[security]:-})"
253
+ printf "║ Diff: [%-4s] %-40s ║\n" "${RESULTS[diff]}" "(${DETAILS[diff]:-})"
254
+ echo "║ ║"
255
+ echo "╠════════════════════════════════════════════════════════════╣"
256
+ printf "║ Overall: [%-9s] for PR ║\n" "$overall"
257
+ echo "╚════════════════════════════════════════════════════════════╝"
258
+ echo ""
259
+ echo "Report saved to: $REPORT_FILE"
260
+ }
261
+
262
+ # メイン処理
263
+ main() {
264
+ echo "Starting verification ($MODE mode)..."
265
+ echo ""
266
+
267
+ local failed=0
268
+
269
+ # Phase 1: Build
270
+ phase_build || failed=1
271
+
272
+ # ビルド失敗時は後続フェーズをスキップ
273
+ if [ "${RESULTS[build]}" = "FAIL" ]; then
274
+ RESULTS[types]="SKIP"
275
+ RESULTS[lint]="SKIP"
276
+ RESULTS[tests]="SKIP"
277
+ RESULTS[security]="SKIP"
278
+ RESULTS[diff]="SKIP"
279
+ else
280
+ # Phase 2: Type Check
281
+ phase_types || failed=1
282
+
283
+ # 型エラー時は後続をスキップ
284
+ if [ "${RESULTS[types]}" = "FAIL" ]; then
285
+ RESULTS[lint]="SKIP"
286
+ RESULTS[tests]="SKIP"
287
+ RESULTS[security]="SKIP"
288
+ else
289
+ # Phase 3-5
290
+ phase_lint || failed=1
291
+ phase_tests || failed=1
292
+ phase_security || failed=1
293
+ fi
294
+
295
+ # Phase 6: Diff (常に実行)
296
+ phase_diff
297
+ fi
298
+
299
+ # レポート生成
300
+ generate_report
301
+
302
+ exit $failed
303
+ }
304
+
305
+ main "$@"
package/AGENTS.md ADDED
@@ -0,0 +1,333 @@
1
+ # AGENTS.md — MUSUBIX v3.7.2
2
+
3
+ > **AI Agent向け最適化ナレッジ** — WHEN/DO構文で明確なトリガーとアクションを定義
4
+
5
+ ## 🎯 クイックリファレンス
6
+
7
+ | 項目 | 値 |
8
+ |------|-----|
9
+ | バージョン | 3.7.2 |
10
+ | テストカバレッジ | 92%+ |
11
+ | パッケージ数 | 28 |
12
+ | MCP ツール | 114 |
13
+ | Agent Skills | 15 |
14
+
15
+ ---
16
+
17
+ ## 📦 パッケージ構成
18
+
19
+ | カテゴリ | パッケージ | 用途 |
20
+ |----------|------------|------|
21
+ | **Core** | `@musubix/core` | エンティティ・値オブジェクト |
22
+ | | `@musubix/knowledge` | ナレッジグラフ CRUD |
23
+ | | `@musubix/musubi` | AI要約(300字以内) |
24
+ | | `@musubix/codegraph` | コード解析・依存関係抽出 |
25
+ | **SDD** | `@musubix/sdd-ontology` | オントロジー管理 |
26
+ | | `@musubix/decisions` | ADR管理・トレーサビリティ |
27
+ | | `@musubix/synthesis` | 情報統合 |
28
+ | **Verification** | `@musubix/formal-verify` | Lean4形式検証 |
29
+ | | `@musubix/lean` | Lean4連携 |
30
+ | | `@musubix/policy` | ルール駆動検証 |
31
+ | **Agent** | `@musubix/assistant-axis` | マルチモーダル統合 |
32
+ | | `@musubix/expert-delegation` | 専門家委譲 |
33
+ | | `@musubix/skill-manager` | スキル動的ロード |
34
+ | | `@musubix/agent-orchestrator` | 階層的オーケストレーション |
35
+ | **Learning** | `@musubix/wake-sleep` | 自律学習 |
36
+ | | `@musubix/deep-research` | 深層調査 |
37
+ | | `@musubix/library-learner` | ライブラリ学習 |
38
+ | **Search** | `@musubix/neural-search` | ベクトル・ハイブリッド検索 |
39
+ | **Workflow** | `@musubix/workflow-engine` | DAGワークフロー |
40
+ | | `@musubix/dfg` | データフローグラフ |
41
+ | **MCP** | `@musubix/mcp-server` | MCP統合サーバー |
42
+ | | `@musubix/ontology-mcp` | オントロジーMCP |
43
+ | | `@musubix/pattern-mcp` | パターンMCP |
44
+
45
+ ---
46
+
47
+ ## 🛠️ CLI コマンド
48
+
49
+ ### 基本操作
50
+
51
+ ```bash
52
+ # プロジェクト全体
53
+ pnpm i && pnpm build && pnpm test
54
+
55
+ # 個別パッケージ
56
+ pnpm --filter @musubix/core test
57
+ pnpm --filter @musubix/knowledge test
58
+ ```
59
+
60
+ ### ナレッジ操作
61
+
62
+ ```bash
63
+ # 追加・検索
64
+ musubix knowledge add --source ./src --output ./knowledge.json
65
+ musubix knowledge search "認証" --semantic --top-k 5
66
+
67
+ # コードグラフ
68
+ musubix codegraph analyze ./src --include-dependencies
69
+ musubix codegraph query "関数 -> 依存関係"
70
+ ```
71
+
72
+ ### SDD ワークフロー
73
+
74
+ ```bash
75
+ # 仕様駆動開発
76
+ musubix sdd init --domain "Eコマース" --output ./specs
77
+ musubix sdd validate ./specs --strict
78
+ musubix sdd generate ./specs --output ./src
79
+ ```
80
+
81
+ ### MCP サーバー
82
+
83
+ ```bash
84
+ # 起動
85
+ musubix-mcp serve
86
+ musubix-mcp serve --port 3000 --skills-dir ./skills
87
+ ```
88
+
89
+ ---
90
+
91
+ ## 🔌 MCP ツール(主要)
92
+
93
+ | カテゴリ | ツール | 用途 |
94
+ |----------|--------|------|
95
+ | **Knowledge** | `knowledge_add`, `knowledge_search`, `knowledge_import`, `knowledge_export` | ナレッジ CRUD |
96
+ | **CodeGraph** | `codegraph_analyze`, `codegraph_query`, `codegraph_visualize` | コード解析 |
97
+ | **SDD** | `sdd_init`, `sdd_validate`, `sdd_generate`, `sdd_trace` | 仕様駆動開発 |
98
+ | **Wake-Sleep** | `wake_observe`, `wake_optimize`, `sleep_consolidate`, `sleep_generate` | 自律学習 |
99
+ | **Formal** | `formal_translate`, `formal_verify`, `formal_prove` | 形式検証 |
100
+ | **Search** | `neural_search`, `hybrid_search`, `graph_search` | 検索 |
101
+
102
+ **全114ツール**: `musubix-mcp list-tools` で確認
103
+
104
+ ---
105
+
106
+ ## 📜 10憲法条項
107
+
108
+ | # | 条項 | ルール |
109
+ |---|------|--------|
110
+ | 1 | コンテキスト最優先 | Steering/product.ja.md, structure.ja.md を必ず参照 |
111
+ | 2 | ナレッジ駆動 | 既存知識を検索・活用してから回答 |
112
+ | 3 | 仕様駆動 (SDD) | 要件→設計→実装→検証の順序厳守 |
113
+ | 4 | トレーサビリティ | 決定事項は ADR として記録 |
114
+ | 5 | 段階的詳細化 | 抽象から具体へ、一度に1レベル |
115
+ | 6 | 自律学習 | Wake-Sleepサイクルで継続的改善 |
116
+ | 7 | 形式検証 | 重要ロジックはLean4で証明 |
117
+ | 8 | パターン適用 | 学習済みベストプラクティスを活用 |
118
+ | 9 | 明示的コミュニケーション | 不明点は確認、仮定を明示 |
119
+ | 10 | 品質最優先 | テスト・レビュー・検証を省略しない |
120
+
121
+ ---
122
+
123
+ ## 🧭 Project Memory(Steering)
124
+
125
+ | ファイル | 用途 | 参照タイミング |
126
+ |----------|------|----------------|
127
+ | `steering/product.ja.md` | 製品ビジョン・ゴール | プロジェクト理解時 |
128
+ | `steering/structure.ja.md` | アーキテクチャ構造 | 設計・実装時 |
129
+ | `steering/tech.ja.md` | 技術スタック・制約 | 技術選定時 |
130
+ | `steering/project.yml` | プロジェクトメタデータ | CI/CD設定時 |
131
+ | `steering/rules/*.md` | ドメイン固有ルール | コード生成時 |
132
+
133
+ ---
134
+
135
+ ## 🔬 主要機能
136
+
137
+ ### 1. Wake-Sleep 自律学習
138
+
139
+ ```typescript
140
+ // WHEN: パターン学習が必要
141
+ // DO: Wake-Sleepサイクルを実行
142
+ const result = await wakeSleep.observe("./src/**/*.ts");
143
+ const patterns = await wakeSleep.consolidate(result);
144
+ await wakeSleep.apply(patterns);
145
+ ```
146
+
147
+ ### 2. Knowledge Graph
148
+
149
+ ```typescript
150
+ // WHEN: 情報の関連付けが必要
151
+ // DO: エンティティとリレーションを追加
152
+ await knowledge.addEntity({ type: "Function", name: "auth" });
153
+ await knowledge.addRelation("auth", "uses", "jwt-library");
154
+ const related = await knowledge.search("認証", { semantic: true });
155
+ ```
156
+
157
+ ### 3. CodeGraph 解析
158
+
159
+ ```typescript
160
+ // WHEN: コード依存関係の把握が必要
161
+ // DO: 解析してクエリ実行
162
+ const graph = await codegraph.analyze("./src");
163
+ const deps = await codegraph.query("Function -> Dependency");
164
+ ```
165
+
166
+ ### 4. SDD ワークフロー
167
+
168
+ ```typescript
169
+ // WHEN: 新機能の仕様策定
170
+ // DO: init → validate → generate
171
+ await sdd.init({ domain: "Payment", output: "./specs" });
172
+ await sdd.validate("./specs", { strict: true });
173
+ await sdd.generate("./specs", { output: "./src" });
174
+ ```
175
+
176
+ ### 5. Formal Verification
177
+
178
+ ```typescript
179
+ // WHEN: 重要ロジックの証明が必要
180
+ // DO: Lean4に変換して検証
181
+ const leanCode = await formal.translate(tsCode);
182
+ const proof = await formal.verify(leanCode);
183
+ ```
184
+
185
+ ---
186
+
187
+ ## 📚 学習済みベストプラクティス
188
+
189
+ | パターン | 適用条件 | 効果 |
190
+ |----------|----------|------|
191
+ | Result型 | エラーハンドリング | 型安全なエラー処理 |
192
+ | Repository | データアクセス | 永続化層の抽象化 |
193
+ | ValueObject | 不変データ | 値の整合性保証 |
194
+ | AggregateRoot | 整合性境界 | トランザクション境界の明確化 |
195
+ | CQRS | 読み書き分離 | パフォーマンス最適化 |
196
+ | EventSourcing | 状態追跡 | 完全な監査証跡 |
197
+ | DomainEvent | 疎結合通知 | モジュール間の依存削減 |
198
+ | Specification | 条件カプセル化 | 再利用可能なビジネスルール |
199
+ | Factory | 生成ロジック | 複雑なオブジェクト生成の隠蔽 |
200
+ | Strategy | アルゴリズム切替 | 実行時の振る舞い変更 |
201
+
202
+ ---
203
+
204
+ ## 🤖 Agent Skills(15スキル)
205
+
206
+ ### Core Skills
207
+
208
+ | スキル | トリガー | 機能 |
209
+ |--------|----------|------|
210
+ | `knowledge-capture` | 新情報入力時 | エンティティ抽出・関係構築 |
211
+ | `knowledge-integration` | 統合要求時 | 複数ソースの知識統合 |
212
+ | `structured-summary` | 要約要求時 | 構造化300字要約 |
213
+ | `deep-research` | 調査要求時 | 多段階深層調査 |
214
+ | `learning-extraction` | パターン発見時 | ベストプラクティス抽出 |
215
+
216
+ ### SDD Skills
217
+
218
+ | スキル | トリガー | 機能 |
219
+ |--------|----------|------|
220
+ | `musubix-domain-inference` | 要件分析時 | ドメインモデル推論 |
221
+ | `musubix-sdd-workflow` | SDD開始時 | 仕様駆動開発ガイド |
222
+ | `musubix-code-generation` | コード生成時 | SDD準拠コード生成 |
223
+ | `musubix-test-generation` | テスト生成時 | 仕様ベーステスト生成 |
224
+ | `musubix-traceability` | 追跡確認時 | 要件-実装追跡 |
225
+
226
+ ### Documentation Skills
227
+
228
+ | スキル | トリガー | 機能 |
229
+ |--------|----------|------|
230
+ | `musubix-adr-generation` | 決定記録時 | ADR自動生成 |
231
+ | `musubix-c4-design` | 設計図作成時 | C4モデル生成 |
232
+ | `musubix-technical-writing` | 文書作成時 | 技術文書生成 |
233
+ | `musubix-best-practices` | ノウハウ整理時 | ベストプラクティス文書化 |
234
+ | `musubix-ears-validation` | 要件検証時 | EARS構文検証 |
235
+
236
+ ---
237
+
238
+ ## 📋 AI Agent ガイドライン
239
+
240
+ ### WHEN: 新規タスク開始
241
+
242
+ ```
243
+ DO:
244
+ 1. steering/ を読んでコンテキスト把握
245
+ 2. knowledge search で既存知識確認
246
+ 3. 関連 ADR を確認
247
+ 4. 必要なスキルを特定
248
+ ```
249
+
250
+ ### WHEN: コード生成
251
+
252
+ ```
253
+ DO:
254
+ 1. SDD ワークフローに従う
255
+ 2. 学習済みパターンを適用
256
+ 3. テストを同時生成
257
+ 4. トレーサビリティを維持
258
+ ```
259
+
260
+ ### WHEN: エラー発生
261
+
262
+ ```
263
+ DO:
264
+ 1. Result型でエラーをラップ
265
+ 2. コンテキスト情報を付加
266
+ 3. リカバリー戦略を検討
267
+ 4. 学習データとして記録
268
+ ```
269
+
270
+ ### WHEN: 不明点がある
271
+
272
+ ```
273
+ DO:
274
+ 1. 仮定を明示して確認を求める
275
+ 2. 複数の選択肢を提示
276
+ 3. 決定事項は ADR に記録
277
+ ```
278
+
279
+ ---
280
+
281
+ ## 🔄 推奨ワークフロー
282
+
283
+ ```
284
+ Phase 1: Context │ steering/ 読込 → knowledge search → ADR確認
285
+
286
+ Phase 2: Plan │ スキル選定 → タスク分解 → 依存関係整理
287
+
288
+ Phase 3: Execute │ SDD準拠実装 → パターン適用 → テスト生成
289
+
290
+ Phase 4: Verify │ 形式検証 → トレーサビリティ確認 → レビュー
291
+
292
+ Phase 5: Learn │ Wake-Sleep → パターン抽出 → ナレッジ更新
293
+ ```
294
+
295
+ ---
296
+
297
+ ## 📁 ストレージ構造
298
+
299
+ | ディレクトリ | 用途 |
300
+ |--------------|------|
301
+ | `storage/learning/` | 学習データ |
302
+ | `storage/specs/` | SDD仕様 |
303
+ | `storage/design/` | 設計文書 |
304
+ | `storage/changes/` | 変更履歴 |
305
+ | `storage/reviews/` | レビュー記録 |
306
+ | `storage/dashboard/` | メトリクス |
307
+
308
+ ---
309
+
310
+ ## 🚨 重要な制約
311
+
312
+ | 制約 | 理由 |
313
+ |------|------|
314
+ | Node.js 20+ | ESM・最新API |
315
+ | TypeScript strict | 型安全性 |
316
+ | pnpm workspace | モノレポ管理 |
317
+ | Vitest | 高速テスト |
318
+ | ESLint flat config | 統一リント |
319
+
320
+ ---
321
+
322
+ ## 📞 トラブルシューティング
323
+
324
+ | 症状 | 対処 |
325
+ |------|------|
326
+ | 依存解決エラー | `pnpm i --force` |
327
+ | 型エラー | `pnpm build` で再ビルド |
328
+ | テスト失敗 | `pnpm --filter <pkg> test` で個別実行 |
329
+ | MCP接続失敗 | ポート確認、`--debug` オプション |
330
+
331
+ ---
332
+
333
+ **最終更新**: 2025-01-29 | **バージョン**: 3.7.2
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.