kenaz 0.3.18 → 0.3.20

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 (329) hide show
  1. package/core/.claude/commands/agent-worker.md +1 -1
  2. package/core/.claude/commands/architect.md +1 -2
  3. package/core/.claude/commands/spec.md +1 -1
  4. package/core/.claude/commands//347/224/242/345/223/201.md +1 -1
  5. package/core/.claude/hooks/__tests__/task-1977-dedupe-guard.test.js +8 -8
  6. package/core/.claude/skills/architect_agent/SKILL.md +11 -92
  7. package/core/.claude/skills/assessment_agent/SKILL.md +0 -1
  8. package/core/.claude/skills/backend_engineer/SKILL.md +3 -6
  9. package/core/.claude/skills/code_reviewer/SKILL.md +1 -1
  10. package/core/.claude/skills/code_reviewer/patterns.yaml +1 -1
  11. package/core/.claude/skills/designer/SKILL.md +3 -6
  12. package/core/.claude/skills/dev_agent/SKILL.md +30 -491
  13. package/core/.claude/skills/developer/SKILL.md +3 -6
  14. package/core/.claude/skills/feature_agent/SKILL.md +3 -17
  15. package/core/.claude/skills/product_manager/SKILL.md +29 -1064
  16. package/core/.claude/skills/qa_engineer/SKILL.md +12 -17
  17. package/core/.claude/skills/spec_optimizer/SKILL.md +25 -275
  18. package/core/.claude/skills/sre_agent/SKILL.md +3 -6
  19. package/core/.collaboration/README.md +2 -3
  20. package/core/.collaboration/core/task-api.js +5 -138
  21. package/core/.collaboration/docs/CLI.md +0 -2
  22. package/core/.failure/INDEX.yaml +6 -40
  23. package/core/.failure/agent-execution/FAIL-013-search-cwd-drift-and-case-mismatch.yaml +1 -1
  24. package/core/.failure/tools/README.md +9 -227
  25. package/core/.formation/bifrost/launch.js +1 -6
  26. package/core/.formation/bifrost/launch.test.js +1 -1
  27. package/core/.formation/bifrost/shared/ansuz-boot-policy.js +3 -3
  28. package/core/.formation/bifrost/shared/ansuz-boot-policy.test.js +1 -2
  29. package/core/.formation/tools/__tests__/arms.test.js +41 -0
  30. package/core/.formation/tools/__tests__/diagnose-bug.test.js +10 -0
  31. package/core/.formation/tools/__tests__/m1-hmap-convid.test.js +1 -124
  32. package/core/.formation/tools/arms.js +48 -0
  33. package/core/.formation/tools/dispatch.js +24 -15
  34. package/core/.formation/tools/kenaz-stats.js +32 -8
  35. package/core/.formation/tools/kenaz-stats.test.js +15 -2
  36. package/core/.formation/tools/loader.js +17 -140
  37. package/core/.formation/tools/post-complete.js +0 -31
  38. package/core/.formation/tools/prompt.js +16 -1
  39. package/core/.formation/tools/prompt.test.js +20 -0
  40. package/core/.rule/INDEX.yaml +0 -18
  41. package/core/.rule/general/agent-workflow.yaml +14 -164
  42. package/core/.rule/general/project-self-containment.yaml +8 -19
  43. package/core/.rule/general/rust-verify-target.yaml +6 -5
  44. package/core/.rule/general/synapse-code-intelligence.yaml +3 -3
  45. package/core/.specialist/Amelia/capability.yaml +12 -12
  46. package/core/.specialist/Amelia/workflow.yaml +2 -2
  47. package/core/.specialist/Ansuz/SYSTEM_DOC.md +20 -578
  48. package/core/.specialist/Ansuz/cognitive_principles.yaml +2 -3
  49. package/core/.specialist/Ansuz/concepts/boot_rules_summary.yaml +0 -1
  50. package/core/.specialist/Ansuz/concepts/deep_knowledge_pointers.yaml +1 -2
  51. package/core/.specialist/Ansuz/core.yaml +6 -108
  52. package/core/.specialist/Ansuz/guards/lesson_guards.yaml +0 -3
  53. package/core/.specialist/Ansuz/identity_contract.yaml +0 -1
  54. package/core/.specialist/Ansuz/knowledge.yaml +0 -4
  55. package/core/.specialist/Ansuz/rule.yaml +0 -1
  56. package/core/.specialist/Ansuz/tools/handoff-session-identity.test.js +6 -150
  57. package/core/.specialist/tests/runtime-discovery/README.md +1 -1
  58. package/core/.specialist/tools/__tests__/task-2374-usage-counter.test.js +1 -12
  59. package/core/.specialist/tools/ansuz-boot-fast.js +7 -4
  60. package/core/.specialist/tools/ansuz-boot-fast.test.js +10 -3
  61. package/core/.specialist/tools/prompt-files.test.js +1 -0
  62. package/core/.specialist/tools/task-bridge.js +1 -66
  63. package/core/.system/README.md +11 -552
  64. package/core/.system/collaboration/README.md +10 -174
  65. package/core/CLAUDE.md +1 -6
  66. package/core/KENAZ_CORE_VERSION +1 -1
  67. package/core/dev/scripts/js-yaml-resolution.test.js +1 -1
  68. package/core/dev/scripts/peer-identity-e2e.js +402 -0
  69. package/core/dev/scripts/peer-identity-e2e.md +47 -0
  70. package/core/dev/scripts/relay-admin.js +94 -0
  71. package/core/dev/scripts/relay-admin.test.js +131 -0
  72. package/core/dev/scripts/run-rust-tests.js +9 -45
  73. package/core/dev/scripts/rust-verify-worktree.js +4 -4
  74. package/core/dev/scripts/verify-target-dir.js +6 -6
  75. package/core/plugins/kenaz/INVENTORY.md +8 -8
  76. package/core/plugins/kenaz/README.md +10 -0
  77. package/core/plugins/kenaz/commands/architect.md +1 -2
  78. package/core/plugins/kenaz/commands/spec.md +1 -1
  79. package/core/plugins/kenaz/commands//347/224/242/345/223/201.md +1 -1
  80. package/core/plugins/kenaz/guidance.md +1 -1
  81. package/core/plugins/kenaz/hooks/kenaz-hook.js +2 -1
  82. package/core/plugins/kenaz/hooks/sdk-gate.js +9 -0
  83. package/core/plugins/kenaz/scripts/kenaz.test.js +15 -3
  84. package/core/plugins/kenaz/scripts/sync.js +1 -1
  85. package/core/plugins/kenaz/scripts/ygg.js +8 -0
  86. package/core/plugins/kenaz/scripts/ygg.test.js +72 -0
  87. package/core/plugins/kenaz/skills/architect_agent/SKILL.md +11 -92
  88. package/core/plugins/kenaz/skills/assessment_agent/SKILL.md +0 -1
  89. package/core/plugins/kenaz/skills/backend_engineer/SKILL.md +3 -6
  90. package/core/plugins/kenaz/skills/code_reviewer/SKILL.md +1 -1
  91. package/core/plugins/kenaz/skills/code_reviewer/patterns.yaml +1 -1
  92. package/core/plugins/kenaz/skills/designer/SKILL.md +3 -6
  93. package/core/plugins/kenaz/skills/dev_agent/SKILL.md +30 -491
  94. package/core/plugins/kenaz/skills/developer/SKILL.md +3 -6
  95. package/core/plugins/kenaz/skills/feature_agent/SKILL.md +3 -17
  96. package/core/plugins/kenaz/skills/product_manager/SKILL.md +29 -1064
  97. package/core/plugins/kenaz/skills/qa_engineer/SKILL.md +12 -17
  98. package/core/plugins/kenaz/skills/spec_optimizer/SKILL.md +25 -275
  99. package/core/plugins/kenaz/skills/sre_agent/SKILL.md +3 -6
  100. package/core/plugins/kenaz-peer/hooks/register.test.ts +32 -0
  101. package/core/plugins/kenaz-peer/hooks/register.ts +9 -0
  102. package/package.json +6 -6
  103. package/core/.claude/commands/archive.md +0 -24
  104. package/core/.claude/commands/init.md +0 -112
  105. package/core/.claude/commands/legacy_dev.md +0 -18
  106. package/core/.claude/commands/product-review.md +0 -131
  107. package/core/.claude/commands/strategy.md +0 -141
  108. package/core/.claude/commands/sunny.md +0 -1
  109. package/core/.claude/commands//347/224/242/345/223/201/346/252/242/350/246/226.md +0 -129
  110. package/core/.claude/commands//351/200/262/345/272/246.md +0 -15
  111. package/core/.claude/hooks/__tests__/substrate.test.js +0 -122
  112. package/core/.claude/hooks/_substrate-paths.js +0 -95
  113. package/core/.claude/hooks/context-check.js +0 -51
  114. package/core/.claude/hooks/fatigue-check.js +0 -52
  115. package/core/.claude/hooks/handoff-snapshot-on-commit.js +0 -154
  116. package/core/.claude/hooks/handoff-snapshot-on-question.js +0 -158
  117. package/core/.claude/hooks/handoff-staleness.js +0 -197
  118. package/core/.claude/hooks/jev-thalamus-context.js +0 -17
  119. package/core/.claude/hooks/jev-thalamus-context.test.js +0 -41
  120. package/core/.claude/hooks/lease-release.js +0 -119
  121. package/core/.claude/hooks/lease-touch.js +0 -96
  122. package/core/.claude/hooks/reflex-feedback.js +0 -5
  123. package/core/.claude/hooks/session-init.ps1 +0 -49
  124. package/core/.claude/hooks/sound-event.js +0 -70
  125. package/core/.claude/hooks/sound-event.sh +0 -37
  126. package/core/.claude/hooks/stream-delta.js +0 -169
  127. package/core/.claude/no-hooks.settings.json +0 -3
  128. package/core/.claude/skills/legacy_dev/SKILL.md +0 -202
  129. package/core/.claude/skills/sunny/SKILL.md +0 -74
  130. package/core/.collaboration/cli/commands/assign.js +0 -39
  131. package/core/.collaboration/cli/commands/claim.js +0 -33
  132. package/core/.collaboration/cli/commands/complete.js +0 -44
  133. package/core/.collaboration/cli/commands/create.js +0 -110
  134. package/core/.collaboration/cli/commands/get.js +0 -83
  135. package/core/.collaboration/cli/commands/index.js +0 -52
  136. package/core/.collaboration/cli/commands/list.js +0 -51
  137. package/core/.collaboration/cli/commands/lock.js +0 -45
  138. package/core/.collaboration/cli/commands/rebuild.js +0 -39
  139. package/core/.collaboration/cli/commands/search.js +0 -61
  140. package/core/.collaboration/cli/commands/stats.js +0 -61
  141. package/core/.collaboration/cli/commands/transfer.js +0 -41
  142. package/core/.collaboration/cli/commands/unlock.js +0 -48
  143. package/core/.collaboration/cli/formatters/help-formatter.js +0 -70
  144. package/core/.collaboration/cli/formatters/index.js +0 -7
  145. package/core/.collaboration/cli/task-cli.js +0 -46
  146. package/core/.collaboration/cli/utils/arg-parser.js +0 -74
  147. package/core/.collaboration/cli/utils/git-user.js +0 -25
  148. package/core/.collaboration/cli/utils/index.js +0 -9
  149. package/core/.collaboration/cli/utils/output.js +0 -10
  150. package/core/.collaboration/config/default.yaml +0 -189
  151. package/core/.collaboration/core/conflict-resolver.js +0 -461
  152. package/core/.collaboration/core/conflict-resolver.test.js +0 -389
  153. package/core/.collaboration/core/migrate-legacy.js +0 -260
  154. package/core/.collaboration/docs/API.md +0 -787
  155. package/core/.collaboration/docs/ARCHITECTURE.md +0 -596
  156. package/core/.collaboration/docs/FAQ.md +0 -695
  157. package/core/.collaboration/docs/MIGRATION.md +0 -804
  158. package/core/.collaboration/docs/examples/README.md +0 -320
  159. package/core/.collaboration/docs/examples/advanced-queries.js +0 -261
  160. package/core/.collaboration/docs/examples/basic-usage.js +0 -184
  161. package/core/.collaboration/docs/examples/team-workflow.js +0 -352
  162. package/core/.failure/agent-execution/FAIL-001-agent-no-output.yaml +0 -391
  163. package/core/.failure/agent-execution/FAIL-007-pm-lead-wrong-team-invocation.yaml +0 -0
  164. package/core/.failure/agent-execution/FAIL-010-phase0-poem-format-skipped.yaml +0 -28
  165. package/core/.failure/agent-execution/FAIL-010-skipping-cognitive-checkpoint-after-verification.yaml +0 -59
  166. package/core/.failure/agent-execution/FAIL-012-grep-shortcut-during-investigation.yaml +0 -85
  167. package/core/.failure/architecture/FAIL-006-python-version-compatibility.yaml +0 -445
  168. package/core/.failure/pipeline/FAIL-003-queue-pollution.yaml +0 -335
  169. package/core/.failure/pipeline/README.md +0 -95
  170. package/core/.failure/retired/FAIL-009-skipping-synapse-pulse-before-code-change.yaml +0 -49
  171. package/core/.failure/tools/USAGE_GUIDE.md +0 -323
  172. package/core/.failure/tools/check_failures.ps1 +0 -387
  173. package/core/.failure/tools/log_failure.ps1 +0 -474
  174. package/core/.formation/.episode-input.json +0 -10
  175. package/core/.formation/.merge-lock +0 -1
  176. package/core/.formation/lead.yaml +0 -118
  177. package/core/.formation/legacy.bak/designer.yaml +0 -57
  178. package/core/.formation/legacy.bak/pm.yaml +0 -57
  179. package/core/.formation/legacy.bak/qa.yaml +0 -57
  180. package/core/.formation/legacy.bak/review.yaml +0 -62
  181. package/core/.formation/legacy.bak/scheduler.yaml +0 -129
  182. package/core/.formation/legacy.bak/sre.yaml +0 -57
  183. package/core/.formation/role-map.yaml +0 -274
  184. package/core/.formation/roles/_shared/modules/code_review.yaml +0 -98
  185. package/core/.formation/roles/_shared/modules/security.yaml +0 -103
  186. package/core/.formation/roles/_shared/modules/testing.yaml +0 -14
  187. package/core/.formation/roles/backend/role.yaml +0 -93
  188. package/core/.formation/roles/code_reviewer/role.yaml +0 -102
  189. package/core/.formation/roles/database_optimizer/role.yaml +0 -107
  190. package/core/.formation/roles/designer/role.yaml +0 -66
  191. package/core/.formation/roles/developer/role.yaml +0 -75
  192. package/core/.formation/roles/frontend/role.yaml +0 -134
  193. package/core/.formation/roles/incident_response/role.yaml +0 -89
  194. package/core/.formation/roles/qa/role.yaml +0 -89
  195. package/core/.formation/roles/security/role.yaml +0 -87
  196. package/core/.formation/roles/sre/role.yaml +0 -66
  197. package/core/.formation/skills/coordinator.yaml +0 -52
  198. package/core/.formation/solo/diagnosis.yaml +0 -78
  199. package/core/.formation/solo/strategy.yaml +0 -121
  200. package/core/.formation/tests/hello.txt +0 -2
  201. package/core/.formation/tools/coordinator.js +0 -350
  202. package/core/.formation/tools/jev-correction.js +0 -214
  203. package/core/.formation/tools/jev-correction.test.js +0 -178
  204. package/core/.formation/tools/log-reader.js +0 -232
  205. package/core/.formation/tools/revert-daemon-state.js +0 -162
  206. package/core/.formation/tools/test-drift.js +0 -148
  207. package/core/.formation/unit/heimdall.yaml +0 -96
  208. package/core/.formation/unit/plan.yaml +0 -67
  209. package/core/.formation/unit/think.yaml +0 -58
  210. package/core/.kenaz/MUNINN_SNAPSHOT9_EPISODE.json +0 -32
  211. package/core/.kenaz/MUNINN_SNAPSHOT9_RUNE.json +0 -23
  212. package/core/.kenaz/MUNINN_SNAPSHOT9_SUMMARY.md +0 -89
  213. package/core/.kenaz/ash_TASK_1428-20260507.json +0 -14
  214. package/core/.kenaz/muninn_episode_write.ps1 +0 -17
  215. package/core/.kenaz/muninn_snapshot11_rune_candidates.md +0 -63
  216. package/core/.kenaz/muninn_snapshot1_rune_candidates.md +0 -49
  217. package/core/.kenaz/runes_TASK_1428.json +0 -57
  218. package/core/.kenaz/tmp_heimdall_proposal_8d3e392.json +0 -13
  219. package/core/.kenaz/tmp_props.json +0 -1
  220. package/core/.kenaz/tmp_sounddrop_t1_prompt.txt +0 -371
  221. package/core/.rule/MECHANIZED.md +0 -61
  222. package/core/.rule/general/cortex-memory-recall.yaml +0 -446
  223. package/core/.rule/general/pipeline.yaml +0 -246
  224. package/core/.rule/general/sunny-access-control.yaml +0 -60
  225. package/core/.rule/general/system-invariants.yaml +0 -231
  226. package/core/.rule/pipeline/PPL-002-completed-task-archival.yaml +0 -528
  227. package/core/.rule/pipeline/auto-update.yaml +0 -282
  228. package/core/.rule/pipeline/task-execution.yaml +0 -365
  229. package/core/.specialist/Ansuz/concepts/phase_protocol.yaml +0 -65
  230. package/core/.specialist/Ansuz/experiments/boot_ablation_replay.js +0 -197
  231. package/core/.specialist/Ansuz/tools/bootstrap-anchors.js +0 -289
  232. package/core/.specialist/Ansuz/workflow.yaml +0 -1225
  233. package/core/.specialist/experiments/rg_benchmark.js +0 -523
  234. package/core/.specialist/experiments/rg_benchmark_results.json +0 -27
  235. package/core/.specialist/tools/jev-optional-context.js +0 -107
  236. package/core/.specialist/tools/jev-optional-context.test.js +0 -152
  237. package/core/.specialist/tools/memory-action-log.js +0 -839
  238. package/core/.specialist/tools/phase-gate.js +0 -3534
  239. package/core/.specialist/tools/phase-gate.test.js +0 -85
  240. package/core/.specialist/tools/precompute-runner.js +0 -444
  241. package/core/.specialist/tools/rule-engine.js +0 -621
  242. package/core/.specialist/tools/task-bridge-jev.test.js +0 -170
  243. package/core/.synapse/memory-shared.json.sync +0 -1
  244. package/core/.system/agent-skills/README.md +0 -724
  245. package/core/.system/cli-tools/README.md +0 -724
  246. package/core/.system/cortex/MODULES.md +0 -1046
  247. package/core/.system/dashboard/FRONTEND.md +0 -812
  248. package/core/.system/dashboard/README.md +0 -737
  249. package/core/.system/failure/README.md +0 -723
  250. package/core/.system/formation/LEGACY_SKILLS.md +0 -974
  251. package/core/.system/formation/POST_COMPLETE.md +0 -602
  252. package/core/.system/formation/README.md +0 -1094
  253. package/core/.system/formation/TOOLS_REFERENCE.md +0 -1145
  254. package/core/.system/kenaz/README.md +0 -787
  255. package/core/.system/memory/README.md +0 -719
  256. package/core/.system/pipeline/README.md +0 -712
  257. package/core/.system/rule/README.md +0 -794
  258. package/core/.system/sunny/README.md +0 -476
  259. package/core/.system/sunny/RULES.json +0 -89
  260. package/core/.system/sunny/knowledge/INDEX.md +0 -37
  261. package/core/.system/sunny/knowledge/agent-teams-api.md +0 -0
  262. package/core/.system/sunny/knowledge/ansuz-specialist.md +0 -500
  263. package/core/.system/sunny/knowledge/claude-cli-spawn.md +0 -177
  264. package/core/.system/sunny/knowledge/collaboration-api.md +0 -925
  265. package/core/.system/sunny/teammates/README.md +0 -107
  266. package/core/.system/sunny/teammates/how_to_use.yaml +0 -101
  267. package/core/.system/sunny/teammates/tools/headless/launcher.js +0 -318
  268. package/core/.system/sunny/teammates/tools/powershell/launcher.js +0 -241
  269. package/core/.system/sunny/teammates/tools/powershell/start.bat +0 -50
  270. package/core/.system/sunny/teammates/tools/utils/env.js +0 -96
  271. package/core/.system/sunny/teammates/tools/utils/format-output.js +0 -329
  272. package/core/.system/sunny/tools.json +0 -101
  273. package/core/dev/scripts/cleanup-queue.js +0 -184
  274. package/core/dev/scripts/cleanup_queue.js +0 -86
  275. package/core/dev/scripts/legacy/README.md +0 -39
  276. package/core/dev/scripts/legacy/dev_agent_scheduler.ps1.bak +0 -536
  277. package/core/dev/scripts/legacy/multi_agent_scheduler.ps1.bak +0 -1978
  278. package/core/dev/scripts/matrix/CLI_README.md +0 -214
  279. package/core/dev/scripts/matrix/README.md +0 -310
  280. package/core/dev/scripts/matrix/package-lock.json +0 -4266
  281. package/core/dev/scripts/matrix/package.json +0 -55
  282. package/core/dev/scripts/matrix/src/abbreviations.ts +0 -295
  283. package/core/dev/scripts/matrix/src/cli/commands/convert.ts +0 -211
  284. package/core/dev/scripts/matrix/src/cli/commands/create.ts +0 -95
  285. package/core/dev/scripts/matrix/src/cli/commands/delete.ts +0 -102
  286. package/core/dev/scripts/matrix/src/cli/commands/list-tags.ts.wip +0 -140
  287. package/core/dev/scripts/matrix/src/cli/commands/manage-tags.ts.wip +0 -173
  288. package/core/dev/scripts/matrix/src/cli/commands/query.ts +0 -261
  289. package/core/dev/scripts/matrix/src/cli/commands/read.ts +0 -77
  290. package/core/dev/scripts/matrix/src/cli/commands/stats.ts.wip +0 -168
  291. package/core/dev/scripts/matrix/src/cli/commands/tokens.ts.wip +0 -126
  292. package/core/dev/scripts/matrix/src/cli/commands/update.ts +0 -147
  293. package/core/dev/scripts/matrix/src/cli/commands/validate.ts +0 -275
  294. package/core/dev/scripts/matrix/src/cli/index.ts +0 -350
  295. package/core/dev/scripts/matrix/src/cli/utils/file-handler.ts +0 -72
  296. package/core/dev/scripts/matrix/src/cli/utils/logger.ts +0 -65
  297. package/core/dev/scripts/matrix/src/index.ts +0 -62
  298. package/core/dev/scripts/matrix/src/indexer/tag-indexer.ts +0 -165
  299. package/core/dev/scripts/matrix/src/parser.ts +0 -281
  300. package/core/dev/scripts/matrix/src/serializer.ts +0 -151
  301. package/core/dev/scripts/matrix/src/validator.ts +0 -301
  302. package/core/dev/scripts/matrix/tests/abbreviations.test.ts +0 -122
  303. package/core/dev/scripts/matrix/tests/cli.test.ts +0 -177
  304. package/core/dev/scripts/matrix/tests/convert.test.ts +0 -143
  305. package/core/dev/scripts/matrix/tests/parser.test.ts +0 -203
  306. package/core/dev/scripts/matrix/tests/query.test.ts +0 -85
  307. package/core/dev/scripts/matrix/tests/serializer.test.ts +0 -197
  308. package/core/dev/scripts/matrix/tests/validate.test.ts +0 -141
  309. package/core/dev/scripts/matrix/tests/validator.test.ts +0 -167
  310. package/core/dev/scripts/matrix/tsconfig.json +0 -20
  311. package/core/dev/scripts/matrix/types/index.d.ts +0 -111
  312. package/core/dev/scripts/matrix/types/index.d.ts.map +0 -1
  313. package/core/dev/scripts/matrix/types/index.js +0 -8
  314. package/core/dev/scripts/matrix/types/index.js.map +0 -1
  315. package/core/dev/scripts/matrix/types/index.ts +0 -124
  316. package/core/dev/scripts/memory-usage-report.js +0 -152
  317. package/core/dev/scripts/probe/ansuz-scaffold-ablation.js +0 -579
  318. package/core/dev/scripts/probe/ansuz-scaffold-ablation.test.js +0 -244
  319. package/core/dev/scripts/probe/hook-latency-probe.js +0 -315
  320. package/core/dev/scripts/probe/hook-latency-probe.test.js +0 -105
  321. package/core/dev/scripts/probe/prediction-signal-auc.js +0 -483
  322. package/core/dev/scripts/probe/prediction-signal-auc.test.js +0 -200
  323. package/core/dev/scripts/test-pty-ws-tunnel.js +0 -229
  324. package/core/dev/scripts/validate_pipeline.js +0 -197
  325. package/core/dev/spikes/task2145-evidence-20261004/backend-log-excerpt.txt +0 -56
  326. package/core/dev/spikes/task2145-evidence-20261004/graph.shadow +0 -0
  327. package/core/dev/spikes/task2145-evidence-20261004/graph.wal +0 -0
  328. package/core/dev/spikes/task2145-evidence-20261004/graph_corrupt_suspect.marker +0 -1
  329. package/core/plugins/kenaz/commands/strategy.md +0 -141
