kenaz 0.3.18 → 0.3.19

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 (308) 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__/m1-hmap-convid.test.js +1 -124
  30. package/core/.formation/tools/dispatch.js +1 -1
  31. package/core/.formation/tools/loader.js +17 -140
  32. package/core/.formation/tools/post-complete.js +0 -31
  33. package/core/.rule/INDEX.yaml +0 -18
  34. package/core/.rule/general/agent-workflow.yaml +14 -164
  35. package/core/.rule/general/project-self-containment.yaml +8 -19
  36. package/core/.rule/general/rust-verify-target.yaml +6 -5
  37. package/core/.rule/general/synapse-code-intelligence.yaml +3 -3
  38. package/core/.specialist/Amelia/capability.yaml +12 -12
  39. package/core/.specialist/Amelia/workflow.yaml +2 -2
  40. package/core/.specialist/Ansuz/SYSTEM_DOC.md +20 -578
  41. package/core/.specialist/Ansuz/cognitive_principles.yaml +2 -3
  42. package/core/.specialist/Ansuz/concepts/boot_rules_summary.yaml +0 -1
  43. package/core/.specialist/Ansuz/concepts/deep_knowledge_pointers.yaml +1 -2
  44. package/core/.specialist/Ansuz/core.yaml +6 -108
  45. package/core/.specialist/Ansuz/guards/lesson_guards.yaml +0 -3
  46. package/core/.specialist/Ansuz/identity_contract.yaml +0 -1
  47. package/core/.specialist/Ansuz/knowledge.yaml +0 -4
  48. package/core/.specialist/Ansuz/rule.yaml +0 -1
  49. package/core/.specialist/Ansuz/tools/handoff-session-identity.test.js +6 -150
  50. package/core/.specialist/tests/runtime-discovery/README.md +1 -1
  51. package/core/.specialist/tools/__tests__/task-2374-usage-counter.test.js +1 -12
  52. package/core/.specialist/tools/prompt-files.test.js +1 -0
  53. package/core/.specialist/tools/task-bridge.js +1 -66
  54. package/core/.system/README.md +11 -552
  55. package/core/.system/collaboration/README.md +10 -174
  56. package/core/CLAUDE.md +1 -6
  57. package/core/KENAZ_CORE_VERSION +1 -1
  58. package/core/dev/scripts/js-yaml-resolution.test.js +1 -1
  59. package/core/dev/scripts/run-rust-tests.js +9 -45
  60. package/core/dev/scripts/rust-verify-worktree.js +4 -4
  61. package/core/dev/scripts/verify-target-dir.js +6 -6
  62. package/core/plugins/kenaz/INVENTORY.md +8 -8
  63. package/core/plugins/kenaz/commands/architect.md +1 -2
  64. package/core/plugins/kenaz/commands/spec.md +1 -1
  65. package/core/plugins/kenaz/commands//347/224/242/345/223/201.md +1 -1
  66. package/core/plugins/kenaz/guidance.md +1 -1
  67. package/core/plugins/kenaz/scripts/sync.js +1 -1
  68. package/core/plugins/kenaz/skills/architect_agent/SKILL.md +11 -92
  69. package/core/plugins/kenaz/skills/assessment_agent/SKILL.md +0 -1
  70. package/core/plugins/kenaz/skills/backend_engineer/SKILL.md +3 -6
  71. package/core/plugins/kenaz/skills/code_reviewer/SKILL.md +1 -1
  72. package/core/plugins/kenaz/skills/code_reviewer/patterns.yaml +1 -1
  73. package/core/plugins/kenaz/skills/designer/SKILL.md +3 -6
  74. package/core/plugins/kenaz/skills/dev_agent/SKILL.md +30 -491
  75. package/core/plugins/kenaz/skills/developer/SKILL.md +3 -6
  76. package/core/plugins/kenaz/skills/feature_agent/SKILL.md +3 -17
  77. package/core/plugins/kenaz/skills/product_manager/SKILL.md +29 -1064
  78. package/core/plugins/kenaz/skills/qa_engineer/SKILL.md +12 -17
  79. package/core/plugins/kenaz/skills/spec_optimizer/SKILL.md +25 -275
  80. package/core/plugins/kenaz/skills/sre_agent/SKILL.md +3 -6
  81. package/package.json +6 -6
  82. package/core/.claude/commands/archive.md +0 -24
  83. package/core/.claude/commands/init.md +0 -112
  84. package/core/.claude/commands/legacy_dev.md +0 -18
  85. package/core/.claude/commands/product-review.md +0 -131
  86. package/core/.claude/commands/strategy.md +0 -141
  87. package/core/.claude/commands/sunny.md +0 -1
  88. package/core/.claude/commands//347/224/242/345/223/201/346/252/242/350/246/226.md +0 -129
  89. package/core/.claude/commands//351/200/262/345/272/246.md +0 -15
  90. package/core/.claude/hooks/__tests__/substrate.test.js +0 -122
  91. package/core/.claude/hooks/_substrate-paths.js +0 -95
  92. package/core/.claude/hooks/context-check.js +0 -51
  93. package/core/.claude/hooks/fatigue-check.js +0 -52
  94. package/core/.claude/hooks/handoff-snapshot-on-commit.js +0 -154
  95. package/core/.claude/hooks/handoff-snapshot-on-question.js +0 -158
  96. package/core/.claude/hooks/handoff-staleness.js +0 -197
  97. package/core/.claude/hooks/jev-thalamus-context.js +0 -17
  98. package/core/.claude/hooks/jev-thalamus-context.test.js +0 -41
  99. package/core/.claude/hooks/lease-release.js +0 -119
  100. package/core/.claude/hooks/lease-touch.js +0 -96
  101. package/core/.claude/hooks/reflex-feedback.js +0 -5
  102. package/core/.claude/hooks/session-init.ps1 +0 -49
  103. package/core/.claude/hooks/sound-event.js +0 -70
  104. package/core/.claude/hooks/sound-event.sh +0 -37
  105. package/core/.claude/hooks/stream-delta.js +0 -169
  106. package/core/.claude/no-hooks.settings.json +0 -3
  107. package/core/.claude/skills/legacy_dev/SKILL.md +0 -202
  108. package/core/.claude/skills/sunny/SKILL.md +0 -74
  109. package/core/.collaboration/cli/commands/assign.js +0 -39
  110. package/core/.collaboration/cli/commands/claim.js +0 -33
  111. package/core/.collaboration/cli/commands/complete.js +0 -44
  112. package/core/.collaboration/cli/commands/create.js +0 -110
  113. package/core/.collaboration/cli/commands/get.js +0 -83
  114. package/core/.collaboration/cli/commands/index.js +0 -52
  115. package/core/.collaboration/cli/commands/list.js +0 -51
  116. package/core/.collaboration/cli/commands/lock.js +0 -45
  117. package/core/.collaboration/cli/commands/rebuild.js +0 -39
  118. package/core/.collaboration/cli/commands/search.js +0 -61
  119. package/core/.collaboration/cli/commands/stats.js +0 -61
  120. package/core/.collaboration/cli/commands/transfer.js +0 -41
  121. package/core/.collaboration/cli/commands/unlock.js +0 -48
  122. package/core/.collaboration/cli/formatters/help-formatter.js +0 -70
  123. package/core/.collaboration/cli/formatters/index.js +0 -7
  124. package/core/.collaboration/cli/task-cli.js +0 -46
  125. package/core/.collaboration/cli/utils/arg-parser.js +0 -74
  126. package/core/.collaboration/cli/utils/git-user.js +0 -25
  127. package/core/.collaboration/cli/utils/index.js +0 -9
  128. package/core/.collaboration/cli/utils/output.js +0 -10
  129. package/core/.collaboration/config/default.yaml +0 -189
  130. package/core/.collaboration/core/conflict-resolver.js +0 -461
  131. package/core/.collaboration/core/conflict-resolver.test.js +0 -389
  132. package/core/.collaboration/core/migrate-legacy.js +0 -260
  133. package/core/.collaboration/docs/API.md +0 -787
  134. package/core/.collaboration/docs/ARCHITECTURE.md +0 -596
  135. package/core/.collaboration/docs/FAQ.md +0 -695
  136. package/core/.collaboration/docs/MIGRATION.md +0 -804
  137. package/core/.collaboration/docs/examples/README.md +0 -320
  138. package/core/.collaboration/docs/examples/advanced-queries.js +0 -261
  139. package/core/.collaboration/docs/examples/basic-usage.js +0 -184
  140. package/core/.collaboration/docs/examples/team-workflow.js +0 -352
  141. package/core/.failure/agent-execution/FAIL-001-agent-no-output.yaml +0 -391
  142. package/core/.failure/agent-execution/FAIL-007-pm-lead-wrong-team-invocation.yaml +0 -0
  143. package/core/.failure/agent-execution/FAIL-010-phase0-poem-format-skipped.yaml +0 -28
  144. package/core/.failure/agent-execution/FAIL-010-skipping-cognitive-checkpoint-after-verification.yaml +0 -59
  145. package/core/.failure/agent-execution/FAIL-012-grep-shortcut-during-investigation.yaml +0 -85
  146. package/core/.failure/architecture/FAIL-006-python-version-compatibility.yaml +0 -445
  147. package/core/.failure/pipeline/FAIL-003-queue-pollution.yaml +0 -335
  148. package/core/.failure/pipeline/README.md +0 -95
  149. package/core/.failure/retired/FAIL-009-skipping-synapse-pulse-before-code-change.yaml +0 -49
  150. package/core/.failure/tools/USAGE_GUIDE.md +0 -323
  151. package/core/.failure/tools/check_failures.ps1 +0 -387
  152. package/core/.failure/tools/log_failure.ps1 +0 -474
  153. package/core/.formation/.episode-input.json +0 -10
  154. package/core/.formation/.merge-lock +0 -1
  155. package/core/.formation/lead.yaml +0 -118
  156. package/core/.formation/legacy.bak/designer.yaml +0 -57
  157. package/core/.formation/legacy.bak/pm.yaml +0 -57
  158. package/core/.formation/legacy.bak/qa.yaml +0 -57
  159. package/core/.formation/legacy.bak/review.yaml +0 -62
  160. package/core/.formation/legacy.bak/scheduler.yaml +0 -129
  161. package/core/.formation/legacy.bak/sre.yaml +0 -57
  162. package/core/.formation/role-map.yaml +0 -274
  163. package/core/.formation/roles/_shared/modules/code_review.yaml +0 -98
  164. package/core/.formation/roles/_shared/modules/security.yaml +0 -103
  165. package/core/.formation/roles/_shared/modules/testing.yaml +0 -14
  166. package/core/.formation/roles/backend/role.yaml +0 -93
  167. package/core/.formation/roles/code_reviewer/role.yaml +0 -102
  168. package/core/.formation/roles/database_optimizer/role.yaml +0 -107
  169. package/core/.formation/roles/designer/role.yaml +0 -66
  170. package/core/.formation/roles/developer/role.yaml +0 -75
  171. package/core/.formation/roles/frontend/role.yaml +0 -134
  172. package/core/.formation/roles/incident_response/role.yaml +0 -89
  173. package/core/.formation/roles/qa/role.yaml +0 -89
  174. package/core/.formation/roles/security/role.yaml +0 -87
  175. package/core/.formation/roles/sre/role.yaml +0 -66
  176. package/core/.formation/skills/coordinator.yaml +0 -52
  177. package/core/.formation/solo/diagnosis.yaml +0 -78
  178. package/core/.formation/solo/strategy.yaml +0 -121
  179. package/core/.formation/tests/hello.txt +0 -2
  180. package/core/.formation/tools/coordinator.js +0 -350
  181. package/core/.formation/tools/jev-correction.js +0 -214
  182. package/core/.formation/tools/jev-correction.test.js +0 -178
  183. package/core/.formation/tools/log-reader.js +0 -232
  184. package/core/.formation/tools/revert-daemon-state.js +0 -162
  185. package/core/.formation/tools/test-drift.js +0 -148
  186. package/core/.formation/unit/heimdall.yaml +0 -96
  187. package/core/.formation/unit/plan.yaml +0 -67
  188. package/core/.formation/unit/think.yaml +0 -58
  189. package/core/.kenaz/MUNINN_SNAPSHOT9_EPISODE.json +0 -32
  190. package/core/.kenaz/MUNINN_SNAPSHOT9_RUNE.json +0 -23
  191. package/core/.kenaz/MUNINN_SNAPSHOT9_SUMMARY.md +0 -89
  192. package/core/.kenaz/ash_TASK_1428-20260507.json +0 -14
  193. package/core/.kenaz/muninn_episode_write.ps1 +0 -17
  194. package/core/.kenaz/muninn_snapshot11_rune_candidates.md +0 -63
  195. package/core/.kenaz/muninn_snapshot1_rune_candidates.md +0 -49
  196. package/core/.kenaz/runes_TASK_1428.json +0 -57
  197. package/core/.kenaz/tmp_heimdall_proposal_8d3e392.json +0 -13
  198. package/core/.kenaz/tmp_props.json +0 -1
  199. package/core/.kenaz/tmp_sounddrop_t1_prompt.txt +0 -371
  200. package/core/.rule/MECHANIZED.md +0 -61
  201. package/core/.rule/general/cortex-memory-recall.yaml +0 -446
  202. package/core/.rule/general/pipeline.yaml +0 -246
  203. package/core/.rule/general/sunny-access-control.yaml +0 -60
  204. package/core/.rule/general/system-invariants.yaml +0 -231
  205. package/core/.rule/pipeline/PPL-002-completed-task-archival.yaml +0 -528
  206. package/core/.rule/pipeline/auto-update.yaml +0 -282
  207. package/core/.rule/pipeline/task-execution.yaml +0 -365
  208. package/core/.specialist/Ansuz/concepts/phase_protocol.yaml +0 -65
  209. package/core/.specialist/Ansuz/experiments/boot_ablation_replay.js +0 -197
  210. package/core/.specialist/Ansuz/tools/bootstrap-anchors.js +0 -289
  211. package/core/.specialist/Ansuz/workflow.yaml +0 -1225
  212. package/core/.specialist/experiments/rg_benchmark.js +0 -523
  213. package/core/.specialist/experiments/rg_benchmark_results.json +0 -27
  214. package/core/.specialist/tools/jev-optional-context.js +0 -107
  215. package/core/.specialist/tools/jev-optional-context.test.js +0 -152
  216. package/core/.specialist/tools/memory-action-log.js +0 -839
  217. package/core/.specialist/tools/phase-gate.js +0 -3534
  218. package/core/.specialist/tools/phase-gate.test.js +0 -85
  219. package/core/.specialist/tools/precompute-runner.js +0 -444
  220. package/core/.specialist/tools/rule-engine.js +0 -621
  221. package/core/.specialist/tools/task-bridge-jev.test.js +0 -170
  222. package/core/.synapse/memory-shared.json.sync +0 -1
  223. package/core/.system/agent-skills/README.md +0 -724
  224. package/core/.system/cli-tools/README.md +0 -724
  225. package/core/.system/cortex/MODULES.md +0 -1046
  226. package/core/.system/dashboard/FRONTEND.md +0 -812
  227. package/core/.system/dashboard/README.md +0 -737
  228. package/core/.system/failure/README.md +0 -723
  229. package/core/.system/formation/LEGACY_SKILLS.md +0 -974
  230. package/core/.system/formation/POST_COMPLETE.md +0 -602
  231. package/core/.system/formation/README.md +0 -1094
  232. package/core/.system/formation/TOOLS_REFERENCE.md +0 -1145
  233. package/core/.system/kenaz/README.md +0 -787
  234. package/core/.system/memory/README.md +0 -719
  235. package/core/.system/pipeline/README.md +0 -712
  236. package/core/.system/rule/README.md +0 -794
  237. package/core/.system/sunny/README.md +0 -476
  238. package/core/.system/sunny/RULES.json +0 -89
  239. package/core/.system/sunny/knowledge/INDEX.md +0 -37
  240. package/core/.system/sunny/knowledge/agent-teams-api.md +0 -0
  241. package/core/.system/sunny/knowledge/ansuz-specialist.md +0 -500
  242. package/core/.system/sunny/knowledge/claude-cli-spawn.md +0 -177
  243. package/core/.system/sunny/knowledge/collaboration-api.md +0 -925
  244. package/core/.system/sunny/teammates/README.md +0 -107
  245. package/core/.system/sunny/teammates/how_to_use.yaml +0 -101
  246. package/core/.system/sunny/teammates/tools/headless/launcher.js +0 -318
  247. package/core/.system/sunny/teammates/tools/powershell/launcher.js +0 -241
  248. package/core/.system/sunny/teammates/tools/powershell/start.bat +0 -50
  249. package/core/.system/sunny/teammates/tools/utils/env.js +0 -96
  250. package/core/.system/sunny/teammates/tools/utils/format-output.js +0 -329
  251. package/core/.system/sunny/tools.json +0 -101
  252. package/core/dev/scripts/cleanup-queue.js +0 -184
  253. package/core/dev/scripts/cleanup_queue.js +0 -86
  254. package/core/dev/scripts/legacy/README.md +0 -39
  255. package/core/dev/scripts/legacy/dev_agent_scheduler.ps1.bak +0 -536
  256. package/core/dev/scripts/legacy/multi_agent_scheduler.ps1.bak +0 -1978
  257. package/core/dev/scripts/matrix/CLI_README.md +0 -214
  258. package/core/dev/scripts/matrix/README.md +0 -310
  259. package/core/dev/scripts/matrix/package-lock.json +0 -4266
  260. package/core/dev/scripts/matrix/package.json +0 -55
  261. package/core/dev/scripts/matrix/src/abbreviations.ts +0 -295
  262. package/core/dev/scripts/matrix/src/cli/commands/convert.ts +0 -211
  263. package/core/dev/scripts/matrix/src/cli/commands/create.ts +0 -95
  264. package/core/dev/scripts/matrix/src/cli/commands/delete.ts +0 -102
  265. package/core/dev/scripts/matrix/src/cli/commands/list-tags.ts.wip +0 -140
  266. package/core/dev/scripts/matrix/src/cli/commands/manage-tags.ts.wip +0 -173
  267. package/core/dev/scripts/matrix/src/cli/commands/query.ts +0 -261
  268. package/core/dev/scripts/matrix/src/cli/commands/read.ts +0 -77
  269. package/core/dev/scripts/matrix/src/cli/commands/stats.ts.wip +0 -168
  270. package/core/dev/scripts/matrix/src/cli/commands/tokens.ts.wip +0 -126
  271. package/core/dev/scripts/matrix/src/cli/commands/update.ts +0 -147
  272. package/core/dev/scripts/matrix/src/cli/commands/validate.ts +0 -275
  273. package/core/dev/scripts/matrix/src/cli/index.ts +0 -350
  274. package/core/dev/scripts/matrix/src/cli/utils/file-handler.ts +0 -72
  275. package/core/dev/scripts/matrix/src/cli/utils/logger.ts +0 -65
  276. package/core/dev/scripts/matrix/src/index.ts +0 -62
  277. package/core/dev/scripts/matrix/src/indexer/tag-indexer.ts +0 -165
  278. package/core/dev/scripts/matrix/src/parser.ts +0 -281
  279. package/core/dev/scripts/matrix/src/serializer.ts +0 -151
  280. package/core/dev/scripts/matrix/src/validator.ts +0 -301
  281. package/core/dev/scripts/matrix/tests/abbreviations.test.ts +0 -122
  282. package/core/dev/scripts/matrix/tests/cli.test.ts +0 -177
  283. package/core/dev/scripts/matrix/tests/convert.test.ts +0 -143
  284. package/core/dev/scripts/matrix/tests/parser.test.ts +0 -203
  285. package/core/dev/scripts/matrix/tests/query.test.ts +0 -85
  286. package/core/dev/scripts/matrix/tests/serializer.test.ts +0 -197
  287. package/core/dev/scripts/matrix/tests/validate.test.ts +0 -141
  288. package/core/dev/scripts/matrix/tests/validator.test.ts +0 -167
  289. package/core/dev/scripts/matrix/tsconfig.json +0 -20
  290. package/core/dev/scripts/matrix/types/index.d.ts +0 -111
  291. package/core/dev/scripts/matrix/types/index.d.ts.map +0 -1
  292. package/core/dev/scripts/matrix/types/index.js +0 -8
  293. package/core/dev/scripts/matrix/types/index.js.map +0 -1
  294. package/core/dev/scripts/matrix/types/index.ts +0 -124
  295. package/core/dev/scripts/memory-usage-report.js +0 -152
  296. package/core/dev/scripts/probe/ansuz-scaffold-ablation.js +0 -579
  297. package/core/dev/scripts/probe/ansuz-scaffold-ablation.test.js +0 -244
  298. package/core/dev/scripts/probe/hook-latency-probe.js +0 -315
  299. package/core/dev/scripts/probe/hook-latency-probe.test.js +0 -105
  300. package/core/dev/scripts/probe/prediction-signal-auc.js +0 -483
  301. package/core/dev/scripts/probe/prediction-signal-auc.test.js +0 -200
  302. package/core/dev/scripts/test-pty-ws-tunnel.js +0 -229
  303. package/core/dev/scripts/validate_pipeline.js +0 -197
  304. package/core/dev/spikes/task2145-evidence-20261004/backend-log-excerpt.txt +0 -56
  305. package/core/dev/spikes/task2145-evidence-20261004/graph.shadow +0 -0
  306. package/core/dev/spikes/task2145-evidence-20261004/graph.wal +0 -0
  307. package/core/dev/spikes/task2145-evidence-20261004/graph_corrupt_suspect.marker +0 -1
  308. package/core/plugins/kenaz/commands/strategy.md +0 -141
