cc-devflow 4.1.4 → 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 (128) hide show
  1. package/.claude/CLAUDE.md +87 -1183
  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/fix.md +1 -6
  14. package/.claude/commands/flow/ideate.md +13 -13
  15. package/.claude/commands/flow/init.md +19 -41
  16. package/.claude/commands/flow/new.md +12 -268
  17. package/.claude/commands/flow/quality.md +10 -153
  18. package/.claude/commands/flow/release.md +18 -131
  19. package/.claude/commands/flow/restart.md +15 -16
  20. package/.claude/commands/flow/spec.md +14 -164
  21. package/.claude/commands/flow/status.md +12 -12
  22. package/.claude/commands/flow/update.md +4 -4
  23. package/.claude/commands/flow/upgrade.md +6 -6
  24. package/.claude/commands/flow/verify.md +19 -78
  25. package/.claude/commands/flow/workspace.md +3 -20
  26. package/.claude/docs/guides/INIT_TROUBLESHOOTING.md +7 -7
  27. package/.claude/docs/guides/NEW_TROUBLESHOOTING.md +44 -96
  28. package/.claude/docs/guides/ROADMAP_TROUBLESHOOTING.md +1 -1
  29. package/.claude/docs/guides/TASK_COMPLETION_MARKING.md +5 -5
  30. package/.claude/docs/guides/TEAM_MODE_GUIDE.md +0 -1
  31. package/.claude/docs/templates/ATTEMPT_TEMPLATE.md +1 -1
  32. package/.claude/docs/templates/BACKLOG_TEMPLATE.md +3 -3
  33. package/.claude/docs/templates/CLARIFICATION_REPORT_TEMPLATE.md +5 -5
  34. package/.claude/docs/templates/ERROR_LOG_TEMPLATE.md +2 -2
  35. package/.claude/docs/templates/INIT_FLOW_TEMPLATE.md +3 -3
  36. package/.claude/docs/templates/NEW_ORCHESTRATION_TEMPLATE.md +33 -64
  37. package/.claude/docs/templates/RESEARCH_TEMPLATE.md +3 -3
  38. package/.claude/docs/templates/ROADMAP_DIALOGUE_TEMPLATE.md +2 -2
  39. package/.claude/docs/templates/ROADMAP_TEMPLATE.md +2 -2
  40. package/.claude/docs/templates/STYLE_TEMPLATE.md +3 -3
  41. package/.claude/docs/templates/UI_PROTOTYPE_TEMPLATE.md +8 -9
  42. package/.claude/guides/workflow-guides/flow-orchestrator.md +31 -265
  43. package/.claude/hooks/CLAUDE.md +1 -1
  44. package/.claude/hooks/checklist-gate.js +4 -4
  45. package/.claude/hooks/inject-agent-context.ts +2 -2
  46. package/.claude/hooks/teammate-idle-hook.ts +1 -1
  47. package/.claude/rules/devflow-conventions.md +2 -93
  48. package/.claude/scripts/CLAUDE.md +1 -4
  49. package/.claude/scripts/calculate-checklist-completion.sh +2 -2
  50. package/.claude/scripts/check-prerequisites.sh +2 -2
  51. package/.claude/scripts/checklist-errors.sh +4 -4
  52. package/.claude/scripts/common.sh +12 -147
  53. package/.claude/scripts/flow-quality-full.sh +5 -5
  54. package/.claude/scripts/flow-quality-quick.sh +4 -4
  55. package/.claude/scripts/flow-workspace-init.sh +2 -2
  56. package/.claude/scripts/generate-clarification-report.sh +4 -4
  57. package/.claude/scripts/recover-workflow.sh +70 -73
  58. package/.claude/scripts/run-quality-gates.sh +1 -1
  59. package/.claude/scripts/setup-epic.sh +2 -2
  60. package/.claude/scripts/setup-ralph-loop.sh +2 -2
  61. package/.claude/scripts/validate-research.sh +1 -1
  62. package/.claude/scripts/verify-setup.sh +1 -1
  63. package/.claude/skills/cc-devflow-orchestrator/SKILL.md +88 -108
  64. package/.claude/skills/workflow/CLAUDE.md +24 -0
  65. package/.claude/skills/workflow/flow-dev/CLAUDE.md +14 -76
  66. package/.claude/skills/workflow/flow-dev/SKILL.md +29 -67
  67. package/.claude/skills/workflow/flow-dev/context.jsonl +4 -8
  68. package/.claude/skills/workflow/flow-init/SKILL.md +23 -186
  69. package/.claude/skills/workflow/flow-init/assets/RESEARCH_TEMPLATE.md +1 -1
  70. package/.claude/skills/workflow/flow-init/context.jsonl +3 -3
  71. package/.claude/skills/workflow/flow-init/scripts/check-prerequisites.sh +1 -1
  72. package/.claude/skills/workflow/flow-init/scripts/create-requirement.sh +15 -134
  73. package/.claude/skills/workflow/flow-init/scripts/validate-research.sh +1 -1
  74. package/.claude/skills/workflow/flow-release/SKILL.md +20 -110
  75. package/.claude/skills/workflow/flow-release/context.jsonl +5 -7
  76. package/.claude/skills/workflow/flow-spec/CLAUDE.md +15 -101
  77. package/.claude/skills/workflow/flow-spec/SKILL.md +15 -518
  78. package/.claude/skills/workflow/flow-spec/context.jsonl +5 -7
  79. package/.claude/skills/workflow/flow-verify/CLAUDE.md +10 -0
  80. package/.claude/skills/workflow/flow-verify/SKILL.md +53 -0
  81. package/.claude/skills/workflow/flow-verify/context.jsonl +5 -0
  82. package/.claude/skills/workflow.yaml +72 -270
  83. package/CHANGELOG.md +72 -0
  84. package/README.md +91 -69
  85. package/README.zh-CN.md +90 -67
  86. package/bin/harness.js +22 -0
  87. package/docs/commands/README.md +34 -38
  88. package/docs/commands/README.zh-CN.md +34 -36
  89. package/docs/commands/core-roadmap.md +2 -2
  90. package/docs/commands/core-roadmap.zh-CN.md +2 -2
  91. package/docs/commands/core-style.md +29 -381
  92. package/docs/commands/core-style.zh-CN.md +29 -381
  93. package/docs/commands/flow-init.md +10 -10
  94. package/docs/commands/flow-init.zh-CN.md +11 -11
  95. package/docs/commands/flow-new.md +25 -260
  96. package/docs/commands/flow-new.zh-CN.md +26 -257
  97. package/docs/guides/getting-started.md +16 -15
  98. package/docs/guides/getting-started.zh-CN.md +10 -12
  99. package/lib/compiler/__tests__/manifest.test.js +156 -0
  100. package/lib/compiler/__tests__/parser.test.js +21 -0
  101. package/lib/compiler/index.js +17 -1
  102. package/lib/compiler/manifest.js +68 -6
  103. package/lib/compiler/parser.js +5 -0
  104. package/lib/harness/CLAUDE.md +21 -0
  105. package/lib/harness/cli.js +208 -0
  106. package/lib/harness/index.js +16 -0
  107. package/lib/harness/operations/dispatch.js +285 -0
  108. package/lib/harness/operations/init.js +48 -0
  109. package/lib/harness/operations/janitor.js +74 -0
  110. package/lib/harness/operations/pack.js +100 -0
  111. package/lib/harness/operations/plan.js +29 -0
  112. package/lib/harness/operations/release.js +83 -0
  113. package/lib/harness/operations/resume.js +44 -0
  114. package/lib/harness/operations/verify.js +163 -0
  115. package/lib/harness/planner.js +141 -0
  116. package/lib/harness/schemas.js +108 -0
  117. package/lib/harness/store.js +240 -0
  118. package/package.json +9 -1
  119. package/.claude/scripts/flow-workspace-start.sh +0 -217
  120. package/.claude/scripts/flow-workspace-switch.sh +0 -234
  121. package/.claude/skills/domain/using-git-worktrees/SKILL.md +0 -252
  122. package/.claude/skills/domain/using-git-worktrees/assets/SHELL_ALIASES.md +0 -133
  123. package/.claude/skills/domain/using-git-worktrees/context.jsonl +0 -4
  124. package/.claude/skills/domain/using-git-worktrees/scripts/worktree-cleanup.sh +0 -218
  125. package/.claude/skills/domain/using-git-worktrees/scripts/worktree-create.sh +0 -232
  126. package/.claude/skills/domain/using-git-worktrees/scripts/worktree-list.sh +0 -130
  127. package/.claude/skills/domain/using-git-worktrees/scripts/worktree-status.sh +0 -140
  128. package/.claude/skills/domain/using-git-worktrees/scripts/worktree-switch.sh +0 -70