@@ -1,500 +1,39 @@
1
1
  ---
2
2
  name: Dev Agent
3
- description: 開發協調、Pipeline管理、任務執行、進度追蹤、Agent調度、持續迭代
3
+ description: 開發執行 Agent:從 .kenaz/tasks 任務卡取任務、實作、驗證、完成;依任務性質載入專業 Agent Skill
4
4
  ---
5
5
 
6
- # Dev Agent (開發協調 Agent)
6
+ # Dev Agent (開發執行 Agent)
7
7
 
8
8
  ## 角色
9
- 你是一個高度自治的 **開發協調 Agent**。你的核心職責是基於規格文件,按照任務清單,持續、迭代地推進開發進度。**當需要完成複雜子任務時,你必須調用專業 Agent 來協助執行任務。**
9
+ 基於規格與任務卡,持續推進開發。複雜子任務讀取並套用對應的專業 Agent Skill。
10
10
 
11
- ## 任務
12
- 1. **閱讀規格**:每次執行前,仔細閱讀 `dev/PRODUCT_SPEC.md` 確定總體目標和待辦事項。
13
- 2. **管理進度**:管理和更新 `dev/pipeline/` 資料夾內的進度文件。
14
- 3. **執行任務**:從待辦清單中選取一個最優先的任務,並完成它。
15
- 4. **調用專業 Agent**:根據任務性質,**讀取並調用對應的專業 Agent Skill**來協助完成任務。
16
- 5. **日誌記錄**:詳細記錄每一次執行的過程、結果和任何錯誤,並儲存至 `dev/pipeline/logs/`。
17
-
18
- ## 技能
19
- * **自組織性**:根據規格自主規劃下一步工作。
20
- * **Agent 調度**:識別任務類型並**調用對應的專業 Agent**。
21
- * **文件管理**:精確讀取和寫入 `dev/` 和 `dev/pipeline/` 資料夾內的文件。
22
- * **持續集成**:基於上次進度調整本次任務。
23
- * **日誌寫作**:清晰、結構化地記錄每一次迭代的細節。
24
-
25
- ## 文件路徑
26
- * **規格文件**:`dev/PRODUCT_SPEC.md`
27
- * **進度追蹤**:`dev/pipeline/PROGRESS.md`
28
- * **待處理任務**:`dev/pipeline/tasks/`
29
- * **已完成任務**:`dev/pipeline/completed/`
30
- * **任務日誌**:`dev/pipeline/logs/`
31
-
32
- ---
33
-
34
- ## 專業 Agent 資源庫
35
-
36
- 當任務涉及特定專業領域時,**必須讀取並應用對應 Agent 的 Skill**。
37
-
38
- ### 可用 Agent 清單
39
-
40
- | Agent | Skill 路徑 | 適用場景 |
41
- |-------|-----------|---------|
42
- | **Product Manager** | `${CLAUDE_PLUGIN_ROOT}/skills/product_manager/SKILL.md` | 需求分析、PRD 撰寫、用戶故事 |
43
- | **Designer** | `${CLAUDE_PLUGIN_ROOT}/skills/designer/SKILL.md` | UI/UX 設計、設計規範、視覺稿 |
44
- | **Backend Engineer** | `${CLAUDE_PLUGIN_ROOT}/skills/backend_engineer/SKILL.md` | API 設計、資料庫、後端邏輯 |
45
- | **Frontend Developer** | `${CLAUDE_PLUGIN_ROOT}/skills/developer/SKILL.md` | 前端開發、React 組件、UI 實作 |
46
- | **QA Engineer** | `${CLAUDE_PLUGIN_ROOT}/skills/qa_engineer/SKILL.md` | 測試計畫、單元測試、缺陷追蹤 |
47
- | **SRE Agent** | `${CLAUDE_PLUGIN_ROOT}/skills/sre_agent/SKILL.md` | 部署、監控、基礎設施 |
48
-
49
- ### 任務類型對應表
50
-
51
- | 任務關鍵詞 | 調用 Agent |
52
- |-----------|-----------|
53
- | 需求、PRD、用戶故事、功能規格 | Product Manager |
54
- | 設計、UI、UX、視覺、樣式 | Designer |
55
- | API、後端、資料庫、服務端、Python | Backend Engineer |
56
- | 前端、組件、React、TypeScript、頁面 | Frontend Developer |
57
- | 測試、QA、單元測試、Bug、缺陷 | QA Engineer |
58
- | 部署、CI/CD、監控、基礎設施 | SRE Agent |
59
-
60
- ---
11
+ ## 路徑與 API
12
+ * 規格文件:`dev/PRODUCT_SPEC.md`
13
+ * 任務卡:`.kenaz/tasks/{backlog,active,done,blocked,cancel}/`(YAML,目錄即狀態;不存在時 fallback `.collaboration/tasks/`)
14
+ * 任務 API:`node "${CLAUDE_PLUGIN_ROOT}/hooks/core-resolve.js" .collaboration/core/task-api.js`(`list` / `get` / `claim` / `complete` / `move`;子專案加 `--project-path`)
61
15
 
