cc-devflow 4.1.5 → 4.1.6

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 (111) hide show
  1. package/.claude/CLAUDE.md +87 -1091
  2. package/.claude/commands/core/architecture.md +2 -2
  3. package/.claude/commands/core/guidelines.md +2 -2
  4. package/.claude/commands/core/roadmap.md +4 -4
  5. package/.claude/commands/core/style.md +40 -268
  6. package/.claude/commands/flow/CLAUDE.md +28 -0
  7. package/.claude/commands/flow/archive.md +2 -2
  8. package/.claude/commands/flow/checklist.md +9 -251
  9. package/.claude/commands/flow/clarify.md +9 -127
  10. package/.claude/commands/flow/constitution.md +1 -1
  11. package/.claude/commands/flow/context.md +1 -1
  12. package/.claude/commands/flow/dev.md +19 -395
  13. package/.claude/commands/flow/ideate.md +13 -13
  14. package/.claude/commands/flow/init.md +19 -30
  15. package/.claude/commands/flow/new.md +12 -268
  16. package/.claude/commands/flow/quality.md +10 -153
  17. package/.claude/commands/flow/release.md +18 -81
  18. package/.claude/commands/flow/restart.md +15 -16
  19. package/.claude/commands/flow/spec.md +14 -164
  20. package/.claude/commands/flow/status.md +12 -12
  21. package/.claude/commands/flow/update.md +4 -4
  22. package/.claude/commands/flow/upgrade.md +6 -6
  23. package/.claude/commands/flow/verify.md +19 -78
  24. package/.claude/commands/flow/workspace.md +1 -1
  25. package/.claude/docs/guides/INIT_TROUBLESHOOTING.md +7 -7
  26. package/.claude/docs/guides/NEW_TROUBLESHOOTING.md +44 -96
  27. package/.claude/docs/guides/ROADMAP_TROUBLESHOOTING.md +1 -1
  28. package/.claude/docs/guides/TASK_COMPLETION_MARKING.md +5 -5
  29. package/.claude/docs/templates/ATTEMPT_TEMPLATE.md +1 -1
  30. package/.claude/docs/templates/BACKLOG_TEMPLATE.md +3 -3
  31. package/.claude/docs/templates/CLARIFICATION_REPORT_TEMPLATE.md +5 -5
  32. package/.claude/docs/templates/ERROR_LOG_TEMPLATE.md +2 -2
  33. package/.claude/docs/templates/INIT_FLOW_TEMPLATE.md +3 -3
  34. package/.claude/docs/templates/NEW_ORCHESTRATION_TEMPLATE.md +33 -64
  35. package/.claude/docs/templates/RESEARCH_TEMPLATE.md +3 -3
  36. package/.claude/docs/templates/ROADMAP_DIALOGUE_TEMPLATE.md +2 -2
  37. package/.claude/docs/templates/ROADMAP_TEMPLATE.md +2 -2
  38. package/.claude/docs/templates/STYLE_TEMPLATE.md +3 -3
  39. package/.claude/docs/templates/UI_PROTOTYPE_TEMPLATE.md +8 -9
  40. package/.claude/guides/workflow-guides/flow-orchestrator.md +31 -265
  41. package/.claude/hooks/CLAUDE.md +1 -1
  42. package/.claude/hooks/checklist-gate.js +4 -4
  43. package/.claude/hooks/inject-agent-context.ts +2 -2
  44. package/.claude/scripts/calculate-checklist-completion.sh +2 -2
  45. package/.claude/scripts/check-prerequisites.sh +2 -2
  46. package/.claude/scripts/checklist-errors.sh +4 -4
  47. package/.claude/scripts/flow-quality-full.sh +5 -5
  48. package/.claude/scripts/flow-quality-quick.sh +4 -4
  49. package/.claude/scripts/flow-workspace-init.sh +2 -2
  50. package/.claude/scripts/generate-clarification-report.sh +4 -4
  51. package/.claude/scripts/recover-workflow.sh +70 -73
  52. package/.claude/scripts/run-quality-gates.sh +1 -1
  53. package/.claude/scripts/setup-epic.sh +2 -2
  54. package/.claude/scripts/setup-ralph-loop.sh +2 -2
  55. package/.claude/scripts/validate-research.sh +1 -1
  56. package/.claude/scripts/verify-setup.sh +1 -1
  57. package/.claude/skills/cc-devflow-orchestrator/SKILL.md +88 -108
  58. package/.claude/skills/workflow/CLAUDE.md +24 -0
  59. package/.claude/skills/workflow/flow-dev/CLAUDE.md +14 -76
  60. package/.claude/skills/workflow/flow-dev/SKILL.md +29 -67
  61. package/.claude/skills/workflow/flow-dev/context.jsonl +4 -8
  62. package/.claude/skills/workflow/flow-init/SKILL.md +24 -151
  63. package/.claude/skills/workflow/flow-init/assets/RESEARCH_TEMPLATE.md +1 -1
  64. package/.claude/skills/workflow/flow-init/context.jsonl +3 -3
  65. package/.claude/skills/workflow/flow-init/scripts/check-prerequisites.sh +1 -1
  66. package/.claude/skills/workflow/flow-init/scripts/validate-research.sh +1 -1
  67. package/.claude/skills/workflow/flow-release/SKILL.md +23 -56
  68. package/.claude/skills/workflow/flow-release/context.jsonl +5 -7
  69. package/.claude/skills/workflow/flow-spec/CLAUDE.md +15 -101
  70. package/.claude/skills/workflow/flow-spec/SKILL.md +15 -518
  71. package/.claude/skills/workflow/flow-spec/context.jsonl +5 -7
  72. package/.claude/skills/workflow/flow-verify/CLAUDE.md +10 -0
  73. package/.claude/skills/workflow/flow-verify/SKILL.md +53 -0
  74. package/.claude/skills/workflow/flow-verify/context.jsonl +5 -0
  75. package/.claude/skills/workflow.yaml +72 -267
  76. package/CHANGELOG.md +31 -0
  77. package/README.md +91 -69
  78. package/README.zh-CN.md +90 -67
  79. package/bin/harness.js +22 -0
  80. package/docs/commands/README.md +34 -38
  81. package/docs/commands/README.zh-CN.md +34 -36
  82. package/docs/commands/core-roadmap.md +2 -2
  83. package/docs/commands/core-roadmap.zh-CN.md +2 -2
  84. package/docs/commands/core-style.md +29 -381
  85. package/docs/commands/core-style.zh-CN.md +29 -381
  86. package/docs/commands/flow-init.md +10 -10
  87. package/docs/commands/flow-init.zh-CN.md +11 -11
  88. package/docs/commands/flow-new.md +25 -260
  89. package/docs/commands/flow-new.zh-CN.md +26 -257
  90. package/docs/guides/getting-started.md +16 -15
  91. package/docs/guides/getting-started.zh-CN.md +10 -12
  92. package/lib/compiler/__tests__/manifest.test.js +156 -0
  93. package/lib/compiler/__tests__/parser.test.js +21 -0
  94. package/lib/compiler/index.js +17 -1
  95. package/lib/compiler/manifest.js +68 -6
  96. package/lib/compiler/parser.js +5 -0
  97. package/lib/harness/CLAUDE.md +21 -0
  98. package/lib/harness/cli.js +208 -0
  99. package/lib/harness/index.js +16 -0
  100. package/lib/harness/operations/dispatch.js +285 -0
  101. package/lib/harness/operations/init.js +48 -0
  102. package/lib/harness/operations/janitor.js +74 -0
  103. package/lib/harness/operations/pack.js +100 -0
  104. package/lib/harness/operations/plan.js +29 -0
  105. package/lib/harness/operations/release.js +83 -0
  106. package/lib/harness/operations/resume.js +44 -0
  107. package/lib/harness/operations/verify.js +163 -0
  108. package/lib/harness/planner.js +141 -0
  109. package/lib/harness/schemas.js +108 -0
  110. package/lib/harness/store.js +240 -0
  111. package/package.json +9 -1
