cc-devflow 4.1.5 → 4.2.0
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/CLAUDE.md +87 -1091
- package/.claude/commands/core/architecture.md +32 -2
- package/.claude/commands/core/guidelines.md +27 -2
- package/.claude/commands/core/roadmap.md +33 -4
- package/.claude/commands/core/style.md +53 -263
- package/.claude/commands/flow/CLAUDE.md +28 -0
- package/.claude/commands/flow/archive.md +2 -2
- package/.claude/commands/flow/checklist.md +9 -251
- package/.claude/commands/flow/clarify.md +9 -127
- package/.claude/commands/flow/constitution.md +1 -1
- package/.claude/commands/flow/context.md +1 -1
- package/.claude/commands/flow/dev.md +19 -395
- package/.claude/commands/flow/ideate.md +13 -13
- package/.claude/commands/flow/init.md +19 -30
- package/.claude/commands/flow/new.md +12 -268
- package/.claude/commands/flow/quality.md +10 -153
- package/.claude/commands/flow/release.md +18 -81
- package/.claude/commands/flow/restart.md +15 -16
- package/.claude/commands/flow/spec.md +14 -164
- package/.claude/commands/flow/status.md +12 -12
- package/.claude/commands/flow/update.md +4 -4
- package/.claude/commands/flow/upgrade.md +6 -6
- package/.claude/commands/flow/verify.md +19 -78
- package/.claude/commands/flow/workspace.md +1 -1
- package/.claude/docs/guides/INIT_TROUBLESHOOTING.md +7 -7
- package/.claude/docs/guides/NEW_TROUBLESHOOTING.md +44 -96
- package/.claude/docs/guides/ROADMAP_TROUBLESHOOTING.md +1 -1
- package/.claude/docs/guides/TASK_COMPLETION_MARKING.md +5 -5
- package/.claude/docs/templates/ATTEMPT_TEMPLATE.md +1 -1
- package/.claude/docs/templates/BACKLOG_TEMPLATE.md +3 -3
- package/.claude/docs/templates/CLARIFICATION_REPORT_TEMPLATE.md +5 -5
- package/.claude/docs/templates/ERROR_LOG_TEMPLATE.md +2 -2
- package/.claude/docs/templates/INIT_FLOW_TEMPLATE.md +3 -3
- package/.claude/docs/templates/NEW_ORCHESTRATION_TEMPLATE.md +33 -64
- package/.claude/docs/templates/RESEARCH_TEMPLATE.md +3 -3
- package/.claude/docs/templates/ROADMAP_DIALOGUE_TEMPLATE.md +2 -2
- package/.claude/docs/templates/ROADMAP_TEMPLATE.md +2 -2
- package/.claude/docs/templates/STYLE_TEMPLATE.md +3 -3
- package/.claude/docs/templates/UI_PROTOTYPE_TEMPLATE.md +8 -9
- package/.claude/guides/workflow-guides/flow-orchestrator.md +31 -265
- package/.claude/hooks/CLAUDE.md +1 -1
- package/.claude/hooks/checklist-gate.js +4 -4
- package/.claude/hooks/inject-agent-context.ts +2 -2
- package/.claude/scripts/calculate-checklist-completion.sh +2 -2
- package/.claude/scripts/check-prerequisites.sh +2 -2
- package/.claude/scripts/checklist-errors.sh +4 -4
- package/.claude/scripts/flow-quality-full.sh +5 -5
- package/.claude/scripts/flow-quality-quick.sh +4 -4
- package/.claude/scripts/flow-workspace-init.sh +2 -2
- package/.claude/scripts/generate-clarification-report.sh +4 -4
- package/.claude/scripts/recover-workflow.sh +70 -73
- package/.claude/scripts/run-quality-gates.sh +1 -1
- package/.claude/scripts/setup-epic.sh +2 -2
- package/.claude/scripts/setup-ralph-loop.sh +2 -2
- package/.claude/scripts/validate-research.sh +1 -1
- package/.claude/scripts/verify-setup.sh +1 -1
- package/.claude/skills/cc-devflow-orchestrator/SKILL.md +113 -108
- package/.claude/skills/workflow/CLAUDE.md +24 -0
- package/.claude/skills/workflow/flow-dev/CLAUDE.md +14 -76
- package/.claude/skills/workflow/flow-dev/SKILL.md +58 -60
- package/.claude/skills/workflow/flow-dev/context.jsonl +4 -8
- package/.claude/skills/workflow/flow-init/SKILL.md +46 -144
- package/.claude/skills/workflow/flow-init/assets/RESEARCH_TEMPLATE.md +1 -1
- package/.claude/skills/workflow/flow-init/context.jsonl +3 -3
- package/.claude/skills/workflow/flow-init/scripts/check-prerequisites.sh +1 -1
- package/.claude/skills/workflow/flow-init/scripts/validate-research.sh +1 -1
- package/.claude/skills/workflow/flow-release/SKILL.md +23 -56
- package/.claude/skills/workflow/flow-release/context.jsonl +5 -7
- package/.claude/skills/workflow/flow-spec/CLAUDE.md +15 -101
- package/.claude/skills/workflow/flow-spec/SKILL.md +40 -511
- package/.claude/skills/workflow/flow-spec/context.jsonl +5 -7
- package/.claude/skills/workflow/flow-verify/CLAUDE.md +10 -0
- package/.claude/skills/workflow/flow-verify/SKILL.md +53 -0
- package/.claude/skills/workflow/flow-verify/context.jsonl +5 -0
- package/.claude/skills/workflow.yaml +72 -267
- package/CHANGELOG.md +72 -0
- package/README.md +96 -69
- package/README.zh-CN.md +95 -67
- package/bin/cc-devflow-cli.js +154 -0
- package/bin/harness.js +22 -0
- package/docs/commands/README.md +34 -38
- package/docs/commands/README.zh-CN.md +34 -36
- package/docs/commands/core-roadmap.md +2 -2
- package/docs/commands/core-roadmap.zh-CN.md +2 -2
- package/docs/commands/core-style.md +29 -381
- package/docs/commands/core-style.zh-CN.md +29 -381
- package/docs/commands/flow-init.md +10 -10
- package/docs/commands/flow-init.zh-CN.md +11 -11
- package/docs/commands/flow-new.md +25 -260
- package/docs/commands/flow-new.zh-CN.md +26 -257
- package/docs/guides/getting-started.md +16 -15
- package/docs/guides/getting-started.zh-CN.md +10 -12
- package/lib/compiler/__tests__/manifest.test.js +156 -0
- package/lib/compiler/__tests__/parser.test.js +21 -0
- package/lib/compiler/index.js +17 -1
- package/lib/compiler/manifest.js +68 -6
- package/lib/compiler/parser.js +5 -0
- package/lib/harness/CLAUDE.md +21 -0
- package/lib/harness/cli.js +208 -0
- package/lib/harness/index.js +16 -0
- package/lib/harness/operations/dispatch.js +285 -0
- package/lib/harness/operations/init.js +48 -0
- package/lib/harness/operations/janitor.js +74 -0
- package/lib/harness/operations/pack.js +100 -0
- package/lib/harness/operations/plan.js +29 -0
- package/lib/harness/operations/release.js +83 -0
- package/lib/harness/operations/resume.js +44 -0
- package/lib/harness/operations/verify.js +163 -0
- package/lib/harness/planner.js +141 -0
- package/lib/harness/schemas.js +108 -0
- package/lib/harness/store.js +240 -0
- package/package.json +9 -1
|
@@ -1,78 +1,16 @@
|
|
|
1
|
-
# flow-dev/
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
| `dev-implementer.jsonl` | dev-implementer Agent 专用上下文 [NEW: v4.4] | ~10 |
|
|
16
|
-
| `scripts/entry-gate.sh` | 入口检查:TASKS.md 存在、状态验证 | ~100 |
|
|
17
|
-
| `scripts/exit-gate.sh` | 出口检查:任务完成度、测试验证 | ~100 |
|
|
18
|
-
| `scripts/task-orchestrator.sh` | 任务调度:解析 TASKS.md、标记完成 | ~100 |
|
|
19
|
-
| `references/dev-implementer.md` | Agent 指令链接 | symlink |
|
|
20
|
-
| `assets/IMPLEMENTATION_PLAN_TEMPLATE.md` | 实现计划模板 | ~80 |
|
|
21
|
-
|
|
22
|
-
## Context Injection (v4.4)
|
|
23
|
-
|
|
24
|
-
Hook `inject-agent-context.ts` 在 Task 调用前自动注入上下文:
|
|
25
|
-
|
|
26
|
-
```
|
|
27
|
-
Task(subagent_type="dev-implementer", prompt="...")
|
|
28
|
-
↓
|
|
29
|
-
Hook 检测到 dev-implementer
|
|
30
|
-
↓
|
|
31
|
-
读取 dev-implementer.jsonl
|
|
32
|
-
↓
|
|
33
|
-
解析 JSONL,加载文件内容
|
|
34
|
-
↓
|
|
35
|
-
注入到 prompt 中
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
JSONL 格式 (Trellis 风格):
|
|
39
|
-
```jsonl
|
|
40
|
-
{"file": "devflow/requirements/{REQ}/TASKS.md", "reason": "Task list with DoD"}
|
|
41
|
-
{"file": "devflow/spec/frontend/index.md", "reason": "Frontend conventions", "optional": true}
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
## TDD Iron Law
|
|
45
|
-
|
|
46
|
-
```
|
|
47
|
-
NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
## Execution Flow
|
|
51
|
-
|
|
52
|
-
```
|
|
53
|
-
Entry Gate → Task Loop (TDD) → Exit Gate
|
|
54
|
-
|
|
55
|
-
For each task:
|
|
56
|
-
1. Protocol 2: 读取任务 DoD
|
|
57
|
-
2. Write failing test (Phase 2)
|
|
58
|
-
3. Verify test fails
|
|
59
|
-
4. Write implementation (Phase 3)
|
|
60
|
-
5. Verify test passes
|
|
61
|
-
6. Mark task [x]
|
|
62
|
-
7. Protocol 3: 读取下一任务 + ERROR_LOG
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
## Mode Matrix
|
|
66
|
-
|
|
67
|
-
| Mode | Flag | Behavior |
|
|
68
|
-
|------|------|----------|
|
|
69
|
-
| Autonomous | (default) | 自动重试,迭代直到完成 |
|
|
70
|
-
| Manual | `--manual` | 遇错停止,等待用户 |
|
|
71
|
-
|
|
72
|
-
## Agent Reference
|
|
73
|
-
|
|
74
|
-
- `references/dev-implementer.md` → `.claude/agents/dev-implementer.md`
|
|
75
|
-
|
|
76
|
-
---
|
|
1
|
+
# flow-dev/
|
|
2
|
+
> L2 | 父级: /Users/dimon/001Area/80-CodeWorld/002-devflow/cc-devflow/.claude/skills/workflow/CLAUDE.md
|
|
3
|
+
|
|
4
|
+
成员清单
|
|
5
|
+
SKILL.md: flow:dev 的核心指令,定义 dispatch/resume 的参数与失败恢复策略。
|
|
6
|
+
context.jsonl: flow-dev 上下文注入定义(task-manifest/context-package/runtime)。
|
|
7
|
+
dev-implementer.jsonl: 旧 Agent 上下文(兼容保留,非主链关键路径)。
|
|
8
|
+
scripts/entry-gate.sh: 旧入口脚本资产(兼容保留)。
|
|
9
|
+
scripts/exit-gate.sh: 旧出口脚本资产(兼容保留)。
|
|
10
|
+
scripts/task-orchestrator.sh: 旧任务调度脚本资产(兼容保留)。
|
|
11
|
+
assets/IMPLEMENTATION_PLAN_TEMPLATE.md: 旧实现计划模板资产(兼容保留)。
|
|
12
|
+
references/dev-implementer.md: 旧 Agent 指令引用(兼容保留)。
|
|
13
|
+
|
|
14
|
+
法则: 成员完整·一行一文件·父级链接·技术词前置
|
|
77
15
|
|
|
78
16
|
[PROTOCOL]: 变更时更新此头部,然后检查 CLAUDE.md
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: flow-dev
|
|
3
|
-
description: 'Execute
|
|
3
|
+
description: 'Execute task-manifest with dependency-aware parallel dispatch and checkpoint recovery. Use when implementing planned tasks for a requirement.'
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Flow-Dev Skill
|
|
@@ -9,88 +9,86 @@ description: 'Execute development tasks with TDD and Autonomous mode. Usage: /fl
|
|
|
9
9
|
|
|
10
10
|
## Purpose
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
执行 `task-manifest.json` 中的任务,默认并行调度并写入 checkpoint/events 供恢复。
|
|
13
13
|
|
|
14
|
-
##
|
|
14
|
+
## Long-Running Harness Protocol(Initializer/Worker/Done Gate)
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST
|
|
18
|
-
```
|
|
16
|
+
`/flow:dev` 是最长链路阶段,必须严格执行“先读状态、再增量、后留证据”。
|
|
19
17
|
|
|
20
|
-
###
|
|
18
|
+
### Session Start(禁止盲跑)
|
|
21
19
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
```
|
|
20
|
+
每个窗口开始时先同步以下信息:
|
|
21
|
+
- `devflow/requirements/${REQ_ID}/session-checklist.json`(若存在)
|
|
22
|
+
- `devflow/requirements/${REQ_ID}/session-progress.md`(若存在)
|
|
23
|
+
- `devflow/requirements/${REQ_ID}/session-handoff.md`(若存在)
|
|
24
|
+
- `devflow/requirements/${REQ_ID}/task-manifest.json`
|
|
25
|
+
- `.harness/runtime/${REQ_ID}/**/checkpoint.json` 与 `events.jsonl`(若存在)
|
|
29
26
|
|
|
30
|
-
|
|
27
|
+
然后执行一次基础健康检查:
|
|
28
|
+
1. 不存在损坏的 `running` 残留状态
|
|
29
|
+
2. 上轮失败任务与失败原因可定位
|
|
31
30
|
|
|
32
|
-
|
|
33
|
-
/flow-dev "REQ_ID" [--manual] [--max-iterations N] [--task T###]
|
|
34
|
-
```
|
|
31
|
+
### Worker Session(最小可执行前沿)
|
|
35
32
|
|
|
36
|
-
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
33
|
+
单窗口仅推进一个最小前沿:
|
|
34
|
+
- 仅处理当前 `dependsOn` 已满足的一组任务
|
|
35
|
+
- 每完成一组任务即写入 checkpoint/events
|
|
36
|
+
- 遇到失败立即收敛原因并记录,不并行扩散新的失败面
|
|
40
37
|
|
|
41
|
-
|
|
38
|
+
会话收尾必须:
|
|
39
|
+
1. 更新 `task-manifest.json` 状态
|
|
40
|
+
2. 更新 `session-progress.md` 与 `session-handoff.md`
|
|
41
|
+
3. 推荐提交一个可回滚的最小 git commit(若仓库策略允许)
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
|--|--------|------------------|
|
|
45
|
-
| 遇到错误 | 停止 | 自动重试 |
|
|
46
|
-
| 注意力刷新 | Protocol 2 | Protocol 2+3+4 |
|
|
47
|
-
| 适用场景 | 复杂需求 | 清晰需求 |
|
|
43
|
+
### Done Gate
|
|
48
44
|
|
|
49
|
-
|
|
45
|
+
仅当以下条件满足才标记 `flow:dev` 完成:
|
|
46
|
+
- 全部任务为 `passed` 或 `skipped`
|
|
47
|
+
- 无 `running`/`failed` 残留
|
|
48
|
+
- `session-checklist.json` 中 `flow:dev.passes == true`
|
|
50
49
|
|
|
51
|
-
|
|
50
|
+
## Input Format
|
|
52
51
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
```bash
|
|
53
|
+
/flow:dev "REQ_ID" [--parallel N] [--resume] [--max-retries N]
|
|
54
|
+
```
|
|
56
55
|
|
|
57
|
-
|
|
56
|
+
## Execution Steps
|
|
58
57
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
58
|
+
1. 解析参数:
|
|
59
|
+
- 默认 `parallel = 3`
|
|
60
|
+
- 默认不 resume
|
|
61
|
+
2. 分支执行:
|
|
62
|
+
- 普通执行:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
npm run harness:dispatch -- --change-id "${REQ_ID}" --parallel ${PARALLEL} [--max-retries ${MAX_RETRIES}]
|
|
66
66
|
```
|
|
67
67
|
|
|
68
|
-
|
|
68
|
+
- 恢复执行:
|
|
69
69
|
|
|
70
|
+
```bash
|
|
71
|
+
npm run harness:resume -- --change-id "${REQ_ID}" --parallel ${PARALLEL} [--max-retries ${MAX_RETRIES}]
|
|
70
72
|
```
|
|
71
|
-
On Error:
|
|
72
|
-
1. Protocol 4: 读取 ERROR_LOG.md
|
|
73
|
-
2. 记录错误到 ERROR_LOG.md
|
|
74
|
-
3. Autonomous: 自动重试
|
|
75
|
-
4. Manual: 停止等待
|
|
76
|
-
```
|
|
77
73
|
|
|
78
|
-
|
|
74
|
+
3. 检查执行结果:
|
|
75
|
+
- `task-manifest.json` 状态更新
|
|
76
|
+
- `.harness/runtime/${REQ_ID}/<TASK_ID>/events.jsonl`
|
|
77
|
+
- `.harness/runtime/${REQ_ID}/<TASK_ID>/checkpoint.json`
|
|
78
|
+
|
|
79
|
+
## Exit Criteria
|
|
79
80
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
3. Status: `development_complete`
|
|
81
|
+
- 所有任务状态为 `passed` 或 `skipped`
|
|
82
|
+
- 没有 `running` 残留状态
|
|
83
83
|
|
|
84
|
-
##
|
|
84
|
+
## Failure Handling
|
|
85
85
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
| 3 | Iteration start | TASKS.md + ERROR_LOG |
|
|
90
|
-
| 4 | After error | ERROR_LOG.md |
|
|
86
|
+
- 若存在 `failed` 任务:
|
|
87
|
+
1. 修复失败原因
|
|
88
|
+
2. 重新运行 `--resume`
|
|
91
89
|
|
|
92
90
|
## Next Step
|
|
93
91
|
|
|
94
|
-
```
|
|
95
|
-
/flow
|
|
92
|
+
```bash
|
|
93
|
+
/flow:verify "${REQ_ID}"
|
|
96
94
|
```
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
{"file": "devflow/requirements/{REQ}/
|
|
2
|
-
{"file": "devflow/requirements/{REQ}/
|
|
3
|
-
{"file": "devflow/requirements/{REQ}/
|
|
4
|
-
{"file": "
|
|
5
|
-
{"file": "devflow/requirements/{REQ}/TECH_DESIGN.md", "reason": "Technical design", "optional": true}
|
|
6
|
-
{"file": "devflow/spec/frontend/index.md", "reason": "Frontend conventions", "optional": true}
|
|
7
|
-
{"file": "devflow/spec/backend/index.md", "reason": "Backend conventions", "optional": true}
|
|
8
|
-
{"file": ".claude/rules/project-constitution.md", "reason": "Quality rules"}
|
|
1
|
+
{"file": "devflow/requirements/{REQ}/task-manifest.json", "reason": "Executable task graph"}
|
|
2
|
+
{"file": "devflow/requirements/{REQ}/context-package.md", "reason": "Execution constraints", "optional": true}
|
|
3
|
+
{"file": "devflow/requirements/{REQ}/harness-state.json", "reason": "Lifecycle status", "optional": true}
|
|
4
|
+
{"file": ".claude/rules/project-constitution.md", "reason": "Quality rules and constraints"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: flow-init
|
|
3
|
-
description: 'Initialize requirement
|
|
3
|
+
description: 'Initialize a requirement with harness state and context package. Use when starting a new REQ/BUG and preparing deterministic execution context for the next stages.'
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Flow-Init Skill
|
|
@@ -9,174 +9,76 @@ description: 'Initialize requirement structure with brainstorming and research.
|
|
|
9
9
|
|
|
10
10
|
## Purpose
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
初始化需求目录的 harness 运行状态,并生成可执行上下文包。
|
|
13
13
|
|
|
14
|
-
##
|
|
15
|
-
|
|
16
|
-
```
|
|
17
|
-
/flow-init "REQ_ID|TITLE|PLAN_URLS?"
|
|
18
|
-
/flow-init --interactive
|
|
19
|
-
```
|
|
14
|
+
## Long-Running Harness Protocol(Initializer/Worker/Done Gate)
|
|
20
15
|
|
|
21
|
-
|
|
22
|
-
- **TITLE**: 需求简短标题
|
|
23
|
-
- **PLAN_URLS**: 计划文档URL (可选,逗号分隔)
|
|
16
|
+
为与 `/core:*` 保持一致,`/flow:init` 也采用会话分层协议。
|
|
24
17
|
|
|
25
|
-
|
|
18
|
+
### Initializer Session(为后续窗口建立可恢复上下文)
|
|
26
19
|
|
|
27
|
-
|
|
20
|
+
在执行 `harness:init + harness:pack` 后,确保以下工件存在:
|
|
21
|
+
- `devflow/requirements/${REQ_ID}/session-checklist.json`
|
|
22
|
+
- 至少包含 `flow:init/flow:spec/flow:dev/flow:verify/flow:release` 五个阶段,默认 `passes=false`
|
|
23
|
+
- `devflow/requirements/${REQ_ID}/session-progress.md`
|
|
24
|
+
- 记录本窗口完成内容、风险和阻塞
|
|
25
|
+
- `devflow/requirements/${REQ_ID}/session-handoff.md`
|
|
26
|
+
- 明确下一窗口唯一优先动作(通常是 `/flow:spec "${REQ_ID}"`)
|
|
28
27
|
|
|
29
|
-
|
|
30
|
-
- 验证 REQ_ID 格式
|
|
31
|
-
- 提取 TITLE 和 PLAN_URLS
|
|
28
|
+
### Worker Session(只做 init 的原子闭环)
|
|
32
29
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
30
|
+
每次仅执行一个最小闭环:
|
|
31
|
+
1. 读取 `session-progress.md` 与 `session-handoff.md`
|
|
32
|
+
2. 运行 `harness:init`
|
|
33
|
+
3. 运行 `harness:pack`
|
|
34
|
+
4. 验证产物并更新 session 工件
|
|
38
35
|
|
|
39
|
-
|
|
40
|
-
- `devflow/requirements/${REQ_ID}/` 不存在
|
|
36
|
+
### Done Gate(禁止口头完成)
|
|
41
37
|
|
|
42
|
-
|
|
38
|
+
仅当以下条件同时满足才允许标记 `flow:init` 为完成:
|
|
39
|
+
- `harness-state.json.status == "initialized"`
|
|
40
|
+
- `context-package.md` 存在且包含 Next Commands
|
|
41
|
+
- `session-checklist.json` 中 `flow:init.passes == true`
|
|
43
42
|
|
|
44
|
-
|
|
45
|
-
- `devflow/ROADMAP.md`
|
|
46
|
-
- `devflow/ARCHITECTURE.md`
|
|
47
|
-
|
|
48
|
-
### Stage 2: Directory Init
|
|
43
|
+
## Input Format
|
|
49
44
|
|
|
50
45
|
```bash
|
|
51
|
-
|
|
46
|
+
/flow:init "REQ_ID|TITLE|PLAN_URLS?"
|
|
52
47
|
```
|
|
53
48
|
|
|
54
|
-
|
|
55
|
-
- `
|
|
56
|
-
- `
|
|
57
|
-
- `devflow/requirements/${REQ_ID}/orchestration_status.json`
|
|
58
|
-
- `devflow/requirements/${REQ_ID}/research/`
|
|
59
|
-
|
|
60
|
-
### Stage 2.3: Brainstorming (MANDATORY)
|
|
61
|
-
|
|
62
|
-
**Iron Law**: `NO FLOW EXECUTION WITHOUT BRAINSTORM ALIGNMENT`
|
|
63
|
-
|
|
64
|
-
触发 `flow-brainstorming` skill,执行:
|
|
65
|
-
|
|
66
|
-
1. **Understanding** - 一次问一个问题
|
|
67
|
-
2. **Exploring** - 提出 2-3 种方案
|
|
68
|
-
3. **Presenting** - 分段呈现设计
|
|
69
|
-
4. **Documentation** - 输出 BRAINSTORM.md
|
|
70
|
-
|
|
71
|
-
**输出**: `devflow/requirements/${REQ_ID}/BRAINSTORM.md`
|
|
72
|
-
|
|
73
|
-
**验证**:
|
|
74
|
-
- [ ] BRAINSTORM.md 存在
|
|
75
|
-
- [ ] 包含「原始需求」章节
|
|
76
|
-
- [ ] 包含「成功标准」章节
|
|
77
|
-
- [ ] 包含「方案探索」章节
|
|
78
|
-
- [ ] 包含「最终决策」章节
|
|
79
|
-
|
|
80
|
-
### Stage 2.5: Research (Subagent)
|
|
81
|
-
|
|
82
|
-
调用 `flow-researcher` subagent:
|
|
83
|
-
|
|
84
|
-
```json
|
|
85
|
-
{
|
|
86
|
-
"reqId": "${REQ_ID}",
|
|
87
|
-
"reqDir": "devflow/requirements/${REQ_ID}",
|
|
88
|
-
"title": "${TITLE}",
|
|
89
|
-
"planUrls": ["..."],
|
|
90
|
-
"contextFiles": {
|
|
91
|
-
"brainstorm": "devflow/requirements/${REQ_ID}/BRAINSTORM.md"
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
```
|
|
49
|
+
- `REQ_ID`: `REQ-123` 或 `BUG-123`
|
|
50
|
+
- `TITLE`: 需求标题
|
|
51
|
+
- `PLAN_URLS`: 可选,逗号分隔
|
|
95
52
|
|
|
96
|
-
|
|
97
|
-
- `research/internal/codebase-overview.md`
|
|
98
|
-
- `research/mcp/YYYYMMDD/**`
|
|
99
|
-
- `research/research-summary.md`
|
|
100
|
-
- `research/tasks.json`
|
|
101
|
-
- `research/research.md`
|
|
53
|
+
## Execution Steps
|
|
102
54
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
55
|
+
1. 解析输入,提取 `REQ_ID`、`TITLE`、`PLAN_URLS`。
|
|
56
|
+
2. 组装 goal 文本:
|
|
57
|
+
- `Deliver <REQ_ID>: <TITLE>`
|
|
58
|
+
- 若有 URL,追加 `Sources: <URLS>`。
|
|
59
|
+
3. 运行初始化:
|
|
108
60
|
|
|
109
61
|
```bash
|
|
110
|
-
|
|
111
|
-
bash scripts/validate-research.sh "${REQ_DIR}" --strict
|
|
62
|
+
npm run harness:init -- --change-id "${REQ_ID}" --goal "${GOAL}"
|
|
112
63
|
```
|
|
113
64
|
|
|
114
|
-
|
|
115
|
-
1. File Existence
|
|
116
|
-
2. Research.md Structure
|
|
117
|
-
3. Content Quality (无 TODO/PLACEHOLDER)
|
|
118
|
-
4. Tasks.json Validation
|
|
119
|
-
5. Git & Status & Constitution
|
|
65
|
+
4. 运行上下文打包:
|
|
120
66
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
```
|
|
124
|
-
devflow/requirements/${REQ_ID}/
|
|
125
|
-
├── README.md
|
|
126
|
-
├── BRAINSTORM.md # 北极星
|
|
127
|
-
├── research/
|
|
128
|
-
│ ├── internal/
|
|
129
|
-
│ │ └── codebase-overview.md
|
|
130
|
-
│ ├── mcp/YYYYMMDD/
|
|
131
|
-
│ ├── research.md
|
|
132
|
-
│ ├── research-summary.md
|
|
133
|
-
│ └── tasks.json
|
|
134
|
-
├── EXECUTION_LOG.md
|
|
135
|
-
└── orchestration_status.json
|
|
67
|
+
```bash
|
|
68
|
+
npm run harness:pack -- --change-id "${REQ_ID}" --goal "${GOAL}"
|
|
136
69
|
```
|
|
137
70
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|--------|---------|
|
|
142
|
-
| `scripts/check-prerequisites.sh` | 前置条件检查 |
|
|
143
|
-
| `scripts/create-requirement.sh` | 创建目录结构 |
|
|
144
|
-
| `scripts/generate-research-tasks.sh` | 生成研究任务 |
|
|
145
|
-
| `scripts/populate-research-tasks.sh` | 填充任务内容 |
|
|
146
|
-
| `scripts/consolidate-research.sh` | 整合研究结果 |
|
|
147
|
-
| `scripts/validate-research.sh` | 验证研究质量 |
|
|
148
|
-
|
|
149
|
-
## Templates Reference
|
|
150
|
-
|
|
151
|
-
| Template | Purpose |
|
|
152
|
-
|----------|---------|
|
|
153
|
-
| `assets/INIT_FLOW_TEMPLATE.md` | 详细执行流程 |
|
|
154
|
-
| `assets/RESEARCH_TEMPLATE.md` | 研究文档格式 |
|
|
155
|
-
| `assets/BRAINSTORM_TEMPLATE.md` | 头脑风暴模板 |
|
|
71
|
+
5. 验证输出文件:
|
|
72
|
+
- `devflow/requirements/${REQ_ID}/harness-state.json`
|
|
73
|
+
- `devflow/requirements/${REQ_ID}/context-package.md`
|
|
156
74
|
|
|
157
|
-
##
|
|
75
|
+
## Exit Criteria
|
|
158
76
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
| `references/flow-researcher.md` | 研究 subagent 指令 |
|
|
162
|
-
|
|
163
|
-
## Error Handling
|
|
164
|
-
|
|
165
|
-
| Error | Solution |
|
|
166
|
-
|-------|----------|
|
|
167
|
-
| Invalid REQ_ID | 检查格式 `^(REQ\|BUG)-[0-9]+$` |
|
|
168
|
-
| REQ_ID exists | 使用不同 ID 或 --force |
|
|
169
|
-
| Git not clean | commit/stash changes |
|
|
170
|
-
| Research validation failed | 手动补充 research.md |
|
|
77
|
+
- `harness-state.json.status == "initialized"`
|
|
78
|
+
- `context-package.md` 存在并包含 Next Commands 段落
|
|
171
79
|
|
|
172
80
|
## Next Step
|
|
173
81
|
|
|
82
|
+
```bash
|
|
83
|
+
/flow:spec "${REQ_ID}"
|
|
174
84
|
```
|
|
175
|
-
/flow-prd "${REQ_ID}"
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
---
|
|
179
|
-
|
|
180
|
-
**Related Skills**:
|
|
181
|
-
- `flow-brainstorming` - 头脑风暴
|
|
182
|
-
- `flow-prd` - PRD 生成
|
|
@@ -145,7 +145,7 @@ Generated: {GENERATED_AT}
|
|
|
145
145
|
2. **Direct Editing**:
|
|
146
146
|
- Copy this template to `research/research.md`
|
|
147
147
|
- Fill in decisions based on your research
|
|
148
|
-
- Run validation script before proceeding to /flow
|
|
148
|
+
- Run validation script before proceeding to /flow:spec
|
|
149
149
|
|
|
150
150
|
---
|
|
151
151
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
{"file": ".claude/rules/project-constitution.md", "reason": "Quality rules and constraints"}
|
|
2
1
|
{"file": "devflow/ROADMAP.md", "reason": "Project roadmap context", "optional": true}
|
|
3
2
|
{"file": "devflow/ARCHITECTURE.md", "reason": "Architecture context", "optional": true}
|
|
4
|
-
{"file": "devflow/
|
|
5
|
-
{"file": "devflow/
|
|
3
|
+
{"file": "devflow/requirements/{REQ}/harness-state.json", "reason": "Existing harness state", "optional": true}
|
|
4
|
+
{"file": "devflow/requirements/{REQ}/context-package.md", "reason": "Existing context package", "optional": true}
|
|
5
|
+
{"file": ".claude/rules/project-constitution.md", "reason": "Quality rules and constraints"}
|
|
@@ -134,7 +134,7 @@ fi
|
|
|
134
134
|
# Validate required directories and files
|
|
135
135
|
if [[ ! -d "$REQ_DIR" ]]; then
|
|
136
136
|
echo "ERROR: Requirement directory not found: $REQ_DIR" >&2
|
|
137
|
-
echo "Run /flow
|
|
137
|
+
echo "Run /flow:init first to create the requirement structure." >&2
|
|
138
138
|
exit 1
|
|
139
139
|
fi
|
|
140
140
|
|
|
@@ -311,7 +311,7 @@ main() {
|
|
|
311
311
|
echo "════════════════════════════════════════════════════════════════════════"
|
|
312
312
|
if [[ $total_errors -eq 0 ]]; then
|
|
313
313
|
echo "✅ ALL VALIDATIONS PASSED"
|
|
314
|
-
echo "research.md is ready for /flow
|
|
314
|
+
echo "research.md is ready for /flow:spec"
|
|
315
315
|
echo "════════════════════════════════════════════════════════════════════════"
|
|
316
316
|
return 0
|
|
317
317
|
else
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: flow-release
|
|
3
|
-
description: '
|
|
3
|
+
description: 'Release a verified requirement and run runtime cleanup. Use only after flow-verify has passed.'
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Flow-Release Skill
|
|
@@ -9,74 +9,41 @@ description: 'Complete requirement and update progress. Usage: /flow-release "RE
|
|
|
9
9
|
|
|
10
10
|
## Purpose
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
在验证通过后生成发布说明并标记需求为 released,同时执行 runtime 清理。
|
|
13
13
|
|
|
14
14
|
## Input Format
|
|
15
15
|
|
|
16
|
+
```bash
|
|
17
|
+
/flow:release "REQ_ID" [--janitor-hours N]
|
|
16
18
|
```
|
|
17
|
-
/flow-release "REQ_ID"
|
|
18
|
-
/flow-release # Auto-detect
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
## Entry Gate
|
|
22
|
-
|
|
23
|
-
1. **PRD.md, EPIC.md, TASKS.md** 存在
|
|
24
|
-
2. **TEST_REPORT.md, SECURITY_REPORT.md** Gate 均为 PASS
|
|
25
|
-
3. **Status**: `quality_complete`(兼容 `qa_complete`)或 `release_failed`
|
|
26
|
-
|
|
27
|
-
## Execution Flow
|
|
28
|
-
|
|
29
|
-
### Stage 1: Context Preparation
|
|
30
|
-
|
|
31
|
-
收集元数据:
|
|
32
|
-
- REQ_ID, TITLE
|
|
33
|
-
- coverage, security 状态
|
|
34
|
-
- TASKS.md 完成情况
|
|
35
|
-
|
|
36
|
-
### Stage 2: Release Manager Agent
|
|
37
|
-
|
|
38
|
-
调用 `release-manager` agent:
|
|
39
|
-
- 生成 RELEASE_PLAN.md (发布摘要)
|
|
40
19
|
|
|
41
|
-
|
|
20
|
+
- `janitor-hours` 默认 `72`
|
|
42
21
|
|
|
43
|
-
|
|
44
|
-
- 找到对应 REQ 条目,更新状态为 `completed` 或 `released`
|
|
22
|
+
## Execution Steps
|
|
45
23
|
|
|
46
|
-
|
|
47
|
-
-
|
|
24
|
+
1. 检查 `report-card.json`:
|
|
25
|
+
- `overall` 必须为 `pass`
|
|
26
|
+
2. 运行发布:
|
|
48
27
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
### Stage 4: Commit Gate (MANDATORY)
|
|
53
|
-
|
|
54
|
-
- 检查 `git status --porcelain`
|
|
55
|
-
- 若存在未提交变更,按 `.claude/commands/util/git-commit.md` 规范提交
|
|
56
|
-
- 提交格式: `chore(release): complete ${REQ_ID} - ${TITLE}`
|
|
57
|
-
|
|
58
|
-
### Stage 5: Exit Gate
|
|
59
|
-
|
|
60
|
-
1. RELEASE_PLAN.md 存在
|
|
61
|
-
2. Status: `release_complete`
|
|
62
|
-
3. 变更已提交
|
|
28
|
+
```bash
|
|
29
|
+
npm run harness:release -- --change-id "${REQ_ID}"
|
|
30
|
+
```
|
|
63
31
|
|
|
64
|
-
|
|
32
|
+
3. 运行熵清理:
|
|
65
33
|
|
|
34
|
+
```bash
|
|
35
|
+
npm run harness:janitor -- --hours ${HOURS}
|
|
66
36
|
```
|
|
67
|
-
devflow/requirements/${REQ_ID}/
|
|
68
|
-
├── RELEASE_PLAN.md
|
|
69
|
-
└── orchestration_status.json (release_complete)
|
|
70
37
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
38
|
+
4. 验证输出:
|
|
39
|
+
- `devflow/requirements/${REQ_ID}/RELEASE_NOTE.md`
|
|
40
|
+
- `devflow/requirements/${REQ_ID}/harness-state.json` 中 `status == "released"`
|
|
74
41
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
42
|
+
## Exit Criteria
|
|
43
|
+
|
|
44
|
+
- 发布文件存在且状态为 released
|
|
45
|
+
- janitor 执行成功
|
|
78
46
|
|
|
79
47
|
## Next Step
|
|
80
48
|
|
|
81
|
-
|
|
82
|
-
2. 可选: `/flow-verify` 复检
|
|
49
|
+
- 进入 PR / merge 流程(仓库策略处理)
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
{"file": "devflow/requirements/{REQ}/
|
|
2
|
-
{"file": "devflow/requirements/{REQ}/
|
|
3
|
-
{"file": "devflow/requirements/{REQ}/
|
|
4
|
-
{"file": "devflow/requirements/{REQ}/
|
|
5
|
-
{"file": "
|
|
6
|
-
{"file": "devflow/requirements/{REQ}/quickstart.md", "reason": "Verification commands", "optional": true}
|
|
7
|
-
{"file": ".claude/rules/project-constitution.md", "reason": "Quality rules"}
|
|
1
|
+
{"file": "devflow/requirements/{REQ}/report-card.json", "reason": "Gate results before release"}
|
|
2
|
+
{"file": "devflow/requirements/{REQ}/task-manifest.json", "reason": "Task completion summary"}
|
|
3
|
+
{"file": "devflow/requirements/{REQ}/harness-state.json", "reason": "Lifecycle status", "optional": true}
|
|
4
|
+
{"file": "devflow/requirements/{REQ}/RELEASE_NOTE.md", "reason": "Previous release note", "optional": true}
|
|
5
|
+
{"file": ".claude/rules/project-constitution.md", "reason": "Quality rules and constraints"}
|