kenaz 0.3.17 → 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 (316) 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/hooks/synapse-first-investigation.js +15 -0
  7. package/core/.claude/skills/architect_agent/SKILL.md +11 -92
  8. package/core/.claude/skills/assessment_agent/SKILL.md +0 -1
  9. package/core/.claude/skills/backend_engineer/SKILL.md +3 -6
  10. package/core/.claude/skills/code_reviewer/SKILL.md +1 -1
  11. package/core/.claude/skills/code_reviewer/patterns.yaml +1 -1
  12. package/core/.claude/skills/designer/SKILL.md +3 -6
  13. package/core/.claude/skills/dev_agent/SKILL.md +30 -491
  14. package/core/.claude/skills/developer/SKILL.md +3 -6
  15. package/core/.claude/skills/feature_agent/SKILL.md +3 -17
  16. package/core/.claude/skills/product_manager/SKILL.md +29 -1064
  17. package/core/.claude/skills/qa_engineer/SKILL.md +12 -17
  18. package/core/.claude/skills/spec_optimizer/SKILL.md +25 -275
  19. package/core/.claude/skills/sre_agent/SKILL.md +3 -6
  20. package/core/.collaboration/README.md +2 -3
  21. package/core/.collaboration/core/task-api.js +5 -138
  22. package/core/.collaboration/docs/CLI.md +0 -2
  23. package/core/.failure/INDEX.yaml +6 -40
  24. package/core/.failure/agent-execution/FAIL-013-search-cwd-drift-and-case-mismatch.yaml +1 -1
  25. package/core/.failure/tools/README.md +9 -227
  26. package/core/.formation/bifrost/exec.js +29 -4
  27. package/core/.formation/bifrost/launch.js +1 -6
  28. package/core/.formation/bifrost/launch.test.js +1 -1
  29. package/core/.formation/bifrost/provider-launch.js +18 -11
  30. package/core/.formation/bifrost/provider-launch.test.js +26 -2
  31. package/core/.formation/bifrost/shared/ansuz-boot-policy.js +3 -3
  32. package/core/.formation/bifrost/shared/ansuz-boot-policy.test.js +1 -2
  33. package/core/.formation/tools/__tests__/dispatch-cwd-project.test.js +42 -0
  34. package/core/.formation/tools/__tests__/m1-hmap-convid.test.js +1 -124
  35. package/core/.formation/tools/__tests__/subagent-executor.test.js +3 -2
  36. package/core/.formation/tools/dispatch.js +15 -2
  37. package/core/.formation/tools/loader.js +17 -140
  38. package/core/.formation/tools/post-complete.js +0 -31
  39. package/core/.rule/INDEX.yaml +0 -18
  40. package/core/.rule/general/agent-workflow.yaml +14 -164
  41. package/core/.rule/general/project-self-containment.yaml +8 -19
  42. package/core/.rule/general/rust-verify-target.yaml +6 -5
  43. package/core/.rule/general/synapse-code-intelligence.yaml +3 -3
  44. package/core/.specialist/Amelia/capability.yaml +12 -12
  45. package/core/.specialist/Amelia/workflow.yaml +2 -2
  46. package/core/.specialist/Ansuz/SYSTEM_DOC.md +20 -578
  47. package/core/.specialist/Ansuz/cognitive_principles.yaml +2 -3
  48. package/core/.specialist/Ansuz/concepts/boot_rules_summary.yaml +0 -1
  49. package/core/.specialist/Ansuz/concepts/deep_knowledge_pointers.yaml +1 -2
  50. package/core/.specialist/Ansuz/core.yaml +6 -108
  51. package/core/.specialist/Ansuz/guards/lesson_guards.yaml +0 -3
  52. package/core/.specialist/Ansuz/identity_contract.yaml +0 -1
  53. package/core/.specialist/Ansuz/knowledge.yaml +0 -4
  54. package/core/.specialist/Ansuz/rule.yaml +0 -1
  55. package/core/.specialist/Ansuz/tools/handoff-session-identity.test.js +6 -150
  56. package/core/.specialist/tests/runtime-discovery/README.md +1 -1
  57. package/core/.specialist/tools/__tests__/task-2374-usage-counter.test.js +1 -12
  58. package/core/.specialist/tools/prompt-files.test.js +1 -0
  59. package/core/.specialist/tools/task-bridge.js +1 -66
  60. package/core/.system/README.md +11 -552
  61. package/core/.system/collaboration/README.md +10 -174
  62. package/core/CLAUDE.md +1 -6
  63. package/core/KENAZ_CORE_VERSION +1 -1
  64. package/core/dev/scripts/js-yaml-resolution.test.js +1 -1
  65. package/core/dev/scripts/run-rust-tests.js +30 -46
  66. package/core/dev/scripts/run-rust-tests.test.js +17 -0
  67. package/core/dev/scripts/rust-verify-worktree.js +4 -4
  68. package/core/dev/scripts/verify-target-dir.js +6 -6
  69. package/core/plugins/kenaz/INVENTORY.md +8 -8
  70. package/core/plugins/kenaz/commands/architect.md +1 -2
  71. package/core/plugins/kenaz/commands/spec.md +1 -1
  72. package/core/plugins/kenaz/commands//347/224/242/345/223/201.md +1 -1
  73. package/core/plugins/kenaz/guidance.md +1 -1
  74. package/core/plugins/kenaz/scripts/sync.js +1 -1
  75. package/core/plugins/kenaz/scripts/ygg.js +6 -0
  76. package/core/plugins/kenaz/skills/architect_agent/SKILL.md +11 -92
  77. package/core/plugins/kenaz/skills/assessment_agent/SKILL.md +0 -1
  78. package/core/plugins/kenaz/skills/backend_engineer/SKILL.md +3 -6
  79. package/core/plugins/kenaz/skills/code_reviewer/SKILL.md +1 -1
  80. package/core/plugins/kenaz/skills/code_reviewer/patterns.yaml +1 -1
  81. package/core/plugins/kenaz/skills/designer/SKILL.md +3 -6
  82. package/core/plugins/kenaz/skills/dev_agent/SKILL.md +30 -491
  83. package/core/plugins/kenaz/skills/developer/SKILL.md +3 -6
  84. package/core/plugins/kenaz/skills/feature_agent/SKILL.md +3 -17
  85. package/core/plugins/kenaz/skills/product_manager/SKILL.md +29 -1064
  86. package/core/plugins/kenaz/skills/qa_engineer/SKILL.md +12 -17
  87. package/core/plugins/kenaz/skills/spec_optimizer/SKILL.md +25 -275
  88. package/core/plugins/kenaz/skills/sre_agent/SKILL.md +3 -6
  89. package/package.json +6 -6
  90. package/core/.claude/commands/archive.md +0 -24
  91. package/core/.claude/commands/init.md +0 -112
  92. package/core/.claude/commands/legacy_dev.md +0 -18
  93. package/core/.claude/commands/product-review.md +0 -131
  94. package/core/.claude/commands/strategy.md +0 -141
  95. package/core/.claude/commands/sunny.md +0 -1
  96. package/core/.claude/commands//347/224/242/345/223/201/346/252/242/350/246/226.md +0 -129
  97. package/core/.claude/commands//351/200/262/345/272/246.md +0 -15
  98. package/core/.claude/hooks/__tests__/substrate.test.js +0 -122
  99. package/core/.claude/hooks/_substrate-paths.js +0 -95
  100. package/core/.claude/hooks/context-check.js +0 -51
  101. package/core/.claude/hooks/fatigue-check.js +0 -52
  102. package/core/.claude/hooks/handoff-snapshot-on-commit.js +0 -154
  103. package/core/.claude/hooks/handoff-snapshot-on-question.js +0 -158
  104. package/core/.claude/hooks/handoff-staleness.js +0 -197
  105. package/core/.claude/hooks/jev-thalamus-context.js +0 -17
  106. package/core/.claude/hooks/jev-thalamus-context.test.js +0 -41
  107. package/core/.claude/hooks/lease-release.js +0 -119
  108. package/core/.claude/hooks/lease-touch.js +0 -96
  109. package/core/.claude/hooks/reflex-feedback.js +0 -5
  110. package/core/.claude/hooks/session-init.ps1 +0 -49
  111. package/core/.claude/hooks/sound-event.js +0 -70
  112. package/core/.claude/hooks/sound-event.sh +0 -37
  113. package/core/.claude/hooks/stream-delta.js +0 -169
  114. package/core/.claude/no-hooks.settings.json +0 -3
  115. package/core/.claude/skills/legacy_dev/SKILL.md +0 -202
  116. package/core/.claude/skills/sunny/SKILL.md +0 -74
  117. package/core/.collaboration/cli/commands/assign.js +0 -39
  118. package/core/.collaboration/cli/commands/claim.js +0 -33
  119. package/core/.collaboration/cli/commands/complete.js +0 -44
  120. package/core/.collaboration/cli/commands/create.js +0 -110
  121. package/core/.collaboration/cli/commands/get.js +0 -83
  122. package/core/.collaboration/cli/commands/index.js +0 -52
  123. package/core/.collaboration/cli/commands/list.js +0 -51
  124. package/core/.collaboration/cli/commands/lock.js +0 -45
  125. package/core/.collaboration/cli/commands/rebuild.js +0 -39
  126. package/core/.collaboration/cli/commands/search.js +0 -61
  127. package/core/.collaboration/cli/commands/stats.js +0 -61
  128. package/core/.collaboration/cli/commands/transfer.js +0 -41
  129. package/core/.collaboration/cli/commands/unlock.js +0 -48
  130. package/core/.collaboration/cli/formatters/help-formatter.js +0 -70
  131. package/core/.collaboration/cli/formatters/index.js +0 -7
  132. package/core/.collaboration/cli/task-cli.js +0 -46
  133. package/core/.collaboration/cli/utils/arg-parser.js +0 -74
  134. package/core/.collaboration/cli/utils/git-user.js +0 -25
  135. package/core/.collaboration/cli/utils/index.js +0 -9
  136. package/core/.collaboration/cli/utils/output.js +0 -10
  137. package/core/.collaboration/config/default.yaml +0 -189
  138. package/core/.collaboration/core/conflict-resolver.js +0 -461
  139. package/core/.collaboration/core/conflict-resolver.test.js +0 -389
  140. package/core/.collaboration/core/migrate-legacy.js +0 -260
  141. package/core/.collaboration/docs/API.md +0 -787
  142. package/core/.collaboration/docs/ARCHITECTURE.md +0 -596
  143. package/core/.collaboration/docs/FAQ.md +0 -695
  144. package/core/.collaboration/docs/MIGRATION.md +0 -804
  145. package/core/.collaboration/docs/examples/README.md +0 -320
  146. package/core/.collaboration/docs/examples/advanced-queries.js +0 -261
  147. package/core/.collaboration/docs/examples/basic-usage.js +0 -184
  148. package/core/.collaboration/docs/examples/team-workflow.js +0 -352
  149. package/core/.failure/agent-execution/FAIL-001-agent-no-output.yaml +0 -391
  150. package/core/.failure/agent-execution/FAIL-007-pm-lead-wrong-team-invocation.yaml +0 -0
  151. package/core/.failure/agent-execution/FAIL-010-phase0-poem-format-skipped.yaml +0 -28
  152. package/core/.failure/agent-execution/FAIL-010-skipping-cognitive-checkpoint-after-verification.yaml +0 -59
  153. package/core/.failure/agent-execution/FAIL-012-grep-shortcut-during-investigation.yaml +0 -85
  154. package/core/.failure/architecture/FAIL-006-python-version-compatibility.yaml +0 -445
  155. package/core/.failure/pipeline/FAIL-003-queue-pollution.yaml +0 -335
  156. package/core/.failure/pipeline/README.md +0 -95
  157. package/core/.failure/retired/FAIL-009-skipping-synapse-pulse-before-code-change.yaml +0 -49
  158. package/core/.failure/tools/USAGE_GUIDE.md +0 -323
  159. package/core/.failure/tools/check_failures.ps1 +0 -387
  160. package/core/.failure/tools/log_failure.ps1 +0 -474
  161. package/core/.formation/.episode-input.json +0 -10
  162. package/core/.formation/.merge-lock +0 -1
  163. package/core/.formation/lead.yaml +0 -118
  164. package/core/.formation/legacy.bak/designer.yaml +0 -57
  165. package/core/.formation/legacy.bak/pm.yaml +0 -57
  166. package/core/.formation/legacy.bak/qa.yaml +0 -57
  167. package/core/.formation/legacy.bak/review.yaml +0 -62
  168. package/core/.formation/legacy.bak/scheduler.yaml +0 -129
  169. package/core/.formation/legacy.bak/sre.yaml +0 -57
  170. package/core/.formation/role-map.yaml +0 -274
  171. package/core/.formation/roles/_shared/modules/code_review.yaml +0 -98
  172. package/core/.formation/roles/_shared/modules/security.yaml +0 -103
  173. package/core/.formation/roles/_shared/modules/testing.yaml +0 -14
  174. package/core/.formation/roles/backend/role.yaml +0 -93
  175. package/core/.formation/roles/code_reviewer/role.yaml +0 -102
  176. package/core/.formation/roles/database_optimizer/role.yaml +0 -107
  177. package/core/.formation/roles/designer/role.yaml +0 -66
  178. package/core/.formation/roles/developer/role.yaml +0 -75
  179. package/core/.formation/roles/frontend/role.yaml +0 -134
  180. package/core/.formation/roles/incident_response/role.yaml +0 -89
  181. package/core/.formation/roles/qa/role.yaml +0 -89
  182. package/core/.formation/roles/security/role.yaml +0 -87
  183. package/core/.formation/roles/sre/role.yaml +0 -66
  184. package/core/.formation/skills/coordinator.yaml +0 -52
  185. package/core/.formation/solo/diagnosis.yaml +0 -78
  186. package/core/.formation/solo/strategy.yaml +0 -121
  187. package/core/.formation/tests/hello.txt +0 -2
  188. package/core/.formation/tools/coordinator.js +0 -350
  189. package/core/.formation/tools/jev-correction.js +0 -214
  190. package/core/.formation/tools/jev-correction.test.js +0 -178
  191. package/core/.formation/tools/log-reader.js +0 -232
  192. package/core/.formation/tools/revert-daemon-state.js +0 -162
  193. package/core/.formation/tools/test-drift.js +0 -148
  194. package/core/.formation/unit/heimdall.yaml +0 -96
  195. package/core/.formation/unit/plan.yaml +0 -67
  196. package/core/.formation/unit/think.yaml +0 -58
  197. package/core/.kenaz/MUNINN_SNAPSHOT9_EPISODE.json +0 -32
  198. package/core/.kenaz/MUNINN_SNAPSHOT9_RUNE.json +0 -23
  199. package/core/.kenaz/MUNINN_SNAPSHOT9_SUMMARY.md +0 -89
  200. package/core/.kenaz/ash_TASK_1428-20260507.json +0 -14
  201. package/core/.kenaz/muninn_episode_write.ps1 +0 -17
  202. package/core/.kenaz/muninn_snapshot11_rune_candidates.md +0 -63
  203. package/core/.kenaz/muninn_snapshot1_rune_candidates.md +0 -49
  204. package/core/.kenaz/runes_TASK_1428.json +0 -57
  205. package/core/.kenaz/tmp_heimdall_proposal_8d3e392.json +0 -13
  206. package/core/.kenaz/tmp_props.json +0 -1
  207. package/core/.kenaz/tmp_sounddrop_t1_prompt.txt +0 -371
  208. package/core/.rule/MECHANIZED.md +0 -61
  209. package/core/.rule/general/cortex-memory-recall.yaml +0 -446
  210. package/core/.rule/general/pipeline.yaml +0 -246
  211. package/core/.rule/general/sunny-access-control.yaml +0 -60
  212. package/core/.rule/general/system-invariants.yaml +0 -231
  213. package/core/.rule/pipeline/PPL-002-completed-task-archival.yaml +0 -528
  214. package/core/.rule/pipeline/auto-update.yaml +0 -282
  215. package/core/.rule/pipeline/task-execution.yaml +0 -365
  216. package/core/.specialist/Ansuz/concepts/phase_protocol.yaml +0 -65
  217. package/core/.specialist/Ansuz/experiments/boot_ablation_replay.js +0 -197
  218. package/core/.specialist/Ansuz/tools/bootstrap-anchors.js +0 -289
  219. package/core/.specialist/Ansuz/workflow.yaml +0 -1225
  220. package/core/.specialist/experiments/rg_benchmark.js +0 -523
  221. package/core/.specialist/experiments/rg_benchmark_results.json +0 -27
  222. package/core/.specialist/tools/jev-optional-context.js +0 -107
  223. package/core/.specialist/tools/jev-optional-context.test.js +0 -152
  224. package/core/.specialist/tools/memory-action-log.js +0 -839
  225. package/core/.specialist/tools/phase-gate.js +0 -3534
  226. package/core/.specialist/tools/phase-gate.test.js +0 -85
  227. package/core/.specialist/tools/precompute-runner.js +0 -444
  228. package/core/.specialist/tools/rule-engine.js +0 -621
  229. package/core/.specialist/tools/task-bridge-jev.test.js +0 -170
  230. package/core/.synapse/memory-shared.json.sync +0 -1
  231. package/core/.system/agent-skills/README.md +0 -724
  232. package/core/.system/cli-tools/README.md +0 -724
  233. package/core/.system/cortex/MODULES.md +0 -1046
  234. package/core/.system/dashboard/FRONTEND.md +0 -812
  235. package/core/.system/dashboard/README.md +0 -737
  236. package/core/.system/failure/README.md +0 -723
  237. package/core/.system/formation/LEGACY_SKILLS.md +0 -974
  238. package/core/.system/formation/POST_COMPLETE.md +0 -602
  239. package/core/.system/formation/README.md +0 -1094
  240. package/core/.system/formation/TOOLS_REFERENCE.md +0 -1145
  241. package/core/.system/kenaz/README.md +0 -787
  242. package/core/.system/memory/README.md +0 -719
  243. package/core/.system/pipeline/README.md +0 -712
  244. package/core/.system/rule/README.md +0 -794
  245. package/core/.system/sunny/README.md +0 -476
  246. package/core/.system/sunny/RULES.json +0 -89
  247. package/core/.system/sunny/knowledge/INDEX.md +0 -37
  248. package/core/.system/sunny/knowledge/agent-teams-api.md +0 -0
  249. package/core/.system/sunny/knowledge/ansuz-specialist.md +0 -500
  250. package/core/.system/sunny/knowledge/claude-cli-spawn.md +0 -177
  251. package/core/.system/sunny/knowledge/collaboration-api.md +0 -925
  252. package/core/.system/sunny/teammates/README.md +0 -107
  253. package/core/.system/sunny/teammates/how_to_use.yaml +0 -101
  254. package/core/.system/sunny/teammates/tools/headless/launcher.js +0 -318
  255. package/core/.system/sunny/teammates/tools/powershell/launcher.js +0 -241
  256. package/core/.system/sunny/teammates/tools/powershell/start.bat +0 -50
  257. package/core/.system/sunny/teammates/tools/utils/env.js +0 -96
  258. package/core/.system/sunny/teammates/tools/utils/format-output.js +0 -329
  259. package/core/.system/sunny/tools.json +0 -101
  260. package/core/dev/scripts/cleanup-queue.js +0 -184
  261. package/core/dev/scripts/cleanup_queue.js +0 -86
  262. package/core/dev/scripts/legacy/README.md +0 -39
  263. package/core/dev/scripts/legacy/dev_agent_scheduler.ps1.bak +0 -536
  264. package/core/dev/scripts/legacy/multi_agent_scheduler.ps1.bak +0 -1978
  265. package/core/dev/scripts/matrix/CLI_README.md +0 -214
  266. package/core/dev/scripts/matrix/README.md +0 -310
  267. package/core/dev/scripts/matrix/package-lock.json +0 -4266
  268. package/core/dev/scripts/matrix/package.json +0 -55
  269. package/core/dev/scripts/matrix/src/abbreviations.ts +0 -295
  270. package/core/dev/scripts/matrix/src/cli/commands/convert.ts +0 -211
  271. package/core/dev/scripts/matrix/src/cli/commands/create.ts +0 -95
  272. package/core/dev/scripts/matrix/src/cli/commands/delete.ts +0 -102
  273. package/core/dev/scripts/matrix/src/cli/commands/list-tags.ts.wip +0 -140
  274. package/core/dev/scripts/matrix/src/cli/commands/manage-tags.ts.wip +0 -173
  275. package/core/dev/scripts/matrix/src/cli/commands/query.ts +0 -261
  276. package/core/dev/scripts/matrix/src/cli/commands/read.ts +0 -77
  277. package/core/dev/scripts/matrix/src/cli/commands/stats.ts.wip +0 -168
  278. package/core/dev/scripts/matrix/src/cli/commands/tokens.ts.wip +0 -126
  279. package/core/dev/scripts/matrix/src/cli/commands/update.ts +0 -147
  280. package/core/dev/scripts/matrix/src/cli/commands/validate.ts +0 -275
  281. package/core/dev/scripts/matrix/src/cli/index.ts +0 -350
  282. package/core/dev/scripts/matrix/src/cli/utils/file-handler.ts +0 -72
  283. package/core/dev/scripts/matrix/src/cli/utils/logger.ts +0 -65
  284. package/core/dev/scripts/matrix/src/index.ts +0 -62
  285. package/core/dev/scripts/matrix/src/indexer/tag-indexer.ts +0 -165
  286. package/core/dev/scripts/matrix/src/parser.ts +0 -281
  287. package/core/dev/scripts/matrix/src/serializer.ts +0 -151
  288. package/core/dev/scripts/matrix/src/validator.ts +0 -301
  289. package/core/dev/scripts/matrix/tests/abbreviations.test.ts +0 -122
  290. package/core/dev/scripts/matrix/tests/cli.test.ts +0 -177
  291. package/core/dev/scripts/matrix/tests/convert.test.ts +0 -143
  292. package/core/dev/scripts/matrix/tests/parser.test.ts +0 -203
  293. package/core/dev/scripts/matrix/tests/query.test.ts +0 -85
  294. package/core/dev/scripts/matrix/tests/serializer.test.ts +0 -197
  295. package/core/dev/scripts/matrix/tests/validate.test.ts +0 -141
  296. package/core/dev/scripts/matrix/tests/validator.test.ts +0 -167
  297. package/core/dev/scripts/matrix/tsconfig.json +0 -20
  298. package/core/dev/scripts/matrix/types/index.d.ts +0 -111
  299. package/core/dev/scripts/matrix/types/index.d.ts.map +0 -1
  300. package/core/dev/scripts/matrix/types/index.js +0 -8
  301. package/core/dev/scripts/matrix/types/index.js.map +0 -1
  302. package/core/dev/scripts/matrix/types/index.ts +0 -124
  303. package/core/dev/scripts/memory-usage-report.js +0 -152
  304. package/core/dev/scripts/probe/ansuz-scaffold-ablation.js +0 -579
  305. package/core/dev/scripts/probe/ansuz-scaffold-ablation.test.js +0 -244
  306. package/core/dev/scripts/probe/hook-latency-probe.js +0 -315
  307. package/core/dev/scripts/probe/hook-latency-probe.test.js +0 -105
  308. package/core/dev/scripts/probe/prediction-signal-auc.js +0 -483
  309. package/core/dev/scripts/probe/prediction-signal-auc.test.js +0 -200
  310. package/core/dev/scripts/test-pty-ws-tunnel.js +0 -229
  311. package/core/dev/scripts/validate_pipeline.js +0 -197
  312. package/core/dev/spikes/task2145-evidence-20261004/backend-log-excerpt.txt +0 -56
  313. package/core/dev/spikes/task2145-evidence-20261004/graph.shadow +0 -0
  314. package/core/dev/spikes/task2145-evidence-20261004/graph.wal +0 -0
  315. package/core/dev/spikes/task2145-evidence-20261004/graph_corrupt_suspect.marker +0 -1
  316. package/core/plugins/kenaz/commands/strategy.md +0 -141
