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,625 @@
1
+ ---
2
+ title: 'MUSUBIX v3.6.0: Cursor FastRenderプロジェクトのソースコード分析から得られた知見を統合'
3
+ tags:
4
+ - TypeScript
5
+ - AI
6
+ - AIエージェント
7
+ - ソフトウェア設計
8
+ - MUSUBIX
9
+ private: false
10
+ updated_at: '2026-01-23'
11
+ id: null
12
+ organization_url_name: null
13
+ slide: false
14
+ ignorePublish: false
15
+ ---
16
+
17
+ # MUSUBIX v3.6.0: Cursor FastRenderプロジェクトのソースコード分析から得られた知見を統合
18
+
19
+ ## はじめに
20
+
21
+ MUSUBIX v3.6.0では、**Cursor社のFastRenderプロジェクト**のソースコード分析から得られた知見を統合しました。FastRenderは「数百のAIエージェントを数週間にわたって協調動作させ、100万行以上のブラウザエンジンを構築する」という野心的な実験プロジェクトです。
22
+
23
+ 本記事では、FastRenderのAGENTS.mdやトリアージシステムの分析から抽出したベストプラクティスと、それをMUSUBIXにどのように統合したかを解説します。
24
+
25
+ ## 目次
26
+
27
+ 1. [FastRenderプロジェクトとは](#fastrenderプロジェクトとは)
28
+ 2. [分析から得られた主要な知見](#分析から得られた主要な知見)
29
+ 3. [MUSUBIX v3.6.0の新機能](#musubix-v360の新機能)
30
+ 4. [コンポーネント詳細](#コンポーネント詳細)
31
+ 5. [使用例](#使用例)
32
+ 6. [まとめ](#まとめ)
33
+
34
+ ---
35
+
36
+ ## FastRenderプロジェクトとは
37
+
38
+ ### 背景: 長時間稼働する自律型コーディング
39
+
40
+ Cursor社は「[長時間稼働する自律型コーディングをスケールさせる](https://cursor.com/ja/blog/scaling-agents)」というブログ記事で、マルチエージェント協調の実験結果を公開しました。
41
+
42
+ > 数週間にわたって、コーディングエージェントを自律的に稼働させる実験を行ってきました。私たちの目標は、通常は人間のチームが数か月かけて完了させるようなプロジェクトに対して、エージェント駆動のコーディングの最前線をどこまで押し広げられるかを見極めることです。
43
+
44
+ ### FastRender: ブラウザをゼロから構築
45
+
46
+ FastRenderは、この実験の成果物として公開されたRust製ブラウザエンジンです。
47
+
48
+ | 項目 | 値 |
49
+ |-----|---|
50
+ | **リポジトリ** | [wilsonzlin/fastrender](https://github.com/wilsonzlin/fastrender) |
51
+ | **言語** | Rust 25.5%, HTML 66.1%, C 4.8% |
52
+ | **コミット数** | 29,858+ |
53
+ | **同時稼働エージェント** | 数百 |
54
+ | **総トークン数** | 数兆 |
55
+
56
+ ### 学んだ教訓
57
+
58
+ Cursorの実験から得られた主要な教訓:
59
+
60
+ 1. **階層がないとエージェントはリスクを避ける** - フラットな構造では難しいタスクを避け、小さな安全な変更だけを行う
61
+ 2. **プランナーとワーカーの分離が有効** - 役割を分けたパイプラインが協調の問題を解決
62
+ 3. **構造の適切なレベルが重要** - 少なすぎると衝突・重複、多すぎると脆弱
63
+ 4. **プロンプト設計が最重要** - ハーネスやモデルよりもプロンプトが重要
64
+
65
+ ---
66
+
67
+ ## 分析から得られた主要な知見
68
+
69
+ ### 1. 優先度ベースのトリアージシステム (P0-P5)
70
+
71
+ FastRenderのAGENTS.mdとtriage.mdから抽出した優先度システム:
72
+
73
+ | Priority | Category | Description |
74
+ |----------|-----------------|-------------------------------------------------------|
75
+ | P0 | Panics/crashes | 本番コードでのパニックはP0バグ |
76
+ | P1 | Timeouts/loops | 5秒の厳格な予算内に収める |
77
+ | P2 | Accuracy | コンテンツ欠落、レイアウト/ペイントの誤り |
78
+ | P3 | Hotspots | レンダリングやイテレーション速度をブロックする場合 |
79
+ | P4 | Fidelity | コア機能に影響しない軽微な視覚的改善 |
80
+ | P5 | Spec expansion | ページセット精度/パフォーマンスに直接寄与する場合のみ |
81
+
82
+
83
+ **Rule**: P0-P2の問題が存在する間はP5にスキップしない。ポリッシュの前にクラッシュを修正する。
84
+
85
+ ### 2. 非交渉事項 (Non-Negotiables)
86
+
87
+ FastRenderのAGENTS.mdから抽出:
88
+
89
+ ```markdown
90
+ - **No page-specific hacks** - ホスト名/セレクタの特殊ケースやマジックナンバー禁止
91
+ - **No deviating-spec behavior** - 互換性のショートカットとして仕様から逸脱しない
92
+ - **No post-layout pixel nudging** - パイプラインをステージ化して維持
93
+ - **No panics** - 本番コードでエラーをクリーンに返し、作業を制限
94
+ - **JavaScript execution must be bounded** - 割り込み/タイムアウトをサポート
95
+ ```
96
+
97
+ ### 3. ワーカーの「完了」の定義
98
+
99
+ FastRenderでは、ワーカータスクは以下のいずれかを生成した場合のみ「完了」:
100
+
101
+ | Outcome | Evidence |
102
+ |---------|----------|
103
+ | タイムアウト→レンダリング | ステータス変更 |
104
+ | 大幅な高速化 | total_ms低下 |
105
+ | パニック/クラッシュ排除 | 回帰テスト追加 |
106
+ | 正確性修正 | ページセットでの改善 |
107
+
108
+ **重要**: 測定可能なデルタを示せない場合、完了ではない。
109
+
110
+ ### 4. リソース制限の徹底
111
+
112
+ FastRenderのリソース管理:
113
+
114
+ ```bash
115
+ # 時間制限: -k オプションで SIGKILL を確実に送信
116
+ timeout -k 10 600 bash scripts/cargo_agent.sh ...
117
+
118
+ # メモリ制限: cgroups または prlimit
119
+ bash scripts/run_limited.sh --as 64G -- ...
120
+ ```
121
+
122
+ **原則**: 制限を超えた場合、それは調査すべきバグであり、制限を引き上げるものではない。
123
+
124
+ ### 5. ワークストリーム管理
125
+
126
+ FastRenderのワークストリーム分類:
127
+
128
+ | Workstream | Owns | Does NOT own |
129
+ |------------|------|--------------|
130
+ | `capability_buildout` | CSS, レイアウトアルゴリズム | ページ固有の修正、ブラウザUI |
131
+ | `pageset_page_loop` | 特定ページのE2E修正 | 汎用機能作業 |
132
+ | `browser_chrome` | タブ、アドレスバー、ナビゲーション | ビジュアルデザイン |
133
+ | `js_engine` | vm-js実行、GC、仕様準拠 | DOM、Web APIs |
134
+
135
+ ---
136
+
137
+ ## MUSUBIX v3.6.0の新機能
138
+
139
+ FastRenderの分析から得られた知見を12の新コンポーネントとして実装しました。
140
+
141
+ ### 概要
142
+
143
+ | 優先度 | コンポーネント | パッケージ | テスト数 | 対応する知見 |
144
+ |-------|---------------|----------|---------|-------------|
145
+ | **P0** | ExtendedQualityGate | workflow-engine | 18 | トリアージシステム |
146
+ | **P0** | ExtendedQualityGateRunner | workflow-engine | 13 | バッチ実行 |
147
+ | **P0** | ResourceLimiter | agent-orchestrator | 20 | リソース制限 |
148
+ | **P0** | NonNegotiablesEngine | policy | 18 | 非交渉事項 |
149
+ | **P1** | SingleStepEnforcer | agent-orchestrator | 17 | 1ステップ完了 |
150
+ | **P1** | EvidenceLevelValidator | workflow-engine | 23 | エビデンス検証 |
151
+ | **P2** | TriageEngine | workflow-engine | 23 | 優先度トリアージ |
152
+ | **P2** | BalanceRuleEngine | policy | 25 | バランスルール |
153
+ | **P3** | MetricsCollector | core | 21 | メトリクス収集 |
154
+ | **P3** | PatternLearningDB | pattern-mcp | 23 | パターン学習 |
155
+ | **P4** | WorkstreamManager | agent-orchestrator | 26 | ワークストリーム |
156
+ | **P4** | TestPlacementValidator | codegraph | 26 | テスト配置 |
157
+
158
+ **合計**: 253テスト (100%合格)
159
+
160
+ ---
161
+
162
+ ## コンポーネント詳細
163
+
164
+ ### P0: 必須品質ゲート
165
+
166
+ #### ExtendedQualityGate
167
+
168
+ FastRenderのトリアージシステムを品質ゲートとして実装:
169
+
170
+ ```typescript
171
+ import {
172
+ createExtendedGate,
173
+ toStandardGate,
174
+ isEntryGate,
175
+ isExitGate,
176
+ } from '@nahisaho/musubix-workflow-engine';
177
+
178
+ // 拡張品質ゲート作成
179
+ const gate = createExtendedGate({
180
+ id: 'GATE-P0-001',
181
+ name: 'No Panics Check',
182
+ phase: 'implementation',
183
+ timing: 'entry', // フェーズ開始時に実行
184
+ priority: 0, // P0: 最高優先度
185
+ check: async (ctx) => {
186
+ const hasPanics = await checkForPanics(ctx);
187
+ return {
188
+ passed: !hasPanics,
189
+ message: hasPanics ? 'Panic detected' : 'No panics',
190
+ };
191
+ },
192
+ services: {
193
+ triageEngine,
194
+ nonNegotiablesEngine,
195
+ },
196
+ });
197
+
198
+ // 標準ゲートに変換
199
+ const standardGate = toStandardGate(gate);
200
+ ```
201
+
202
+ #### ResourceLimiter
203
+
204
+ FastRenderのリソース制限ポリシーを実装:
205
+
206
+ ```typescript
207
+ import {
208
+ ResourceLimiter,
209
+ createResourceLimits,
210
+ } from '@nahisaho/musubix-agent-orchestrator';
211
+
212
+ // リソース制限設定
213
+ const limits = createResourceLimits({
214
+ maxConcurrentTasks: 10,
215
+ maxMemoryMB: 4096,
216
+ maxExecutionTimeMs: 300000, // 5分
217
+ windowSizeMs: 60000, // 1分ウィンドウ
218
+ });
219
+
220
+ const limiter = new ResourceLimiter(limits);
221
+
222
+ // 実行前チェック
223
+ if (limiter.canExecute('workstream-1')) {
224
+ limiter.recordExecution('workstream-1', {
225
+ taskId: 'TSK-001',
226
+ memoryMB: 512,
227
+ durationMs: 10000,
228
+ });
229
+ } else {
230
+ console.log('Resource exhausted, waiting...');
231
+ }
232
+ ```
233
+
234
+ #### NonNegotiablesEngine
235
+
236
+ FastRenderの非交渉ルールを実装:
237
+
238
+ ```typescript
239
+ import {
240
+ NonNegotiablesEngine,
241
+ createNonNegotiablesEngine,
242
+ } from '@musubix/policy';
243
+
244
+ const engine = createNonNegotiablesEngine();
245
+
246
+ // 検証実行
247
+ const result = await engine.validate({
248
+ code: sourceCode,
249
+ filePath: 'src/feature.ts',
250
+ });
251
+
252
+ if (!result.passed) {
253
+ for (const violation of result.violations) {
254
+ console.error(`[${violation.rule}] ${violation.message}`);
255
+ }
256
+ }
257
+ ```
258
+
259
+ **デフォルトルール**:
260
+ - `no-tests-skip`: テストスキップ禁止
261
+ - `no-security-bypass`: セキュリティバイパス禁止
262
+ - `no-console-in-prod`: 本番環境でのconsole禁止
263
+ - `no-any-type`: any型使用禁止
264
+ - `no-hardcoded-secrets`: ハードコードされた機密情報禁止
265
+
266
+ ### P1: 高優先度
267
+
268
+ #### SingleStepEnforcer
269
+
270
+ FastRenderの「1タスク完了」原則を実装:
271
+
272
+ ```typescript
273
+ import {
274
+ SingleStepEnforcer,
275
+ createStepDefinition,
276
+ } from '@nahisaho/musubix-agent-orchestrator';
277
+
278
+ const enforcer = new SingleStepEnforcer({
279
+ maxLinesPerStep: 100,
280
+ allowMultiFile: false,
281
+ requireTests: true,
282
+ });
283
+
284
+ const step = createStepDefinition({
285
+ name: 'Add validation',
286
+ files: ['src/validator.ts'],
287
+ linesChanged: 50,
288
+ });
289
+
290
+ // ステップ実行
291
+ const result = await enforcer.enforceStep(step, async () => {
292
+ // 実装
293
+ return { success: true };
294
+ });
295
+
296
+ if (!result.valid) {
297
+ console.error('Step validation failed:', result.warnings);
298
+ }
299
+ ```
300
+
301
+ #### EvidenceLevelValidator
302
+
303
+ FastRenderの「測定可能なデルタ」要件を実装:
304
+
305
+ ```typescript
306
+ import {
307
+ EvidenceLevelValidator,
308
+ EvidenceLevel,
309
+ } from '@nahisaho/musubix-workflow-engine';
310
+
311
+ const validator = new EvidenceLevelValidator();
312
+
313
+ // 検証
314
+ const result = validator.validate({
315
+ phase: 'implementation',
316
+ evidence: {
317
+ testsAdded: 5,
318
+ testsPassing: 5,
319
+ coverageIncrease: 10.5,
320
+ performanceImprovement: null,
321
+ },
322
+ });
323
+
324
+ // 必要レベル取得
325
+ const requiredLevel = validator.getRequiredLevel('implementation');
326
+ // => EvidenceLevel.HIGH
327
+ ```
328
+
329
+ ### P2: 中優先度
330
+
331
+ #### TriageEngine
332
+
333
+ FastRenderのP0-P5優先度システムを実装:
334
+
335
+ ```typescript
336
+ import {
337
+ TriageEngine,
338
+ createTriageEngine,
339
+ } from '@nahisaho/musubix-workflow-engine';
340
+
341
+ const engine = createTriageEngine();
342
+
343
+ // タスクトリアージ
344
+ const priority = engine.triage({
345
+ type: 'bug',
346
+ severity: 'critical', // panic/crash
347
+ urgency: 'immediate',
348
+ impact: 'high',
349
+ blocksNewWork: true,
350
+ });
351
+ // => { priority: 0, label: 'P0', action: 'fix-immediately' }
352
+
353
+ // ブロッキングチェック
354
+ const isBlocking = engine.checkBlocking(priority);
355
+ // => true (P0-P1はブロッキング)
356
+ ```
357
+
358
+ #### BalanceRuleEngine
359
+
360
+ コード変更のバランス評価:
361
+
362
+ ```typescript
363
+ import {
364
+ BalanceRuleEngine,
365
+ createBalanceRuleEngine,
366
+ } from '@musubix/policy';
367
+
368
+ const engine = createBalanceRuleEngine();
369
+
370
+ // 変更追加
371
+ engine.addChange({ file: 'src/feature.ts', lines: 100, type: 'feature' });
372
+ engine.addChange({ file: 'src/feature.test.ts', lines: 80, type: 'test' });
373
+
374
+ // バランス評価
375
+ const result = engine.evaluate();
376
+ // => { passed: true, ratio: 0.8, message: 'Good test coverage' }
377
+
378
+ // レポート生成
379
+ const report = engine.getBalanceReport();
380
+ ```
381
+
382
+ ### P3: 低優先度
383
+
384
+ #### MetricsCollector
385
+
386
+ FastRenderのprogress/pages/*.jsonシステムを参考:
387
+
388
+ ```typescript
389
+ import {
390
+ MetricsCollector,
391
+ createMetricsCollector,
392
+ } from '@nahisaho/musubix-core';
393
+
394
+ const collector = createMetricsCollector({
395
+ categories: ['performance', 'quality', 'coverage'],
396
+ windowSizeMs: 3600000, // 1時間
397
+ });
398
+
399
+ // メトリクス記録
400
+ collector.record({
401
+ category: 'performance',
402
+ name: 'build_time_ms',
403
+ value: 12500,
404
+ tags: { phase: 'implementation' },
405
+ });
406
+
407
+ // 統計取得
408
+ const stats = collector.getStats('performance');
409
+ // => { count: 10, min: 10000, max: 15000, avg: 12000, p95: 14500 }
410
+
411
+ // レポート生成
412
+ const report = collector.generateReport();
413
+ ```
414
+
415
+ #### PatternLearningDB
416
+
417
+ パターン学習と検索:
418
+
419
+ ```typescript
420
+ import {
421
+ PatternLearningDB,
422
+ createPatternLearningDB,
423
+ } from '@nahisaho/musubix-pattern-mcp';
424
+
425
+ const db = createPatternLearningDB({
426
+ maxPatterns: 1000,
427
+ minConfidence: 0.7,
428
+ });
429
+
430
+ // パターン追加
431
+ const pattern = await db.add({
432
+ name: 'Resource Limiter Pattern',
433
+ code: resourceLimiterCode,
434
+ source: 'fastrender-analysis',
435
+ confidence: 0.95,
436
+ tags: ['resource', 'limit', 'agent'],
437
+ });
438
+
439
+ // パターン検索
440
+ const results = await db.query({
441
+ tags: ['resource'],
442
+ minConfidence: 0.8,
443
+ });
444
+
445
+ // 統計
446
+ const stats = db.getStats();
447
+ // => { total: 150, active: 145, avgConfidence: 0.88 }
448
+ ```
449
+
450
+ ### P4: 最低優先度
451
+
452
+ #### WorkstreamManager
453
+
454
+ FastRenderのワークストリーム管理を実装:
455
+
456
+ ```typescript
457
+ import {
458
+ WorkstreamManager,
459
+ createWorkstreamManager,
460
+ } from '@nahisaho/musubix-agent-orchestrator';
461
+
462
+ const manager = createWorkstreamManager();
463
+
464
+ // ワークストリーム作成
465
+ const workstream = manager.createWorkstream({
466
+ name: 'capability_buildout',
467
+ description: 'CSS, layout algorithms, paint correctness',
468
+ owner: 'agent-001',
469
+ priority: 1,
470
+ });
471
+
472
+ // ステータス更新
473
+ manager.updateWorkstream(workstream.id, {
474
+ status: 'active',
475
+ progress: 45,
476
+ });
477
+
478
+ // 一覧取得
479
+ const activeStreams = manager.listWorkstreams({ status: 'active' });
480
+ ```
481
+
482
+ #### TestPlacementValidator
483
+
484
+ テスト配置ルールの検証:
485
+
486
+ ```typescript
487
+ import {
488
+ TestPlacementValidator,
489
+ createTestPlacementValidator,
490
+ } from '@nahisaho/musubix-codegraph';
491
+
492
+ const validator = createTestPlacementValidator({
493
+ rules: [
494
+ { pattern: '**/*.test.ts', placement: 'colocate' },
495
+ { pattern: '**/integration/**', placement: 'separate' },
496
+ { pattern: '**/e2e/**', placement: 'dedicated' },
497
+ ],
498
+ });
499
+
500
+ // 検証
501
+ const result = validator.validate({
502
+ sourceFile: 'src/feature.ts',
503
+ testFile: 'src/feature.test.ts',
504
+ });
505
+ // => { valid: true, rule: 'colocate-unit-tests' }
506
+
507
+ // サマリー取得
508
+ const summary = validator.getSummary();
509
+ // => { total: 100, valid: 95, violations: 5 }
510
+ ```
511
+
512
+ ---
513
+
514
+ ## 使用例
515
+
516
+ ### FastRenderスタイルのワークフロー
517
+
518
+ ```typescript
519
+ import {
520
+ createExtendedGateRunner,
521
+ createTriageEngine,
522
+ createNonNegotiablesEngine,
523
+ createResourceLimiter,
524
+ } from '@nahisaho/musubix-workflow-engine';
525
+
526
+ // サービス初期化
527
+ const triageEngine = createTriageEngine();
528
+ const nonNegotiables = createNonNegotiablesEngine();
529
+ const resourceLimiter = createResourceLimiter(defaultLimits);
530
+
531
+ // ゲートランナー設定
532
+ const runner = createExtendedGateRunner({
533
+ services: {
534
+ triageEngine,
535
+ nonNegotiablesEngine: nonNegotiables,
536
+ },
537
+ });
538
+
539
+ // フェーズ開始時のゲート実行
540
+ const entryResult = await runner.executePhaseGates('implementation', 'entry');
541
+
542
+ if (!entryResult.passed) {
543
+ // P0-P1の問題が検出された
544
+ for (const failure of entryResult.failures) {
545
+ console.error(`[${failure.gate}] ${failure.message}`);
546
+ }
547
+ process.exit(1);
548
+ }
549
+
550
+ // 実装作業...
551
+
552
+ // フェーズ終了時のゲート実行
553
+ const exitResult = await runner.executePhaseGates('implementation', 'exit');
554
+ ```
555
+
556
+ ### トリアージフロー
557
+
558
+ ```typescript
559
+ import { createTriageEngine } from '@nahisaho/musubix-workflow-engine';
560
+
561
+ const triage = createTriageEngine();
562
+
563
+ // 問題をトリアージ
564
+ function handleIssue(issue: Issue) {
565
+ const priority = triage.triage({
566
+ type: issue.type,
567
+ severity: issue.severity,
568
+ urgency: issue.urgency,
569
+ impact: issue.impact,
570
+ blocksNewWork: issue.blocksNewWork,
571
+ });
572
+
573
+ // P0-P2は即座に対応
574
+ if (priority.priority <= 2) {
575
+ return assignToOnCall(issue, priority);
576
+ }
577
+
578
+ // P3-P5はバックログへ
579
+ return addToBacklog(issue, priority);
580
+ }
581
+ ```
582
+
583
+ ---
584
+
585
+ ## まとめ
586
+
587
+ ### FastRenderから学んだこと
588
+
589
+ 1. **構造化されたトリアージが重要** - P0-P5の明確な優先度で作業を組織化
590
+ 2. **非交渉事項を定義する** - 品質の最低ラインを明確に
591
+ 3. **リソース制限を徹底する** - 暴走を防ぐ外部制限
592
+ 4. **ワーカーの「完了」を定義する** - 測定可能なデルタがなければ完了ではない
593
+ 5. **ワークストリームを分離する** - 責務の明確な分離
594
+
595
+ ### MUSUBIX v3.6.0の成果
596
+
597
+ | 項目 | 値 |
598
+ |-----|---|
599
+ | 新規コンポーネント | 12 |
600
+ | 新規テスト | 253 |
601
+ | テスト合格率 | 100% |
602
+ | 対応パッケージ | 6 |
603
+ | 追加コード行 | +11,878 |
604
+
605
+ ### 今後の展望
606
+
607
+ - MCPツールとしての公開
608
+ - Claude Codeスキルとしての統合
609
+ - より高度なトリアージアルゴリズム
610
+ - マルチエージェント協調サポート
611
+
612
+ ---
613
+
614
+ ## 参考リンク
615
+
616
+ - [Cursor Blog: 長時間稼働する自律型コーディングをスケールさせる](https://cursor.com/ja/blog/scaling-agents)
617
+ - [FastRender GitHub](https://github.com/wilsonzlin/fastrender)
618
+ - [MUSUBIX GitHub](https://github.com/nahisaho/MUSUBIX)
619
+ - [MUSUBIX npm](https://www.npmjs.com/package/@nahisaho/musubix-core)
620
+
621
+ ---
622
+
623
+ **Author**: MUSUBIX Team
624
+ **Version**: 3.6.0
625
+ **Date**: 2026-01-23