cc-devflow 4.5.11 → 4.5.13
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.
- package/.claude/skills/cc-act/CHANGELOG.md +18 -0
- package/.claude/skills/cc-act/PLAYBOOK.md +17 -269
- package/.claude/skills/cc-act/SKILL.md +38 -425
- package/.claude/skills/cc-act/assets/PROJECT_POSTMORTEM_INDEX_TEMPLATE.md +2 -13
- package/.claude/skills/cc-act/assets/PROJECT_POSTMORTEM_TEMPLATE.md +1 -9
- package/.claude/skills/cc-act/assets/PR_BRIEF_TEMPLATE.md +21 -177
- package/.claude/skills/cc-act/references/closure-contract.md +12 -63
- package/.claude/skills/cc-act/references/git-commit-guidelines.md +5 -5
- package/.claude/skills/cc-act/scripts/cc-act-common.sh +5 -322
- package/.claude/skills/cc-act/scripts/detect-ship-target.sh +11 -2
- package/.claude/skills/cc-act/scripts/inspect-git-index.sh +58 -0
- package/.claude/skills/cc-act/scripts/render-pr-brief.sh +40 -440
- package/.claude/skills/cc-act/scripts/verify-act-gate.sh +10 -50
- package/.claude/skills/cc-check/CHANGELOG.md +18 -0
- package/.claude/skills/cc-check/PLAYBOOK.md +19 -273
- package/.claude/skills/cc-check/SKILL.md +33 -456
- package/.claude/skills/cc-check/references/review-contract.md +12 -147
- package/.claude/skills/cc-dev/CHANGELOG.md +15 -0
- package/.claude/skills/cc-dev/PLAYBOOK.md +1 -1
- package/.claude/skills/cc-dev/SKILL.md +52 -137
- package/.claude/skills/cc-dev/scripts/resolve-cc-devflow.sh +181 -0
- package/.claude/skills/cc-do/CHANGELOG.md +11 -0
- package/.claude/skills/cc-do/PLAYBOOK.md +19 -113
- package/.claude/skills/cc-do/SKILL.md +39 -245
- package/.claude/skills/cc-do/references/execution-recovery.md +15 -109
- package/.claude/skills/cc-do/scripts/cc-do-common.sh +5 -57
- package/.claude/skills/cc-do/scripts/check-task-status.sh +35 -65
- package/.claude/skills/cc-do/scripts/mark-task-complete.sh +9 -46
- package/.claude/skills/cc-do/scripts/select-ready-tasks.sh +29 -97
- package/.claude/skills/cc-investigate/CHANGELOG.md +16 -0
- package/.claude/skills/cc-investigate/PLAYBOOK.md +20 -180
- package/.claude/skills/cc-investigate/SKILL.md +64 -246
- package/.claude/skills/cc-investigate/assets/TASKS_TEMPLATE.md +48 -98
- package/.claude/skills/cc-investigate/references/investigation-contract.md +14 -218
- package/.claude/skills/cc-next/CHANGELOG.md +6 -0
- package/.claude/skills/cc-next/PLAYBOOK.md +12 -8
- package/.claude/skills/cc-next/SKILL.md +34 -140
- package/.claude/skills/cc-plan/CHANGELOG.md +16 -0
- package/.claude/skills/cc-plan/PLAYBOOK.md +22 -161
- package/.claude/skills/cc-plan/SKILL.md +45 -295
- package/.claude/skills/cc-plan/assets/TASKS_TEMPLATE.md +30 -228
- package/.claude/skills/cc-plan/references/planning-contract.md +24 -161
- package/.claude/skills/cc-plan/scripts/next-change-key.sh +8 -44
- package/.claude/skills/cc-plan/scripts/parse-task-dependencies.js +2 -2
- package/.claude/skills/cc-plan/scripts/validate-scope.sh +1 -1
- package/.claude/skills/cc-pr-land/SKILL.md +14 -114
- package/.claude/skills/cc-pr-review/CHANGELOG.md +4 -0
- package/.claude/skills/cc-pr-review/SKILL.md +20 -103
- package/.claude/skills/cc-review/CHANGELOG.md +23 -0
- package/.claude/skills/cc-review/PLAYBOOK.md +13 -86
- package/.claude/skills/cc-review/SKILL.md +67 -238
- package/.claude/skills/cc-review/references/e2e-and-plugin-verification.md +2 -2
- package/.claude/skills/cc-review/references/implementation-review-branch.md +7 -147
- package/.claude/skills/cc-review/references/plan-review-branch.md +5 -147
- package/.claude/skills/cc-review/references/review-methods.md +10 -218
- package/.claude/skills/cc-review/scripts/collect-review-context.sh +4 -63
- package/.claude/skills/cc-roadmap/PLAYBOOK.md +1 -1
- package/.claude/skills/cc-roadmap/SKILL.md +3 -3
- package/.claude/skills/cc-simplify/CHANGELOG.md +7 -0
- package/.claude/skills/cc-simplify/SKILL.md +26 -21
- package/.claude/skills/cc-spec-init/PLAYBOOK.md +12 -48
- package/.claude/skills/cc-spec-init/SKILL.md +29 -132
- package/.claude/skills/cc-spec-init/references/spec-contract.md +8 -17
- package/CHANGELOG.md +21 -0
- package/bin/cc-devflow-cli.js +20 -260
- package/bin/cc-devflow.js +44 -7
- package/docs/commands/README.md +1 -1
- package/docs/commands/README.zh-CN.md +1 -1
- package/docs/examples/README.md +1 -1
- package/docs/examples/START-HERE.md +14 -15
- package/docs/examples/example-bindings.json +11 -11
- package/docs/examples/full-design-blocked/README.md +4 -6
- package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/{planning/tasks.md → task.md} +20 -15
- package/docs/examples/local-handoff/README.md +8 -11
- package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/handoff/pr-brief.md +31 -0
- package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/{planning/tasks.md → task.md} +18 -13
- package/docs/examples/pdca-loop/README.md +6 -9
- package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/handoff/pr-brief.md +9 -11
- package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/{planning/tasks.md → task.md} +18 -13
- package/docs/examples/scripts/check-example-bindings.sh +11 -62
- package/docs/guides/artifact-contract.md +10 -40
- package/docs/guides/getting-started.md +8 -8
- package/docs/guides/getting-started.zh-CN.md +8 -8
- package/docs/guides/minimize-artifacts.md +16 -130
- package/docs/guides/project-postmortem.md +14 -71
- package/lib/compiler/__tests__/skills-registry.test.js +9 -8
- package/lib/compiler/resource-copier.js +29 -0
- package/lib/skill-runtime/__tests__/archive-change.test.js +2 -2
- package/lib/skill-runtime/__tests__/benchmark-skills.test.js +3 -3
- package/lib/skill-runtime/__tests__/cli-bootstrap.integration.test.js +14 -4
- package/lib/skill-runtime/errors.js +3 -3
- package/lib/skill-runtime/index.js +5 -23
- package/lib/skill-runtime/paths.js +5 -52
- package/lib/skill-runtime/query-registry.js +4 -4
- package/lib/skill-runtime/query.js +89 -201
- package/lib/skill-runtime/store.js +4 -40
- package/lib/skill-runtime/trace.js +2 -2
- package/package.json +2 -5
- package/.claude/skills/cc-act/assets/PROJECT_POSTMORTEM_PRINCIPLES_TEMPLATE.md +0 -29
- package/.claude/skills/cc-act/assets/RELEASE_NOTE_TEMPLATE.md +0 -54
- package/.claude/skills/cc-act/scripts/generate-status-report.sh +0 -92
- package/.claude/skills/cc-act/scripts/sync-act-docs.sh +0 -355
- package/.claude/skills/cc-check/assets/REPORT_CARD_TEMPLATE.json +0 -234
- package/.claude/skills/cc-check/scripts/render-report-card.js +0 -438
- package/.claude/skills/cc-check/scripts/verify-gate.sh +0 -85
- package/.claude/skills/cc-do/scripts/build-task-context.sh +0 -175
- package/.claude/skills/cc-do/scripts/record-review-decision.sh +0 -88
- package/.claude/skills/cc-do/scripts/recover-workflow.sh +0 -82
- package/.claude/skills/cc-do/scripts/run-problem-analysis.sh +0 -70
- package/.claude/skills/cc-do/scripts/verify-task-gates.sh +0 -109
- package/.claude/skills/cc-do/scripts/write-task-checkpoint.sh +0 -92
- package/.claude/skills/cc-investigate/assets/TASK_MANIFEST_TEMPLATE.json +0 -224
- package/.claude/skills/cc-plan/assets/TASK_MANIFEST_TEMPLATE.json +0 -178
- package/.claude/skills/cc-spec-init/assets/CHANGE_META_TEMPLATE.json +0 -28
- package/.claude/skills/cc-spec-init/scripts/validate-spec-links.sh +0 -45
- package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/planning/design.md +0 -234
- package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/planning/task-manifest.json +0 -488
- package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/review/report-card.json +0 -189
- package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/handoff/resume-index.md +0 -39
- package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/handoff/status.md +0 -29
- package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/planning/design.md +0 -123
- package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/planning/task-manifest.json +0 -292
- package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/review/report-card.json +0 -136
- package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/handoff/status.md +0 -29
- package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/planning/design.md +0 -124
- package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/planning/task-manifest.json +0 -292
- package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/review/report-card.json +0 -136
- package/docs/get-shit-done-strategy-audit.md +0 -518
- package/docs/skill-runtime-migration.md +0 -46
- package/lib/skill-runtime/__tests__/approve.test.js +0 -92
- package/lib/skill-runtime/__tests__/autopilot.test.js +0 -253
- package/lib/skill-runtime/__tests__/benchmark-artifacts.test.js +0 -165
- package/lib/skill-runtime/__tests__/delegation.test.js +0 -97
- package/lib/skill-runtime/__tests__/dispatch.test.js +0 -237
- package/lib/skill-runtime/__tests__/intent.test.js +0 -203
- package/lib/skill-runtime/__tests__/lifecycle.test.js +0 -169
- package/lib/skill-runtime/__tests__/planner.tdd.test.js +0 -331
- package/lib/skill-runtime/__tests__/prepare-pr.test.js +0 -126
- package/lib/skill-runtime/__tests__/query.test.js +0 -860
- package/lib/skill-runtime/__tests__/readiness.test.js +0 -53
- package/lib/skill-runtime/__tests__/release.test.js +0 -85
- package/lib/skill-runtime/__tests__/review-check-integration.test.js +0 -148
- package/lib/skill-runtime/__tests__/review-records.test.js +0 -619
- package/lib/skill-runtime/__tests__/runtime.integration.test.js +0 -351
- package/lib/skill-runtime/__tests__/schemas.test.js +0 -337
- package/lib/skill-runtime/__tests__/task-contract-migrate.test.js +0 -137
- package/lib/skill-runtime/__tests__/task-contract.test.js +0 -874
- package/lib/skill-runtime/__tests__/team-state.test.js +0 -51
- package/lib/skill-runtime/__tests__/verify-artifacts.test.js +0 -203
- package/lib/skill-runtime/__tests__/worker-run.test.js +0 -275
- package/lib/skill-runtime/__tests__/worker.test.js +0 -56
- package/lib/skill-runtime/__tests__/workflow-context-legacy-fallback.test.js +0 -31
- package/lib/skill-runtime/__tests__/workflow-context.test.js +0 -98
- package/lib/skill-runtime/artifacts.js +0 -88
- package/lib/skill-runtime/context-index.js +0 -545
- package/lib/skill-runtime/delegation.js +0 -533
- package/lib/skill-runtime/intent.js +0 -309
- package/lib/skill-runtime/lifecycle.js +0 -294
- package/lib/skill-runtime/operations/CLAUDE.md +0 -19
- package/lib/skill-runtime/operations/approve.js +0 -81
- package/lib/skill-runtime/operations/autopilot-core.js +0 -337
- package/lib/skill-runtime/operations/autopilot-execution.js +0 -307
- package/lib/skill-runtime/operations/autopilot-shared.js +0 -48
- package/lib/skill-runtime/operations/autopilot.js +0 -163
- package/lib/skill-runtime/operations/dispatch.js +0 -416
- package/lib/skill-runtime/operations/init.js +0 -60
- package/lib/skill-runtime/operations/janitor.js +0 -61
- package/lib/skill-runtime/operations/plan.js +0 -59
- package/lib/skill-runtime/operations/prepare-pr.js +0 -25
- package/lib/skill-runtime/operations/release.js +0 -99
- package/lib/skill-runtime/operations/resume.js +0 -126
- package/lib/skill-runtime/operations/review-records.js +0 -265
- package/lib/skill-runtime/operations/snapshot.js +0 -45
- package/lib/skill-runtime/operations/task-contract.js +0 -593
- package/lib/skill-runtime/operations/verify.js +0 -170
- package/lib/skill-runtime/operations/worker-run.js +0 -531
- package/lib/skill-runtime/operations/worker.js +0 -33
- package/lib/skill-runtime/planner.js +0 -539
- package/lib/skill-runtime/readiness.js +0 -84
- package/lib/skill-runtime/review-records.js +0 -123
- package/lib/skill-runtime/review.js +0 -855
- package/lib/skill-runtime/schemas.js +0 -746
- package/lib/skill-runtime/task-contract.js +0 -188
- package/lib/skill-runtime/team-state.js +0 -122
- package/lib/skill-runtime/workflow-context.js +0 -748
|
@@ -1,127 +1,33 @@
|
|
|
1
1
|
# CC-Do Playbook
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## State Machine
|
|
4
4
|
|
|
5
5
|
`cc-plan | cc-investigate -> cc-do -> cc-check`
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
- Stay in: `cc-do` while there are ready tasks, current task state is clear, and the design contract still holds.
|
|
9
|
-
- Exit to: `cc-check` once the current task set has red/green/review evidence and no hidden execution gaps remain.
|
|
10
|
-
- Reroute to: `cc-investigate` if repeated failures prove the root-cause contract is wrong, or `cc-plan` if the requirement design itself is wrong.
|
|
11
|
-
|
|
12
|
-
## Quick Triage
|
|
13
|
-
|
|
14
|
-
开始前先把当前执行局面归到 4 类之一:
|
|
15
|
-
|
|
16
|
-
- `implement`: 已有 ready task,可直接进入 TDD
|
|
17
|
-
- `resume`: task 状态或 Git 工作区显示中断,需要续做
|
|
18
|
-
- `repair-from-investigation`: `planning/analysis.md` 已冻结,可直接修
|
|
19
|
-
- `reroute-cc-investigate`: bug 根因未明,回调查入口
|
|
20
|
-
- `review-fix`: scope 不变,只修 review 指向的问题
|
|
21
|
-
|
|
22
|
-
如果这一步归不清,说明当前上下文还没组装好,不准开始实现。
|
|
23
|
-
|
|
24
|
-
## Execution Loop
|
|
25
|
-
|
|
26
|
-
1. 读取 `task-manifest.json`,先用 `scripts/select-ready-tasks.sh` 找出当前 ready tasks 和当前 wave。
|
|
27
|
-
2. 如果有多于一个 ready task,要先跑 `scripts/detect-file-conflicts.sh`;有共享触点、父子路径触点或依赖关系就退回串行。
|
|
28
|
-
3. 对每个要执行的 task,先用 `workflow-context` 和完整 task block 组装上下文;只有恢复卡住时才运行 `scripts/build-task-context.sh`,且它只输出 stdout。
|
|
29
|
-
4. 如果当前任务来自 `cc-investigate`,把 `planning/analysis.md` 当成上游合同,不准一边做一边重开调查。
|
|
30
|
-
5. 进入 TDD 闭环:先红,再绿,再重构。
|
|
31
|
-
6. 每个关键节点都留下客观证据:代码 diff、Git 状态、验证命令输出、review verdict;失败或 debug 才写 CLI event。
|
|
32
|
-
7. 任务实现后,先过 `spec review`,再过 `code review`,review 不通过就回到实现。
|
|
33
|
-
8. 两道 review 门都通过后,才能把任务标成完成,并把结果留给 `cc-check`。
|
|
34
|
-
9. quick lane 只允许减少叙事,不允许减少 current task、verification、handoff 和 review gates。
|
|
35
|
-
|
|
36
|
-
## Local Kit
|
|
37
|
-
|
|
38
|
-
- 恢复时看 `references/execution-recovery.md`
|
|
39
|
-
- 并行分配时看 `references/parallel-dispatch.md`
|
|
40
|
-
- 需要判断当前任务时用 `scripts/check-task-status.sh`
|
|
41
|
-
- 需要找 ready task 时用 `scripts/select-ready-tasks.sh`
|
|
42
|
-
- 需要组装任务上下文时用 `scripts/build-task-context.sh`
|
|
43
|
-
- 不要写 checkpoint;`scripts/write-task-checkpoint.sh` 只是旧兼容入口,默认不生成 checkpoint 文件
|
|
44
|
-
- 需要写 review 门结果时用 `scripts/record-review-decision.sh`
|
|
45
|
-
- 需要校验任务闭环时用 `scripts/verify-task-gates.sh`
|
|
46
|
-
- 需要勾选任务时用 `scripts/mark-task-complete.sh`
|
|
47
|
-
- 需要确认并行安全时用 `scripts/detect-file-conflicts.sh`
|
|
48
|
-
- bug 根因没冻结时,退出当前执行并回 `cc-investigate`
|
|
49
|
-
|
|
50
|
-
## TDD Standard
|
|
51
|
-
|
|
52
|
-
1. 先写失败测试,再运行到红。
|
|
53
|
-
2. 确认红灯是预期失败,不是测试写错、fixture 缺失或环境没接上。
|
|
54
|
-
3. 确认红灯通过公共 seam 证明行为缺失,而不是测私有函数、内部调用次数或临时结构。
|
|
55
|
-
4. 确认 mock 只发生在系统边界;内部协作者不 mock。
|
|
56
|
-
5. 确认测试名像规格说明,一个 Red 只证明一个逻辑行为,结果从公共验证路径读回。
|
|
57
|
-
6. 只写让当前测试转绿的最小实现,不提前实现未来测试尚未要求的分支、状态或 API。
|
|
58
|
-
7. 绿后才允许重构。
|
|
59
|
-
8. 重构后必须保持绿,并说明处理了重复、长方法、浅模块、feature envy、primitive obsession、命名、三层以上分支或其它具体坏味道。
|
|
60
|
-
9. 测试没先红过,或红灯不是公共 seam 上的行为失败,就不能宣称这次变更受 TDD 保护。
|
|
61
|
-
|
|
62
|
-
## TDD Exception Rule
|
|
63
|
-
|
|
64
|
-
只有这些场景允许跳过 fail-first:
|
|
65
|
-
|
|
66
|
-
- throwaway prototype
|
|
67
|
-
- 纯生成文件
|
|
68
|
-
- 纯配置变更
|
|
69
|
-
- 上游明确禁止写测试的探索步骤
|
|
70
|
-
|
|
71
|
-
每个例外都要写入当前 task block 或 manifest task context:
|
|
72
|
-
|
|
73
|
-
- `tddException.reason`
|
|
74
|
-
- `tddException.risk`
|
|
75
|
-
- `tddException.alternativeEvidence`
|
|
76
|
-
|
|
77
|
-
没有例外记录,就按违规处理,回到 Red。
|
|
7
|
+
`cc-do` edits code. It does not create process files.
|
|
78
8
|
|
|
79
9
|
## Task Gates
|
|
80
10
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
6. `green_passed`: 当前任务实现转绿,且实现只覆盖当前红灯要求的最小行为
|
|
89
|
-
7. `refactor_done` 或 `refactor_not_needed`
|
|
90
|
-
8. `refactor_green`: 重构后相关测试仍绿,且没有在 Red 状态做结构清理
|
|
91
|
-
9. `spec_review_pass`
|
|
92
|
-
10. `code_review_pass`
|
|
93
|
-
|
|
94
|
-
任何一门失败,都回到实现,不准直接跨过去。
|
|
95
|
-
|
|
96
|
-
## Parallel Dispatch Rule
|
|
97
|
-
|
|
98
|
-
只有满足全部条件,才能并行:
|
|
99
|
-
|
|
100
|
-
1. 任务处于当前 active phase
|
|
101
|
-
2. `dependsOn` 已全部满足
|
|
102
|
-
3. 任务显式允许并行,例如 `[P]`
|
|
103
|
-
4. `touches` / `files` 不冲突,且父路径 / 子路径也不重叠
|
|
104
|
-
5. submodule touches 已被标出;触达 submodule 的任务不能默认拿普通 worktree 隔离
|
|
105
|
-
6. 每个 subagent 都拿到了自己的 task context
|
|
11
|
+
1. Task selected from `task.md`
|
|
12
|
+
2. Red observed or TDD exception recorded
|
|
13
|
+
3. Green observed
|
|
14
|
+
4. Refactor complete or unnecessary
|
|
15
|
+
5. Verification run
|
|
16
|
+
6. `mark-task-complete.sh` updates `task.md`
|
|
17
|
+
7. Git commit created
|
|
106
18
|
|
|
107
|
-
|
|
19
|
+
## Recovery
|
|
108
20
|
|
|
109
|
-
|
|
21
|
+
Recover from Git and `task.md`:
|
|
110
22
|
|
|
111
|
-
-
|
|
112
|
-
-
|
|
113
|
-
-
|
|
114
|
-
-
|
|
115
|
-
-
|
|
23
|
+
- current branch
|
|
24
|
+
- latest commits
|
|
25
|
+
- dirty files
|
|
26
|
+
- completed checkboxes
|
|
27
|
+
- next unchecked task
|
|
116
28
|
|
|
117
|
-
|
|
29
|
+
Do not recover from process files. Only `task.md`, Git, and current repo truth count.
|
|
118
30
|
|
|
119
|
-
|
|
31
|
+
## Commit Rule
|
|
120
32
|
|
|
121
|
-
|
|
122
|
-
- 当前 active phase / ready tasks
|
|
123
|
-
- 已完成什么
|
|
124
|
-
- 卡在哪里
|
|
125
|
-
- 下一步唯一动作
|
|
126
|
-
- 相关文件 / 命令 / 观察
|
|
127
|
-
- 最近一次 Red/Green/Review 到了哪一站
|
|
33
|
+
Every completed task or execution environment gets its own commit. Split by behavior or layer when needed, but do not leave completed work uncommitted between stages.
|
|
@@ -1,67 +1,47 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: cc-do
|
|
3
|
-
version: 1.
|
|
4
|
-
description: Use when implementing
|
|
3
|
+
version: 1.7.1
|
|
4
|
+
description: Use when implementing frozen tasks, resuming interrupted work, applying an investigation handoff, or fixing review feedback inside the approved scope.
|
|
5
5
|
triggers:
|
|
6
6
|
- 开始做 T003
|
|
7
7
|
- 继续上次做到一半的任务
|
|
8
|
-
- 按
|
|
8
|
+
- 按 task.md 开始实现
|
|
9
9
|
- 修这个 review comment
|
|
10
10
|
- implement this task
|
|
11
11
|
- resume this requirement
|
|
12
|
-
- repair this investigated bug
|
|
13
12
|
reads:
|
|
14
13
|
- PLAYBOOK.md
|
|
15
|
-
- CHANGELOG.md
|
|
16
14
|
- references/execution-recovery.md
|
|
17
15
|
- references/parallel-dispatch.md
|
|
18
16
|
- docs/guides/project-postmortem.md
|
|
17
|
+
- ../cc-dev/scripts/resolve-cc-devflow.sh
|
|
19
18
|
writes:
|
|
20
|
-
- path: devflow/changes/<change-key>/
|
|
19
|
+
- path: devflow/changes/<change-key>/task.md
|
|
21
20
|
durability: durable
|
|
22
|
-
required:
|
|
23
|
-
when:
|
|
24
|
-
- path: devflow/changes/<change-key>/execution/team-state.json
|
|
25
|
-
durability: durable
|
|
26
|
-
required: false
|
|
27
|
-
when: execution mode uses delegated or team workers
|
|
28
|
-
- path: devflow/changes/<change-key>/meta/change-state.json
|
|
29
|
-
durability: durable
|
|
30
|
-
required: false
|
|
31
|
-
when: pause, resume, dispatch, or quick-lane state changes
|
|
21
|
+
required: true
|
|
22
|
+
when: task checkbox/status changes
|
|
32
23
|
effects:
|
|
33
24
|
- code changes
|
|
34
25
|
- test changes
|
|
35
|
-
-
|
|
26
|
+
- Git commit after each completed execution environment or task slice
|
|
36
27
|
entry_gate:
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
- Read `
|
|
40
|
-
-
|
|
41
|
-
- Reject parallel execution when touched paths overlap by exact path or parent/child path; submodule touches must be isolated unless the task explicitly owns that submodule.
|
|
42
|
-
- If the current task cannot be restated from canonical artifacts, run a context reset before coding.
|
|
43
|
-
- Before each single-task execution, run a quick Project Postmortem search against `devflow/postmortems` using the task's touched files, capability, failure class, and model-risk terms; apply applicable reminders to the code path and mention only blocking/failure facts in CLI events.
|
|
44
|
-
- "Validate the current task's TDD shape before coding: spec-style test name, one logical behavior, public verification path, allowed boundary mocks, Green minimality guard, and refactor candidates."
|
|
28
|
+
- Resolve the CLI with `../cc-dev/scripts/resolve-cc-devflow.sh require query workflow-context config`.
|
|
29
|
+
- Run `query workflow-context --change <changeId> --change-key <changeKey> --data-only --no-trace --compact`.
|
|
30
|
+
- Read `task.md`, current Git status, and only the code/tests needed by the current task.
|
|
31
|
+
- Reject execution if the task cannot be restated from `task.md` and repo evidence.
|
|
45
32
|
exit_criteria:
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
-
|
|
50
|
-
-
|
|
33
|
+
- Current task has Red/Green evidence or a recorded TDD exception in `task.md`.
|
|
34
|
+
- Verification commands have been run or explicitly blocked.
|
|
35
|
+
- Task status is updated through `scripts/mark-task-complete.sh`.
|
|
36
|
+
- The completed task/environment is committed to Git.
|
|
37
|
+
- No process file is created beyond `task.md` updates and Git commits.
|
|
51
38
|
reroutes:
|
|
52
|
-
- when:
|
|
39
|
+
- when: New evidence disproves root cause.
|
|
53
40
|
target: cc-investigate
|
|
54
|
-
- when: New evidence
|
|
41
|
+
- when: New evidence breaks scope or design.
|
|
55
42
|
target: cc-plan
|
|
56
|
-
- when: Implementation and
|
|
43
|
+
- when: Implementation and review feedback are complete.
|
|
57
44
|
target: cc-check
|
|
58
|
-
recovery_modes:
|
|
59
|
-
- name: resume-from-task-state
|
|
60
|
-
when: Work was interrupted but the current design contract is still valid.
|
|
61
|
-
action: Reload workflow-context, planning/tasks.md, task-manifest.json, current Git state, and CLI logs; continue from the first pending or failed task.
|
|
62
|
-
- name: context-reset
|
|
63
|
-
when: The conversation history is noisy, stale, or cannot reproduce the exact task state.
|
|
64
|
-
action: Discard chat memory, reread planning/tasks.md, planning/task-manifest.json, change-meta.json, current Git state, and CLI logs; use legacy design/analysis only as fallback.
|
|
65
45
|
tool_budget:
|
|
66
46
|
read_files: 9
|
|
67
47
|
search_steps: 6
|
|
@@ -70,74 +50,15 @@ tool_budget:
|
|
|
70
50
|
|
|
71
51
|
# CC-Do
|
|
72
52
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
## Role
|
|
76
|
-
|
|
77
|
-
`cc-do` 是 PDCA 里的 `Do`。
|
|
78
|
-
|
|
79
|
-
同时它也是 IDCA / DDCA 里的 `Do`。
|
|
80
|
-
|
|
81
|
-
它只做一件事:沿着已经冻结的任务,把代码真正做出来,并把执行证据留到足够让别人接手、复盘、复验。
|
|
82
|
-
|
|
83
|
-
## Runtime Output Policy
|
|
84
|
-
|
|
85
|
-
写入任何 durable Markdown 或 JSON metadata 前,先运行 `cc-devflow config resolve --format policy`。
|
|
86
|
-
|
|
87
|
-
- `Output language` 是机器约束;如果失败或 debug CLI 日志需要人类可读摘要,必须记录并遵守它。
|
|
88
|
-
- `agent_preferences` 是用户偏好建议,只影响表达方式和结构选择,不覆盖本 Skill 的工作流边界。
|
|
89
|
-
- 如果配置解析失败,先修配置或向用户说明阻塞,不要用默认语言继续生成正式文档。
|
|
90
|
-
|
|
91
|
-
上游冻结合同来自 `planning/tasks.md`:
|
|
92
|
-
|
|
93
|
-
- `cc-plan` 产出的 `planning/tasks.md#Contract Summary`
|
|
94
|
-
- `cc-investigate` 产出的 `planning/tasks.md#Root Cause Contract`
|
|
95
|
-
|
|
96
|
-
## Read First
|
|
53
|
+
`cc-do` 是 PDCA / IDCA 的 `Do`。它只执行 `task.md` 中已经冻结的任务。
|
|
97
54
|
|
|
98
|
-
|
|
99
|
-
2. `CHANGELOG.md`
|
|
100
|
-
3. `references/execution-recovery.md`
|
|
101
|
-
4. `references/parallel-dispatch.md`
|
|
102
|
-
5. `docs/guides/project-postmortem.md`
|
|
55
|
+
默认只更新:
|
|
103
56
|
|
|
104
|
-
|
|
57
|
+
- 代码和测试
|
|
58
|
+
- `devflow/changes/<change-key>/task.md` 中的任务状态
|
|
59
|
+
- Git commit
|
|
105
60
|
|
|
106
|
-
|
|
107
|
-
- 执行被中断,需要恢复
|
|
108
|
-
- bug 根因已经在 `cc-investigate` 里冻结,准备开始修
|
|
109
|
-
- review feedback 要落成代码
|
|
110
|
-
|
|
111
|
-
如果方案还没冻结、任务边界还没定,停下并回 `cc-plan` 或 `cc-investigate`。
|
|
112
|
-
|
|
113
|
-
## Quick Start
|
|
114
|
-
|
|
115
|
-
先判断现在是哪一种执行局面,再开始编码:
|
|
116
|
-
|
|
117
|
-
| 现实状态 | 先走什么路径 |
|
|
118
|
-
| --- | --- |
|
|
119
|
-
| 已有 ready task,直接实现 | `implement` |
|
|
120
|
-
| 上次做到一半,需要继续 | `resume` |
|
|
121
|
-
| bug 根因已冻结 | `repair-from-investigation` |
|
|
122
|
-
| bug 还没搞清根因 | reroute 到 `cc-investigate` |
|
|
123
|
-
| 收到 review comment,要在既定范围内修正 | `review-fix` |
|
|
124
|
-
|
|
125
|
-
如果连“当前 task 是什么”都说不清,先别写代码,先跑 `cc-devflow query workflow-context`。只有它的 `openWhen` 指向 scheduling 或 recovery 时,才继续跑 `scripts/select-ready-tasks.sh`;`scripts/build-task-context.sh` 只能输出 stdout,不得生成 `context.md`。
|
|
126
|
-
|
|
127
|
-
## Harness Contract
|
|
128
|
-
|
|
129
|
-
- Allowed actions: implement ready tasks, debug inside frozen scope, update task status through the completion script, and apply review feedback that does not reopen design.
|
|
130
|
-
- Forbidden actions: re-planning the requirement in place, blindly rerunning the whole requirement, or delegating tasks without full task context.
|
|
131
|
-
- Required evidence: every task must leave objective code/Git/test evidence; blocked or failed work may leave compact CLI events, but must not create AI-written process files.
|
|
132
|
-
- Reroute rule: after repeated failed repairs or root-cause drift, stop patching and go back to `cc-investigate`; if scope or design truth breaks, go back to `cc-plan`; after task closure, hand off to `cc-check`.
|
|
133
|
-
|
|
134
|
-
## Execution Discipline
|
|
135
|
-
|
|
136
|
-
- Make the smallest task-scoped diff; do not add features, abstractions, or adjacent cleanup outside the frozen task. Clean only traces introduced by this task.
|
|
137
|
-
- Match existing style and conventions even when another pattern looks nicer; harmful conventions require reroute/discussion, not private divergence.
|
|
138
|
-
- Deterministic state changes use scripts (`mark-task-complete.sh`, ready-task selectors); the model does not hand-edit status JSON.
|
|
139
|
-
- Tests must prove the behavior's intent through a public seam; tests that would pass after the wrong business behavior changes are invalid.
|
|
140
|
-
- Blockers, skipped tests, stale context, or unclear ownership are reported loudly before continuing.
|
|
61
|
+
不要生成额外过程文件或 JSON 文档。失败和阻塞写在对用户的响应里;需要长期保留的失败教训交给 `cc-act` 写 incident postmortem。
|
|
141
62
|
|
|
142
63
|
## TDD Iron Law
|
|
143
64
|
|
|
@@ -145,150 +66,23 @@ tool_budget:
|
|
|
145
66
|
NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST
|
|
146
67
|
```
|
|
147
68
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
1. Red:先写一个最小失败测试,运行并确认它因为目标行为缺失而失败。
|
|
151
|
-
2. Green:只写让当前失败测试通过的最小生产代码。
|
|
152
|
-
3. Refactor:只有 Green 之后才能清理命名、重复、结构和坏味道。
|
|
153
|
-
4. Record:任务状态只通过 `mark-task-complete.sh` 同步到 `planning/tasks.md` 与 `planning/task-manifest.json`;失败或 debug 时才写 `events.jsonl`。
|
|
154
|
-
|
|
155
|
-
Red 不是形式上的红,而是公共 seam 上的行为缺失证明。测试必须通过公共接口、调用方流程、CLI/API/UI 路径或其它真实边界进入系统;只验证私有函数、内部调用次数、临时数据结构或 mock 自己控制的内部协作者,不算 TDD 证据。
|
|
156
|
-
|
|
157
|
-
一个 Red 只证明一个逻辑行为。测试名要像规格说明,而不是实现步骤;结果要从同一类公共入口读回。直接查数据库、读内部状态、扫描临时文件或绕过 API 来证明行为,只在那个边界本身就是被测对象时成立。
|
|
158
|
-
|
|
159
|
-
例外只能用于 throwaway prototype、纯生成文件、纯配置改动;例外必须写在当前 task block 或 manifest task context 中,包含原因、风险和替代验证命令。测试第一次就绿,说明测试没有证明新行为,必须修测试而不是继续写生产代码。
|
|
160
|
-
|
|
161
|
-
禁止水平切片:不要先写一批测试,再写一批实现。每次只推进一个 tracer bullet:一个可观察行为的 Red -> 让它变绿的最小实现 -> 必要重构 -> 记录证据,然后再进入下一个行为。
|
|
162
|
-
|
|
163
|
-
测试数据也必须诚实。fixture 只提供当前行为需要的最小输入;partial fixture、类型断言、mock payload 或 generated stub 必须写清哪些字段是真实 contract,哪些只是测试填充。不能用 `as`、`any`、双重 cast、缺字段 partial mock 或 test-only method 掩盖 seam 设计问题。
|
|
164
|
-
|
|
165
|
-
Green 不是顺手把未来行为都做掉。只写当前红灯要求的最小生产代码;如果需要新接口,优先保持小接口深模块,依赖从调用方传入,外部 boundary adapter 拆成具体操作,而不是用一个 generic fetcher 把复杂条件推给 mock。
|
|
166
|
-
|
|
167
|
-
Refactor 只能发生在 Green 之后。优先处理当前 slice 暴露出的重复、长方法、浅模块、feature envy、primitive obsession、命名混乱、三层以上分支和新代码揭开的旧代码坏味道;没被当前绿色测试保护的扩张性整理,回到 `cc-plan` 或后续任务。
|
|
168
|
-
|
|
169
|
-
## Entry Gate
|
|
170
|
-
|
|
171
|
-
1. 先运行 `cc-devflow query workflow-context --change <changeId> --change-key <changeKey> --data-only --no-trace --compact`,把 `nextAction.skill == "cc-do"` 和 `currentTask.id` 作为执行入口。
|
|
172
|
-
2. 先只用 `workflow-context.progressiveDisclosure.packetOnly` 和 `mustNotForget` 做导航与护栏,必要时打开 `defaultOpen` 的 section / JSON refs;如果 `sourceHashes` 不匹配、命令缺失、scope/依赖/触点不确定,必须按 `openWhen.conditions` 打开 `deepOpen`,不能靠猜。
|
|
173
|
-
3. 先用 `workflow-context.queues.readyTasks` 判断现在到底哪几个任务真的 ready;需要 shell 复核时再跑 `scripts/select-ready-tasks.sh`。
|
|
174
|
-
4. 只锁定当前 ready task,或一组经依赖、wave、精确触点与父子路径触点校验后可并行的 ready tasks。
|
|
175
|
-
5. 如果这次来自 `cc-investigate`,必须把 `planning/tasks.md#Root Cause Contract` 当成 canonical contract,而不是一边实现一边重新调查。
|
|
176
|
-
6. 没有任务上下文,不准把任务扔给 subagent;先用 `workflow-context.currentTask`,不够时再用 `scripts/build-task-context.sh` 从 canonical artifacts 组装上下文。
|
|
177
|
-
7. 如果 `task-manifest.json.metadata.lane == "quick"`,仍然必须有 current task、verification、task status 和唯一 next action;quick 只缩短文档密度,不跳过证据。
|
|
178
|
-
8. 如果仓库含 `.gitmodules` 或 manifest 提供 `submodulePaths`,先用 `scripts/detect-file-conflicts.sh` 标出 `submoduleTouches`;只有触达该 submodule 的任务失去默认 worktree 隔离资格,未触达任务不能被无辜串行化。
|
|
179
|
-
9. 每个单 task 开工前,用当前 task 的 touched files、capability、错误类型、模型风险词快速检索 `devflow/postmortems`;命中时把相关原则转成当前 task 的 guardrail。不要为 no-match 生成过程文件。
|
|
69
|
+
允许例外:纯配置、纯生成文件、throwaway prototype、用户明确禁止测试。例外必须写进当前 task block。
|
|
180
70
|
|
|
181
71
|
## Loop
|
|
182
72
|
|
|
183
|
-
1.
|
|
184
|
-
2.
|
|
185
|
-
3.
|
|
186
|
-
4.
|
|
187
|
-
5.
|
|
188
|
-
6.
|
|
189
|
-
7.
|
|
190
|
-
8.
|
|
191
|
-
9. 按 `Red -> Green -> Refactor` 推进,Green 只允许最小实现,不预铺未来测试尚未要求的分支、状态或 API。
|
|
192
|
-
10. 如果当前 Red 需要新的 fixture 或 mock,先证明它仍从公共 seam 触发真实行为;fixture 缺字段、类型强转或内部 mock 都要写入 `tdd.testQuality.fixtureRisk` 或先修 seam。
|
|
193
|
-
11. Refactor 后必须重跑相关测试,保持 Green;Red 状态下不重构。
|
|
194
|
-
12. 每次推进都以代码 diff、Git 状态、验证命令输出和 task 状态为真相源;只有失败、阻塞或 debug 需要机器日志时才写 `events.jsonl`。
|
|
195
|
-
13. 任务实现后,先过 `spec review`,再过 `code review`,两道门都过才算任务收口;这里只验证 spec delta,不回写长期 spec。
|
|
196
|
-
14. 当前任务完成后,把可验证证据留给 `cc-check`。
|
|
197
|
-
|
|
198
|
-
## Output
|
|
199
|
-
|
|
200
|
-
- 代码变更
|
|
201
|
-
- 测试变更
|
|
202
|
-
- `planning/tasks.md` 与 `planning/task-manifest.json` 的 task 状态
|
|
203
|
-
- `devflow/changes/<change-key>/execution/tasks/<task-id>/events.jsonl`(仅 debug / failed 默认保留;CLI 自动日志,不写叙事 Markdown)
|
|
204
|
-
- `planning/task-manifest.json` 里的 task review verdict
|
|
205
|
-
|
|
206
|
-
## Good Output
|
|
207
|
-
|
|
208
|
-
- 当前 task 一眼可见,执行者不用从聊天记录里猜目标
|
|
209
|
-
- 当前 wave、ready tasks、parallel candidates、touch conflict verdict 和 submoduleTouches 一眼可见
|
|
210
|
-
- 至少留下一次明确的 tracer bullet Red/Green/Refactor 证据,且 Red 是公共 seam 上的预期行为失败
|
|
211
|
-
- Red 证据说明测试名、单一行为、公共验证路径和为何不是实现细节测试
|
|
212
|
-
- Green 证据说明 minimality guard:本轮只满足当前红灯,没有提前实现未来分支
|
|
213
|
-
- Refactor 证据说明清掉了哪个具体坏味道,或者为什么当前 slice 不需要 refactor
|
|
214
|
-
- 测试 fixture 说明真实 contract 字段和测试填充字段,没有用类型欺骗或内部 mock 制造假绿
|
|
215
|
-
- task status、Git diff、验证命令和必要 CLI 日志足够让下一位接手者恢复
|
|
216
|
-
- quick lane 也有 mini manifest、verification 和唯一 next action,不靠聊天记录继续
|
|
217
|
-
- reviewer 能顺着 review 记录和验证命令复盘这次实现
|
|
218
|
-
|
|
219
|
-
## Bundled Resources
|
|
220
|
-
|
|
221
|
-
- 变更记录:`CHANGELOG.md`
|
|
222
|
-
- 执行 / 恢复规则:`references/execution-recovery.md`
|
|
223
|
-
- 并行分配准则:`references/parallel-dispatch.md`
|
|
224
|
-
- 恢复分析:`scripts/recover-workflow.sh`
|
|
225
|
-
- 任务状态:`scripts/check-task-status.sh`
|
|
226
|
-
- ready 任务选择:`scripts/select-ready-tasks.sh`
|
|
227
|
-
- 任务上下文组装:`scripts/build-task-context.sh`(stdout only,不落盘)
|
|
228
|
-
- 旧 checkpoint 兼容入口:`scripts/write-task-checkpoint.sh`(不写 checkpoint,只在失败 / debug 时写事件)
|
|
229
|
-
- review 记录:`scripts/record-review-decision.sh`
|
|
230
|
-
- 任务闭环校验:`scripts/verify-task-gates.sh`
|
|
231
|
-
- 任务勾选:`scripts/mark-task-complete.sh`
|
|
232
|
-
- 文件冲突:`scripts/detect-file-conflicts.sh`
|
|
233
|
-
|
|
234
|
-
## Working Rules
|
|
235
|
-
|
|
236
|
-
1. 没有根因,不准修 bug。
|
|
237
|
-
2. 没有任务边界,不准无界发散。
|
|
238
|
-
3. 没有失败测试,不准写生产代码。
|
|
239
|
-
4. 测试如果第一次就绿,说明你没证明任何东西,先修测试。
|
|
240
|
-
5. 红灯原因必须和目标行为缺失一致;红灯如果只是测试写错,不算 TDD 证据。
|
|
241
|
-
6. 红灯必须验证公共接口上的行为;实现细节测试、私有方法测试、内部调用次数断言都要先退回 Red 修正。
|
|
242
|
-
7. Mock 只能放在系统边界;如果必须 mock 内部协作者才能测试,说明 seam 或设计合同有问题。
|
|
243
|
-
8. 一个 Red 只证明一个逻辑行为;bulk Red 或测试名描述实现步骤,都先退回测试设计。
|
|
244
|
-
9. Green 只写当前红灯需要的最小实现;预铺未来功能、兼容分支或宽接口都算越界。
|
|
245
|
-
10. Red 时不重构;Refactor 只在相关测试已绿后处理当前 slice 暴露的坏味道。
|
|
246
|
-
11. 先过 `spec review`,再过 `code review`,顺序不能反。
|
|
247
|
-
12. 不在 `cc-do` 里改 capability spec 正文;这里只产出实现证据和 spec 对齐证据。
|
|
248
|
-
13. 失败和阻塞都要留下恢复证据。
|
|
249
|
-
14. 给 subagent 的输入必须包含:当前进度、当前任务全文、依赖状态、必读文件、验收标准、可信命令。
|
|
250
|
-
15. 三次失败修补后必须先质疑调查合同或设计合同,而不是继续堆补丁。
|
|
251
|
-
16. 完成任务后必须调用 `scripts/mark-task-complete.sh` 同步 `planning/task-manifest.json` 和 `planning/tasks.md`;禁止手工改 checkbox、status、currentTaskId 来冒充完成。
|
|
252
|
-
17. 如果 `mark-task-complete.sh` 失败,说明 review gate 或任务依赖还没闭合;先修证据,再重跑脚本,不准绕过。
|
|
253
|
-
|
|
254
|
-
## Task Status Protocol
|
|
255
|
-
|
|
256
|
-
ClaudeCode / Codex 执行 `cc-do` 时必须把任务状态当成状态机,不是普通 Markdown TODO。
|
|
257
|
-
|
|
258
|
-
1. 开始前用 `planning/task-manifest.json.currentTaskId` 或 ready-task 脚本确认当前任务。
|
|
259
|
-
2. 执行时读取完整 task block,包含 Goal、TDD phase、Files、Read first、Verification、Evidence、test seam、mock boundary、minimality / refactor 字段。
|
|
260
|
-
3. 完成验证和 review gate 后运行完成脚本:
|
|
261
|
-
|
|
262
|
-
```bash
|
|
263
|
-
SCRIPT_ROOT=".claude/skills/cc-do/scripts"
|
|
264
|
-
if [[ ! -d "$SCRIPT_ROOT" && -d ".codex/skills/cc-do/scripts" ]]; then
|
|
265
|
-
SCRIPT_ROOT=".codex/skills/cc-do/scripts"
|
|
266
|
-
fi
|
|
267
|
-
bash "$SCRIPT_ROOT/mark-task-complete.sh" --manifest devflow/changes/<change-key>/planning/task-manifest.json --tasks devflow/changes/<change-key>/planning/tasks.md --task <task-id>
|
|
268
|
-
```
|
|
269
|
-
|
|
270
|
-
4. 脚本会先跑任务 gate,再同步 manifest、checkbox、`currentTaskId` 和整体状态。不要手动改这些字段。
|
|
271
|
-
5. 如果任务不能完成,只在失败 / debug 需要时写 CLI event;不要生成过程 Markdown,也不要把失败任务标成完成。
|
|
272
|
-
|
|
273
|
-
## Exit Criteria
|
|
274
|
-
|
|
275
|
-
- 当前任务有 Red/Green 证据
|
|
276
|
-
- 当前任务有 `spec review` / `code review` 两道门证据
|
|
277
|
-
- 恢复点可从 `planning/tasks.md`、`planning/task-manifest.json`、Git 状态和必要 CLI 日志判断
|
|
278
|
-
- 阻塞原因已写清楚
|
|
279
|
-
- 下一步应进入 `cc-check`,或明确退回 `cc-investigate` / `cc-plan`
|
|
73
|
+
1. 从 `task.md` 选择第一个未完成且依赖满足的任务;必要时用 `scripts/select-ready-tasks.sh` 复核。
|
|
74
|
+
2. 读取当前任务涉及的最小代码和测试。
|
|
75
|
+
3. Red:写最小失败测试,确认失败原因就是目标行为缺失。
|
|
76
|
+
4. Green:写最小实现,不预铺未来分支。
|
|
77
|
+
5. Refactor:只清理当前 slice 暴露出的坏味道,保持测试绿。
|
|
78
|
+
6. Review:自查 scope、公共 seam、mock 边界、错误路径和文档影响。
|
|
79
|
+
7. Complete:运行 `scripts/mark-task-complete.sh --tasks devflow/changes/<change-key>/task.md --task <task-id>`。
|
|
80
|
+
8. Commit:每个任务或执行环境完成后提交 Git commit。
|
|
280
81
|
|
|
281
|
-
##
|
|
82
|
+
## Parallel Rule
|
|
282
83
|
|
|
283
|
-
|
|
284
|
-
- 不把一次修复膨胀成重写整个模块
|
|
285
|
-
- 不把依赖任务和被依赖任务同时并行
|
|
286
|
-
- 不把没有当前进度的任务直接丢给 subagent
|
|
287
|
-
- 三层以上判断说明上游合同该回炉
|
|
84
|
+
只有任务显式允许并行、依赖已满足、触碰路径无重叠、且每个执行环境都能独立提交时,才并行。否则串行。
|
|
288
85
|
|
|
289
|
-
##
|
|
86
|
+
## Exit
|
|
290
87
|
|
|
291
|
-
|
|
292
|
-
- 变更记录:`CHANGELOG.md`
|
|
293
|
-
- 执行规则:`references/execution-recovery.md`
|
|
294
|
-
- 并行规则:`references/parallel-dispatch.md`
|
|
88
|
+
退出时报告任务 ID、验证命令、commit hash、剩余任务或下一步 `cc-check`。不要写过程文件。
|
|
@@ -1,114 +1,20 @@
|
|
|
1
|
-
# Execution
|
|
1
|
+
# Execution Recovery
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Recover from:
|
|
4
4
|
|
|
5
|
-
-
|
|
6
|
-
-
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
- 当前 wave / parallel candidates / touch conflict verdict
|
|
11
|
-
- submoduleTouches(如适用)
|
|
12
|
-
- 当前 review gates(spec / code)
|
|
13
|
-
- 已完成证据
|
|
14
|
-
- 阻塞点
|
|
15
|
-
- 下一步唯一动作
|
|
5
|
+
- Git branch
|
|
6
|
+
- Git status
|
|
7
|
+
- recent commits
|
|
8
|
+
- `task.md`
|
|
9
|
+
- current test output
|
|
16
10
|
|
|
17
|
-
|
|
11
|
+
Do not recover from process files. They are not part of the workflow.
|
|
18
12
|
|
|
19
|
-
|
|
13
|
+
## Resume Steps
|
|
20
14
|
|
|
21
|
-
1.
|
|
22
|
-
2.
|
|
23
|
-
3.
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
## Runtime Layout
|
|
28
|
-
|
|
29
|
-
默认执行真相来自:
|
|
30
|
-
|
|
31
|
-
- 代码和测试 diff
|
|
32
|
-
- Git 状态
|
|
33
|
-
- `planning/tasks.md` 的 checkbox
|
|
34
|
-
- `planning/task-manifest.json` 的 task status / reviews / currentTaskId
|
|
35
|
-
- `devflow/changes/<change-key>/execution/tasks/<task-id>/events.jsonl`(仅 debug / failed 默认保留;CLI 自动日志)
|
|
36
|
-
- `planning/task-manifest.json` 里的 `tasks[*].reviews`
|
|
37
|
-
|
|
38
|
-
不得生成 `context.md`、`checkpoint.json`、review markdown 或其它 AI 手写过程文件。需要复盘时重新读取代码、Git、task 状态和 CLI 自动日志。
|
|
39
|
-
|
|
40
|
-
## Optional Event Spine
|
|
41
|
-
|
|
42
|
-
`events.jsonl` 只在 debug 或 failed 时存在。存在时可以包含这些事件:
|
|
43
|
-
|
|
44
|
-
1. `context_ready`
|
|
45
|
-
2. `red_failed`
|
|
46
|
-
3. `red_reason_verified`
|
|
47
|
-
4. `red_seam_verified`
|
|
48
|
-
5. `red_behavior_verified`
|
|
49
|
-
6. `mock_boundary_verified`
|
|
50
|
-
7. `green_passed`
|
|
51
|
-
8. `refactor_done` 或 `refactor_not_needed`
|
|
52
|
-
9. `refactor_green`
|
|
53
|
-
10. `spec_review_pass`
|
|
54
|
-
11. `code_review_pass`
|
|
55
|
-
|
|
56
|
-
如果 `events.jsonl` 没开启,使用 manifest task status、`tasks.md` checkbox、review verdict 和验证命令输出恢复。
|
|
57
|
-
|
|
58
|
-
## Task Evidence Fields
|
|
59
|
-
|
|
60
|
-
当前 task block / manifest task / 验证输出至少能回答:
|
|
61
|
-
|
|
62
|
-
- `red.command`
|
|
63
|
-
- `red.exitStatus`
|
|
64
|
-
- `red.expectedFailure`
|
|
65
|
-
- `red.testSeam`
|
|
66
|
-
- `red.behaviorAsserted`
|
|
67
|
-
- `red.specStyleTestName`
|
|
68
|
-
- `red.oneLogicalBehavior`
|
|
69
|
-
- `red.publicVerificationPath`
|
|
70
|
-
- `red.allowedMocks`
|
|
71
|
-
- `red.implementationDetailRisk`
|
|
72
|
-
- `green.command`
|
|
73
|
-
- `green.exitStatus`
|
|
74
|
-
- `green.minimalityGuard`
|
|
75
|
-
- `refactor.status`
|
|
76
|
-
- `refactor.candidates`
|
|
77
|
-
- `refactor.greenCommand`
|
|
78
|
-
- `testQuality.usesPublicInterface`
|
|
79
|
-
- `testQuality.describesBehavior`
|
|
80
|
-
- `testQuality.specStyleName`
|
|
81
|
-
- `testQuality.verifiesThroughPublicPath`
|
|
82
|
-
- `testQuality.noBulkRed`
|
|
83
|
-
- `testQuality.survivesInternalRefactor`
|
|
84
|
-
- `testQuality.mocksOnlySystemBoundaries`
|
|
85
|
-
- `review.spec.status`
|
|
86
|
-
- `review.code.status`
|
|
87
|
-
|
|
88
|
-
如果跳过 TDD,必须有 `tddException` 或 task-level exception 说明,并写清替代验证。没有这些字段时,恢复执行先补证据,不准直接继续实现。
|
|
89
|
-
|
|
90
|
-
## Bug Rule
|
|
91
|
-
|
|
92
|
-
- 先复现
|
|
93
|
-
- 再收证据
|
|
94
|
-
- 再下根因判断
|
|
95
|
-
- 最后改代码
|
|
96
|
-
|
|
97
|
-
## Local Recovery Ladder
|
|
98
|
-
|
|
99
|
-
1. 先重试当前命令或当前 task,而不是重跑整条 requirement
|
|
100
|
-
2. 两次失败后回看证据链、task block、Git diff 和 CLI 日志
|
|
101
|
-
3. 三次失败后默认怀疑上游合同:根因漂移回 `cc-investigate`,范围 / 设计漂移回 `cc-plan`
|
|
102
|
-
|
|
103
|
-
## Subagent Rule
|
|
104
|
-
|
|
105
|
-
给 subagent 的上下文至少包含:
|
|
106
|
-
|
|
107
|
-
- 当前任务全文
|
|
108
|
-
- 当前进度与 manifest task status
|
|
109
|
-
- 已满足 / 未满足的依赖
|
|
110
|
-
- 必读文件
|
|
111
|
-
- 验收标准
|
|
112
|
-
- 验证命令
|
|
113
|
-
- 不做项 / 边界
|
|
114
|
-
- quick lane 是否仍有 mini manifest、verification 和唯一 next action
|
|
15
|
+
1. Read `task.md`.
|
|
16
|
+
2. Run `git status --short`.
|
|
17
|
+
3. Inspect recent commits.
|
|
18
|
+
4. Select the first unchecked task.
|
|
19
|
+
5. Re-run the task's verification command if previous output is stale.
|
|
20
|
+
6. Continue or reroute.
|