@@ -1,78 +1,16 @@
1
- # flow-dev/ - Development Execution Skill
2
-
3
- > L2 | 父级: `.claude/skills/workflow/CLAUDE.md`
4
-
5
- ## Purpose
6
-
7
- 执行开发任务,遵循 TDD Iron Law,默认 Autonomous 模式。
8
-
9
- ## Members
10
-
11
- | File | Purpose | Lines |
12
- |------|---------|-------|
13
- | `SKILL.md` | 核心指令:TDD 执行流程、模式、错误处理 | ~100 |
14
- | `context.jsonl` | 通用上下文注入定义 (fallback) | ~10 |
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 development tasks with TDD and Autonomous mode. Usage: /flow-dev "REQ-123" [--manual] [--max-iterations N]'
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,50 @@ description: 'Execute development tasks with TDD and Autonomous mode. Usage: /fl
9
9
 
10
10
  ## Purpose
11
11
 
12
- 执行开发任务,遵循 TDD Iron Law,默认 Autonomous 模式。
13
-
14
- ## TDD Iron Law
15
-
16
- ```
17
- NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST
18
- ```
19
-
20
- ### TDD Checkpoint
21
-
22
- ```yaml
23
- ⚠️ TEST VERIFICATION CHECKPOINT:
24
- 1. 运行所有 Phase 2 测试
25
- 2. 验证所有新测试 FAIL
26
- 3. 只有全部 FAIL 后才能进入 Phase 3
27
- 4. 如果已经写了实现代码 → DELETE 重来
28
- ```
12
+ 执行 `task-manifest.json` 中的任务,默认并行调度并写入 checkpoint/events 供恢复。
29
13
 
