cc-devflow 4.3.0 → 4.4.1

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 (575) hide show
  1. package/.claude/skills/cc-act/CHANGELOG.md +64 -0
  2. package/.claude/skills/cc-act/PLAYBOOK.md +212 -0
  3. package/.claude/skills/cc-act/SKILL.md +322 -0
  4. package/.claude/skills/cc-act/assets/PR_BRIEF_TEMPLATE.md +64 -0
  5. package/.claude/skills/cc-act/assets/RELEASE_NOTE_TEMPLATE.md +25 -0
  6. package/.claude/skills/cc-act/references/closure-contract.md +49 -0
  7. package/.claude/skills/cc-act/references/git-commit-guidelines.md +83 -0
  8. package/.claude/skills/cc-act/scripts/archive-requirement.sh +49 -0
  9. package/.claude/skills/cc-act/scripts/cc-act-common.sh +240 -0
  10. package/.claude/skills/cc-act/scripts/detect-ship-target.sh +82 -0
  11. package/.claude/skills/cc-act/scripts/generate-status-report.sh +83 -0
  12. package/.claude/skills/cc-act/scripts/render-pr-brief.sh +195 -0
  13. package/.claude/skills/cc-act/scripts/sync-act-docs.sh +315 -0
  14. package/.claude/skills/cc-act/scripts/verify-act-gate.sh +63 -0
  15. package/.claude/skills/cc-check/CHANGELOG.md +73 -0
  16. package/.claude/skills/cc-check/PLAYBOOK.md +153 -0
  17. package/.claude/skills/cc-check/SKILL.md +345 -0
  18. package/.claude/skills/cc-check/assets/REPORT_CARD_TEMPLATE.json +50 -0
  19. package/.claude/skills/cc-check/references/gate-contract.md +29 -0
  20. package/.claude/skills/cc-check/references/review-contract.md +45 -0
  21. package/.claude/skills/cc-check/scripts/render-report-card.js +229 -0
  22. package/.claude/skills/cc-check/scripts/run-quality-gates.sh +86 -0
  23. package/.claude/skills/cc-check/scripts/verify-gate.sh +57 -0
  24. package/.claude/skills/cc-do/CHANGELOG.md +49 -0
  25. package/.claude/skills/cc-do/PLAYBOOK.md +119 -0
  26. package/.claude/skills/cc-do/SKILL.md +216 -0
  27. package/.claude/skills/cc-do/references/execution-recovery.md +86 -0
  28. package/.claude/skills/cc-do/references/parallel-dispatch.md +80 -0
  29. package/.claude/skills/cc-do/scripts/build-task-context.sh +184 -0
  30. package/.claude/skills/cc-do/scripts/cc-do-common.sh +79 -0
  31. package/.claude/skills/cc-do/scripts/check-task-status.sh +92 -0
  32. package/.claude/skills/cc-do/scripts/detect-file-conflicts.sh +87 -0
  33. package/.claude/skills/cc-do/scripts/mark-task-complete.sh +119 -0
  34. package/.claude/skills/cc-do/scripts/record-review-decision.sh +89 -0
  35. package/.claude/skills/cc-do/scripts/recover-workflow.sh +84 -0
  36. package/.claude/skills/cc-do/scripts/run-problem-analysis.sh +70 -0
  37. package/.claude/skills/cc-do/scripts/select-ready-tasks.sh +135 -0
  38. package/.claude/skills/cc-do/scripts/verify-task-gates.sh +94 -0
  39. package/.claude/skills/cc-do/scripts/write-task-checkpoint.sh +102 -0
  40. package/.claude/skills/cc-investigate/CHANGELOG.md +26 -0
  41. package/.claude/skills/cc-investigate/PLAYBOOK.md +49 -0
  42. package/.claude/skills/cc-investigate/SKILL.md +221 -0
  43. package/.claude/skills/cc-investigate/assets/ANALYSIS_TEMPLATE.md +55 -0
  44. package/.claude/skills/cc-investigate/assets/TASKS_TEMPLATE.md +52 -0
  45. package/.claude/skills/cc-investigate/assets/TASK_MANIFEST_TEMPLATE.json +103 -0
  46. package/.claude/skills/cc-investigate/references/investigation-contract.md +28 -0
  47. package/.claude/skills/cc-investigate/scripts/bootstrap-analysis.sh +38 -0
  48. package/.claude/skills/cc-plan/CHANGELOG.md +99 -0
  49. package/.claude/skills/cc-plan/PLAYBOOK.md +106 -0
  50. package/.claude/skills/cc-plan/SKILL.md +325 -0
  51. package/.claude/skills/cc-plan/assets/DESIGN_TEMPLATE.md +155 -0
  52. package/.claude/skills/cc-plan/assets/TASKS_TEMPLATE.md +98 -0
  53. package/.claude/skills/cc-plan/assets/TASK_MANIFEST_TEMPLATE.json +108 -0
  54. package/.claude/skills/cc-plan/assets/TINY_DESIGN_TEMPLATE.md +79 -0
  55. package/.claude/skills/cc-plan/references/planning-contract.md +82 -0
  56. package/.claude/skills/cc-plan/scripts/bump-skill-version.sh +103 -0
  57. package/.claude/skills/cc-plan/scripts/parse-task-dependencies.js +75 -0
  58. package/.claude/skills/cc-plan/scripts/validate-scope.sh +78 -0
  59. package/.claude/skills/cc-roadmap/CHANGELOG.md +114 -0
  60. package/.claude/skills/cc-roadmap/PLAYBOOK.md +136 -0
  61. package/.claude/skills/cc-roadmap/SKILL.md +259 -0
  62. package/.claude/skills/cc-roadmap/assets/BACKLOG_TEMPLATE.md +45 -0
  63. package/.claude/skills/cc-roadmap/assets/ROADMAP_TEMPLATE.md +153 -0
  64. package/.claude/skills/cc-roadmap/assets/TRACKING_TEMPLATE.json +48 -0
  65. package/.claude/skills/cc-roadmap/references/roadmap-dialogue.md +37 -0
  66. package/.claude/skills/cc-roadmap/scripts/bump-skill-version.sh +103 -0
  67. package/.claude/skills/cc-roadmap/scripts/lib/roadmap-tracking/markdown.js +604 -0
  68. package/.claude/skills/cc-roadmap/scripts/lib/roadmap-tracking/query.js +63 -0
  69. package/.claude/skills/cc-roadmap/scripts/lib/roadmap-tracking/schema.js +245 -0
  70. package/.claude/skills/cc-roadmap/scripts/lib/roadmap-tracking/store.js +139 -0
  71. package/.claude/skills/cc-roadmap/scripts/locate-roadmap-item.sh +109 -0
  72. package/.claude/skills/cc-roadmap/scripts/roadmap-tracking.js +153 -0
  73. package/.claude/skills/cc-roadmap/scripts/sync-roadmap-progress.sh +100 -0
  74. package/.claude/skills/cc-simplify/CHANGELOG.md +10 -0
  75. package/.claude/skills/cc-simplify/SKILL.md +55 -0
  76. package/.claude/skills/cc-spec-init/CHANGELOG.md +7 -0
  77. package/.claude/skills/cc-spec-init/PLAYBOOK.md +55 -0
  78. package/.claude/skills/cc-spec-init/SKILL.md +127 -0
  79. package/.claude/skills/cc-spec-init/assets/CAPABILITY_TEMPLATE.md +63 -0
  80. package/.claude/skills/cc-spec-init/assets/CHANGE_META_TEMPLATE.json +25 -0
  81. package/.claude/skills/cc-spec-init/assets/INDEX_TEMPLATE.md +34 -0
  82. package/.claude/skills/cc-spec-init/references/spec-contract.md +22 -0
  83. package/.claude/skills/cc-spec-init/scripts/bootstrap-specs.sh +31 -0
  84. package/.claude/skills/cc-spec-init/scripts/validate-spec-links.sh +45 -0
  85. package/CHANGELOG.md +61 -4
  86. package/README.md +120 -756
  87. package/README.zh-CN.md +119 -756
  88. package/bin/adapt.js +2 -6
  89. package/bin/cc-devflow-cli.js +72 -177
  90. package/config/distributable-skills.json +24 -0
  91. package/docs/CLAUDE.md +10 -6
  92. package/docs/commands/README.md +19 -46
  93. package/docs/commands/README.zh-CN.md +25 -48
  94. package/docs/examples/BY-ARTIFACT.md +7 -0
  95. package/docs/examples/README.md +38 -0
  96. package/docs/examples/START-HERE.md +149 -0
  97. package/docs/examples/example-bindings.json +38 -0
  98. package/docs/examples/full-design-blocked/BACKLOG.md +45 -0
  99. package/docs/examples/full-design-blocked/README.md +55 -0
  100. package/docs/examples/full-design-blocked/ROADMAP.md +53 -0
  101. package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/planning/design.md +154 -0
  102. package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/planning/task-manifest.json +146 -0
  103. package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/planning/tasks.md +78 -0
  104. package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/review/report-card.json +52 -0
  105. package/docs/examples/full-design-blocked/roadmap-tracking.json +50 -0
  106. package/docs/examples/local-handoff/BACKLOG.md +45 -0
  107. package/docs/examples/local-handoff/README.md +56 -0
  108. package/docs/examples/local-handoff/ROADMAP.md +45 -0
  109. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/handoff/resume-index.md +39 -0
  110. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/handoff/status.md +29 -0
  111. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/planning/design.md +71 -0
  112. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/planning/task-manifest.json +98 -0
  113. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/planning/tasks.md +59 -0
  114. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/review/report-card.json +44 -0
  115. package/docs/examples/local-handoff/roadmap-tracking.json +48 -0
  116. package/docs/examples/pdca-loop/BACKLOG.md +46 -0
  117. package/docs/examples/pdca-loop/README.md +58 -0
  118. package/docs/examples/pdca-loop/ROADMAP.md +133 -0
  119. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/handoff/pr-brief.md +72 -0
  120. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/handoff/status.md +29 -0
  121. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/planning/design.md +72 -0
  122. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/planning/task-manifest.json +201 -0
  123. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/planning/tasks.md +73 -0
  124. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/review/report-card.json +44 -0
  125. package/docs/examples/pdca-loop/roadmap-tracking.json +114 -0
  126. package/docs/examples/scripts/check-example-bindings.sh +116 -0
  127. package/docs/guides/getting-started.md +94 -129
  128. package/docs/guides/getting-started.zh-CN.md +103 -84
  129. package/docs/skill-runtime-migration.md +46 -0
  130. package/docs/v4.3.0-migration-guide.md +60 -225
  131. package/lib/compiler/CLAUDE.md +55 -84
  132. package/lib/compiler/__tests__/drift.test.js +1 -1
  133. package/lib/compiler/__tests__/errors.test.js +0 -1
  134. package/lib/compiler/__tests__/integration.test.js +49 -3
  135. package/lib/compiler/__tests__/manifest.test.js +0 -156
  136. package/lib/compiler/__tests__/parser.test.js +33 -104
  137. package/lib/compiler/__tests__/schemas.test.js +30 -34
  138. package/lib/compiler/__tests__/skills-registry.test.js +114 -0
  139. package/lib/compiler/__tests__/transformer.test.js +5 -9
  140. package/lib/compiler/emitters/antigravity-emitter.js +5 -213
  141. package/lib/compiler/emitters/base-emitter.js +3 -298
  142. package/lib/compiler/emitters/codex-emitter.js +4 -202
  143. package/lib/compiler/emitters/cursor-emitter.js +3 -287
  144. package/lib/compiler/emitters/qwen-emitter.js +4 -176
  145. package/lib/compiler/index.js +65 -345
  146. package/lib/compiler/manifest.js +6 -68
  147. package/lib/compiler/parser.js +31 -63
  148. package/lib/compiler/platforms.js +32 -277
  149. package/lib/compiler/resource-copier.js +176 -6
  150. package/lib/compiler/rules-emitters/__tests__/antigravity-rules-emitter.test.js +3 -3
  151. package/lib/compiler/rules-emitters/__tests__/cursor-rules-emitter.test.js +14 -4
  152. package/lib/compiler/rules-emitters/__tests__/qwen-rules-emitter.test.js +16 -7
  153. package/lib/compiler/rules-emitters/antigravity-rules-emitter.js +10 -15
  154. package/lib/compiler/rules-emitters/base-rules-emitter.js +5 -5
  155. package/lib/compiler/rules-emitters/cursor-rules-emitter.js +7 -12
  156. package/lib/compiler/rules-emitters/index.js +6 -3
  157. package/lib/compiler/rules-emitters/qwen-rules-emitter.js +7 -7
  158. package/lib/compiler/schemas.js +8 -4
  159. package/lib/compiler/skills-registry.js +213 -15
  160. package/lib/compiler/transformer.js +1 -1
  161. package/lib/skill-runtime/CLAUDE.md +19 -0
  162. package/lib/skill-runtime/__tests__/autopilot.test.js +210 -0
  163. package/lib/skill-runtime/__tests__/cli-bootstrap.integration.test.js +181 -0
  164. package/lib/skill-runtime/__tests__/delegation.test.js +97 -0
  165. package/lib/skill-runtime/__tests__/dispatch.test.js +267 -0
  166. package/lib/skill-runtime/__tests__/intent.test.js +219 -0
  167. package/lib/skill-runtime/__tests__/lifecycle.test.js +169 -0
  168. package/lib/skill-runtime/__tests__/paths.test.js +42 -0
  169. package/lib/skill-runtime/__tests__/planner.tdd.test.js +250 -0
  170. package/lib/skill-runtime/__tests__/prepare-pr.test.js +139 -0
  171. package/lib/skill-runtime/__tests__/query.test.js +284 -0
  172. package/lib/skill-runtime/__tests__/runtime.integration.test.js +279 -0
  173. package/lib/skill-runtime/__tests__/schemas.test.js +207 -0
  174. package/lib/skill-runtime/__tests__/team-state.test.js +51 -0
  175. package/lib/skill-runtime/__tests__/worker-run.test.js +253 -0
  176. package/lib/skill-runtime/__tests__/worker.test.js +56 -0
  177. package/lib/skill-runtime/artifacts.js +93 -0
  178. package/lib/skill-runtime/delegation.js +533 -0
  179. package/lib/skill-runtime/index.js +34 -0
  180. package/lib/skill-runtime/intent.js +333 -0
  181. package/lib/skill-runtime/lifecycle.js +294 -0
  182. package/lib/skill-runtime/operations/CLAUDE.md +19 -0
  183. package/lib/skill-runtime/operations/approve.js +66 -0
  184. package/lib/skill-runtime/operations/autopilot-core.js +337 -0
  185. package/lib/skill-runtime/operations/autopilot-execution.js +307 -0
  186. package/lib/skill-runtime/operations/autopilot-shared.js +48 -0
  187. package/lib/skill-runtime/operations/autopilot.js +163 -0
  188. package/lib/skill-runtime/operations/dispatch.js +454 -0
  189. package/lib/skill-runtime/operations/init.js +64 -0
  190. package/lib/{harness → skill-runtime}/operations/janitor.js +9 -6
  191. package/lib/skill-runtime/operations/plan.js +59 -0
  192. package/lib/skill-runtime/operations/prepare-pr.js +25 -0
  193. package/lib/skill-runtime/operations/release.js +96 -0
  194. package/lib/skill-runtime/operations/resume.js +143 -0
  195. package/lib/skill-runtime/operations/snapshot.js +45 -0
  196. package/lib/skill-runtime/operations/verify.js +170 -0
  197. package/lib/skill-runtime/operations/worker-run.js +529 -0
  198. package/lib/skill-runtime/operations/worker.js +33 -0
  199. package/lib/skill-runtime/paths.js +213 -0
  200. package/lib/skill-runtime/planner.js +519 -0
  201. package/lib/skill-runtime/query.js +157 -0
  202. package/lib/skill-runtime/review.js +557 -0
  203. package/lib/skill-runtime/schemas.js +400 -0
  204. package/lib/{harness → skill-runtime}/store.js +45 -30
  205. package/lib/skill-runtime/team-state.js +122 -0
  206. package/package.json +13 -11
  207. package/.claude/CLAUDE.md +0 -125
  208. package/.claude/agents/architecture-designer.md +0 -443
  209. package/.claude/agents/bug-analyzer.md +0 -381
  210. package/.claude/agents/checklist-agent.md +0 -175
  211. package/.claude/agents/clarify-analyst.md +0 -50
  212. package/.claude/agents/code-quality-reviewer.md +0 -205
  213. package/.claude/agents/code-reviewer.md +0 -71
  214. package/.claude/agents/codex-analyzer.md +0 -39
  215. package/.claude/agents/compatibility-checker.md +0 -579
  216. package/.claude/agents/consistency-checker.md +0 -532
  217. package/.claude/agents/dev-implementer.md +0 -195
  218. package/.claude/agents/flow-researcher.md +0 -132
  219. package/.claude/agents/impact-analyzer.md +0 -440
  220. package/.claude/agents/planner.md +0 -230
  221. package/.claude/agents/prd-writer.md +0 -320
  222. package/.claude/agents/project-guidelines-generator.md +0 -1329
  223. package/.claude/agents/qa-tester.md +0 -313
  224. package/.claude/agents/release-manager.md +0 -295
  225. package/.claude/agents/security-reviewer.md +0 -314
  226. package/.claude/agents/spec-reviewer.md +0 -221
  227. package/.claude/agents/style-guide-generator.md +0 -458
  228. package/.claude/agents/tech-architect.md +0 -516
  229. package/.claude/agents/ui-designer.md +0 -485
  230. package/.claude/commands/core/architecture.md +0 -459
  231. package/.claude/commands/core/guidelines.md +0 -511
  232. package/.claude/commands/core/roadmap.md +0 -468
  233. package/.claude/commands/core/style.md +0 -83
  234. package/.claude/commands/flow/CLAUDE.md +0 -24
  235. package/.claude/commands/flow/archive.md +0 -280
  236. package/.claude/commands/flow/constitution.md +0 -82
  237. package/.claude/commands/flow/context.md +0 -150
  238. package/.claude/commands/flow/delta.md +0 -245
  239. package/.claude/commands/flow/dev.md +0 -40
  240. package/.claude/commands/flow/fix.md +0 -217
  241. package/.claude/commands/flow/ideate.md +0 -214
  242. package/.claude/commands/flow/init.md +0 -38
  243. package/.claude/commands/flow/release.md +0 -36
  244. package/.claude/commands/flow/restart.md +0 -97
  245. package/.claude/commands/flow/spec.md +0 -36
  246. package/.claude/commands/flow/status.md +0 -64
  247. package/.claude/commands/flow/update.md +0 -111
  248. package/.claude/commands/flow/upgrade.md +0 -115
  249. package/.claude/commands/flow/verify.md +0 -37
  250. package/.claude/commands/flow/workspace.md +0 -155
  251. package/.claude/commands/util/cancel-ralph.md +0 -60
  252. package/.claude/commands/util/code-review.md +0 -58
  253. package/.claude/commands/util/git-commit.md +0 -422
  254. package/.claude/commands/util/problem-analyzer.md +0 -60
  255. package/.claude/config/quality-gates.yml +0 -305
  256. package/.claude/config/quality-rules.yml +0 -161
  257. package/.claude/docs/SPEC_KIT_CONSTITUTION_ANALYSIS.md +0 -426
  258. package/.claude/docs/design/consistency-conflict-detection-algorithms.md +0 -658
  259. package/.claude/docs/design/intent-driven-input-design.md +0 -380
  260. package/.claude/docs/design/prd-version-management-design.md +0 -437
  261. package/.claude/docs/examples/design-inspiration-pool.md +0 -59
  262. package/.claude/docs/examples/ui-prototype-constitution-checklist.md +0 -75
  263. package/.claude/docs/guides/INIT_TROUBLESHOOTING.md +0 -117
  264. package/.claude/docs/guides/NEW_TROUBLESHOOTING.md +0 -99
  265. package/.claude/docs/guides/ROADMAP_TROUBLESHOOTING.md +0 -188
  266. package/.claude/docs/guides/TASK_COMPLETION_MARKING.md +0 -338
  267. package/.claude/docs/guides/TEAM_MODE_GUIDE.md +0 -312
  268. package/.claude/docs/implementation-summary-v7.md +0 -449
  269. package/.claude/docs/spec-format-guide.md +0 -349
  270. package/.claude/docs/state-consolidation-design.md +0 -323
  271. package/.claude/docs/templates/ARCHITECTURE_TEMPLATE.md +0 -332
  272. package/.claude/docs/templates/ATTEMPT_TEMPLATE.md +0 -156
  273. package/.claude/docs/templates/BACKLOG_TEMPLATE.md +0 -261
  274. package/.claude/docs/templates/BRAINSTORM_TEMPLATE.md +0 -148
  275. package/.claude/docs/templates/CHECKLIST_TEMPLATE.md +0 -52
  276. package/.claude/docs/templates/CLARIFICATION_REPORT_TEMPLATE.md +0 -206
  277. package/.claude/docs/templates/CODE_REVIEW_TEMPLATE.md +0 -71
  278. package/.claude/docs/templates/DELTA_SPEC_TEMPLATE.md +0 -91
  279. package/.claude/docs/templates/DESIGN_DECISIONS_TEMPLATE.md +0 -151
  280. package/.claude/docs/templates/DESIGN_TEMPLATE.md +0 -157
  281. package/.claude/docs/templates/ERROR_LOG_TEMPLATE.md +0 -80
  282. package/.claude/docs/templates/INIT_FLOW_TEMPLATE.md +0 -198
  283. package/.claude/docs/templates/INTENT_CLARIFICATION_TEMPLATE.md +0 -57
  284. package/.claude/docs/templates/JOURNAL_TEMPLATE.md +0 -75
  285. package/.claude/docs/templates/NEW_ORCHESTRATION_TEMPLATE.md +0 -76
  286. package/.claude/docs/templates/PROPOSAL_TEMPLATE.md +0 -91
  287. package/.claude/docs/templates/RESEARCH_TEMPLATE.md +0 -276
  288. package/.claude/docs/templates/REVIEW-HIGH.md +0 -57
  289. package/.claude/docs/templates/ROADMAP_DIALOGUE_TEMPLATE.md +0 -198
  290. package/.claude/docs/templates/ROADMAP_TEMPLATE.md +0 -310
  291. package/.claude/docs/templates/SPEC_TEMPLATE_DELTA.md +0 -139
  292. package/.claude/docs/templates/SPEC_TEMPLATE_PROJECT.md +0 -93
  293. package/.claude/docs/templates/STYLE_TEMPLATE.md +0 -479
  294. package/.claude/docs/templates/UI_PROTOTYPE_TEMPLATE.md +0 -373
  295. package/.claude/docs/templates/_shared/CLAUDE.md +0 -36
  296. package/.claude/docs/templates/_shared/CONSTITUTION_CHECK.md +0 -125
  297. package/.claude/docs/templates/_shared/VALIDATION_CHECKLIST.md +0 -187
  298. package/.claude/docs/templates/_shared/YAML_FRONTMATTER.md +0 -164
  299. package/.claude/docs/templates/context/dev.jsonl.template +0 -6
  300. package/.claude/docs/templates/context/epic.jsonl.template +0 -5
  301. package/.claude/docs/templates/context/prd.jsonl.template +0 -4
  302. package/.claude/docs/templates/context/research.jsonl.template +0 -4
  303. package/.claude/docs/templates/context/review.jsonl.template +0 -5
  304. package/.claude/docs/templates/context/tech.jsonl.template +0 -5
  305. package/.claude/guides/agent-guides/agent-coordination-guide.md +0 -459
  306. package/.claude/guides/project-guidelines-system.md +0 -463
  307. package/.claude/guides/technical-guides/datetime-handling-guide.md +0 -563
  308. package/.claude/guides/technical-guides/git-github-guide.md +0 -642
  309. package/.claude/guides/technical-guides/test-execution-guide.md +0 -618
  310. package/.claude/guides/workflow-guides/bug-fix-orchestrator.md +0 -217
  311. package/.claude/guides/workflow-guides/flow-orchestrator.md +0 -48
  312. package/.claude/hooks/CLAUDE.md +0 -342
  313. package/.claude/hooks/checklist-gate.js +0 -397
  314. package/.claude/hooks/error-handling-reminder.sh +0 -12
  315. package/.claude/hooks/error-handling-reminder.ts +0 -459
  316. package/.claude/hooks/hooks.json +0 -15
  317. package/.claude/hooks/inject-agent-context.ts +0 -480
  318. package/.claude/hooks/inject-skill-context.ts +0 -359
  319. package/.claude/hooks/post-tool-use-tracker.sh +0 -280
  320. package/.claude/hooks/pre-tool-use-guardrail.sh +0 -36
  321. package/.claude/hooks/pre-tool-use-guardrail.ts +0 -342
  322. package/.claude/hooks/ralph-loop.ts +0 -931
  323. package/.claude/hooks/ralph-stop-hook.sh +0 -190
  324. package/.claude/hooks/skill-activation-prompt.sh +0 -36
  325. package/.claude/hooks/skill-activation-prompt.ts +0 -214
  326. package/.claude/hooks/state/skills-used-test-guard.json +0 -3
  327. package/.claude/hooks/task-completed-hook.ts +0 -593
  328. package/.claude/hooks/teammate-idle-hook.ts +0 -690
  329. package/.claude/hooks/types/team-types.d.ts +0 -238
  330. package/.claude/rules/devflow-conventions.md +0 -286
  331. package/.claude/rules/project-constitution.md +0 -1002
  332. package/.claude/rules/rationalization-library.md +0 -282
  333. package/.claude/schemas/constitution.schema.json +0 -43
  334. package/.claude/scripts/.claude/commands/flow/export-openspec.md +0 -221
  335. package/.claude/scripts/.claude/commands/flow/import-openspec.md +0 -171
  336. package/.claude/scripts/CLAUDE.md +0 -76
  337. package/.claude/scripts/__tests__/openspec.test.js +0 -212
  338. package/.claude/scripts/analyze-upgrade-impact.sh +0 -200
  339. package/.claude/scripts/archive-requirement.sh +0 -394
  340. package/.claude/scripts/calculate-checklist-completion.sh +0 -243
  341. package/.claude/scripts/calculate-quarter.sh +0 -206
  342. package/.claude/scripts/check-dependencies.sh +0 -409
  343. package/.claude/scripts/check-prerequisites.sh +0 -232
  344. package/.claude/scripts/check-task-status.sh +0 -288
  345. package/.claude/scripts/checklist-errors.sh +0 -131
  346. package/.claude/scripts/common.sh +0 -1102
  347. package/.claude/scripts/consolidate-research.sh +0 -182
  348. package/.claude/scripts/create-requirement.sh +0 -451
  349. package/.claude/scripts/delta-parser.ts +0 -637
  350. package/.claude/scripts/detect-file-conflicts.sh +0 -151
  351. package/.claude/scripts/export-contracts.sh +0 -117
  352. package/.claude/scripts/export-openspec.js +0 -222
  353. package/.claude/scripts/extract-data-model.sh +0 -78
  354. package/.claude/scripts/flow-context-add.sh +0 -134
  355. package/.claude/scripts/flow-context-init.sh +0 -133
  356. package/.claude/scripts/flow-context-validate.sh +0 -144
  357. package/.claude/scripts/flow-delta-apply.sh +0 -297
  358. package/.claude/scripts/flow-delta-archive.sh +0 -71
  359. package/.claude/scripts/flow-delta-create.sh +0 -202
  360. package/.claude/scripts/flow-delta-list.sh +0 -142
  361. package/.claude/scripts/flow-delta-status.sh +0 -235
  362. package/.claude/scripts/flow-quality-full.sh +0 -215
  363. package/.claude/scripts/flow-quality-quick.sh +0 -119
  364. package/.claude/scripts/flow-workspace-init.sh +0 -117
  365. package/.claude/scripts/flow-workspace-record.sh +0 -164
  366. package/.claude/scripts/generate-clarification-questions.sh +0 -377
  367. package/.claude/scripts/generate-clarification-report.sh +0 -463
  368. package/.claude/scripts/generate-quickstart.sh +0 -146
  369. package/.claude/scripts/generate-research-tasks.sh +0 -157
  370. package/.claude/scripts/generate-status-report.sh +0 -523
  371. package/.claude/scripts/generate-tech-analysis.sh +0 -46
  372. package/.claude/scripts/get-workflow-status.sh +0 -415
  373. package/.claude/scripts/import-openspec.js +0 -272
  374. package/.claude/scripts/locate-requirement-in-roadmap.sh +0 -233
  375. package/.claude/scripts/manage-constitution.sh +0 -602
  376. package/.claude/scripts/mark-task-complete.sh +0 -198
  377. package/.claude/scripts/parse-task-dependencies.js +0 -334
  378. package/.claude/scripts/populate-research-tasks.sh +0 -284
  379. package/.claude/scripts/record-quality-error.sh +0 -165
  380. package/.claude/scripts/recover-workflow.sh +0 -463
  381. package/.claude/scripts/run-clarify-scan.sh +0 -601
  382. package/.claude/scripts/run-high-review.sh +0 -62
  383. package/.claude/scripts/run-problem-analysis.sh +0 -68
  384. package/.claude/scripts/run-quality-gates.sh +0 -242
  385. package/.claude/scripts/setup-epic.sh +0 -173
  386. package/.claude/scripts/setup-ralph-loop.sh +0 -155
  387. package/.claude/scripts/sync-roadmap-progress.sh +0 -300
  388. package/.claude/scripts/sync-task-marks.sh +0 -199
  389. package/.claude/scripts/team-dev-init.sh +0 -319
  390. package/.claude/scripts/team-state-recovery.sh +0 -229
  391. package/.claude/scripts/test-clarify-scan.sh +0 -515
  392. package/.claude/scripts/update-agent-context.sh +0 -806
  393. package/.claude/scripts/validate-constitution.sh +0 -567
  394. package/.claude/scripts/validate-hooks.sh +0 -487
  395. package/.claude/scripts/validate-research.sh +0 -332
  396. package/.claude/scripts/validate-scope-boundary.sh +0 -493
  397. package/.claude/scripts/validate-scope.sh +0 -200
  398. package/.claude/scripts/verify-gate.sh +0 -269
  399. package/.claude/scripts/verify-setup.sh +0 -37
  400. package/.claude/scripts/workflow-status.ts +0 -433
  401. package/.claude/settings.json +0 -95
  402. package/.claude/skills/_reference-implementations/README.md +0 -96
  403. package/.claude/skills/_reference-implementations/backend-express-prisma/SKILL.md +0 -302
  404. package/.claude/skills/_reference-implementations/backend-express-prisma/resources/architecture-overview.md +0 -451
  405. package/.claude/skills/_reference-implementations/backend-express-prisma/resources/async-and-errors.md +0 -307
  406. package/.claude/skills/_reference-implementations/backend-express-prisma/resources/complete-examples.md +0 -638
  407. package/.claude/skills/_reference-implementations/backend-express-prisma/resources/configuration.md +0 -275
  408. package/.claude/skills/_reference-implementations/backend-express-prisma/resources/database-patterns.md +0 -224
  409. package/.claude/skills/_reference-implementations/backend-express-prisma/resources/middleware-guide.md +0 -213
  410. package/.claude/skills/_reference-implementations/backend-express-prisma/resources/routing-and-controllers.md +0 -756
  411. package/.claude/skills/_reference-implementations/backend-express-prisma/resources/sentry-and-monitoring.md +0 -336
  412. package/.claude/skills/_reference-implementations/backend-express-prisma/resources/services-and-repositories.md +0 -789
  413. package/.claude/skills/_reference-implementations/backend-express-prisma/resources/testing-guide.md +0 -235
  414. package/.claude/skills/_reference-implementations/backend-express-prisma/resources/validation-patterns.md +0 -754
  415. package/.claude/skills/_reference-implementations/frontend-react-mui/SKILL.md +0 -399
  416. package/.claude/skills/_reference-implementations/frontend-react-mui/resources/common-patterns.md +0 -331
  417. package/.claude/skills/_reference-implementations/frontend-react-mui/resources/complete-examples.md +0 -872
  418. package/.claude/skills/_reference-implementations/frontend-react-mui/resources/component-patterns.md +0 -502
  419. package/.claude/skills/_reference-implementations/frontend-react-mui/resources/data-fetching.md +0 -767
  420. package/.claude/skills/_reference-implementations/frontend-react-mui/resources/file-organization.md +0 -502
  421. package/.claude/skills/_reference-implementations/frontend-react-mui/resources/loading-and-error-states.md +0 -501
  422. package/.claude/skills/_reference-implementations/frontend-react-mui/resources/performance.md +0 -406
  423. package/.claude/skills/_reference-implementations/frontend-react-mui/resources/routing-guide.md +0 -364
  424. package/.claude/skills/_reference-implementations/frontend-react-mui/resources/styling-guide.md +0 -428
  425. package/.claude/skills/_reference-implementations/frontend-react-mui/resources/typescript-standards.md +0 -418
  426. package/.claude/skills/attention-refresh/SKILL.md +0 -170
  427. package/.claude/skills/brainstorming/SKILL.md +0 -161
  428. package/.claude/skills/cc-devflow-orchestrator/SKILL.md +0 -169
  429. package/.claude/skills/constitution-guardian/SKILL.md +0 -306
  430. package/.claude/skills/constitution-quick-ref/SKILL.md +0 -374
  431. package/.claude/skills/debugging/SKILL.md +0 -221
  432. package/.claude/skills/file-standards/SKILL.md +0 -353
  433. package/.claude/skills/finishing-branch/SKILL.md +0 -189
  434. package/.claude/skills/flow-dev/CLAUDE.md +0 -16
  435. package/.claude/skills/flow-dev/SKILL.md +0 -94
  436. package/.claude/skills/flow-dev/assets/IMPLEMENTATION_PLAN_TEMPLATE.md +0 -71
  437. package/.claude/skills/flow-dev/context.jsonl +0 -4
  438. package/.claude/skills/flow-dev/dev-implementer.jsonl +0 -8
  439. package/.claude/skills/flow-dev/scripts/entry-gate.sh +0 -116
  440. package/.claude/skills/flow-dev/scripts/exit-gate.sh +0 -101
  441. package/.claude/skills/flow-dev/scripts/task-orchestrator.sh +0 -106
  442. package/.claude/skills/flow-fix/SKILL.md +0 -105
  443. package/.claude/skills/flow-fix/context.jsonl +0 -6
  444. package/.claude/skills/flow-fix/references/bug-analyzer.md +0 -381
  445. package/.claude/skills/flow-init/SKILL.md +0 -105
  446. package/.claude/skills/flow-init/assets/BRAINSTORM_TEMPLATE.md +0 -148
  447. package/.claude/skills/flow-init/assets/INIT_FLOW_TEMPLATE.md +0 -198
  448. package/.claude/skills/flow-init/assets/RESEARCH_TEMPLATE.md +0 -276
  449. package/.claude/skills/flow-init/context.jsonl +0 -5
  450. package/.claude/skills/flow-init/references/flow-researcher.md +0 -132
  451. package/.claude/skills/flow-init/scripts/check-prerequisites.sh +0 -240
  452. package/.claude/skills/flow-init/scripts/consolidate-research.sh +0 -182
  453. package/.claude/skills/flow-init/scripts/create-requirement.sh +0 -404
  454. package/.claude/skills/flow-init/scripts/generate-research-tasks.sh +0 -157
  455. package/.claude/skills/flow-init/scripts/populate-research-tasks.sh +0 -284
  456. package/.claude/skills/flow-init/scripts/validate-research.sh +0 -340
  457. package/.claude/skills/flow-quality/SKILL.md +0 -98
  458. package/.claude/skills/flow-quality/context.jsonl +0 -6
  459. package/.claude/skills/flow-quality/references/code-quality-reviewer.md +0 -205
  460. package/.claude/skills/flow-quality/references/qa-tester.md +0 -313
  461. package/.claude/skills/flow-quality/references/security-reviewer.md +0 -314
  462. package/.claude/skills/flow-quality/references/spec-reviewer.md +0 -221
  463. package/.claude/skills/flow-release/SKILL.md +0 -60
  464. package/.claude/skills/flow-release/context.jsonl +0 -5
  465. package/.claude/skills/flow-release/references/release-manager.md +0 -295
  466. package/.claude/skills/flow-spec/CLAUDE.md +0 -17
  467. package/.claude/skills/flow-spec/SKILL.md +0 -102
  468. package/.claude/skills/flow-spec/context.jsonl +0 -5
  469. package/.claude/skills/flow-spec/scripts/entry-gate.sh +0 -194
  470. package/.claude/skills/flow-spec/scripts/exit-gate.sh +0 -244
  471. package/.claude/skills/flow-spec/scripts/parallel-orchestrator.sh +0 -205
  472. package/.claude/skills/flow-spec/scripts/team-communication.sh +0 -353
  473. package/.claude/skills/flow-spec/scripts/team-init.sh +0 -195
  474. package/.claude/skills/flow-spec/scripts/test-team-mode.sh +0 -496
  475. package/.claude/skills/flow-spec/team-config.json +0 -165
  476. package/.claude/skills/flow-verify/CLAUDE.md +0 -10
  477. package/.claude/skills/flow-verify/SKILL.md +0 -53
  478. package/.claude/skills/flow-verify/context.jsonl +0 -5
  479. package/.claude/skills/fractal-docs/SKILL.md +0 -45
  480. package/.claude/skills/journey-checker/SKILL.md +0 -199
  481. package/.claude/skills/journey-checker/pressure-scenarios.md +0 -164
  482. package/.claude/skills/receiving-review/SKILL.md +0 -153
  483. package/.claude/skills/skill-creator/LICENSE.txt +0 -202
  484. package/.claude/skills/skill-creator/SKILL.md +0 -356
  485. package/.claude/skills/skill-creator/references/output-patterns.md +0 -82
  486. package/.claude/skills/skill-creator/references/workflows.md +0 -28
  487. package/.claude/skills/skill-creator/scripts/init_skill.py +0 -303
  488. package/.claude/skills/skill-creator/scripts/package_skill.py +0 -110
  489. package/.claude/skills/skill-creator/scripts/quick_validate.py +0 -95
  490. package/.claude/skills/skill-rules.json +0 -359
  491. package/.claude/skills/tdd/SKILL.md +0 -218
  492. package/.claude/skills/tdd-enforcer/SKILL.md +0 -192
  493. package/.claude/skills/utility/npm-release/CLAUDE.md +0 -55
  494. package/.claude/skills/utility/npm-release/SKILL.md +0 -379
  495. package/.claude/skills/utility/npm-release/references/version-decision-guide.md +0 -134
  496. package/.claude/skills/utility/npm-release/scripts/atomic-version-bump.sh +0 -95
  497. package/.claude/skills/utility/npm-release/scripts/validate-version-sync.sh +0 -82
  498. package/.claude/skills/utility/npm-release/scripts/version-decision-tree.sh +0 -44
  499. package/.claude/skills/verification/SKILL.md +0 -158
  500. package/.claude/skills/workflow.yaml +0 -219
  501. package/.claude/tests/README.md +0 -300
  502. package/.claude/tests/TODO.md +0 -69
  503. package/.claude/tests/__pycache__/test_analyze_upgrade_impact.cpython-311-pytest-7.2.2.pyc +0 -0
  504. package/.claude/tests/__pycache__/test_consolidate_research.cpython-311-pytest-7.2.2.pyc +0 -0
  505. package/.claude/tests/__pycache__/test_export_contracts.cpython-311-pytest-7.2.2.pyc +0 -0
  506. package/.claude/tests/__pycache__/test_extract_data_model.cpython-311-pytest-7.2.2.pyc +0 -0
  507. package/.claude/tests/__pycache__/test_generate_quickstart.cpython-311-pytest-7.2.2.pyc +0 -0
  508. package/.claude/tests/__pycache__/test_generate_research_tasks.cpython-311-pytest-7.2.2.pyc +0 -0
  509. package/.claude/tests/constitution/run_all_constitution_tests.sh +0 -111
  510. package/.claude/tests/constitution/test_agent_assignment.sh +0 -207
  511. package/.claude/tests/constitution/test_article_coverage.sh +0 -201
  512. package/.claude/tests/constitution/test_template_completeness.sh +0 -150
  513. package/.claude/tests/constitution/test_version_consistency.sh +0 -120
  514. package/.claude/tests/fixtures/spec_delta_full.md +0 -16
  515. package/.claude/tests/fixtures/tasks_progress_sample.md +0 -5
  516. package/.claude/tests/run-all-tests.sh +0 -229
  517. package/.claude/tests/scripts/run.sh +0 -30
  518. package/.claude/tests/scripts/test-framework.sh +0 -128
  519. package/.claude/tests/scripts/test_check_prerequisites.sh +0 -511
  520. package/.claude/tests/scripts/test_check_prerequisites.sh.bak +0 -504
  521. package/.claude/tests/scripts/test_check_prerequisites.sh.bak2 +0 -505
  522. package/.claude/tests/scripts/test_check_prerequisites.sh.bak3 +0 -506
  523. package/.claude/tests/scripts/test_check_prerequisites.sh.bak4 +0 -507
  524. package/.claude/tests/scripts/test_check_prerequisites.sh.bak5 +0 -508
  525. package/.claude/tests/scripts/test_check_task_status.sh +0 -499
  526. package/.claude/tests/scripts/test_common.sh +0 -244
  527. package/.claude/tests/scripts/test_generate_status_report.sh +0 -71
  528. package/.claude/tests/scripts/test_mark_task_complete.sh +0 -441
  529. package/.claude/tests/scripts/test_mark_task_complete.sh.backup +0 -410
  530. package/.claude/tests/scripts/test_recover_workflow.sh +0 -304
  531. package/.claude/tests/scripts/test_setup_epic.sh +0 -437
  532. package/.claude/tests/scripts/test_sync_task_marks.sh +0 -196
  533. package/.claude/tests/scripts/test_validate_constitution.sh +0 -74
  534. package/.claude/tests/scripts/test_validate_research.sh +0 -462
  535. package/.claude/tests/slugify.bats +0 -82
  536. package/.claude/tests/test-framework.sh +0 -732
  537. package/.claude/tests/test_analyze_upgrade_impact.py +0 -34
  538. package/.claude/tests/test_consolidate_research.py +0 -48
  539. package/.claude/tests/test_export_contracts.py +0 -43
  540. package/.claude/tests/test_extract_data_model.py +0 -33
  541. package/.claude/tests/test_generate_quickstart.py +0 -50
  542. package/.claude/tests/test_generate_research_tasks.py +0 -52
  543. package/.claude/tsc-cache/70d2fc6d-2936-429b-b529-429f1aae8c88/affected-repos.txt +0 -1
  544. package/.claude/tsc-cache/70d2fc6d-2936-429b-b529-429f1aae8c88/edited-files.log +0 -2
  545. package/bin/harness.js +0 -22
  546. package/docs/commands/core-roadmap.md +0 -106
  547. package/docs/commands/core-roadmap.zh-CN.md +0 -102
  548. package/docs/commands/core-style.md +0 -53
  549. package/docs/commands/core-style.zh-CN.md +0 -53
  550. package/docs/commands/flow-init.md +0 -140
  551. package/docs/commands/flow-init.zh-CN.md +0 -169
  552. package/docs/commands/flow-new.md +0 -39
  553. package/docs/commands/flow-new.zh-CN.md +0 -39
  554. package/lib/compiler/__tests__/compile-regression.test.js +0 -103
  555. package/lib/compiler/__tests__/multi-module-emitters.test.js +0 -534
  556. package/lib/compiler/__tests__/resource-copier.test.js +0 -26
  557. package/lib/compiler/__tests__/skill-discovery.test.js +0 -72
  558. package/lib/compiler/context-expander.js +0 -179
  559. package/lib/compiler/rules-emitters/__tests__/codex-rules-emitter.test.js +0 -109
  560. package/lib/compiler/rules-emitters/codex-rules-emitter.js +0 -116
  561. package/lib/compiler/skill-discovery.js +0 -68
  562. package/lib/harness/CLAUDE.md +0 -22
  563. package/lib/harness/__tests__/planner.tdd.test.js +0 -125
  564. package/lib/harness/cli.js +0 -208
  565. package/lib/harness/index.js +0 -18
  566. package/lib/harness/operations/dispatch.js +0 -298
  567. package/lib/harness/operations/init.js +0 -48
  568. package/lib/harness/operations/pack.js +0 -100
  569. package/lib/harness/operations/plan.js +0 -83
  570. package/lib/harness/operations/release.js +0 -170
  571. package/lib/harness/operations/resume.js +0 -44
  572. package/lib/harness/operations/verify.js +0 -177
  573. package/lib/harness/planner.js +0 -272
  574. package/lib/harness/query.js +0 -126
  575. package/lib/harness/schemas.js +0 -129