@@ -6,159 +6,139 @@ description: CC-DevFlow workflow router and agent recommender. Use when starting
6
6
  # CC-DevFlow Orchestrator
7
7
 
8
8
  ## Purpose
9
- Guide users to the correct agent/command WITHOUT duplicating their detailed standards.
9
+ Guide users to the correct command/skill without duplicating detailed implementation standards.
10
10
 
11
11
  ## Workflow Map
12
12
 
13
- ### 🏢 项目级工作流(Project-Level, 项目初期执行一次)
13
+ ### Project-Level (run once per project)
14
14
 
15
- ```
16
- /core:roadmap → ROADMAP.md + BACKLOG.md (产品路线图)
17
- /core:architecture → ARCHITECTURE.md (系统架构设计)
18
- /core:guidelines → frontend-guidelines.md / backend-guidelines.md (项目规范)
19
- /core:style → STYLE.md (设计风格指南)
15
+ ```text
16
+ /core:roadmap → ROADMAP.md + BACKLOG.md
17
+ /core:architecture → ARCHITECTURE.md
18
+ /core:guidelines → frontend/backend guidelines
19
+ /core:style → STYLE.md
20
20
  ```
21
21
 
22
- ### 📦 需求级工作流(Requirement-Level, 每个需求执行一次)
22
+ ### Requirement-Level Canonical Mainline (v6)
23
23
 
24
- ```
25
- /flow:init research.md + tasks.json + BRAINSTORM.md (研究初始化 + 头脑风暴)
26
-
27
- /flow:clarify → clarifications/*.md (11 维度歧义扫描, 可选)
24
+ ```text
25
+ /flow:init harness:init + harness:pack
26
+ → context-package.md + harness-state.json
28
27
 
29
- /flow:spec PRD + Tech + UI + Epic (统一规格阶段)
30
- Modes:
31
- - Full: PRD → Tech+UI (并行) → Epic
32
- - Quick: PRD → Epic (--skip-tech --skip-ui)
33
- - Backend: PRD → Tech → Epic (--skip-ui)
34
- - Frontend: PRD → UI → Epic (--skip-tech)
28
+ /flow:spec harness:plan
29
+ → task-manifest.json
35
30
 
36
- /flow:dev TASKS.md execution (TDD + Autonomous mode default)
31
+ /flow:dev harness:dispatch / harness:resume
32
+ → runtime events + checkpoints + manifest status
37
33
 
38
- /flow:quality Quality verification
34
+ /flow:verify harness:verify
35
+ → report-card.json (quick/strict gates)
39
36
 
40
- /flow:release → PR creation + deployment
41
-
42
- /flow:verify → consistency check (任意阶段可调用)
43
- ```
44
-
45
- ### 🚀 简化流程
46
-
37
+ /flow:release → harness:release + harness:janitor
38
+ → RELEASE_NOTE.md + released state
47
39
  ```
48
- 【精简流程】(适合小需求, 3 步)
49
- /flow:init --quick → /flow:spec --skip-tech --skip-ui → /flow:dev → /flow:release
50
40
 
51
- 【标准流程】(适合中等需求, 4 步)
52
- /flow:init → /flow:spec → /flow:dev → /flow:quality → /flow:release
41
+ ### Bug Workflow
53
42
 
54
- 【完整流程】(适合大需求, 5 步)
55
- /flow:init /flow:clarify /flow:spec → /flow:dev → /flow:quality --full → /flow:release
43
+ ```text
44
+ /flow:fix "BUG-123|描述"系统化调试与修复
56
45
  ```
57
46
 
58
- ### 🐛 Bug 修复工作流
47
+ ### Deprecated Migrations (keep for compatibility)
59
48
 
49
+ ```text
50
+ /flow:new → /flow:init → /flow:spec → /flow:dev → /flow:verify → /flow:release
51
+ /flow:clarify → merged into /flow:spec
52
+ /flow:checklist → merged into /flow:verify --strict
53
+ /flow:quality → merged into /flow:verify
60
54
  ```
61
- /flow:fix "BUG-123|描述" → 系统化调试 (4阶段: Root Cause → Pattern → Hypothesis → TDD Fix)
62
- ```
63
-
64
- **说明**:
65
- - `/flow:spec` 是统一规格命令,合并 PRD/Tech/UI/Epic 为单一命令
66
- - `/flow:spec` 内部并行执行 Tech + UI,减少 ~35% 设计阶段时间
67
- - `/flow:dev` 默认 Autonomous 模式(自动重试),使用 `--manual` 退出到 Manual 模式
68
55
 
69
- ## Agent Delegation Guide
56
+ ## Routing Guide
70
57
 
71
- ### When User Asks About Unified Specification
72
- - **DO**: Recommend `/flow:spec` command → orchestrates prd-writer + tech-architect + ui-designer + planner
73
- - **Link**: See `.claude/skills/workflow/flow-spec/SKILL.md` for details
74
- - **Modes**: Full (default), Quick (--skip-tech --skip-ui), Backend (--skip-ui), Frontend (--skip-tech)
58
+ ### Requirement kickoff
59
+ - Recommend: `/flow:init "REQ-123|Title|URLs?"`
60
+ - Then: `/flow:spec "REQ-123"`
75
61
 
76
- ### When User Asks About Requirements Clarification
77
- - **DO**: Recommend `/flow:clarify` command → invokes clarify-analyst agent
78
- - **Link**: See `.claude/commands/flow/clarify.md` for details
62
+ ### Planning/specification questions
63
+ - Recommend: `/flow:spec`
64
+ - Notes: this is the unified planning stage for executable task-manifest generation.
79
65
 
80
- ### When User Asks About PRD/Tech/UI/Epic
81
- - **DO**: Recommend `/flow:spec` command (unified)
82
- - **Link**: See `.claude/agents/prd-writer.md`, `tech-architect.md`, `ui-designer.md`, `planner.md` for agent details
66
+ ### Development execution / interrupted execution
67
+ - Recommend: `/flow:dev "REQ-123"`
68
+ - If interrupted/failed: `/flow:dev "REQ-123" --resume`
83
69
 
84
- ### When User Asks About QA/Security
85
- - **DO**: Recommend `/flow:quality` command → invokes qa-tester + security-reviewer agents
86
- - **Link**: See `.claude/agents/qa-tester.md` for QA details
70
+ ### QA/security/release readiness
71
+ - Recommend: `/flow:verify "REQ-123"`
72
+ - Strict gate: `/flow:verify "REQ-123" --strict`
87
73
 
88
- ### When User Asks About Code Review
89
- - **DO**: Recommend `/flow:review` command → invokes spec-reviewer + code-quality-reviewer agents
90
- - **Link**: See `.claude/commands/flow/review.md` for details
74
+ ### Release
75
+ - Recommend: `/flow:release "REQ-123"`
76
+ - Release is blocked when report-card overall is fail.
91
77
 
92
- ### When User Asks About Bug Fix
93
- - **DO**: Recommend `/flow:fix` command → 4-phase systematic debugging
94
- - **Link**: See `.claude/commands/flow/fix.md` for details
78
+ ### Code review requests
79
+ - Recommend: `/flow:verify "REQ-123" --strict`
80
+ - Optional deep review: `/util:code-review "<diff>"`
95
81
 
96
82
  ## Phase Gates (Quick Reference)
97
83
 
98
84
  ### Entry Gates
99
- - **flow:init Entry**: Git 工作区干净, main 分支
100
- - **flow:clarify Entry**: research.md 存在, phase0_complete == true
101
- - **flow:spec Entry**: BRAINSTORM.md 存在, research.md TODO placeholder
102
- - **flow:dev Entry**: EPIC.md + TASKS.md 存在
103
- - **flow:quality Entry**: development_complete == true
104
- - **flow:release Entry**: quality_complete == true
85
+ - `flow:init`: repository and requirement id are valid.
86
+ - `flow:spec`: `context-package.md` and `harness-state.json` exist.
87
+ - `flow:dev`: `task-manifest.json` exists and is schema-valid.
88
+ - `flow:verify`: task dispatch completed or at least one dispatch/resume run exists.
89
+ - `flow:release`: `report-card.json.overall == pass`.
105
90
 
106
91
  ### Exit Gates
107
- - **flow:init Exit**: research.md 5-level quality check, BRAINSTORM.md 完整
108
- - **flow:spec Exit**: PRD.md + EPIC.md + TASKS.md 完整, TDD 顺序正确
109
- - **flow:dev Exit**: 所有 TASKS 完成, TDD Checkpoint 通过
110
- - **flow:quality Exit**: high-severity 漏洞
111
- - **flow:release Exit**: PR 创建成功
92
+ - `flow:init`: requirement context packaged.
93
+ - `flow:spec`: task-manifest generated.
94
+ - `flow:dev`: task statuses updated with runtime checkpoints/events.
95
+ - `flow:verify`: report-card emitted (quick/strict/review sections).
96
+ - `flow:release`: release note generated and harness state marked released.
112
97
 
113
- ## State Machine: Status → Recommended Command
98
+ ## State → Recommended Command
114
99
 
115
100
  ```yaml
116
- status: "initialized"
117
- → Recommend: /flow:spec (统一规格阶段)
118
- → Alternative: /flow:clarify (optional)
101
+ no_requirement_context:
102
+ recommend: /flow:init
119
103
 
120
- status: "clarify_complete" OR "clarify_skipped"
121
- → Recommend: /flow:spec
104
+ initialized_or_context_packed:
105
+ recommend: /flow:spec
122
106
 
123
- status: "spec_complete"
124
- → Recommend: /flow:dev (TDD development, Autonomous mode default)
107
+ manifest_exists_with_pending_or_failed:
108
+ recommend: /flow:dev
109
+ alternative: /flow:dev --resume
125
110
 
126
- status: "development_complete"
127
- → Recommend: /flow:quality
111
+ manifest_all_passed_without_report_card:
112
+ recommend: /flow:verify --strict
128
113
 
129
- status: "quality_complete"
130
- → Recommend: /flow:release
114
+ report_card_fail:
115
+ recommend: /flow:dev --resume
116
+ then: /flow:verify --strict
131
117
 
132
- status: "released"
133
- → Recommend: /flow:verify (final consistency check)
118
+ report_card_pass:
119
+ recommend: /flow:release
120
+
121
+ released:
122
+ recommend: /flow:archive (optional)
134
123
  ```
135
124
 
136
125
  ## Auxiliary Commands
137
126
 
138
- ### Status and Progress
139
- - `/flow:status` - Query requirement progress
140
- - `/flow:update "REQ-123" "T012"` - Update task completion
141
- - `/flow:restart "REQ-123" --from=spec` - Resume interrupted workflow
142
-
143
- ### Upgrade and Analysis
144
- - `/flow:upgrade "REQ-123" --analyze` - PRD version upgrade impact analysis
145
- - `/flow:constitution` - Constitution management
146
- - `/flow:verify "REQ-123"` - Comprehensive consistency verification
147
-
148
- ### Bug Fix
149
- - `/flow:fix "BUG-123|描述"` - 系统化 BUG 修复
150
- - `/util:problem-analyzer "<issue>"` - Problem diagnosis
127
+ ### Progress and recovery
128
+ - `/flow:status` - query requirement progress
129
+ - `/flow:update "REQ-123" "T012"` - update task progress
130
+ - `/flow:restart "REQ-123" --from=dev` - recover interrupted workflow state
151
131
 
152
- ### Code Review
153
- - `/flow:review "REQ-123"` - Two-Stage Code Review
154
- - `/util:code-review "<diff>"` - High-rigor code review
132
+ ### Upgrade and governance
133
+ - `/flow:upgrade "REQ-123" --analyze` - PRD version impact analysis
134
+ - `/flow:constitution` - constitution governance
135
+ - `/flow:verify "REQ-123"` - consistency and quality verification
155
136
 
156
137
  ## Design Principle
157
138
 
158
- **This skill ONLY contains**:
159
- - Workflow routing (which command to run next)
160
- - Agent delegation (which agent handles what)
161
- - Quick reference (Phase Gates summary)
162
- - ✅ Links to detailed documentation
139
+ This skill only does routing:
140
+ - Which command to run next
141
+ - Which gate blocks progress
142
+ - Which migration path applies for deprecated commands
163
143
 
164
- **Rationale**: Avoid duplication. Agents and Commands own detailed standards.
144
+ Detailed quality standards stay in command files and workflow skills.
@@ -0,0 +1,24 @@
1
+ # workflow/
2
+ > L2 | 父级: /Users/dimon/001Area/80-CodeWorld/002-devflow/cc-devflow/.claude/CLAUDE.md
3
+
4
+ 成员清单
5
+ flow-init/SKILL.md: 需求初始化入口,调用 harness:init + harness:pack。
6
+ flow-init/context.jsonl: flow-init 的上下文注入定义。
7
+ flow-spec/SKILL.md: 计划生成入口,调用 harness:plan 产出 task-manifest。
8
+ flow-spec/context.jsonl: flow-spec 的上下文注入定义。
9
+ flow-spec/team-config.json: 旧 Team 配置资产(兼容保留,当前主链不依赖)。
10
+ flow-dev/SKILL.md: 执行入口,调用 harness:dispatch/resume 并写 checkpoint/events。
11
+ flow-dev/context.jsonl: flow-dev 的上下文注入定义。
12
+ flow-dev/dev-implementer.jsonl: 旧 dev-implementer 上下文(兼容保留)。
13
+ flow-verify/SKILL.md: 质量门禁入口,调用 harness:verify 输出 report-card。
14
+ flow-verify/context.jsonl: flow-verify 的上下文注入定义。
15
+ flow-release/SKILL.md: 发布入口,调用 harness:release + harness:janitor。
16
+ flow-release/context.jsonl: flow-release 的上下文注入定义。
17
+ flow-quality/SKILL.md: 旧质量流程技能(迁移过渡保留)。
18
+ flow-quality/context.jsonl: 旧质量流程上下文(迁移过渡保留)。
19
+ flow-fix/SKILL.md: Bug 修复流程技能。
20
+ flow-fix/context.jsonl: flow-fix 的上下文注入定义。
21
+
22
+ 法则: 成员完整·一行一文件·父级链接·技术词前置
23
+
24
+ [PROTOCOL]: 变更时更新此头部,然后检查 CLAUDE.md
@@ -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"}