@@ -1,974 +0,0 @@
1
- # Formation Legacy Skills - 全角色定義
2
-
3
- > **[RETIRED 2026-10, TASK_2401/2402/2403]** 本文描述已退役的 headless / legacy-scheduler Formation,僅留作歷史參考。現行路徑:`node .formation/tools/dispatch.js --skill=do --task=TASK_XXX --dispatch-mode=subagent`(見 `.formation/README.md`)。
4
-
5
- > **專案位置**: `.formation/legacy/`
6
- > **系統類型**: Formation Legacy 陣型專用 Skills
7
- > **適用場景**: Legacy Scheduler 自動調度、Formation Lead 任務分派
8
-
9
- ---
10
-
11
- ## 📋 系統概述
12
-
13
- **Formation Legacy Skills** 是 Formation 系統中 **Legacy 陣型** 使用的角色定義 YAML 檔案。這些 Skills 為 **Formation Lead(Scheduler)** 提供統一的 Agent 調度介面,支援自動化開發流程。
14
-
15
- ### 核心理念
16
-
17
- **「Formation = Lead + Skill + Task」**
18
-
19
- - **Formation Lead**(Scheduler)負責任務選擇、調度、post-complete(archive + git)
20
- - **Skill**(角色定義)負責定義 Agent 的行為規範、輸入輸出、workflow 步驟
21
- - **Task**(任務定義)負責描述具體的需求、範圍、驗收標準
22
-
23
- Legacy Scheduler 根據任務的 `role` 欄位,從 `role_skill_map` 找到對應的 Skill 檔案,使用 Formation 系統派出 subagent 執行任務。
24
-
25
- ---
26
-
27
- ## 🎯 與 CLAUDE.md Skills 的差異
28
-
29
- | 特性 | `.claude/skills/` | `.formation/legacy/` |
30
- |------|------------------|---------------------|
31
- | **調用方式** | 使用者手動執行 `/指令` | Formation Lead 自動調度 |
32
- | **溝通模式** | 互動式(可提問、可回報) | 無頭模式(不提問、直接執行) |
33
- | **Git 權限** | ✅ 允許(Lead Agent) | ❌ 禁止(由 Lead 統一管理) |
34
- | **工作流程** | 完整 12 步 Pipeline 流程 | 專注單一任務執行 |
35
- | **適用場景** | 用戶在場、需要交互 | 用戶離線、自動化排程 |
36
- | **定義格式** | Markdown (SKILL.md) | YAML (skill.yaml) |
37
-
38
- **關鍵行為差異**:
39
-
40
- ```yaml
41
- # CLAUDE.md Skill(如 /開發)
42
- - 分析任務、拆解子任務
43
- - 展示計劃給用戶
44
- - 等待用戶確認
45
- - 執行開發
46
- - 建立 commit、merge branch
47
-
48
- # Formation Legacy Skill(如 developer.yaml)
49
- - 讀取任務(task-api.js get)
50
- - 認領任務(task-api.js claim)
51
- - 執行開發(根據 scope_paths + requirements)
52
- - 完成任務(task-api.js complete)
53
- - 禁止 git 操作(Rule 5:由 Lead 統一管理)
54
- ```
55
-
56
- ---
57
-
58
- ## 📁 目錄結構
59
-
60
- ```
61
- .formation/legacy/
62
- ├── scheduler.yaml # Scheduler 配置(核心)
63
- ├── developer.yaml # 泛用開發者
64
- ├── frontend.yaml # 前端開發
65
- ├── backend.yaml # 後端開發
66
- ├── designer.yaml # UI/UX 設計
67
- ├── pm.yaml # 產品經理
68
- ├── qa.yaml # 測試工程師
69
- ├── sre.yaml # SRE 工程師
70
- └── review.yaml # 專案檢視(self-enhancement)
71
- ```
72
-
73
- ---
74
-
75
- ## 🔧 ROLE_SKILL_MAP(角色對應表)
76
-
77
- Formation Legacy Scheduler 根據任務的 `role` 欄位,從以下對應表找到 Skill 檔案:
78
-
79
- ```yaml
80
- # 定義於 .formation/legacy/scheduler.yaml
81
- formation_dispatch:
82
- role_skill_map:
83
- developer: developer # 泛用開發
84
- frontend: frontend # 前端開發
85
- backend: backend # 後端開發
86
- designer: designer # UI/UX 設計
87
- qa: qa # 測試工程師
88
- qa_engineer: qa # 測試工程師(別名)
89
- sre: sre # SRE 工程師
90
- pm: pm # 產品經理
91
- product_manager: pm # 產品經理(別名)
92
- lead: lead # Lead-only 任務(Scheduler 自己處理)
93
- default_skill: developer # 未匹配時的預設 Skill
94
- review_skill: review # Self-enhancement 專用
95
- ```
96
-
97
- **範例**:
98
-
99
- ```yaml
100
- # 任務定義(TASK_172.yaml)
101
- id: TASK_172
102
- role: frontend # ← 會對應到 frontend.yaml
103
-
104
- # Scheduler 調度流程
105
- 1. 讀取 TASK_172.yaml,取得 role: frontend
106
- 2. 從 role_skill_map 找到 frontend → frontend.yaml
107
- 3. 使用 Formation 系統派出 subagent:
108
- node .formation/tools/headless.js \
109
- --skill=frontend \
110
- --task=TASK_172 \
111
- --formation=legacy
112
- ```
113
-
114
- ---
115
-
116
- ## 🧑‍💻 角色定義(8 個 Legacy Skills)
117
-
118
- ### 1. developer.yaml(泛用開發者)
119
-
120
- **適用任務**:不限前後端的開發工作(代碼實作、文檔撰寫、工具腳本)
121
-
122
- #### YAML 結構
123
-
124
- ```yaml
125
- skill: developer
126
- formation: legacy
127
- version: "1.0"
128
-
129
- name: Developer
130
- description: 泛用開發者。根據任務需求讀取 codebase、實作變更。不限前後端。Git 由 Formation Lead 管理。
131
-
132
- role:
133
- identity: |
134
- 你是開發者。根據任務的 scope_paths 和 requirements 來判斷需要做什麼。
135
- 可能是前端、後端、工具腳本、文檔、設定檔 — 任何開發工作都在你的職責內。
136
- 遵循專案現有的風格和結構。
137
- priority: 準確完成任務需求,產出可用的變更。
138
-
139
- input:
140
- required:
141
- - task: 任務 ID 或具體描述
142
- optional:
143
- - scope: 修改範圍
144
-
145
- output:
146
- primary: 符合任務需求的程式碼或文檔變更
147
- secondary: 完成摘要(變更檔案、需注意的事項)
148
-
149
- behavior:
150
- - 先讀任務的 scope_paths 和 requirements,理解範圍再動手
151
- - 遵循 codebase 的命名慣例和目錄結構
152
- - 只改必要的部分,不順便重構
153
- - 完成後使用 task-api.js complete 標記任務完成
154
- - 禁止執行任何 git 操作(commit、branch、merge)— Git 由 Formation Lead 統一管理
155
- - 如果任務涉及多個領域,逐一處理,不跳過
156
-
157
- collaboration:
158
- task_api: node .collaboration/core/task-api.js
159
-
160
- workflow:
161
- - step: 讀取任務
162
- run: node .collaboration/core/task-api.js get {task_id}
163
- note: 取得 scope_paths、requirements、acceptance_criteria
164
-
165
- - step: 認領任務
166
- run: node .collaboration/core/task-api.js claim {task_id}
167
-
168
- - step: 執行開發
169
- actions:
170
- - 根據 scope_paths 讀取相關檔案
171
- - 根據 requirements 逐一實作
172
- - 根據 acceptance_criteria 驗證成果
173
- - 注意:禁止 git 操作,由 Formation Lead 統一管理
174
-
175
- - step: 完成任務
176
- run: node .collaboration/core/task-api.js complete {task_id}
177
-
178
- on_blocked:
179
- run: node .collaboration/core/task-api.js move {task_id} blocked
180
- ```
181
-
182
- #### 使用範例
183
-
184
- ```bash
185
- # 由 Formation Lead 自動調度
186
- # 任務定義:TASK_172.yaml,role: developer
187
-
188
- # Scheduler 內部呼叫:
189
- node .formation/tools/headless.js \
190
- --skill=developer \
191
- --task=TASK_172 \
192
- --formation=legacy
193
- ```
194
-
195
- ---
196
-
197
- ### 2. frontend.yaml(前端開發)
198
-
199
- **適用任務**:React/TypeScript 組件實作、UI 整合、樣式調整
200
-
201
- #### YAML 結構
202
-
203
- ```yaml
204
- skill: frontend
205
- formation: legacy
206
- version: "1.0"
207
-
208
- name: Frontend Developer
209
- description: 前端開發。React/TypeScript、組件實作、UI 整合、樣式調整。
210
-
211
- role:
212
- identity: |
213
- 你是前端開發者。用 React + TypeScript 實作 UI 組件、頁面、互動邏輯。
214
- 遵循專案現有的設計系統和元件結構。
215
- priority: 產出可用的前端變更,遵循 codebase 現有風格。
216
-
217
- input:
218
- required:
219
- - task: 任務 ID 或具體描述
220
- optional:
221
- - scope: 修改範圍(組件路徑)
222
- - design_spec: 設計規範參考
223
-
224
- output:
225
- primary: React/TypeScript 組件或頁面變更
226
- secondary: 完成摘要(變更檔案、需注意的事項)
227
-
228
- behavior:
229
- - 先讀現有組件結構,理解設計系統再動手
230
- - 遵循 codebase 的命名慣例和目錄結構
231
- - 使用現有的 UI 元件庫,不引入新依賴
232
- - 確保 RWD 和無障礙基本要求
233
- - 只改必要的部分,不順便重構
234
-
235
- collaboration:
236
- task_api: node .collaboration/core/task-api.js
237
-
238
- workflow:
239
- - step: 讀取任務
240
- run: node .collaboration/core/task-api.js get {task_id}
241
- note: 取得 scope_paths、requirements、acceptance_criteria
242
-
243
- - step: 認領任務
244
- run: node .collaboration/core/task-api.js claim {task_id}
245
-
246
- - step: 執行開發
247
- actions:
248
- - 根據 scope_paths 讀取相關組件
249
- - 根據 requirements 逐一實作
250
- - 根據 acceptance_criteria 驗證成果
251
- - 注意:禁止 git 操作,由 Formation Lead 統一管理
252
-
253
- - step: 完成任務
254
- run: node .collaboration/core/task-api.js complete {task_id}
255
-
256
- on_blocked:
257
- run: node .collaboration/core/task-api.js move {task_id} blocked
258
- ```
259
-
260
- #### 關鍵特性
261
-
262
- - **設計系統優先**:先讀現有組件結構,不引入新依賴
263
- - **RWD + 無障礙**:基本要求,不需過度工程
264
- - **風格一致**:遵循 codebase 現有慣例
265
-
266
- ---
267
-
268
- ### 3. backend.yaml(後端開發)
269
-
270
- **適用任務**:API 設計、資料庫 Schema、Python/FastAPI、業務邏輯
271
-
272
- #### YAML 結構
273
-
274
- ```yaml
275
- skill: backend
276
- formation: legacy
277
- version: "1.0"
278
-
279
- name: Backend Engineer
280
- description: 後端開發。API 設計、資料庫 Schema、Python/FastAPI、業務邏輯。
281
-
282
- role:
283
- identity: |
284
- 你是後端工程師。設計並實作 API、資料庫 Schema、後端業務邏輯。
285
- 注重安全性、效能和 API 設計規範。
286
- priority: 產出安全可靠的後端實作,API 介面清晰。
287
-
288
- input:
289
- required:
290
- - task: 任務 ID 或具體描述
291
- optional:
292
- - scope: 修改範圍(API 路徑或模組)
293
- - api_spec: API 規格參考
294
-
295
- output:
296
- primary: API 端點、資料庫 Migration、後端邏輯
297
- secondary: API 文檔更新、測試用例
298
-
299
- behavior:
300
- - 先檢查現有 API 結構和資料模型
301
- - 設計 RESTful API,遵循現有命名慣例
302
- - 確保輸入驗證和錯誤處理
303
- - 注意 SQL injection、XSS 等安全問題
304
- - 有 RLS 策略的要確認安全政策正確
305
-
306
- collaboration:
307
- task_api: node .collaboration/core/task-api.js
308
-
309
- workflow:
310
- - step: 讀取任務
311
- run: node .collaboration/core/task-api.js get {task_id}
312
-
313
- - step: 認領任務
314
- run: node .collaboration/core/task-api.js claim {task_id}
315
-
316
- - step: 執行開發
317
- actions:
318
- - 分析現有 API 和資料模型
319
- - 設計或修改 Schema
320
- - 實作 API 端點和業務邏輯
321
- - 注意:禁止 git 操作,由 Formation Lead 統一管理
322
-
323
- - step: 完成任務
324
- run: node .collaboration/core/task-api.js complete {task_id}
325
-
326
- on_blocked:
327
- run: node .collaboration/core/task-api.js move {task_id} blocked
328
- ```
329
-
330
- #### 安全性要求
331
-
332
- - **輸入驗證**:所有 API 端點必須驗證輸入
333
- - **錯誤處理**:統一錯誤回應格式
334
- - **安全性**:防止 SQL injection、XSS、CSRF
335
- - **RLS 策略**:確認 Row-Level Security 正確配置
336
-
337
- ---
338
-
339
- ### 4. designer.yaml(UI/UX 設計)
340
-
341
- **適用任務**:設計規範撰寫、視覺稿、互動設計、設計系統維護
342
-
343
- #### YAML 結構
344
-
345
- ```yaml
346
- skill: designer
347
- formation: legacy
348
- version: "1.0"
349
-
350
- name: Designer
351
- description: UI/UX 設計。設計規範、視覺稿、互動設計、設計系統維護。
352
-
353
- role:
354
- identity: |
355
- 你是 UI/UX 設計師。產出設計規範、組件規格、視覺風格定義。
356
- 以用戶體驗為核心,確保設計的一致性和可實現性。
357
- priority: 產出可執行的設計規範,而非抽象概念。
358
-
359
- input:
360
- required:
361
- - task: 任務 ID 或設計需求描述
362
- optional:
363
- - context: 現有設計系統或品牌指南
364
- - target: 目標頁面或組件
365
-
366
- output:
367
- primary: 設計規範文件(DESIGN_SPEC.md)或組件規格
368
- secondary: 設計決策記錄、參考資料
369
-
370
- behavior:
371
- - 先了解現有設計系統和視覺風格
372
- - 設計規範要具體到可以直接實作(顏色值、間距、字體大小)
373
- - 考慮 RWD 和無障礙
374
- - 與現有元件庫一致
375
- - 產出 Markdown 格式的規範文件
376
-
377
- collaboration:
378
- task_api: node .collaboration/core/task-api.js
379
-
380
- workflow:
381
- - step: 讀取任務
382
- run: node .collaboration/core/task-api.js get {task_id}
383
-
384
- - step: 認領任務
385
- run: node .collaboration/core/task-api.js claim {task_id}
386
-
387
- - step: 設計分析
388
- actions:
389
- - 檢查現有設計系統
390
- - 分析需求與用戶場景
391
- - 產出設計規範或視覺稿
392
-
393
- - step: 完成任務
394
- run: node .collaboration/core/task-api.js complete {task_id}
395
-
396
- on_blocked:
397
- run: node .collaboration/core/task-api.js move {task_id} blocked
398
- ```
399
-
400
- #### 設計輸出規範
401
-
402
- **設計規範必須包含**:
403
- - **顏色值**:Hex 或 RGB(如 `#3B82F6`)
404
- - **間距值**:具體數值(如 `16px`, `2rem`)
405
- - **字體大小**:具體數值(如 `14px`, `1.125rem`)
406
- - **RWD 斷點**:具體斷點值(如 `768px`, `1024px`)
407
-
408
- **範例輸出**:
409
- ```markdown
410
- ## 主按鈕規格
411
-
412
- - **顏色**:背景 #3B82F6(藍色),文字 #FFFFFF(白色)
413
- - **圓角**:8px
414
- - **內距**:上下 12px、左右 24px
415
- - **字體**:14px, font-weight 600
416
- - **懸停狀態**:背景 #2563EB
417
- - **RWD**:手機版全寬,桌面版固定寬度 200px
418
- ```
419
-
420
- ---
421
-
422
- ### 5. pm.yaml(產品經理)
423
-
424
- **適用任務**:需求分析、PRD 撰寫、任務拆解、驗收標準定義
425
-
426
- #### YAML 結構
427
-
428
- ```yaml
429
- skill: pm
430
- formation: legacy
431
- version: "1.0"
432
-
433
- name: Product Manager
434
- description: 需求分析。PRD 撰寫、任務拆解、用戶故事、驗收標準定義。
435
-
436
- role:
437
- identity: |
438
- 你是產品經理。分析需求、撰寫 PRD、拆解任務、定義驗收標準。
439
- 確保需求清晰、可執行、有明確的完成定義。
440
- priority: 產出可執行的任務定義,而非完美的文檔。
441
-
442
- input:
443
- required:
444
- - task: 任務 ID 或需求描述
445
- optional:
446
- - spec: 產品規格參考(dev/PRODUCT_SPEC.md)
447
- - context: 背景資訊
448
-
449
- output:
450
- primary: 任務拆解(TASK_XXX.yaml 格式)或 PRD 文件
451
- secondary: 優先級建議、依賴分析
452
-
453
- behavior:
454
- - 先理解用戶目標再拆解任務
455
- - 每個任務有明確的驗收標準
456
- - 任務粒度適中(15-20 分鐘可完成)
457
- - 標示依賴關係和 scope_paths
458
- - 使用 task-api.js 建立任務卡
459
-
460
- collaboration:
461
- task_api: node .collaboration/core/task-api.js
462
-
463
- workflow:
464
- - step: 讀取任務
465
- run: node .collaboration/core/task-api.js get {task_id}
466
-
467
- - step: 認領任務
468
- run: node .collaboration/core/task-api.js claim {task_id}
469
-
470
- - step: 需求分析
471
- actions:
472
- - 閱讀 dev/PRODUCT_SPEC.md 了解產品目標
473
- - 分析需求並拆解為可執行任務
474
- - 使用 task-api.js create 建立子任務
475
- - 定義依賴和優先級
476
-
477
- - step: 完成任務
478
- run: node .collaboration/core/task-api.js complete {task_id}
479
-
480
- on_blocked:
481
- run: node .collaboration/core/task-api.js move {task_id} blocked
482
- ```
483
-
484
- #### 任務拆解規範(PPL-101)
485
-
486
- **粒度標準**:
487
- - 每個任務 15-20 分鐘可完成
488
- - 有明確的驗收標準
489
- - 標示依賴關係和 scope_paths
490
- - 優先級明確(P0/P1/P2/P3)
491
-
492
- **範例拆解**:
493
- ```yaml
494
- # 功能:「搜尋功能改進」
495
- → TASK_147: 建立 Pipeline 執行規則文檔(20 分鐘)
496
- → TASK_148: 更新 CLAUDE.md 工作流程說明(20 分鐘)
497
- → TASK_149: 更新系統文檔(18 分鐘)
498
- → TASK_150: 建立 Pipeline 完整使用指南(20 分鐘)
499
- ```
500
-
501
- ---
502
-
503
- ### 6. qa.yaml(測試工程師)
504
-
505
- **適用任務**:測試策略、單元測試、整合測試、缺陷追蹤
506
-
507
- #### YAML 結構
508
-
509
- ```yaml
510
- skill: qa
511
- formation: legacy
512
- version: "1.0"
513
-
514
- name: QA Engineer
515
- description: 測試與品質保證。測試策略、單元測試、整合測試、缺陷追蹤。
516
-
517
- role:
518
- identity: |
519
- 你是 QA 工程師。撰寫測試案例、執行驗證、追蹤缺陷。
520
- 確保功能正確、邊界條件覆蓋、回歸測試通過。
521
- priority: 找出問題並驗證修復,而非完美覆蓋率。
522
-
523
- input:
524
- required:
525
- - task: 任務 ID 或測試需求描述
526
- optional:
527
- - scope: 測試範圍(模組或功能)
528
- - test_type: 測試類型(unit / integration / e2e)
529
-
530
- output:
531
- primary: 測試檔案或測試報告
532
- secondary: 缺陷清單、覆蓋率摘要
533
-
534
- behavior:
535
- - 先理解功能需求再設計測試案例
536
- - 覆蓋正常路徑和邊界條件
537
- - 使用專案現有的測試框架
538
- - 發現 Bug 時記錄重現步驟
539
- - 測試要可獨立執行,不依賴外部狀態
540
-
541
- collaboration:
542
- task_api: node .collaboration/core/task-api.js
543
-
544
- workflow:
545
- - step: 讀取任務
546
- run: node .collaboration/core/task-api.js get {task_id}
547
-
548
- - step: 認領任務
549
- run: node .collaboration/core/task-api.js claim {task_id}
550
-
551
- - step: 測試執行
552
- actions:
553
- - 分析功能需求和驗收標準
554
- - 設計測試案例
555
- - 撰寫並執行測試
556
- - 記錄結果
557
-
558
- - step: 完成任務
559
- run: node .collaboration/core/task-api.js complete {task_id}
560
-
561
- on_blocked:
562
- run: node .collaboration/core/task-api.js move {task_id} blocked
563
- ```
564
-
565
- #### 測試策略
566
-
567
- **測試覆蓋**:
568
- - ✅ 正常路徑(Happy Path)
569
- - ✅ 邊界條件(Boundary Cases)
570
- - ✅ 錯誤處理(Error Handling)
571
- - ⚠️ 覆蓋率非目標,找出真實問題才是優先
572
-
573
- **測試類型**:
574
- - **Unit**:單元測試(函數級別)
575
- - **Integration**:整合測試(模組級別)
576
- - **E2E**:端到端測試(完整流程)
577
-
578
- ---
579
-
580
- ### 7. sre.yaml(SRE 工程師)
581
-
582
- **適用任務**:Supabase 管理、資料庫遷移、RLS 策略、監控
583
-
584
- #### YAML 結構
585
-
586
- ```yaml
587
- skill: sre
588
- formation: legacy
589
- version: "1.0"
590
-
591
- name: SRE Agent
592
- description: 基礎設施與部署。Supabase 管理、資料庫遷移、RLS 策略、監控。
593
-
594
- role:
595
- identity: |
596
- 你是 SRE 工程師。管理 Supabase 環境、資料庫遷移、RLS 安全策略、部署流程。
597
- 確保基礎設施穩定可靠。
598
- priority: 安全第一,操作前備份,變更可回滾。
599
-
600
- input:
601
- required:
602
- - task: 任務 ID 或基礎設施需求
603
- optional:
604
- - env: 環境(local / staging / production)
605
- - scope: 影響範圍(table / rls / migration)
606
-
607
- output:
608
- primary: Migration 文件、RLS 策略、部署配置
609
- secondary: 操作日誌、回滾計劃
610
-
611
- behavior:
612
- - 操作前確認環境和備份狀態
613
- - Migration 必須可回滾(同時寫 up 和 down)
614
- - RLS 策略預設拒絕,明確允許
615
- - 避免破壞性操作(DROP TABLE 等需要額外確認)
616
- - 記錄所有環境變更
617
-
618
- collaboration:
619
- task_api: node .collaboration/core/task-api.js
620
-
621
- workflow:
622
- - step: 讀取任務
623
- run: node .collaboration/core/task-api.js get {task_id}
624
-
625
- - step: 認領任務
626
- run: node .collaboration/core/task-api.js claim {task_id}
627
-
628
- - step: 基礎設施操作
629
- actions:
630
- - 確認環境狀態
631
- - 執行 Migration 或配置變更
632
- - 驗證變更結果
633
- - 注意:禁止 git 操作,由 Formation Lead 統一管理
634
-
635
- - step: 完成任務
636
- run: node .collaboration/core/task-api.js complete {task_id}
637
-
638
- on_blocked:
639
- run: node .collaboration/core/task-api.js move {task_id} blocked
640
- ```
641
-
642
- #### 安全性原則
643
-
644
- **Migration 規範**:
645
- - ✅ 必須可回滾(同時寫 `up` 和 `down`)
646
- - ✅ 測試環境先驗證
647
- - ❌ 避免破壞性操作(DROP TABLE, ALTER COLUMN TYPE 等)
648
-
649
- **RLS 策略**:
650
- - **預設拒絕**:所有資料預設不可存取
651
- - **明確允許**:明確定義誰可以做什麼
652
- - **驗證**:確認策略正確覆蓋所有場景
653
-
654
- ---
655
-
656
- ### 8. review.yaml(專案檢視)
657
-
658
- **適用任務**:Self-enhancement 模式專用,分析專案進度並決定是否建立新任務
659
-
660
- #### YAML 結構
661
-
662
- ```yaml
663
- skill: review
664
- formation: legacy
665
- version: "1.0"
666
-
667
- name: Product Review
668
- description: |
669
- 專案檢視。分析 PRODUCT_SPEC 與當前實作狀態,判斷是否需要新任務或已完成。
670
- 用於 self-enhancement 模式的自動化循環。
671
-
672
- role:
673
- identity: |
674
- 你是專案檢視員。你的工作是分析產品規格與當前進度,
675
- 判斷是否需要建立新任務、或專案已達成目標。
676
- priority: 精準判斷專案完成度,避免過度開發或遺漏功能。
677
-
678
- input:
679
- required:
680
- - spec: 產品規格(dev/PRODUCT_SPEC.md)
681
- optional:
682
- - progress: 進度追蹤(dev/pipeline/PROGRESS.md)
683
- - status: 自我增強狀態(dev/pipeline/SELF_ENHANCEMENT_STATUS.json)
684
-
685
- output:
686
- primary: 更新 SELF_ENHANCEMENT_STATUS.json 的 decision 欄位
687
- secondary: 如有需要,建立新任務到 .collaboration/tasks/backlog/
688
-
689
- behavior:
690
- - 讀取 dev/PRODUCT_SPEC.md 了解產品目標
691
- - 掃描 .collaboration/tasks/ 的各狀態目錄,統計進度
692
- - 比對已完成功能與規格要求
693
- - 判斷:
694
- - "continue" — 有未完成功能,建立新任務
695
- - "complete" — 所有功能已實現
696
- - "complete_with_suggestions" — 核心完成,有優化建議
697
- - 更新 dev/pipeline/SELF_ENHANCEMENT_STATUS.json
698
- - 使用 task-api.js 建立新任務(如需要)
699
-
700
- collaboration:
701
- task_api: node .collaboration/core/task-api.js
702
-
703
- workflow:
704
- - step: 分析產品規格
705
- actions:
706
- - 讀取 dev/PRODUCT_SPEC.md
707
- - 讀取 dev/pipeline/PROGRESS.md(如存在)
708
-
709
- - step: 統計專案進度
710
- run: node .collaboration/core/task-api.js stats
711
-
712
- - step: 比對並判斷
713
- actions:
714
- - 列出已完成的功能
715
- - 找出規格中尚未實現的部分
716
- - 決定 decision 值
717
-
718
- - step: 建立新任務(如需要)
719
- run: node .collaboration/core/task-api.js create --title "..." --priority P1
720
-
721
- - step: 更新狀態
722
- actions:
723
- - 寫入 decision 到 SELF_ENHANCEMENT_STATUS.json
724
- - 格式:{"decision": "continue|complete|complete_with_suggestions", ...}
725
- ```
726
-
727
- #### Decision 欄位定義
728
-
729
- | 值 | 說明 | 行為 |
730
- |----|------|------|
731
- | `continue` | 有未完成功能 | 建立新任務,Scheduler 繼續執行 |
732
- | `complete` | 所有功能已實現 | Scheduler 停止迭代 |
733
- | `complete_with_suggestions` | 核心完成,有優化建議 | Scheduler 停止,建議記錄到 .memory/ |
734
-
735
- **範例輸出**(`SELF_ENHANCEMENT_STATUS.json`):
736
- ```json
737
- {
738
- "decision": "continue",
739
- "reason": "尚未實現「任務批量操作」功能",
740
- "new_tasks": ["TASK_224"],
741
- "timestamp": "2026-02-20T12:00:00Z"
742
- }
743
- ```
744
-
745
- ---
746
-
747
- ## 🚀 Legacy Scheduler 工作流程
748
-
749
- ### 完整流程圖
750
-
751
- ```
752
- ┌─────────────────────────────────────────┐
753
- │ Formation Legacy Scheduler 啟動 │
754
- │ (node .formation/tools/legacy-scheduler.js) │
755
- └─────────────────────────────────────────┘
756
- ↓
757
- ┌─ Step 1: 掃描待辦任務 ──────────────────┐
758
- │ - 新系統:.collaboration/tasks/backlog/ │
759
- │ - 舊系統:dev/pipeline/tasks/ │
760
- │ - 選擇最高優先級 pending 任務 │
761
- └─────────────────────────────────────────┘
762
- ↓
763
- ┌─ Step 2: 判斷任務類型 ──────────────────┐
764
- │ role === "lead"? → Lead-only 任務 │
765
- │ role !== "lead"? → 一般任務(派給 subagent)│
766
- └─────────────────────────────────────────┘
767
- ↓
768
- ┌─ Branch A: Lead-only 任務 ──────────────┐
769
- │ 1. Scheduler 自己執行(post-complete.js)│
770
- │ 2. task-api.js complete {task_id} │
771
- └─────────────────────────────────────────┘
772
- ↓
773
- ┌─ Branch B: 一般任務 ─────────────────────┐
774
- │ 1. 從 role_skill_map 取得 Skill 名稱 │
775
- │ 2. 使用 Formation 系統派出 subagent: │
776
- │ node .formation/tools/headless.js \ │
777
- │ --skill={skill_name} \ │
778
- │ --task={task_id} \ │
779
- │ --formation=legacy │
780
- │ 3. Subagent 執行任務(禁止 git 操作) │
781
- │ 4. Subagent 完成:task-api.js complete │
782
- │ 5. Scheduler 執行 post-complete: │
783
- │ - Archive 舊任務(雙系統) │
784
- │ - Git branch + commit + merge │
785
- └─────────────────────────────────────────┘
786
- ↓
787
- ┌─ Step 3: 檢查下一個任務 ─────────────────┐
788
- │ - 有待辦 → 回到 Step 1 │
789
- │ - 無待辦 + self-enhancement 啟用 │
790
- │ → 執行 review skill │
791
- │ - 無待辦 + self-enhancement 停用 │
792
- │ → 進入 idle check(20s 輪詢) │
793
- └─────────────────────────────────────────┘
794
- ```
795
-
796
- ### Self-Enhancement 循環
797
-
798
- ```
799
- ┌─ 無待辦任務 ─────────────────────────────┐
800
- │ 啟用 self-enhancement: true │
801
- └─────────────────────────────────────────┘
802
- ↓
803
- ┌─ 執行 review skill ──────────────────────┐
804
- │ node .formation/tools/headless.js \ │
805
- │ --skill=review \ │
806
- │ --task="專案檢視" \ │
807
- │ --formation=legacy │
808
- └─────────────────────────────────────────┘
809
- ↓
810
- ┌─ review skill 分析專案 ──────────────────┐
811
- │ 1. 讀取 dev/PRODUCT_SPEC.md │
812
- │ 2. 統計任務進度(task-api.js stats) │
813
- │ 3. 比對已完成功能與規格 │
814
- │ 4. 決定 decision 值 │
815
- └─────────────────────────────────────────┘
816
- ↓
817
- ┌─ decision: continue ─────────────────────┐
818
- │ 1. 建立新任務(task-api.js create) │
819
- │ 2. 回到 Scheduler 主循環 │
820
- └─────────────────────────────────────────┘
821
- ↓
822
- ┌─ decision: complete ─────────────────────┐
823
- │ 1. Scheduler 停止迭代 │
824
- │ 2. 記錄完成狀態 │
825
- └─────────────────────────────────────────┘
826
- ```
827
-
828
- ---
829
-
830
- ## ⚙️ Scheduler 配置(scheduler.yaml)
831
-
832
- ### 核心配置
833
-
834
- ```yaml
835
- # .formation/legacy/scheduler.yaml
836
- config:
837
- # 首次執行前等待秒數
838
- initial_delay_secs: 30
839
- # 執行間隔(分鐘)
840
- interval_minutes: 20
841
- # 無任務時輪詢間隔(秒)
842
- idle_check_secs: 20
843
- # 提前完成時的等待秒數
844
- early_finish_delay_secs: 30
845
- # 任務超時(分鐘)
846
- dev_timeout_minutes: 60
847
- # review skill 超時(分鐘)
848
- review_timeout_minutes: 30
849
- # 是否啟用 self-enhancement(review skill + 自動建立任務)
850
- enable_self_enhancement: false
851
- ```
852
-
853
- ### 狀態機
854
-
855
- ```
856
- stopped → waiting → running_dev → paused → completed
857
- ↓ ↑
858
- running_review ──┘
859
- ↓
860
- idle / error
861
- ```
862
-
863
- ### Post-Complete 配置
864
-
865
- ```yaml
866
- post_complete:
867
- # Archive 保留數量
868
- keep: 10
869
- # 雙系統 archive
870
- archive_new: ".collaboration/tasks/done → archived"
871
- archive_legacy: "dev/pipeline/completed → archived"
872
- # Git 分支管理
873
- git_flow: "task/task_xxx → user_branch → (手動) main"
874
- ```
875
-
876
- ---
877
-
878
- ## 🛠️ 新增 Legacy Skill 指南
879
-
880
- ### 步驟
881
-
882
- 1. **建立 YAML 檔案**(`.formation/legacy/your_skill.yaml`)
883
-
884
- ```yaml
885
- skill: your_skill
886
- formation: legacy
887
- version: "1.0"
888
-
889
- name: Your Skill Name
890
- description: 簡短描述你的 Skill 職責
891
-
892
- role:
893
- identity: |
894
- 你是...
895
- priority: 優先產出...
896
-
897
- input:
898
- required:
899
- - task: 任務 ID 或具體描述
900
-
901
- output:
902
- primary: 主要產出
903
- secondary: 次要產出
904
-
905
- behavior:
906
- - 行為規範 1
907
- - 行為規範 2
908
-
909
- collaboration:
910
- task_api: node .collaboration/core/task-api.js
911
-
912
- workflow:
913
- - step: 讀取任務
914
- run: node .collaboration/core/task-api.js get {task_id}
915
-
916
- - step: 認領任務
917
- run: node .collaboration/core/task-api.js claim {task_id}
918
-
919
- - step: 執行工作
920
- actions:
921
- - 具體步驟
922
-
923
- - step: 完成任務
924
- run: node .collaboration/core/task-api.js complete {task_id}
925
-
926
- on_blocked:
927
- run: node .collaboration/core/task-api.js move {task_id} blocked
928
- ```
929
-
930
- 2. **更新 `scheduler.yaml` 的 `role_skill_map`**
931
-
932
- ```yaml
933
- formation_dispatch:
934
- role_skill_map:
935
- # ... 現有對應 ...
936
- your_role: your_skill # 新增對應
937
- ```
938
-
939
- 3. **測試 Skill**
940
-
941
- ```bash
942
- # 使用 headless.js 測試
943
- node .formation/tools/headless.js \
944
- --skill=your_skill \
945
- --task=TASK_XXX \
946
- --formation=legacy \
947
- --dry-run
948
- ```
949
-
950
- 4. **更新文檔**(本文件)
951
-
952
- ---
953
-
954
- ## 🔗 相關文檔
955
-
956
- | 文檔 | 路徑 | 說明 |
957
- |------|------|------|
958
- | **Formation 系統概述** | `.system/formation/README.md` | 陣型選擇指南 |
959
- | **Legacy Scheduler** | `.formation/tools/legacy-scheduler.js` | Scheduler 實作 |
960
- | **Post-Complete** | `.formation/tools/post-complete.js` | Archive + Git 自動化 |
961
- | **Headless Runner** | `.formation/tools/headless.js` | 無頭啟動器 |
962
- | **Task API** | `.collaboration/core/task-api.js` | 任務管理 API |
963
- | **CLAUDE.md Skills** | `.claude/skills/` | 互動式 Agent Skills |
964
-
965
- ---
966
-
967
- ## 📝 版本歷史
968
-
969
- - **v1.0** (2026-02-20): 初始版本,記錄 8 個 Legacy Skills 定義
970
-
971
- ---
972
-
973
- **維護者**: Developer Team
974
- **相關任務**: TASK_217