@@ -1,1002 +0,0 @@
1
- # CC-DevFlow Project Constitution
2
-
3
- > **Version**: v2.1.0
4
- > **Effective Date**: 2025-01-10
5
- > **Last Amended**: 2026-01-08
6
- > **Status**: Active
7
- > **Amendment Process**: See Section IX
8
-
9
- ---
10
-
11
- ## Preamble
12
-
13
- This Constitution establishes the **immutable architectural DNA** of the CC-DevFlow project. It serves as the highest authority governing all development activities, ensuring quality, consistency, security, and maintainability across the entire lifecycle.
14
-
15
- **Constitutional Authority**:
16
- 1. **Supreme Priority**: Constitutional principles override all other rules and conventions
17
- 2. **Inviolable**: No agent, process, or individual may violate constitutional principles
18
- 3. **Persistent**: The Constitution remains effective throughout the project lifecycle
19
- 4. **Universal**: Applies to all requirements, all stages, all agents
20
-
21
- ---
22
-
23
- ## Article I: Quality First (质量至上)
24
-
25
- **Principle**: Quality is the non-negotiable baseline.
26
-
27
- ### The Iron Law
28
-
29
- ```
30
- NO PARTIAL IMPLEMENTATION - COMPLETE OR NOTHING
31
- ```
32
-
33
- ### Rationalization Defense
34
-
35
- > See [rationalization-library.md](./rationalization-library.md#article-i-quality-first---rationalization-table) for full table.
36
-
37
- | Excuse | Reality |
38
- |--------|---------|
39
- | "This is simplified for now" | CONSTITUTIONAL VIOLATION. Complete it or don't ship it. |
40
- | "Will complete in v2" | Future versions don't exist. Implement fully now. |
41
- | "80% is good enough" | 80% = broken for 20% of users. Not good enough. |
42
-
43
- ### Red Flags - STOP
44
-
45
- If you find yourself thinking:
46
- - "This is good enough for now"
47
- - "I'll fix it before PR"
48
- - "Core logic works, edge cases later"
49
-
50
- **STOP. You are rationalizing. Complete the implementation or don't ship.**
51
-
52
- ### I.1 Complete Implementation Mandate
53
-
54
- ```yaml
55
- NO PARTIAL IMPLEMENTATION:
56
- Prohibition: Any form of partial implementation or placeholder code
57
- Requirement: Complete implementation or no implementation
58
- Examples:
59
- ❌ Forbidden: "// TODO: Implement this later"
60
- ❌ Forbidden: "// Simplified for now, will complete in v2"
61
- ✅ Required: Fully functional, production-ready code
62
- ```
63
-
64
- ### I.2 Testing Mandate
65
-
66
- ```yaml
67
- MANDATORY TEST COVERAGE:
68
- Rule: Every function must have corresponding tests
69
- Coverage Threshold: ≥80%
70
- Test Types: Unit, Integration, Contract, E2E (as appropriate)
71
- Verification: Tests must fail first (TDD), then pass
72
- ```
73
-
74
- ### I.3 No Simplification Clause
75
-
76
- ```text
77
- "This is simplified for now, complete implementation would..."
78
- ↑ CONSTITUTIONAL VIOLATION - Immediate rejection
79
- ```
80
-
81
- ### I.4 Quality Gates
82
-
83
- All code must pass:
84
- - [ ] Type checking (TypeScript, Python type hints, etc.)
85
- - [ ] Linting (ESLint, Pylint, etc.)
86
- - [ ] Security scanning (no high-severity issues)
87
- - [ ] Build verification
88
- - [ ] Documentation completeness
89
-
90
- **Enforcement**: Pre-push guard (`pre-push-guard.sh`)
91
-
92
- ---
93
-
94
- ## Article II: Architectural Consistency (架构一致性)
95
-
96
- **Principle**: Maintain codebase uniformity and predictability.
97
-
98
- ### The Iron Law
99
-
100
- ```
101
- REUSE EXISTING CODE - NO DUPLICATION
102
- ```
103
-
104
- ### Rationalization Defense
105
-
106
- > See [rationalization-library.md](./rationalization-library.md#article-ii-architectural-consistency---rationalization-table) for full table.
107
-
108
- | Excuse | Reality |
109
- |--------|---------|
110
- | "Faster to rewrite" | Faster now = slower forever. Find and reuse. |
111
- | "Slightly different use case" | Extract common, parameterize difference. |
112
- | "I understand my version better" | Understand the shared version. That's your job. |
113
-
114
- ### Red Flags - STOP
115
-
116
- If you find yourself thinking:
117
- - "That code is messy, I'll write my own"
118
- - "I don't have time to search"
119
- - "It's just a small function"
120
-
121
- **STOP. Search the codebase. Reuse or refactor existing code.**
122
-
123
- ### II.1 No Code Duplication
124
-
125
- ```yaml
126
- REUSE MANDATE:
127
- Before Writing New Code:
128
- 1. Search existing codebase for similar functionality
129
- 2. Use Read/Grep/Glob tools to find reusable functions
130
- 3. Prefer function call over copy-paste
131
-
132
- Violation Examples:
133
- ❌ Copying validation logic across files
134
- ❌ Duplicate database connection code
135
- ❌ Repeated error handling patterns
136
- ```
137
-
138
- ### II.2 Consistent Naming
139
-
140
- ```yaml
141
- NAMING CONSISTENCY:
142
- Requirement: Follow existing codebase naming patterns
143
- Process:
144
- 1. Read existing files before naming new entities
145
- 2. Match verb-noun patterns (getUserById, createOrder)
146
- 3. Match case conventions (camelCase, snake_case)
147
-
148
- Tools: Use Grep to find naming patterns in codebase
149
- ```
150
-
151
- ### II.3 Anti-Over-Engineering
152
-
153
- ```yaml
154
- SIMPLICITY MANDATE:
155
- Prohibited Patterns:
156
- ❌ BaseController, AbstractService, GenericRepository
157
- ❌ Factory patterns for simple object creation
158
- ❌ Middleware layers with single responsibility
159
- ❌ "Future-proofing" abstractions
160
-
161
- Required Approach:
162
- ✅ Direct framework usage (Express, FastAPI, Flask)
163
- ✅ Solve current problem with simplest solution
164
- ✅ Refactor when actual need emerges
165
- ```
166
-
167
- ### II.4 Single Responsibility
168
-
169
- ```yaml
170
- MODULE COHESION:
171
- Rule: Each module/class/function has ONE reason to change
172
- File Size Limit: ≤500 lines per file
173
- Function Length Limit: ≤50 lines per function
174
-
175
- Violation Indicators:
176
- - File has multiple unrelated imports
177
- - Function has multiple if-else branches for different concerns
178
- - Class name contains "And" or "Manager" or "Helper"
179
- ```
180
-
181
- **Enforcement**: Phase -1 Anti-Abstraction Gate (EPIC_TEMPLATE.md)
182
-
183
- ---
184
-
185
- ## Article III: Security First (安全优先)
186
-
187
- **Principle**: Security is foundational, not an afterthought.
188
-
189
- ### The Iron Law
190
-
191
- ```
192
- NO HARDCODED SECRETS - ENVIRONMENT VARIABLES ONLY
193
- ```
194
-
195
- ### Rationalization Defense
196
-
197
- > See [rationalization-library.md](./rationalization-library.md#article-iii-security-first---rationalization-table) for full table.
198
-
199
- | Excuse | Reality |
200
- |--------|---------|
201
- | "It's just for testing" | Commits are forever. Use env vars even for tests. |
202
- | "I'll remove it before commit" | You won't. You'll forget. Use env vars. |
203
- | "Local development only" | Local becomes production. Start secure. |
204
-
205
- ### Red Flags - STOP
206
-
207
- If you find yourself thinking:
208
- - "Nobody will see the repo"
209
- - "It's not a real secret"
210
- - "I'll rotate it later"
211
-
212
- **STOP. Never commit secrets. Use environment variables from the start.**
213
-
214
- ### III.1 No Hardcoded Secrets
215
-
216
- ```yaml
217
- SECRET MANAGEMENT:
218
- Prohibited:
219
- ❌ API_KEY = "sk-abc123..." in source code
220
- ❌ PASSWORD = "admin123" in config files
221
- ❌ JWT_SECRET embedded in code
222
-
223
- Required:
224
- ✅ Environment variables (.env files, not committed)
225
- ✅ Secret management services (AWS Secrets Manager, etc.)
226
- ✅ Configuration injection at runtime
227
-
228
- Detection: Pre-push guard scans for secret patterns
229
- ```
230
-
231
- ### III.2 Input Validation
232
-
233
- ```yaml
234
- VALIDATION MANDATE:
235
- Rule: All external inputs must be validated BEFORE processing
236
- Scope:
237
- - User inputs (forms, API requests)
238
- - File uploads
239
- - Database query results (防止 SQL injection)
240
- - Environment variables
241
-
242
- Validation Types:
243
- - Type checking
244
- - Range validation
245
- - Format validation (regex)
246
- - Sanitization (XSS prevention)
247
- ```
248
-
249
- ### III.3 Principle of Least Privilege
250
-
251
- ```yaml
252
- PERMISSION CONTROL:
253
- Default: Deny all, explicitly allow needed permissions
254
- File Permissions: Minimal necessary (no 777)
255
- Database Access: Read-only when possible
256
- API Scopes: Request minimum required scopes
257
- ```
258
-
259
- ### III.4 Secure by Default
260
-
261
- ```yaml
262
- DEFAULT SECURITY:
263
- Examples:
264
- ✅ HTTPS by default, not HTTP
265
- ✅ CORS with explicit origin whitelist
266
- ✅ Authentication required unless explicitly public
267
- ✅ Rate limiting enabled by default
268
- ```
269
-
270
- **Enforcement**: Security-reviewer agent + pre-push security scan
271
-
272
- ---
273
-
274
- ## Article IV: Performance Accountability (性能责任)
275
-
276
- **Principle**: Performance is user experience; proactive optimization required.
277
-
278
- ### The Iron Law
279
-
280
- ```
281
- NO RESOURCE LEAKS - ALWAYS CLEANUP
282
- ```
283
-
284
- ### Rationalization Defense
285
-
286
- > See [rationalization-library.md](./rationalization-library.md#article-iv-performance-accountability---rationalization-table) for full table.
287
-
288
- | Excuse | Reality |
289
- |--------|---------|
290
- | "Garbage collector will handle it" | GC doesn't close files/connections. Explicit cleanup. |
291
- | "Small leak, won't matter" | Small leaks become big crashes. Fix now. |
292
- | "Framework handles it" | Verify that. Don't assume. |
293
-
294
- ### Red Flags - STOP
295
-
296
- If you find yourself thinking:
297
- - "It's a short-lived process"
298
- - "I'll add cleanup later"
299
- - "Only happens in edge case"
300
-
301
- **STOP. Add cleanup with creation. Edge cases run in production.**
302
-
303
- ### IV.1 No Resource Leaks
304
-
305
- ```yaml
306
- RESOURCE MANAGEMENT:
307
- Mandatory Cleanup:
308
- - Database connections (use connection pooling)
309
- - File handles (use with/try-finally)
310
- - Event listeners (removeEventListener)
311
- - Timers (clearTimeout, clearInterval)
312
- - HTTP connections (connection.close())
313
-
314
- Pattern:
315
- try:
316
- resource = acquire_resource()
317
- use_resource(resource)
318
- finally:
319
- resource.close() # MUST execute
320
- ```
321
-
322
- ### IV.2 Algorithm Efficiency
323
-
324
- ```yaml
325
- COMPLEXITY AWARENESS:
326
- Before Implementation:
327
- - Choose appropriate data structure (Array vs Set vs Map)
328
- - Avoid O(n²) when O(n) exists
329
- - Use binary search for sorted data
330
-
331
- Review Triggers:
332
- - Nested loops over same dataset
333
- - Repeated database queries in loops
334
- - Full table scans
335
- ```
336
-
337
- ### IV.3 Lazy Loading
338
-
339
- ```yaml
340
- ON-DEMAND LOADING:
341
- Apply To:
342
- - Large datasets (pagination)
343
- - Heavy dependencies (dynamic import)
344
- - Images/media (lazy loading)
345
- - Database records (streaming)
346
-
347
- Example:
348
- ❌ loadAllUsers() # Loads 1M users into memory
349
- ✅ getUsersPaginated(page, limit) # Loads 50 at a time
350
- ```
351
-
352
- ### IV.4 Caching Strategy
353
-
354
- ```yaml
355
- INTELLIGENT CACHING:
356
- When to Cache:
357
- ✅ Expensive computations with stable inputs
358
- ✅ External API responses with TTL
359
- ✅ Database query results (with invalidation)
360
-
361
- When NOT to Cache:
362
- ❌ User-specific sensitive data
363
- ❌ Real-time data requirements
364
- ❌ Infrequently accessed data
365
- ```
366
-
367
- **Enforcement**: Performance profiling in QA stage
368
-
369
- ---
370
-
371
- ## Article V: Maintainability (可维护性)
372
-
373
- **Principle**: Code must be understandable, modifiable, and extensible.
374
-
375
- ### The Iron Law
376
-
377
- ```
378
- NO DEAD CODE - USE IT OR DELETE IT
379
- ```
380
-
381
- ### Rationalization Defense
382
-
383
- > See [rationalization-library.md](./rationalization-library.md#article-v-maintainability---rationalization-table) for full table.
384
-
385
- | Excuse | Reality |
386
- |--------|---------|
387
- | "Might need it later" | Git history exists. Delete now, retrieve if needed. |
388
- | "It's just commented out" | Commented code = noise. Delete it. |
389
- | "Too risky to delete" | Tests exist. If tests pass after delete, it's safe. |
390
-
391
- ### Red Flags - STOP
392
-
393
- If you find yourself thinking:
394
- - "Reference for future work"
395
- - "Someone else might need it"
396
- - "I worked hard on this"
397
-
398
- **STOP. Sunk cost fallacy. Delete dead code. Git remembers.**
399
-
400
- ### V.1 No Dead Code
401
-
402
- ```yaml
403
- CODE HYGIENE:
404
- Rule: Use it or delete it, no middle ground
405
-
406
- Dead Code Patterns:
407
- ❌ Commented-out code blocks
408
- ❌ Unused imports
409
- ❌ Unreachable branches (if false:)
410
- ❌ Functions with no callers
411
-
412
- Tools: Use IDE "Find Usages" before writing new code
413
- ```
414
-
415
- ### V.2 Separation of Concerns
416
-
417
- ```yaml
418
- CLEAR BOUNDARIES:
419
- Prohibited Mixing:
420
- ❌ Validation logic inside API handlers
421
- ❌ Database queries inside UI components
422
- ❌ Business logic in presentation layer
423
-
424
- Required Separation:
425
- ✅ Models (data structure)
426
- ✅ Services (business logic)
427
- ✅ Controllers (request handling)
428
- ✅ Views (presentation)
429
- ```
430
-
431
- ### V.3 Documentation
432
-
433
- ```yaml
434
- DOCUMENTATION MANDATE:
435
- Required Documentation:
436
- - Complex algorithms (why this approach)
437
- - Business logic (domain rules)
438
- - Public APIs (parameters, return types, examples)
439
- - Configuration options
440
-
441
- Format:
442
- - Inline comments for WHY, not WHAT
443
- - Docstrings for public functions
444
- - README for modules
445
- ```
446
-
447
- ### V.4 File Size Limits
448
-
449
- ```yaml
450
- SIZE CONSTRAINTS:
451
- Single File: ≤500 lines (including comments)
452
- Single Function: ≤50 lines
453
-
454
- Violation Response:
455
- - Extract functions/classes to separate files
456
- - Split by responsibility
457
- - Use modules for grouping
458
- ```
459
-
460
- **Enforcement**: Linting rules + code review
461
-
462
- ---
463
-
464
- ## Article VI: Test-First Development (测试优先开发)
465
-
466
- **Principle**: Tests define behavior; implementation makes tests pass.
467
-
468
- ### The Iron Law
469
-
470
- ```
471
- NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST
472
- ```
473
-
474
- ### Rationalization Defense
475
-
476
- > See [rationalization-library.md](./rationalization-library.md#article-vi-test-first-development---rationalization-table) for full table.
477
-
478
- | Excuse | Reality |
479
- |--------|---------|
480
- | "Too simple to test" | Simple code breaks. Test takes 30 seconds. |
481
- | "I'll test after" | Tests passing immediately prove nothing. |
482
- | "TDD slows me down" | TDD faster than debugging. Pragmatic = test-first. |
483
- | "This is different because..." | No. This is rationalization. Follow the law. |
484
-
485
- ### Red Flags - STOP
486
-
487
- If you find yourself thinking:
488
- - "Just this once"
489
- - "I'm being pragmatic, not dogmatic"
490
- - "Spirit not letter"
491
- - "Need to explore first" (without deleting exploration code)
492
-
493
- **STOP. You are rationalizing. Delete the code. Write the test first.**
494
-
495
- ### VI.1 TDD Mandate (NON-NEGOTIABLE)
496
-
497
- ```yaml
498
- STRICT TDD SEQUENCE:
499
- Phase 2: Write Tests FIRST ⚠️
500
- - Contract tests
501
- - Integration tests
502
- - E2E tests
503
- - Unit tests
504
-
505
- TEST VERIFICATION CHECKPOINT:
506
- → All tests MUST fail initially
507
- → If test passes immediately → ERROR (invalid test)
508
-
509
- Phase 3: Write Implementation
510
- → Goal: Make tests pass
511
- → Refactor while keeping tests green
512
- ```
513
-
514
- ### VI.2 Test Independence
515
-
516
- ```yaml
517
- INDEPENDENT TESTS:
518
- Rule: Each test must run in isolation
519
-
520
- Prohibited:
521
- ❌ Tests depending on execution order
522
- ❌ Shared mutable state between tests
523
- ❌ Tests modifying global variables
524
-
525
- Required:
526
- ✅ Setup before each test
527
- ✅ Teardown after each test
528
- ✅ Mock external dependencies
529
- ```
530
-
531
- ### VI.3 Meaningful Tests
532
-
533
- ```yaml
534
- TEST QUALITY:
535
- Prohibited "Cheater Tests":
536
- ❌ assert True # Always passes
537
- ❌ assert result is not None # Too weak
538
- ❌ Mock everything, test nothing
539
-
540
- Required:
541
- ✅ Test actual behavior, not implementation
542
- ✅ Use realistic test data
543
- ✅ Verify error cases, not just happy path
544
- ```
545
-
546
- **Enforcement**: TEST VERIFICATION CHECKPOINT in TASKS.md
547
-
548
- ---
549
-
550
- ## Article VII: Simplicity Gate (简单性闸门)
551
-
552
- **Principle**: Default to simplicity; complexity requires justification.
553
-
554
- ### The Iron Law
555
-
556
- ```
557
- MAXIMUM 3 PROJECTS - JUSTIFY ANY ADDITIONAL COMPLEXITY
558
- ```
559
-
560
- ### Rationalization Defense
561
-
562
- > See [rationalization-library.md](./rationalization-library.md#article-vii-simplicity-gate---rationalization-table) for full table.
563
-
564
- | Excuse | Reality |
565
- |--------|---------|
566
- | "Microservices are better" | For your scale? Monolith is simpler. Start there. |
567
- | "Future scalability" | YAGNI. Scale when you need to. |
568
- | "Best practices say..." | Best practices assume scale you don't have. |
569
-
570
- ### Red Flags - STOP
571
-
572
- If you find yourself thinking:
573
- - "Separation of concerns" (as justification for new project)
574
- - "Team autonomy"
575
- - "We might need it"
576
-
577
- **STOP. Build for now. Refactor when needed. Complexity is the enemy.**
578
-
579
- ### VII.1 Project Count Limit
580
-
581
- ```yaml
582
- MAXIMUM 3 PROJECTS/MODULES:
583
- Rule: Use ≤3 distinct projects/services
584
-
585
- If >3 needed:
586
- → Must fill Complexity Tracking table in EPIC.md
587
- → Justify why simpler alternative insufficient
588
- → Document mitigation strategy
589
- ```
590
-
591
- ### VII.2 No Future-Proofing
592
-
593
- ```yaml
594
- YAGNI ENFORCEMENT:
595
- Prohibited:
596
- ❌ "Reserved interfaces" for future features
597
- ❌ "Extension points" with no current use
598
- ❌ "Generic framework" when specific solution exists
599
- ❌ "Will need this later" abstractions
600
-
601
- Required:
602
- ✅ Implement ONLY what current requirement needs
603
- ✅ Refactor when new requirement emerges
604
- ```
605
-
606
- **Enforcement**: Phase -1 Simplicity Gate in EPIC_TEMPLATE.md
607
-
608
- ---
609
-
610
- ## Article VIII: Anti-Abstraction (反抽象)
611
-
612
- **Principle**: Trust frameworks; avoid unnecessary wrapping.
613
-
614
- ### The Iron Law
615
-
616
- ```
617
- USE FRAMEWORKS DIRECTLY - NO UNNECESSARY WRAPPERS
618
- ```
619
-
620
- ### Rationalization Defense
621
-
622
- > See [rationalization-library.md](./rationalization-library.md#article-viii-anti-abstraction---rationalization-table) for full table.
623
-
624
- | Excuse | Reality |
625
- |--------|---------|
626
- | "Abstraction for future flexibility" | YAGNI. You won't switch frameworks. |
627
- | "Cleaner interface" | Framework interface IS clean. Learn it. |
628
- | "Easier testing" | Mock the framework. Don't wrap it. |
629
-
630
- ### Red Flags - STOP
631
-
632
- If you find yourself thinking:
633
- - "Hide implementation details"
634
- - "Consistent with other projects"
635
- - "Best practice pattern"
636
-
637
- **STOP. Use the framework directly. Wrappers add complexity, not value.**
638
-
639
- ### VIII.1 Direct Framework Usage
640
-
641
- ```yaml
642
- FRAMEWORK TRUST:
643
- Prohibited Wrappers:
644
- ❌ BaseController extending Express/FastAPI
645
- ❌ DatabaseService wrapping ORM
646
- ❌ CacheManager wrapping Redis client
647
-
648
- Required:
649
- ✅ Use Express/FastAPI/Flask directly
650
- ✅ Use ORM (Prisma/SQLAlchemy) directly
651
- ✅ Use libraries as intended
652
- ```
653
-
654
- ### VIII.2 Single Model Representation
655
-
656
- ```yaml
657
- ONE ENTITY, ONE REPRESENTATION:
658
- Prohibited:
659
- ❌ UserDTO → User Entity → UserViewModel
660
- ❌ Multiple mappings between layers
661
-
662
- Required:
663
- ✅ One User model used across layers
664
- ✅ Add fields as needed, don't transform
665
- ```
666
-
667
- **Enforcement**: Phase -1 Anti-Abstraction Gate in EPIC_TEMPLATE.md
668
-
669
- ---
670
-
671
- ## Article IX: Integration-First Testing (集成优先测试)
672
-
673
- **Principle**: Test with real environments, not mocks.
674
-
675
- ### The Iron Law
676
-
677
- ```
678
- CONTRACTS FIRST - REAL ENVIRONMENTS
679
- ```
680
-
681
- ### Rationalization Defense
682
-
683
- > See [rationalization-library.md](./rationalization-library.md#article-ix-integration-first-testing---rationalization-table) for full table.
684
-
685
- | Excuse | Reality |
686
- |--------|---------|
687
- | "Unit tests are faster" | Fast wrong tests waste time. Integration tests catch real bugs. |
688
- | "Mocks are simpler" | Mocks hide integration issues. Real databases find them. |
689
- | "In-memory database works" | In-memory differs from production. Test with real DB. |
690
-
691
- ### Red Flags - STOP
692
-
693
- If you find yourself thinking:
694
- - "CI is slow"
695
- - "Docker is complex"
696
- - "We can mock this"
697
-
698
- **STOP. Production bugs are expensive. Test with real environments.**
699
-
700
- ### IX.1 Contract-First
701
-
702
- ```yaml
703
- CONTRACT DEFINITION:
704
- Sequence:
705
- 1. Define API contracts BEFORE implementation
706
- 2. Write contract tests in Phase 2
707
- 3. Implement to satisfy contracts in Phase 3
708
-
709
- Tools:
710
- - OpenAPI specifications
711
- - GraphQL schemas
712
- - gRPC proto files
713
- ```
714
-
715
- ### IX.2 Real Environment Testing
716
-
717
- ```yaml
718
- INTEGRATION TESTING:
719
- Preferred:
720
- ✅ Real database (use Docker for local)
721
- ✅ Real message queue
722
- ✅ Real cache (Redis)
723
-
724
- Avoid:
725
- ❌ Mocking database layer
726
- ❌ In-memory substitutes (unless testing speed critical)
727
- ```
728
-
729
- **Enforcement**: Phase -1 Integration-First Gate in EPIC_TEMPLATE.md
730
-
731
- ---
732
-
733
- ## Article X: Requirement Boundary (需求边界)
734
-
735
- **Principle**: Implement what's requested, nothing more.
736
-
737
- ### The Iron Law
738
-
739
- ```
740
- IMPLEMENT WHAT'S REQUESTED, NOTHING MORE
741
- ```
742
-
743
- ### Rationalization Defense
744
-
745
- > See [rationalization-library.md](./rationalization-library.md#article-x-requirement-boundary---rationalization-table) for full table.
746
-
747
- | Excuse | Reality |
748
- |--------|---------|
749
- | "User might need this later" | User didn't ask. Don't add. YAGNI. |
750
- | "It's just a small addition" | Small additions compound. Scope creep. |
751
- | "I'm being helpful" | Helpful = following spec. Unhelpful = scope creep. |
752
-
753
- ### Red Flags - STOP
754
-
755
- If you find yourself thinking:
756
- - "While I'm here anyway"
757
- - "It's only 5 more lines"
758
- - "User will thank me"
759
- - "This is a natural extension"
760
-
761
- **STOP. Stay on task. Create separate requirement for extensions.**
762
-
763
- ### X.1 Forced Clarification
764
-
765
- ```yaml
766
- [NEEDS CLARIFICATION] MANDATE:
767
- Rule: Mark ALL ambiguities explicitly
768
-
769
- Prohibited:
770
- ❌ Guessing user intent
771
- ❌ Adding "helpful" features not requested
772
- ❌ Assuming technical details
773
-
774
- Required:
775
- ✅ Use [NEEDS CLARIFICATION: specific question]
776
- ✅ Wait for user clarification
777
- ✅ Document assumptions made
778
- ```
779
-
780
- ### X.2 No Speculative Features
781
-
782
- ```yaml
783
- ANTI-EXPANSION:
784
- Prohibited Phrases:
785
- ❌ "May need in the future..."
786
- ❌ "Should also add..."
787
- ❌ "Might want to consider..."
788
-
789
- Required:
790
- ✅ Only implement explicitly requested features
791
- ✅ Focus on current user stories
792
- ```
793
-
794
- ### X.3 User Story Independence
795
-
796
- ```yaml
797
- STORY ISOLATION:
798
- Each User Story Must Have:
799
- - Explicit priority (P1, P2, P3...)
800
- - Independent Test criteria
801
- - Standalone deliverability (can ship as MVP)
802
-
803
- Organization:
804
- - Tasks organized by user story [US1], [US2], [US3]
805
- - Each story testable independently
806
- ```
807
-
808
- **Enforcement**:
809
- - PRD anti-expansion validation checklist (prd-writer agent)
810
- - validate-scope-boundary.sh script
811
-
812
- ---
813
-
814
- ## Immutable Constraints
815
-
816
- ### Workflow Constraints
817
-
818
- 1. **Standard Flow Mandate**: All development through `/flow-init` → `/flow-prd` → `/flow-epic` → `/flow-dev` → `/flow-qa` → `/flow-release`
819
- 2. **No Gate Skipping**: Quality gates (Entry/Exit) cannot be bypassed
820
- 3. **Document-Driven**: Important decisions must be documented
821
- 4. **Version Control**: All changes through Git
822
-
823
- ### Agent Behavior Constraints
824
-
825
- 1. **Main Agent Authority**: Only main agent (Claude) may execute code modifications
826
- 2. **Research Agent Role**: Research agents (prd-writer, planner, etc.) only analyze and output documents
827
- 3. **Coordination**: Agents must coordinate via `orchestration_status.json`
828
- 4. **Error Handling**: Agents must stop and report errors, not ignore
829
-
830
- ### Technology Choice Constraints
831
-
832
- 1. **Existing Stack First**: Prefer project's existing technologies
833
- 2. **Backward Compatibility**: New features must not break existing functionality
834
- 3. **Dependency Evaluation**: New dependencies require justification
835
- 4. **Standards Compliance**: Follow industry best practices
836
-
837
- ---
838
-
839
- ## Constitutional Violations
840
-
841
- ### Severity Levels
842
-
843
- #### Minor Violations
844
- - **Examples**: Inconsistent code style, missing documentation
845
- - **Consequence**: Immediate correction required, re-review
846
-
847
- #### Moderate Violations
848
- - **Examples**: Partial implementation, missing tests, security risks
849
- - **Consequence**: Block commit, mandatory fix
850
-
851
- #### Severe Violations
852
- - **Examples**: Hardcoded secrets, resource leaks, architectural destruction
853
- - **Consequence**: Immediate rollback, comprehensive audit
854
-
855
- ---
856
-
857
- ## Amendment Process
858
-
859
- ### Amendment Principles
860
-
861
- 1. **Cautious Amendment**: Constitutional changes require careful justification
862
- 2. **Backward Compatible**: Amendments must not break existing commitments
863
- 3. **Community Consensus**: Major amendments need broad discussion
864
- 4. **Version Tracking**: All amendments tracked with semantic versioning
865
-
866
- ### Amendment Procedure
867
-
868
- ```yaml
869
- Amendment Workflow:
870
- 1. Proposal:
871
- - Submit amendment proposal with rationale
872
- - Document affected Articles and implications
873
- - Provide migration strategy
874
-
875
- 2. Review:
876
- - Community discussion (minimum 7 days)
877
- - Impact analysis (compatibility-checker agent)
878
- - Test amendment in isolated environment
879
-
880
- 3. Approval:
881
- - Requires consensus or majority vote
882
- - Update Constitution version (MAJOR.MINOR.PATCH)
883
- - Generate Sync Impact Report
884
-
885
- 4. Propagation:
886
- - Update all templates referencing amended Articles
887
- - Update agent instructions
888
- - Update validation scripts
889
- - Notify all stakeholders
890
- ```
891
-
892
- ### Versioning Scheme
893
-
894
- ```yaml
895
- Version Format: MAJOR.MINOR.PATCH
896
-
897
- MAJOR (e.g., 1.0.0 → 2.0.0):
898
- - Fundamental principle changes
899
- - Breaking changes to existing rules
900
- - Requires full codebase audit
901
-
902
- MINOR (e.g., 2.0.0 → 2.1.0):
903
- - New Article additions
904
- - Non-breaking clarifications
905
- - Enhanced enforcement mechanisms
906
-
907
- PATCH (e.g., 2.1.0 → 2.1.1):
908
- - Typo corrections
909
- - Example updates
910
- - Documentation improvements
911
- ```
912
-
913
- ---
914
-
915
- ## Constitutional Enforcement
916
-
917
- ### Four-Layer Defense System
918
-
919
- ```text
920
- Layer 1: Template Hard Constraints
921
-
922
- - PRD_TEMPLATE.md: ANTI-EXPANSION RULES (Article X)
923
- - EPIC_TEMPLATE.md: Phase -1 Gates (Articles VII, VIII, IX)
924
- - TASKS_TEMPLATE.md: TDD enforcement (Article VI)
925
-
926
- Layer 2: Command-Level Enforcement
927
-
928
- - /flow-constitution: Update and propagate Constitution
929
- - /flow-verify: Consistency checking across documents
930
-
931
- Layer 3: Agent-Level Constraints
932
-
933
- - prd-writer: Anti-Expansion Validation Checklist
934
- - planner: Phase -1 Gate Enforcement
935
- - dev-implementer: TDD Sequence Validation
936
- - qa-tester: Test Quality Standards
937
- - security-reviewer: Security Mandate Compliance
938
-
939
- Layer 4: Validation Scripts
940
-
941
- - validate-scope-boundary.sh: Boundary compliance
942
- - validate-constitution.sh: Constitutional compliance
943
- - pre-push-guard.sh: Pre-commit quality gates
944
- ```
945
-
946
- ### Compliance Checklist
947
-
948
- **Before Code Commit**:
949
- - [ ] Article I: Complete implementation, no placeholders (Quality First)
950
- - [ ] Article I: Tests written and passing, coverage ≥80%
951
- - [ ] Article II: No code duplication, existing code reused (Architectural Consistency)
952
- - [ ] Article II: Naming follows existing patterns
953
- - [ ] Article III: No hardcoded secrets (Security First)
954
- - [ ] Article IV: Resources properly managed, no leaks (Performance Accountability)
955
- - [ ] Article V: No dead code, clean codebase (Maintainability)
956
- - [ ] Article VI: TDD sequence followed (Test-First Development)
957
-
958
- **Before Flow Execution**:
959
- - [ ] Article VII: ≤3 projects/modules (Simplicity Gate)
960
- - [ ] Article VIII: No unnecessary abstractions (Anti-Abstraction)
961
- - [ ] Article IX: Contracts defined first, real environments (Integration-First)
962
- - [ ] Article X: No speculative features, all ambiguities marked (Requirement Boundary)
963
-
964
- **Tools**:
965
- ```bash
966
- # Automated Constitutional Compliance Check
967
- bash .claude/scripts/validate-constitution.sh
968
-
969
- # Scope Boundary Compliance Check
970
- bash .claude/scripts/validate-scope-boundary.sh
971
-
972
- # Pre-push Quality Gates
973
- bash .claude/hooks/pre-push-guard.sh
974
- ```
975
-
976
- ---
977
-
978
- ## Single Source of Truth
979
-
980
- This Constitution is the **architectural DNA** of CC-DevFlow. All templates, agent instructions, validation scripts, and documentation derive their authority from this document.
981
-
982
- **Consistency Propagation**: When this Constitution is amended, changes MUST automatically propagate to:
983
- - `.claude/docs/templates/*.md` (PRD, EPIC, TASKS templates)
984
- - `.claude/agents/*.md` (All agent instruction files)
985
- - `.claude/scripts/validate-*.sh` (Validation scripts)
986
- - `.claude/hooks/*.sh` (Git hooks)
987
- - `CLAUDE.md` (Project documentation)
988
-
989
- **Amendment Impact Report**: Use `/flow-constitution --amend` command to generate automatic sync report.
990
-
991
- ---
992
-
993
- **Declaration**: This Constitution represents the unwavering commitment of CC-DevFlow to excellence, consistency, and sustainable development. All participants bear the responsibility to uphold and defend these principles.
994
-
995
- ---
996
-
997
- *CC-DevFlow Project Constitution - Ensuring Excellence, Rejecting Compromise*
998
-
999
- **Version History**:
1000
- - v2.1.0 (2026-01-08): Added Iron Law + Rationalization Defense + Red Flags to all 10 Articles
1001
- - v2.0.0 (2025-10-09): Article-based restructure, enforcement mechanisms, amendment process
1002
- - v1.0.0 (2025-01-20): Initial version with five core principles