30
14
  ## Input Format
31
15
 
16
+ ```bash
17
+ /flow:dev "REQ_ID" [--parallel N] [--resume] [--max-retries N]
32
18
  ```
33
- /flow-dev "REQ_ID" [--manual] [--max-iterations N] [--task T###]
34
- ```
35
-
36
- - **默认**: Autonomous 模式 (自动重试)
37
- - **--manual**: Manual 模式 (遇错停止)
38
- - **--max-iterations**: 最大迭代次数 (默认 10)
39
- - **--task**: 从指定任务开始
40
19
 
41
- ## 运行模式对比
20
+ ## Execution Steps
42
21
 
43
- | | Manual | Autonomous (默认) |
44
- |--|--------|------------------|
45
- | 遇到错误 | 停止 | 自动重试 |
46
- | 注意力刷新 | Protocol 2 | Protocol 2+3+4 |
47
- | 适用场景 | 复杂需求 | 清晰需求 |
48
-
49
- ## Execution Flow
50
-
51
- ### Stage 1: Entry Gate
52
-
53
- 1. TASKS.md 存在
54
- 2. EPIC.md 存在
55
- 3. Status: `epic_complete`
56
-
57
- ### Stage 2: Task Execution (Ralph Loop)
22
+ 1. 解析参数:
23
+ - 默认 `parallel = 3`
24
+ - 默认不 resume
25
+ 2. 分支执行:
26
+ - 普通执行:
58
27
 
59
- ```
60
- For each task in TASKS.md:
61
- 1. Protocol 2: 读取任务 DoD
62
- 2. 执行任务
63
- 3. 验证完成
64
- 4. 标记 [x]
65
- 5. Protocol 3: 读取下一任务 + ERROR_LOG
28
+ ```bash
29
+ npm run harness:dispatch -- --change-id "${REQ_ID}" --parallel ${PARALLEL} [--max-retries ${MAX_RETRIES}]
66
30
  ```
67
31
 
68
- ### Stage 3: Error Handling
32
+ - 恢复执行:
69
33
 
70
- ```
71
- On Error:
72
- 1. Protocol 4: 读取 ERROR_LOG.md
73
- 2. 记录错误到 ERROR_LOG.md
74
- 3. Autonomous: 自动重试
75
- 4. Manual: 停止等待
34
+ ```bash
35
+ npm run harness:resume -- --change-id "${REQ_ID}" --parallel ${PARALLEL} [--max-retries ${MAX_RETRIES}]
76
36
  ```
77
37
 
78
- ### Stage 4: Exit Gate
38
+ 3. 检查执行结果:
39
+ - `task-manifest.json` 状态更新
40
+ - `.harness/runtime/${REQ_ID}/<TASK_ID>/events.jsonl`
41
+ - `.harness/runtime/${REQ_ID}/<TASK_ID>/checkpoint.json`
79
42
 
80
- 1. 所有任务完成
81
- 2. 测试通过
82
- 3. Status: `development_complete`
43
+ ## Exit Criteria
83
44
 
84
- ## Attention Refresh Protocols
45
+ - 所有任务状态为 `passed` 或 `skipped`
46
+ - 没有 `running` 残留状态
85
47
 
86
- | Protocol | Trigger | Reads |
87
- |----------|---------|-------|
88
- | 2 | Task start | TASKS.md T### + DoD |
89
- | 3 | Iteration start | TASKS.md + ERROR_LOG |
90
- | 4 | After error | ERROR_LOG.md |
48
+ ## Failure Handling
49
+
50
+ - 若存在 `failed` 任务:
51
+ 1. 修复失败原因
52
+ 2. 重新运行 `--resume`
91
53
 
92
54
  ## Next Step
93
55
 
94
- ```
95
- /flow-quality "${REQ_ID}"
56
+ ```bash
57
+ /flow:verify "${REQ_ID}"
96
58
  ```
@@ -1,8 +1,4 @@
1
- {"file": "devflow/requirements/{REQ}/TASKS.md", "reason": "Task list"}
2
- {"file": "devflow/requirements/{REQ}/EPIC.md", "reason": "Epic overview"}
3
- {"file": "devflow/requirements/{REQ}/BRAINSTORM.md", "reason": "Original intent"}
4
- {"file": "devflow/requirements/{REQ}/ERROR_LOG.md", "reason": "Previous errors", "optional": true}
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 structure with brainstorming and research. Usage: /flow-init "REQ-123|Title|URLs". Creates BRAINSTORM.md (north star) and research artifacts.'
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,47 @@ description: 'Initialize requirement structure with brainstorming and research.
9
9
 
10
10
  ## Purpose
11
11
 
12
- 初始化需求结构,包含头脑风暴和研究阶段。生成 BRAINSTORM.md 作为需求的「北极星」。
12
+ 初始化需求目录的 harness 运行状态,并生成可执行上下文包。
13
13
 
14
14
  ## Input Format
15
15
 
16
- ```
17
- /flow-init "REQ_ID|TITLE|PLAN_URLS?"
18
- /flow-init --interactive
19
- ```
20
-
21
- - **REQ_ID**: `^(REQ|BUG)-[0-9]+$`
22
- - **TITLE**: 需求简短标题
23
- - **PLAN_URLS**: 计划文档URL (可选,逗号分隔)
24
-
25
- ## Execution Flow
26
-
27
- ### Stage 1: Entry Gate
28
-
29
- 1. **参数解析**
30
- - 验证 REQ_ID 格式
31
- - 提取 TITLE 和 PLAN_URLS
32
-
33
- 2. **前置检查**
34
- ```bash
35
- bash scripts/check-prerequisites.sh --json --paths-only
36
- ```
37
- - devflow/ 目录存在
38
-
39
- 3. **唯一性检查**
40
- - `devflow/requirements/${REQ_ID}/` 不存在
41
-
42
- ### Stage 1.5: Context Loading
43
-
44
- 检查并加载 (如存在):
45
- - `devflow/ROADMAP.md`
46
- - `devflow/ARCHITECTURE.md`
47
-
48
- ### Stage 2: Directory Init
49
-
50
16
  ```bash
51
- bash scripts/create-requirement.sh "${REQ_ID}" --title "${TITLE}"
17
+ /flow:init "REQ_ID|TITLE|PLAN_URLS?"
52
18
  ```
53
19
 
54
- 生成:
55
- - `devflow/requirements/${REQ_ID}/README.md`
56
- - `devflow/requirements/${REQ_ID}/EXECUTION_LOG.md`
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,执行:
20
+ - `REQ_ID`: `REQ-123` 或 `BUG-123`
21
+ - `TITLE`: 需求标题
22
+ - `PLAN_URLS`: 可选,逗号分隔
65
23
 
66
- 1. **Understanding** - 一次问一个问题
67
- 2. **Exploring** - 提出 2-3 种方案
68
- 3. **Presenting** - 分段呈现设计
69
- 4. **Documentation** - 输出 BRAINSTORM.md
24
+ ## Execution Steps
70
25
 
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
- ```
95
-
96
- **输出**:
97
- - `research/internal/codebase-overview.md`
98
- - `research/mcp/YYYYMMDD/**`
99
- - `research/research-summary.md`
100
- - `research/tasks.json`
101
- - `research/research.md`
102
-
103
- ### Stage 3: README Generation
104
-
105
- 生成 `devflow/requirements/${REQ_ID}/README.md`
106
-
107
- ### Stage 4: Exit Gate (5-Level)
26
+ 1. 解析输入,提取 `REQ_ID`、`TITLE`、`PLAN_URLS`。
27
+ 2. 组装 goal 文本:
28
+ - `Deliver <REQ_ID>: <TITLE>`
29
+ - 若有 URL,追加 `Sources: <URLS>`。
30
+ 3. 运行初始化:
108
31
 
109
32
  ```bash
110
- # Level 2: Structure validation
111
- bash scripts/validate-research.sh "${REQ_DIR}" --strict
33
+ npm run harness:init -- --change-id "${REQ_ID}" --goal "${GOAL}"
112
34
  ```
113
35
 
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
36
+ 4. 运行上下文打包:
120
37
 
121
- ## Output Artifacts
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
38
+ ```bash
39
+ npm run harness:pack -- --change-id "${REQ_ID}" --goal "${GOAL}"
136
40
  ```
137
41
 
138
- ## Scripts Reference
139
-
140
- | Script | Purpose |
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` | 验证研究质量 |
42
+ 5. 验证输出文件:
43
+ - `devflow/requirements/${REQ_ID}/harness-state.json`
44
+ - `devflow/requirements/${REQ_ID}/context-package.md`
148
45
 
149
- ## Templates Reference
46
+ ## Exit Criteria
150
47
 
151
- | Template | Purpose |
152
- |----------|---------|
153
- | `assets/INIT_FLOW_TEMPLATE.md` | 详细执行流程 |
154
- | `assets/RESEARCH_TEMPLATE.md` | 研究文档格式 |
155
- | `assets/BRAINSTORM_TEMPLATE.md` | 头脑风暴模板 |
156
-
157
- ## Agent Reference
158
-
159
- | Agent | Purpose |
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 |
48
+ - `harness-state.json.status == "initialized"`
49
+ - `context-package.md` 存在并包含 Next Commands 段落
171
50
 
172
51
  ## Next Step
173
52
 
53
+ ```bash
54
+ /flow:spec "${REQ_ID}"
174
55
  ```
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-prd
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/spec/frontend/index.md", "reason": "Frontend conventions", "optional": true}
5
- {"file": "devflow/spec/backend/index.md", "reason": "Backend conventions", "optional": true}
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-new first to create the requirement structure." >&2
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-prd"
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: 'Complete requirement and update progress. Usage: /flow-release "REQ-123" or /flow-release'
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
- 完成需求发布:更新进度文档、提交变更。Git 分支/PR/合并由用户自行管理。
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
- ### Stage 3: Progress Update
20
+ - `janitor-hours` 默认 `72`
42
21
 
43
- 1. **更新 BACKLOG.md**
44
- - 找到对应 REQ 条目,更新状态为 `completed` 或 `released`
22
+ ## Execution Steps
45
23
 
46
- 2. **更新 ROADMAP.md**
47
- - 找到对应 REQ 条目,更新进度
24
+ 1. 检查 `report-card.json`:
25
+ - `overall` 必须为 `pass`
26
+ 2. 运行发布:
48
27
 
49
- 3. **更新 orchestration_status.json**
50
- - Status `release_complete`
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
- ## Output
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
- Updated:
72
- ├── devflow/BACKLOG.md (REQ status updated)
73
- └── devflow/ROADMAP.md (REQ progress updated)
38
+ 4. 验证输出:
39
+ - `devflow/requirements/${REQ_ID}/RELEASE_NOTE.md`
40
+ - `devflow/requirements/${REQ_ID}/harness-state.json` `status == "released"`
74
41
 
75
- Git:
76
- └── Changes committed (user handles branch/PR/merge externally)
77
- ```
42
+ ## Exit Criteria
43
+
44
+ - 发布文件存在且状态为 released
45
+ - janitor 执行成功
78
46
 
79
47
  ## Next Step
80
48
 
81
- 1. 用户自行处理分支合并 / PR 创建
82
- 2. 可选: `/flow-verify` 复检
49
+ - 进入 PR / merge 流程(仓库策略处理)
@@ -1,7 +1,5 @@
1
- {"file": "devflow/requirements/{REQ}/PRD.md", "reason": "Product requirements"}
2
- {"file": "devflow/requirements/{REQ}/EPIC.md", "reason": "Epic overview"}
3
- {"file": "devflow/requirements/{REQ}/TASKS.md", "reason": "Task completion"}
4
- {"file": "devflow/requirements/{REQ}/TEST_REPORT.md", "reason": "Test results", "optional": true}
5
- {"file": "devflow/requirements/{REQ}/SECURITY_REPORT.md", "reason": "Security results", "optional": true}
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"}