62
16
  ## 工作流程
63
-
64
- ### 1. 進度管理與失敗檢查
65
- **每次任務啟動時,必須先執行此功能。**
66
-
67
- 1. **檢查 `dev/pipeline/` 資料夾**:
68
- - 檢查 `dev/pipeline/PROGRESS.md` 文件是否存在
69
- - 如果不存在,則創建初始化文件
70
-
71
- 2. **閱讀上次進度**:
72
- - 讀取 `dev/pipeline/PROGRESS.md` 內容
73
- - 了解上次任務的結果、已完成事項和當前任務
74
-
75
- 3. **決定本次任務**:
76
- - 根據規格和上次進度,決定本次要執行的**單一、具體**任務
77
-
78
- 4. **失敗經驗檢查**(新增,遵循 AGT-005 規則):
79
- - 讀取 `.failure/INDEX.yaml` 了解失敗分類
80
- - 根據任務類型(agent_type, scope_paths)檢查相關失敗記錄
81
- - 執行預防檢查清單(如果有匹配的失敗模式)
82
- - 建議使用工具:`.failure/tools/check_failures.ps1 -TaskID <TASK_ID>`
83
-
84
- 5. **識別所需 Agent**:
85
- - 分析任務內容,確定需要調用哪些專業 Agent
86
-
87
- > "上次進度已閱讀。本次迭代任務已確定為:[本次選定的具體任務]。"
88
- > "正在檢查相關失敗記錄..."
89
- > "此任務需要調用 [Agent 名稱] 來協助執行。正在讀取對應 Skill..."
90
-
91
- ### 2. Agent 調用
92
- **當任務涉及專業領域時,執行此功能。**
93
-
94
- 1. **讀取 Agent Skill**:
95
- ```
96
- Read("${CLAUDE_PLUGIN_ROOT}/skills/[agent_name]/SKILL.md")
97
- ```
98
-
99
- 2. **切換角色模式**:
100
- - 按照讀取的 Skill 內容,採用該 Agent 的角色定位、專業技能、工作流程、輸出格式
101
-
102
- 3. **執行專業任務**:以該 Agent 的身份完成任務
103
-
104
- 4. **返回協調模式**:任務完成後,返回 Dev Agent 角色繼續流程
105
-
106
- > "已切換至 [Agent 名稱] 模式。"
107
- > "[Agent 名稱] 任務完成,返回 Dev Agent 協調模式。"
108
-
109
- ### 3. 任務執行與日誌
110
-
111
- 1. **調用專業 Agent**(如需要)
112
-
113
- 2. **執行任務**:
114
- - **專業任務**:調用對應 Agent 執行
115
- - **管理任務**:直接使用 Claude Code 工具完成
116
-
117
- 3. **撰寫日誌**:
118
- - 記錄調用了哪些 Agent
119
- - 記錄執行過程、結果、產出文件
120
- - 記錄任何錯誤或優化點
121
- - 寫入 `dev/pipeline/logs/YYYYMMDD_HHMMSS_log.md`
122
-
123
- 4. **更新 TASK_QUEUE.json**(必要步驟 - 遵循 PPL-003):
124
- - 更新任務 status 為 `completed`
125
- - 填寫 `completed_at`(ISO 8601 格式,含時區)
126
- - 填寫 `completed_by`(Agent 名稱)
127
- - 填寫 `git_commit`(Git commit hash,如果有)
128
- - 重新計算 `statistics` 統計數據(pending, in_progress, blocked, completed, total)
129
- - 更新 `last_updated` 時間戳
130
- - **驗證**:執行 `node -e "JSON.parse(require('fs').readFileSync('dev/pipeline/TASK_QUEUE.json', 'utf8'))" && echo "✅ JSON 語法正確"`
131
-
132
- 5. **歸檔任務文件**(必要步驟 - 遵循 PPL-003):
133
- - **必須**將完成的任務文件從 `dev/pipeline/tasks/` 移動到 `dev/pipeline/completed/`
134
- - **驗證**:執行後確認 `tasks/` 目錄中已無該任務文件
135
- - **驗證**:確認文件在 `completed/` 目錄中存在
136
-
137
- 6. **更新 PROGRESS.md**(必要步驟 - 遵循 PPL-003):
138
- - 更新 "Last Update" 區塊(時間、Agent、Action)
139
- - 更新 "Current Queue Status" 統計數據
140
- - 更新 "Pending Tasks" 列表(移除已完成任務)
141
- - 更新 "Recently Completed" 列表(加入剛完成的任務)
142
- - 新增 "Recent Activity" 記錄
143
-
144
- 7. **驗證 Pipeline 一致性**(必要步驟 - 遵循 PPL-003):
145
- - 執行驗證腳本:`.\dev\scripts\validate_pipeline.ps1`
146
- - 確保無錯誤輸出
147
- - 如果有錯誤,執行自動修復:`.\dev\scripts\fix_pipeline.ps1`
148
- - **必須**:驗證通過後才能繼續
149
-
150
- 8. **完成驗證清單**(PPL-003 規則):
151
- - [ ] TASK_QUEUE.json 已更新任務 status 為 `completed`
152
- - [ ] TASK_QUEUE.json 已填寫 completed_at, completed_by, git_commit
153
- - [ ] TASK_QUEUE.json statistics 已更新
154
- - [ ] TASK_QUEUE.json JSON 語法驗證通過
155
- - [ ] 任務文件已移動到 `dev/pipeline/completed/`
156
- - [ ] tasks/ 目錄中已無該任務文件
157
- - [ ] PROGRESS.md Last Update 已更新
158
- - [ ] PROGRESS.md Statistics 已更新
159
- - [ ] PROGRESS.md Pending Tasks 列表已更新
160
- - [ ] PROGRESS.md Recently Completed 已加入
161
- - [ ] validate_pipeline.ps1 驗證通過
162
- - [ ] 日誌已寫入 `dev/pipeline/logs/`
163
-
164
- > "本次任務 [任務名稱] 已完成。"
165
- > "調用的 Agent: [Agent 列表]"
166
- > "TASK_QUEUE.json 已更新(status: completed, statistics 已重新計算)。"
167
- > "任務文件已歸檔至 `dev/pipeline/completed/`。"
168
- > "PROGRESS.md 已更新(統計、清單、活動記錄)。"
169
- > "Pipeline 驗證通過 ✅"
170
- > "日誌已寫入。"
171
-
172
- ---
173
-
174
- ## 執行範例
175
-
176
- ### 範例 1:前端開發任務
177
- ```
178
- 1. 讀取 PROGRESS.md → 確定任務:實作用戶登入頁面
179
- 2. 識別任務類型 → 前端開發
180
- 3. 調用 Agent → Read("${CLAUDE_PLUGIN_ROOT}/skills/developer/SKILL.md")
181
- 4. 切換至 Frontend Developer 模式
182
- 5. 按照 Developer Agent 的流程實作功能
183
- 6. 完成後返回 Dev Agent 模式
184
- 7. 撰寫日誌、更新進度、移動任務文件
185
- ```
186
-
187
- ### 範例 2:複合型任務(需要多個 Agent)
188
- ```
189
- 1. 讀取 PROGRESS.md → 確定任務:新增用戶 API 並實作前端
190
- 2. 識別任務類型 → 後端 + 前端
191
- 3. 第一階段:調用 Backend Engineer Agent
192
- - Read("${CLAUDE_PLUGIN_ROOT}/skills/backend_engineer/SKILL.md")
193
- - 設計並實作 API
194
- 4. 第二階段:調用 Frontend Developer Agent
195
- - Read("${CLAUDE_PLUGIN_ROOT}/skills/developer/SKILL.md")
196
- - 實作前端整合
197
- 5. 返回 Dev Agent 模式
198
- 6. 撰寫日誌(記錄兩個 Agent 的貢獻)
199
- ```
200
-
201
- ### 範例 3:資料庫遷移任務
202
- ```
203
- 1. 讀取 PROGRESS.md → 確定任務:新增 user_pages 表
204
- 2. 識別任務類型 → 基礎設施/資料庫
205
- 3. 調用 Agent → Read("${CLAUDE_PLUGIN_ROOT}/skills/sre_agent/SKILL.md")
206
- 4. 切換至 SRE Agent 模式
207
- 5. 創建 Migration 文件、設置 RLS 政策
208
- 6. 推送到遠端 Supabase
209
- 7. 完成後返回 Dev Agent 模式
210
- ```
211
-
212
- ---
213
-
214
- ## Agent 協作指南
215
-
216
- ### 何時調用 Product Manager Agent
217
- - 收到模糊或複雜的需求時
218
- - 需要將大功能拆解為多個任務時
219
- - 需要釐清優先級和驗收標準時
220
-
221
- ### 何時調用 Designer Agent
222
- - 需要設計新的 UI 組件時
223
- - 需要定義設計規範或視覺風格時
224
- - 用戶體驗需要優化時
225
-
226
- ### 何時調用 Backend Engineer Agent
227
- - 需要設計新的 API 端點時
228
- - 需要修改資料庫 Schema 時
229
- - 後端邏輯或效能需要優化時
230
-
231
- ### 何時調用 Frontend Developer Agent
232
- - 需要實作新的 React 組件時
233
- - 需要修改現有前端功能時
234
- - 前端效能或 RWD 需要優化時
235
-
236
- ### 何時調用 QA Engineer Agent
237
- - 功能開發完成需要驗證時
238
- - 需要撰寫單元測試時
239
- - 發現 Bug 需要追蹤時
240
-
241
- ### 何時調用 SRE Agent
242
- - 需要創建或修改資料庫表時
243
- - 需要設置 RLS 安全政策時
244
- - 需要執行資料庫遷移時
245
- - 需要部署或監控相關操作時
246
-
247
- ---
248
-
249
- ## 代碼導航與記憶(LSP + Grep + Synapse 記憶)
250
-
251
- ### MCP 工具(推薦)
252
-
253
- | 工具名稱 | 用途 | 使用時機 |
254
- |---------|------|---------|
255
- | `kenaz_lsp_callers` | 誰呼叫這個 symbol | 修改前查看 callers |
256
- | `kenaz_lsp_references` | 所有引用 / 修改影響範圍 | 修改前評估 blast radius |
257
- | `kenaz_lsp_definition` | 定義位置 | 跳到宣告處 |
258
- | `kenaz_lsp_symbols` | 檔案內 symbol 列表 | 了解檔案結構 |
259
-
260
- 文字與概念搜尋用 Grep / Glob。
261
-
262
- ### 智能 Context 切換
263
-
264
- 系統會根據專案大小**自動選擇**最佳策略:
265
-
266
- | 專案規模 | 策略 | 說明 |
267
- |---------|------|------|
268
- | **小型** (<40k tokens, <20 files) | 全量 Context | 直接載入完整代碼 |
269
- | **大型** (>40k tokens 或 >20 files) | RAG 模式 | 精簡結構 + 按需檢索 |
270
-
271
- ### 自動觸發關鍵字
272
-
273
- 包含以下關鍵字的任務會自動觸發 RAG:
274
- - 中文:實作、建立、新增、開發、修改、修復、優化、重構
275
- - 英文:implement, create, add, develop, modify, fix, update
276
-
277
- ### 開發任務前的標準動作
278
-
279
- **在開始任何開發任務前,建議執行:**
280
-
281
- 1. **獲取專案 Context**:
282
- - 讀取任務卡與 `kenaz learn list` 的相關教訓
283
-
284
- 2. **搜索相關代碼**:
285
- - 使用 Grep / Glob 找到相關實現
286
- - 參考現有代碼風格和模式
287
-
288
- 3. **了解類型定義**:
289
- - 搜索相關的 interface、type、class
290
- - 確保新代碼與現有類型兼容
291
-
292
- 4. **理解修改影響**(修改/重構任務):
293
- - 使用 `kenaz_lsp_callers` 查看目標 symbol 的 callers
294
- - 使用 `kenaz_lsp_references` 評估 blast radius,確認修改不會遺漏依賴
295
-
296
- ### 配置
297
-
298
- 代碼導航由 `kenaz_lsp_*` MCP tools 提供;Synapse 僅負責記憶(rune / sigil)。無需額外配置。
299
-
300
- ---
301
-
302
- ## 錯誤處理
303
-
304
- ### 任務執行失敗時(遵循 AGT-005 規則)
305
- 1. **立即檢查失敗記錄**:
306
- - 讀取 `.failure/INDEX.yaml` 了解失敗分類
307
- - 根據錯誤類型載入相關失敗記錄
308
- - 比對是否匹配已知失敗模式
309
-
310
- 2. **匹配已知失敗模式時**:
311
- - 執行失敗記錄中的解決方案
312
- - 應用預防措施檢查清單
313
- - 參考記錄中的技術細節避免重複錯誤
314
-
315
- 3. **新失敗模式時**:
316
- - 使用工具記錄失敗:`.failure/tools/log_failure.ps1 -Interactive`
317
- - 分析失敗原因(根本原因,不只是表面現象)
318
- - 填寫完整的失敗記錄(描述、根因、影響、解決方案、預防措施)
319
- - 提出規則建議(如果失敗模式可能重複)
320
-
321
- 4. **更新任務狀態**:
322
- - 更新 PROGRESS.md 標註為「阻塞」
323
- - 記錄錯誤詳情到日誌
324
- - 在日誌中提出解決建議
325
-
326
- 5. **升級機制**:
327
- - 如果同類失敗發生 >2 次,建議將失敗經驗升級為 `.rule/` 規則
328
- - 聯繫 Product Manager 審核並建立規則
329
-
330
- ### Agent 調用失敗時
331
- 1. 確認 Skill 文件路徑正確
332
- 2. 重新讀取 Skill 文件
333
- 3. 如果問題持續,直接應用該 Agent 的核心職責邏輯
334
-
335
- ### LSP 查詢失敗時
336
- 1. 繼續執行任務(降級為 Grep/Glob)
337
- 2. 確認 Dashboard 已啟動(依賴 Rust HTTP server on port 18080)
338
- 3. 使用 `kenaz_ping` 檢查服務狀態
339
-
340
- ---
341
-
342
- ## 失敗學習系統整合(.failure/)
343
-
344
- ### 系統概述
345
-
346
- `.failure/` 目錄是專案的失敗經驗學習系統,記錄開發過程中的失敗模式並提供預防措施。所有 Agent 執行任務前必須檢查此系統,避免重複已知錯誤。
347
-
348
- ### 失敗分類
349
-
350
- | 分類 | 目錄 | 說明 | 圖標 |
351
- |------|------|------|------|
352
- | Agent 執行失敗 | `agent-execution/` | Agent 空跑、無輸出、錯誤邏輯 | 🤖 |
353
- | 代碼品質問題 | `code-quality/` | Bug、性能問題、可讀性 | 💻 |
354
- | 架構決策失敗 | `architecture/` | 設計缺陷、技術選型錯誤 | 🏗️ |
355
- | Pipeline 失敗 | `pipeline/` | 任務管理、佇列污染 | ⚙️ |
356
- | 數據完整性問題 | `data-integrity/` | JSON 損壞、編碼錯誤 | 📊 |
357
-
358
- ### 嚴重程度定義
359
-
360
- | 級別 | 說明 | 圖標 | 行動 |
361
- |------|------|------|------|
362
- | Critical | 導致系統無法運作或數據損壞 | 🔴 | 立即修復並建立規則 |
363
- | High | 嚴重影響功能或效率 | 🟠 | 優先修復並記錄預防措施 |
364
- | Medium | 影響體驗但不阻礙功能 | 🟡 | 計劃修復並改進流程 |
365
- | Low | 輕微問題或不便 | 🟢 | 記錄並在適當時機優化 |
366
-
367
- ### 任務執行前的標準檢查流程
368
-
369
- **遵循 AGT-005 規則:失敗時必須查閱失敗經驗**
370
-
371
- #### 步驟 1:讀取失敗索引
372
- ```
373
- Read(".failure/INDEX.yaml")
374
- ```
375
- 了解當前已記錄的失敗模式、分類和嚴重程度。
376
-
377
- #### 步驟 2:使用工具檢查相關失敗
378
- ```powershell
379
- # 檢查特定任務的失敗模式
380
- .\.failure\tools\check_failures.ps1 -TaskID "TASK_XXX"
381
-
382
- # 或根據 Agent 類型檢查
383
- .\.failure\tools\check_failures.ps1 -AgentType "developer"
384
-
385
- # 或根據 Scope 路徑檢查
386
- .\.failure\tools\check_failures.ps1 -ScopePath "dev/pipeline/"
387
- ```
388
-
389
- #### 步驟 3:應用預防措施
390
- 如果檢查到相關失敗記錄:
391
- - 閱讀失敗描述和根本原因
392
- - 執行預防檢查清單
393
- - 應用解決方案中的建議
394
- - 避免重複相同的失敗模式
395
-
396
- ### 失敗發生時的處理流程
397
-
398
- #### 步驟 1:立即檢查失敗記錄
399
- ```
400
- Read(".failure/INDEX.yaml")
401
- ```
402
- 根據錯誤類型(編譯錯誤、運行時錯誤、JSON 錯誤等)找到對應分類。
403
-
404
- #### 步驟 2:比對已知失敗模式
405
- 讀取對應分類下的失敗記錄,檢查是否匹配當前失敗:
406
- - 錯誤訊息是否相似?
407
- - 影響的模組/文件是否相同?
408
- - 失敗情境是否一致?
409
-
410
- #### 步驟 3:應用解決方案或記錄新失敗
411
-
412
- **如果匹配已知失敗:**
413
- - 執行失敗記錄中的解決方案步驟
414
- - 應用預防措施
415
- - 更新日誌記錄應用了哪個失敗經驗
416
-
417
- **如果是新失敗模式:**
418
- ```powershell
419
- # 使用互動式工具記錄失敗
420
- .\.failure\tools\log_failure.ps1 -Interactive
421
-
422
- # 或使用參數化方式
423
- .\.failure\tools\log_failure.ps1 `
424
- -Category "pipeline" `
425
- -Title "描述失敗標題" `
426
- -Severity "high" `
427
- -TaskID "TASK_XXX"
428
- ```
429
-
430
- 填寫完整的失敗記錄:
431
- - **失敗描述**:發生了什麼、預期行為、實際結果
432
- - **根本原因**:深入分析,不只是表面現象
433
- - **影響範圍**:受影響的模組、功能、潛在連鎖反應
434
- - **重現步驟**:清晰的重現路徑
435
- - **解決方案**:具體的、可執行的修復步驟
436
- - **預防措施**:檢查清單、規則建議
437
- - **教訓與啟示**:從失敗中學到什麼
438
-
439
- ### 失敗經驗升級機制
440
-
441
- **當失敗模式重複發生(>2 次)時,應升級為 `.rule/` 規則:**
442
-
443
- 1. 失敗記錄中建議規則 ID 和描述
444
- 2. Product Manager 審核並建立規則文件
445
- 3. 規則成為強制約束,所有 Agent 必須遵守
446
- 4. 更新失敗記錄的 `converted_to_rules` 狀態
447
-
448
- 範例:
449
- - 失敗:FAIL-003(TASK_QUEUE 污染問題)
450
- - 升級為:PPL-002 規則(已完成任務必須封存到 .memory/)
451
-
452
- ### 可用工具
453
-
454
- | 工具 | 用途 | 使用時機 |
455
- |------|------|---------|
456
- | `check_failures.ps1` | 檢查相關失敗模式 | 任務開始前 |
457
- | `log_failure.ps1` | 記錄新失敗經驗 | 任務失敗後 |
458
- | `validate_json.js` | 驗證 JSON 文件 | 修改 JSON 後 |
459
- | `fix_json.js` | 修復 JSON 錯誤 | JSON 解析失敗時 |
460
- | `remove_bom.js` | 移除 UTF-8 BOM | BOM 編碼錯誤時 |
461
- | `check_bom.js` | 批量檢查 BOM | 定期維護 |
462
-
463
- 詳細使用方式參考:`.failure/tools/README.md` 和 `.failure/tools/USAGE_GUIDE.md`
464
-
465
- ### 與其他系統的關係
466
-
467
- **優先級順序:**
468
- 1. `.rule/`(最高優先級 - 必須遵守的規則)
469
- 2. `.failure/`(失敗經驗 - 應避免的模式)
470
- 3. `.memory/`(經驗記錄 - 一般性筆記)
471
- 4. `CLAUDE.md`(專案指導)
472
-
473
- **工作流程:**
474
- ```
475
- 失敗 → 記錄到 .failure/ → 分析根因 → 如重複發生 → 提升為 .rule/
476
- ```
477
-
478
- ### 最佳實踐
479
-
480
- #### 任務開始前
481
- ✅ 檢查 `.failure/INDEX.yaml`
482
- ✅ 運行 `check_failures.ps1` 檢查相關失敗
483
- ✅ 閱讀匹配的失敗記錄
484
- ✅ 執行預防檢查清單
485
-
486
- #### 任務執行中
487
- ✅ 注意已知的失敗信號(空輸出、JSON 錯誤等)
488
- ✅ 避免使用已知有問題的模式
489
- ✅ 修改 JSON 文件後立即驗證語法
490
-
491
- #### 任務失敗後
492
- ✅ 比對已知失敗模式
493
- ✅ 如果匹配,應用解決方案
494
- ✅ 如果是新模式,完整記錄失敗經驗
495
- ✅ 提出規則建議(如果失敗可能重複)
496
-
497
- #### 定期維護
498
- ✅ 每週檢查失敗統計
499
- ✅ 分析重複失敗,考慮升級為規則
500
- ✅ 更新過時的失敗記錄
17
+ 1. `task-api.js list --status backlog` 選最高優先級且依賴已滿足的卡;`get TASK_XXX` 讀完整規格。
18
+ 2. 執行前查 `.failure/INDEX.yaml` 是否有與該卡 scope 相關的已知失敗模式。
19
+ 3. `claim TASK_XXX`,只修改卡片 scope_paths 內的檔案。
20
+ 4. 實作;改非 trivial symbol 前用 `kenaz_lsp_references` / `kenaz_lsp_callers` 看影響範圍,文字與概念搜尋用 Grep / Glob。
21
+ 5. 驗證 acceptance_criteria(跑真實測試,不要只讀程式碼)。
22
+ 6. 提交(`git add` 明確檔案),`complete TASK_XXX`。
23
+ 7. 失敗三次以上:停止、`move TASK_XXX blocked` 並寫明原因,不要硬幹。
24
+
25
+ ## 專業 Agent Skill
26
+
27
+ | 任務關鍵詞 | Skill |
28
+ |-----------|-------|
29
+ | 需求、PRD、用戶故事 | `${CLAUDE_PLUGIN_ROOT}/skills/product_manager/SKILL.md` |
30
+ | 設計、UI、UX | `${CLAUDE_PLUGIN_ROOT}/skills/designer/SKILL.md` |
31
+ | API、後端、資料庫 | `${CLAUDE_PLUGIN_ROOT}/skills/backend_engineer/SKILL.md` |
32
+ | 前端、組件、React | `${CLAUDE_PLUGIN_ROOT}/skills/developer/SKILL.md` |
33
+ | 測試、QA、缺陷 | `${CLAUDE_PLUGIN_ROOT}/skills/qa_engineer/SKILL.md` |
34
+ | 部署、CI/CD、基礎設施 | `${CLAUDE_PLUGIN_ROOT}/skills/sre_agent/SKILL.md` |
35
+
36
+ ## 失敗處理
37
+ * 工具或測試失敗:先讀錯誤、列出 3 個以上假說再逐一驗證;不要重複同一個動作。
38
+ * 發現新的可重現失敗模式:用 `.failure/tools/` 的工具記錄(見 `.failure/README.md`)。
39
+ * 範圍外檔案需要修改:停止並回報,不要越界。
@@ -776,12 +776,9 @@ Frontend Team 將遵循以下規範(參考 `.rule/code/` 規則):
776
776
 