@@ -1,695 +0,0 @@
1
- # .collaboration 常見問題 (FAQ)
2
-
3
- 關於 .collaboration 分散式任務協作系統的常見問題解答。
4
-
5
- ## 目錄
6
-
7
- - [基本概念](#基本概念)
8
- - [安裝與設置](#安裝與設置)
9
- - [任務管理](#任務管理)
10
- - [Git 工作流程](#git-工作流程)
11
- - [衝突處理](#衝突處理)
12
- - [效能與優化](#效能與優化)
13
- - [疑難排解](#疑難排解)
14
- - [最佳實踐](#最佳實踐)
15
-
16
- ---
17
-
18
- ## 基本概念
19
-
20
- ### Q: 什麼是 .collaboration 系統?
21
-
22
- **A**: `.collaboration` 是一個基於 Git 的分散式任務協作系統,特色包括:
23
-
24
- - **分散式** - 無需中央伺服器,完全基於 Git
25
- - **原子文件** - 每個任務一個 JSON 文件,最小化衝突
26
- - **UUID 任務 ID** - 全局唯一,可排序(ULID 格式)
27
- - **JSONL 索引** - Append-only 格式,Git 合併友好
28
- - **樂觀鎖定** - 版本號衝突偵測
29
-
30
- ---
31
-
32
- ### Q: 為什麼要使用 .collaboration 而不是其他任務管理工具?
33
-
34
- **A**: 主要優勢:
35
-
36
- | 特性 | .collaboration | Jira/Trello | GitHub Issues |
37
- |------|---------------|-------------|---------------|
38
- | **離線工作** | ✅ 完全支援 | ❌ 需要網路 | ❌ 需要網路 |
39
- | **版本控制** | ✅ Git 原生 | ❌ 需手動 | ⚠️ 有限支援 |
40
- | **自訂欄位** | ✅ JSON 格式 | ⚠️ 受限 | ⚠️ 受限 |
41
- | **API 存取** | ✅ 完全控制 | ⚠️ 受限 | ⚠️ Rate Limit |
42
- | **資料所有權** | ✅ 你擁有 | ❌ 供應商 | ❌ GitHub |
43
- | **成本** | ✅ 免費 | 💰 付費 | ✅ 免費(有限) |
44
-
45
- **適用場景**:
46
- - ✅ 需要離線工作
47
- - ✅ 需要完全控制資料
48
- - ✅ 已使用 Git 進行協作
49
- - ✅ 需要與代碼緊密整合
50
-
51
- **不適用場景**:
52
- - ❌ 非技術團隊(CLI 使用困難)
53
- - ❌ 需要豐富的 UI 介面
54
- - ❌ 需要複雜的工作流程(如 Scrum/Kanban)
55
-
56
- ---
57
-
58
- ### Q: 任務 ID 的格式是什麼?
59
-
60
- **A**: 格式為 `TASK_` + 10 字元 ULID
61
-
62
- ```
63
- TASK_5KPEES80MMXH
64
- ↑↑↑↑↑↑ ↑↑↑↑
65
- 時間部分 隨機部分
66
- (6字元) (4字元)
67
- ```
68
-
69
- **特性**:
70
- - **時間部分**:可排序,精確到毫秒
71
- - **隨機部分**:確保唯一性
72
- - **編碼**:Crockford Base32(避免 0/O, 1/I/L 歧義)
73
-
74
- **範例**:
75
- ```javascript
76
- const { generateTaskID } = require('./.collaboration/core/id-generator.js');
77
-
78
- console.log(generateTaskID()); // TASK_5KPEES80MMXH
79
- console.log(generateTaskID()); // TASK_5KPEES80NRTW (不同時間,不同隨機)
80
- ```
81
-
82
- ---
83
-
84
- ## 安裝與設置
85
-
86
- ### Q: 如何在新專案中使用 .collaboration?
87
-
88
- **A**: 複製目錄結構即可:
89
-
90
- ```bash
91
- # 1. 複製整個 .collaboration 目錄到新專案
92
- cp -r /path/to/template/.collaboration /path/to/new-project/
93
-
94
- # 2. 初始化 Git(如果尚未初始化)
95
- cd /path/to/new-project
96
- git init
97
-
98
- # 3. 測試是否正常
99
- node .collaboration/cli/task-cli.js --help
100
-
101
- # 4. 建立第一個任務
102
- node .collaboration/cli/task-cli.js create --title "初始化專案" --priority P1
103
- ```
104
-
105
- ---
106
-
107
- ### Q: 需要安裝什麼依賴?
108
-
109
- **A**: 只需要 Node.js(>= 14)
110
-
111
- ```bash
112
- # 檢查 Node.js 版本
113
- node --version # 應該 >= 14.0.0
114
-
115
- # 無需 npm install!系統使用 Node.js 內建模組:
116
- # - fs (檔案系統)
117
- # - path (路徑處理)
118
- # - child_process (Git 命令)
119
- ```
120
-
121
- ---
122
-
123
- ### Q: 如何整合到現有專案?
124
-
125
- **A**: 參考[遷移指南](./MIGRATION.md)
126
-
127
- 簡要步驟:
128
- 1. 備份現有任務資料
129
- 2. 複製 `.collaboration/` 目錄
130
- 3. 執行遷移腳本(可選)
131
- 4. 驗證遷移結果
132
- 5. 提交到 Git
133
-
134
- ---
135
-
136
- ## 任務管理
137
-
138
- ### Q: 如何建立任務?
139
-
140
- **A**: 使用 CLI 或 API
141
-
142
- **CLI 方式**:
143
- ```bash
144
- node .collaboration/cli/task-cli.js create \
145
- --title "實作登入功能" \
146
- --description "建立登入頁面和認證 API" \
147
- --priority P1
148
- ```
149
-
150
- **API 方式**:
151
- ```javascript
152
- const { TaskAPI } = require('./.collaboration/core/task-api.js');
153
- const api = new TaskAPI();
154
-
155
- const task = await api.createTask({
156
- title: '實作登入功能',
157
- description: '建立登入頁面和認證 API',
158
- priority: 'P1'
159
- });
160
-
161
- console.log(`任務已建立: ${task.id}`);
162
- ```
163
-
164
- ---
165
-
166
- ### Q: 如何查看我的任務?
167
-
168
- **A**: 按分配對象過濾
169
-
170
- ```bash
171
- # 方法 1:CLI(需要知道 Git 用戶名)
172
- node .collaboration/cli/task-cli.js list --assigned-to $(git config user.email | cut -d@ -f1)
173
-
174
- # 方法 2:API
175
- const api = new TaskAPI();
176
- const gitUser = execSync('git config user.email').toString().trim().split('@')[0];
177
- const myTasks = await api.queryTasks({ assigned_to: gitUser });
178
- ```
179
-
180
- ---
181
-
182
- ### Q: 如何更新任務狀態?
183
-
184
- **A**: 使用 `updateTask` API
185
-
186
- ```javascript
187
- const api = new TaskAPI();
188
-
189
- // 更新狀態
190
- await api.updateTask('TASK_5KPEES80MMXH', {
191
- status: 'in_progress'
192
- });
193
-
194
- // 或使用預設方法
195
- await api.claimTask('TASK_5KPEES80MMXH'); // → in_progress
196
- await api.completeTask('TASK_5KPEES80MMXH'); // → completed
197
- ```
198
-
199
- ---
200
-
201
- ### Q: 任務狀態有哪些?
202
-
203
- **A**: 4 種標準狀態
204
-
205
- | 狀態 | 說明 | 轉換 |
206
- |------|------|------|
207
- | `pending` | 待執行 | 初始狀態 |
208
- | `in_progress` | 執行中 | 認領後 |
209
- | `completed` | 已完成 | 完成後 |
210
- | `blocked` | 已阻塞 | 遇到阻礙 |
211
-
212
- **狀態流轉**:
213
- ```
214
- pending → in_progress → completed
215
- ↓
216
- blocked → in_progress
217
- ```
218
-
219
- ---
220
-
221
- ### Q: 如何設置任務優先級?
222
-
223
- **A**: 使用 P0-P3 級別
224
-
225
- | 優先級 | 說明 | SLA |
226
- |-------|------|-----|
227
- | `P0` | 緊急(Critical) | 立即處理 |
228
- | `P1` | 高(High) | 24 小時內 |
229
- | `P2` | 中(Medium) | 1 週內 |
230
- | `P3` | 低(Low) | 有空處理 |
231
-
232
- **範例**:
233
- ```bash
234
- # 建立緊急任務
235
- node .collaboration/cli/task-cli.js create \
236
- --title "修復線上登入問題" \
237
- --priority P0
238
-
239
- # 查看所有 P0 任務
240
- node .collaboration/cli/task-cli.js list --priority P0
241
- ```
242
-
243
- ---
244
-
245
- ## Git 工作流程
246
-
247
- ### Q: 何時需要提交到 Git?
248
-
249
- **A**: 每次建立或更新任務後
250
-
251
- **最佳實踐**:
252
- ```bash
253
- # 1. 建立任務
254
- task-cli.js create --title "新功能"
255
-
256
- # 2. 立即提交
257
- git add .collaboration/tasks/
258
- git commit -m "feat: 建立任務 TASK_5KPEES80MMXH"
259
- git push
260
-
261
- # 3. 認領任務
262
- task-cli.js claim TASK_5KPEES80MMXH
263
-
264
- # 4. 再次提交
265
- git add .collaboration/tasks/
266
- git commit -m "chore: 認領任務 TASK_5KPEES80MMXH"
267
- git push
268
- ```
269
-
270
- **為什麼要立即提交?**
271
- - ✅ 其他用戶可以看到任務
272
- - ✅ 避免本地丟失
273
- - ✅ 記錄變更歷史
274
-
275
- ---
276
-
277
- ### Q: 如何同步其他用戶的任務?
278
-
279
- **A**: 定期 `git pull`
280
-
281
- ```bash
282
- # 每天開始工作前
283
- git pull origin main
284
-
285
- # 列出所有任務(包含其他用戶建立的)
286
- task-cli.js list
287
- ```
288
-
289
- **建議頻率**:
290
- - 每天早上 1 次
291
- - 認領任務前 1 次
292
- - 提交任務前 1 次
293
-
294
- ---
295
-
296
- ### Q: Commit Message 有什麼建議格式?
297
-
298
- **A**: 使用 Conventional Commits
299
-
300
- ```bash
301
- # 建立任務
302
- git commit -m "feat: 建立任務 TASK_5KPEES80MMXH - 實作登入功能"
303
-
304
- # 認領任務
305
- git commit -m "chore: 認領任務 TASK_5KPEES80MMXH"
306
-
307
- # 完成任務
308
- git commit -m "feat: 完成任務 TASK_5KPEES80MMXH - 實作登入功能"
309
-
310
- # 修正任務
311
- git commit -m "fix: 修正任務 TASK_5KPEES80MMXH 的描述"
312
- ```
313
-
314
- **前綴規則**:
315
- - `feat:` - 建立新任務、完成任務
316
- - `chore:` - 認領、分配、狀態更新
317
- - `fix:` - 修正任務資料
318
- - `docs:` - 更新任務描述
319
-
320
- ---
321
-
322
- ## 衝突處理
323
-
324
- ### Q: 為什麼會發生 Git 衝突?
325
-
326
- **A**: 當兩個用戶同時編輯同一任務時
327
-
328
- **範例**:
329
- ```
330
- 用戶 A(10:00) 用戶 B(10:00)
331
- ↓ ↓
332
- 讀取 TASK_XXX.json 讀取 TASK_XXX.json
333
- (_version: 1) (_version: 1)
334
- ↓ ↓
335
- 修改 status → in_progress 修改 priority → P0
336
- ↓ ↓
337
- 寫入 (_version: 2) 寫入 (_version: 2)
338
- ↓ ↓
339
- git commit & push ✅ git commit & push ❌
340
- ↓
341
- 衝突!
342
- ```
343
-
344
- ---
345
-
346
- ### Q: 如何避免衝突?
347
-
348
- **A**: 使用鎖定機制
349
-
350
- ```bash
351
- # 1. 鎖定任務
352
- task-cli.js lock TASK_5KPEES80MMXH
353
-
354
- # 2. 修改任務
355
- # ... 執行工作 ...
356
-
357
- # 3. 完成後解鎖
358
- task-cli.js unlock TASK_5KPEES80MMXH
359
- ```
360
-
361
- **自動過期**:
362
- - 預設鎖定 60 分鐘
363
- - 過期後自動釋放
364
-
365
- ---
366
-
367
- ### Q: 如何解決已發生的衝突?
368
-
369
- **A**: 手動合併或使用版本號判斷
370
-
371
- **步驟 1:檢查衝突**
372
- ```bash
373
- git pull origin main
374
- # CONFLICT (content): Merge conflict in .collaboration/tasks/db/all/TASK_XXX.json
375
- ```
376
-
377
- **步驟 2:查看衝突內容**
378
- ```bash
379
- cat .collaboration/tasks/db/all/TASK_5KPEES80MMXH.json
380
-
381
- # <<<<<<< HEAD
382
- # "status": "in_progress",
383
- # "_version": 2,
384
- # "last_modified_by": { "git_user": "zhangsan", "timestamp": "2026-02-11T10:05:00Z" }
385
- # =======
386
- # "priority": "P0",
387
- # "_version": 2,
388
- # "last_modified_by": { "git_user": "lisi", "timestamp": "2026-02-11T10:08:00Z" }
389
- # >>>>>>> origin/main
390
- ```
391
-
392
- **步驟 3:判斷保留哪個版本**
393
-
394
- 使用時間戳判斷:
395
- - `zhangsan`: 10:05:00
396
- - `lisi`: 10:08:00
397
- - **保留 lisi 的版本**(較新)
398
-
399
- **步驟 4:合併並遞增版本號**
400
- ```json
401
- {
402
- "status": "in_progress",
403
- "priority": "P0",
404
- "_version": 3, // 遞增版本號
405
- "last_modified_by": {
406
- "git_user": "lisi",
407
- "timestamp": "2026-02-11T10:08:00Z"
408
- }
409
- }
410
- ```
411
-
412
- **步驟 5:標記為已解決**
413
- ```bash
414
- git add .collaboration/tasks/db/all/TASK_5KPEES80MMXH.json
415
- git commit -m "fix: 解決任務 TASK_5KPEES80MMXH 的合併衝突"
416
- git push
417
- ```
418
-
419
- ---
420
-
421
- ### Q: 未來會有自動衝突解決工具嗎?
422
-
423
- **A**: 是的!計劃中的 `conflict-resolver.js`
424
-
425
- ```bash
426
- # 未來使用方式
427
- node .collaboration/core/conflict-resolver.js TASK_5KPEES80MMXH
428
-
429
- # 輸出:
430
- # 🔍 檢測到衝突
431
- # 本地版本(zhangsan, 10:05:00): status → in_progress
432
- # 遠端版本(lisi, 10:08:00): priority → P0
433
- #
434
- # 推薦操作:保留遠端版本(較新)
435
- # 是否自動合併?(y/n)
436
- ```
437
-
438
- ---
439
-
440
- ## 效能與優化
441
-
442
- ### Q: 任務數量很多時會變慢嗎?
443
-
444
- **A**: 不會,已優化
445
-
446
- **原因**:
447
- 1. **JSONL 索引** - 無需載入所有任務
448
- 2. **扁平化存儲** - 無需遍歷目錄
449
- 3. **按需查詢** - 只載入需要的任務
450
-
451
- **效能測試**:
452
- | 任務數量 | 查詢時間 | 建立時間 |
453
- |---------|---------|---------|
454
- | 100 | < 10ms | < 5ms |
455
- | 1,000 | < 50ms | < 5ms |
456
- | 10,000 | < 200ms | < 5ms |
457
-
458
- ---
459
-
460
- ### Q: 如何加速查詢?
461
-
462
- **A**: 使用索引查詢
463
-
464
- ```bash
465
- # ❌ 慢:載入所有任務再過濾
466
- const all = await api.getAllTasks();
467
- const pending = all.tasks.filter(t => t.status === 'pending');
468
-
469
- # ✅ 快:使用索引直接查詢
470
- const pending = await api.queryTasks({ status: 'pending' });
471
- ```
472
-
473
- ---
474
-
475
- ### Q: 索引會自動更新嗎?
476
-
477
- **A**: 會,但建議定期重建
478
-
479
- **自動更新**:
480
- - 建立任務時自動更新索引
481
- - 更新任務時自動更新索引
482
-
483
- **定期重建**(建議每週):
484
- ```bash
485
- task-cli.js rebuild
486
- ```
487
-
488
- ---
489
-
490
- ## 疑難排解
491
-
492
- ### Q: 執行 CLI 報錯 "Cannot find module"
493
-
494
- **A**: 檢查 Node.js 版本和路徑
495
-
496
- ```bash
497
- # 1. 檢查 Node.js 版本
498
- node --version # 應該 >= 14
499
-
500
- # 2. 確認在正確的目錄
501
- pwd # 應該在專案根目錄
502
-
503
- # 3. 檢查文件是否存在
504
- ls .collaboration/cli/task-cli.js
505
- ls .collaboration/core/task-api.js
506
-
507
- # 4. 嘗試完整路徑
508
- node "$(pwd)/.collaboration/cli/task-cli.js" --help
509
- ```
510
-
511
- ---
512
-
513
- ### Q: 建立任務後看不到文件
514
-
515
- **A**: 檢查權限和路徑
516
-
517
- ```bash
518
- # 1. 檢查目錄權限
519
- ls -la .collaboration/tasks/db/all/
520
-
521
- # 2. 檢查是否真的建立成功
522
- task-cli.js list
523
-
524
- # 3. 手動查找文件
525
- find .collaboration/tasks/ -name "TASK_*.json"
526
- ```
527
-
528
- ---
529
-
530
- ### Q: Git 提交後其他用戶看不到任務
531
-
532
- **A**: 檢查是否推送到遠端
533
-
534
- ```bash
535
- # 1. 檢查本地提交
536
- git log -1 --oneline
537
-
538
- # 2. 檢查是否推送
539
- git status # 應該顯示 "Your branch is up to date"
540
-
541
- # 3. 如果未推送,推送它
542
- git push origin main
543
-
544
- # 4. 其他用戶拉取
545
- git pull origin main
546
- ```
547
-
548
- ---
549
-
550
- ### Q: 任務 ID 無法識別
551
-
552
- **A**: 檢查格式
553
-
554
- ```bash
555
- # ✅ 正確格式
556
- TASK_5KPEES80MMXH # TASK_ + 10 字元
557
-
558
- # ❌ 錯誤格式
559
- TASK_147 # 舊格式(不支援)
560
- TASK-5KPEES80MMXH # 錯誤分隔符
561
- task_5kpees80mmxh # 小寫(不支援)
562
- ```
563
-
564
- ---
565
-
566
- ## 最佳實踐
567
-
568
- ### Q: 團隊協作有什麼建議?
569
-
570
- **A**: 遵循這些原則
571
-
572
- 1. **每天同步** - 早上第一件事 `git pull`
573
- 2. **使用鎖定** - 長時間工作時鎖定任務
574
- 3. **小步提交** - 每次只修改一個任務
575
- 4. **清晰描述** - 任務標題和描述要清楚
576
- 5. **及時更新** - 狀態變化時立即提交
577
-
578
- ---
579
-
580
- ### Q: 如何組織大型專案的任務?
581
-
582
- **A**: 使用標籤和優先級
583
-
584
- ```javascript
585
- // 建立任務時加入標籤
586
- const task = await api.createTask({
587
- title: '實作登入功能',
588
- priority: 'P1',
589
- tags: ['frontend', 'auth', 'sprint-1'] // 自訂欄位
590
- });
591
-
592
- // 查詢時過濾
593
- const allData = await api.getAllTasks();
594
- const authTasks = allData.tasks.filter(t => t.tags?.includes('auth'));
595
- ```
596
-
597
- ---
598
-
599
- ### Q: 如何追蹤任務歷史?
600
-
601
- **A**: 使用 Git log
602
-
603
- ```bash
604
- # 查看任務的所有變更
605
- git log --oneline --follow .collaboration/tasks/db/all/TASK_5KPEES80MMXH.json
606
-
607
- # 查看詳細差異
608
- git log -p .collaboration/tasks/db/all/TASK_5KPEES80MMXH.json
609
-
610
- # 查看特定欄位變更
611
- git log -S '"status"' .collaboration/tasks/db/all/TASK_5KPEES80MMXH.json
612
- ```
613
-
614
- ---
615
-
616
- ### Q: 如何備份任務資料?
617
-
618
- **A**: Git 本身就是備份
619
-
620
- ```bash
621
- # 1. 定期推送到遠端
622
- git push origin main
623
-
624
- # 2. 額外備份到其他遠端(可選)
625
- git remote add backup https://gitlab.com/user/project.git
626
- git push backup main
627
-
628
- # 3. 本地備份(可選)
629
- tar -czf tasks-backup-$(date +%Y%m%d).tar.gz .collaboration/tasks/
630
- ```
631
-
632
- ---
633
-
634
- ### Q: 如何整合到 CI/CD?
635
-
636
- **A**: 使用 Git Hooks 或 CI 腳本
637
-
638
- **GitHub Actions 範例**:
639
- ```yaml
640
- # .github/workflows/task-validation.yml
641
- name: Task Validation
642
-
643
- on: [push, pull_request]
644
-
645
- jobs:
646
- validate:
647
- runs-on: ubuntu-latest
648
- steps:
649
- - uses: actions/checkout@v2
650
-
651
- - name: Setup Node.js
652
- uses: actions/setup-node@v2
653
- with:
654
- node-version: '14'
655
-
656
- - name: Validate Task Files
657
- run: |
658
- node .collaboration/tools/validate-all-tasks.js
659
-
660
- - name: Rebuild Index
661
- run: |
662
- node .collaboration/cli/task-cli.js rebuild
663
-
664
- - name: Check for Changes
665
- run: |
666
- if [ -n "$(git status --porcelain)" ]; then
667
- echo "索引需要重建!"
668
- exit 1
669
- fi
670
- ```
671
-
672
- ---
673
-
674
- ## 相關文檔
675
-
676
- - [API 參考文檔](./API.md) - JavaScript API 完整文檔
677
- - [CLI 使用指南](./CLI.md) - 命令列工具文檔
678
- - [遷移指南](./MIGRATION.md) - 從舊系統遷移步驟
679
- - [架構設計](./ARCHITECTURE.md) - 系統架構詳細說明
680
-
681
- ---
682
-
683
- **版本**: 1.0.0
684
- **最後更新**: 2026-02-11
685
- **維護者**: Developer Team
686
-
687
- ---
688
-
689
- ## 還有問題?
690
-
691
- 如果本 FAQ 未涵蓋您的問題,請:
692
-
693
- 1. 查看[完整文檔](./)
694
- 2. 檢查 [GitHub Issues](https://github.com/your/repo/issues)(如果適用)
695
- 3. 聯繫團隊維護者