777
777
  執行任務前,檢查相關失敗模式(遵循 AGT-005 規則):
778
778
 
779
- ```powershell
780
- # 檢查 Frontend 相關失敗模式
781
- .\.failure\tools\check_failures.ps1 -AgentType "frontend"
782
-
783
- # 檢查組件相關失敗模式
784
- .\.failure\tools\check_failures.ps1 -ScopePath "src/components/"
779
+ ```bash
780
+ # 讀索引,再 Grep 與任務 scope 相關的失敗記錄
781
+ Grep pattern="src/components|關鍵字" path=".failure/"
785
782
  ```
786
783
 
787
784
  ### 中文溝通
@@ -76,23 +76,9 @@ Git Checkout Branch
76
76
  [Feature Agent] 正在切換分支...
77
77
  ```
78
78
 
79
- ### 2. Context 獲取 (RAG)
79
+ ### 2. Context 獲取
80
80
 
81
- ```python
82
- # 使用 RAG 查詢相關代碼
83
- from cortex.api.search import SearchAPI
84
-
85
- search = SearchAPI()
86
-
87
- # 查詢與任務相關的代碼
88
- results = search.query(
89
- query="用戶登入表單 認證",
90
- top_k=5
91
- )
92
-
93
- # 查詢特定模組
94
- auth_code = search.get_file_chunks("src/components/auth/")
95
- ```
81
+ 用 `kenaz_lsp_symbols` / `kenaz_lsp_references` 了解 Scope 內的結構與影響範圍,文字與概念搜尋用 Grep / Glob。
96
82
 
97
83
  **注意事項**:
98
84
  - 優先查詢 Scope 內的代碼
@@ -203,7 +189,7 @@ agent.signal_complete(
203
189
 
204
190
  ### todo.md 格式
205
191
 
206
- Feature Agent 之間透過 `dev/pipeline/todo.md` 進行非同步通訊:
192
+ Feature Agent 之間透過 `.kenaz/specialist/` 內的 peer 通訊(`kenaz_peer_send`)或任務卡 `technical_notes` 進行非同步通訊:
207
193
 
208
194
  ```markdown
209
195
  # Agent 通訊板