cc-devflow 2.4.3 → 2.4.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.
- package/.claude/CLAUDE.md +3 -2
- package/.claude/agents/bug-analyzer.md +0 -1
- package/.claude/agents/compatibility-checker.md +0 -1
- package/.claude/agents/flow-researcher.md +132 -0
- package/.claude/agents/impact-analyzer.md +0 -1
- package/.claude/commands/flow-fix.md +1 -1
- package/.claude/commands/flow-init.md +33 -65
- package/.claude/commands/flow-new.md +2 -3
- package/.claude/commands/git-commit.md +425 -0
- package/.claude/docs/guides/NEW_TROUBLESHOOTING.md +4 -4
- package/.claude/docs/templates/INIT_FLOW_TEMPLATE.md +17 -40
- package/.claude/docs/templates/NEW_ORCHESTRATION_TEMPLATE.md +2 -3
- package/.claude/rules/devflow-conventions.md +3 -6
- package/.claude/scripts/generate-status-report.sh +7 -7
- package/.claude/scripts/populate-research-tasks.sh +63 -38
- package/.claude/scripts/recover-workflow.sh +18 -12
- package/.claude/skills/npm-release/SKILL.md +314 -0
- package/.claude/skills/writing-skills/SKILL.md +655 -0
- package/.claude/skills/writing-skills/anthropic-best-practices.md +1150 -0
- package/.claude/skills/writing-skills/examples/CLAUDE_MD_TESTING.md +189 -0
- package/.claude/skills/writing-skills/graphviz-conventions.dot +172 -0
- package/.claude/skills/writing-skills/persuasion-principles.md +187 -0
- package/.claude/skills/writing-skills/render-graphs.js +168 -0
- package/.claude/skills/writing-skills/testing-skills-with-subagents.md +384 -0
- package/CHANGELOG.md +76 -0
- package/README.md +12 -0
- package/README.zh-CN.md +12 -0
- package/docs/commands/flow-init.md +14 -10
- package/docs/commands/flow-init.zh-CN.md +12 -8
- package/package.json +2 -2
- package/.claude/tsc-cache/6e64f818-6398-49ca-8623-581a9af85c44/edited-files.log +0 -1
- package/.claude/tsc-cache/777aa1de-497e-411b-a40f-13b74efcec58/edited-files.log +0 -2
- package/.claude/tsc-cache/795ba6e3-b98a-423b-bab2-51aa62812569/edited-files.log +0 -1
- package/.claude/tsc-cache/ae335694-be5a-4ba4-a1a0-b676c09a7906/edited-files.log +0 -1
package/.claude/CLAUDE.md
CHANGED
|
@@ -10,6 +10,7 @@ This directory contains Claude Code CLI extensions for the CC-DevFlow developmen
|
|
|
10
10
|
├── agents/ # Agent instruction files (research-type, invoked by commands)
|
|
11
11
|
│ ├── checklist-agent.md # Checklist generation logic [NEW: REQ-002]
|
|
12
12
|
│ ├── clarify-analyst.md # Requirements clarification
|
|
13
|
+
│ ├── flow-researcher.md # /flow-init mandatory research runner (subagent; file-based memory)
|
|
13
14
|
│ ├── prd-writer.md # PRD generation
|
|
14
15
|
│ ├── tech-architect.md # Technical design
|
|
15
16
|
│ ├── planner.md # EPIC/TASKS planning
|
|
@@ -19,7 +20,7 @@ This directory contains Claude Code CLI extensions for the CC-DevFlow developmen
|
|
|
19
20
|
│
|
|
20
21
|
├── commands/ # Slash command definitions
|
|
21
22
|
│ ├── flow-checklist.md # /flow-checklist command [NEW: REQ-002]
|
|
22
|
-
│ ├── flow-init.md # /flow-init (modified:
|
|
23
|
+
│ ├── flow-init.md # /flow-init (modified: research delegated to flow-researcher subagent)
|
|
23
24
|
│ ├── flow-clarify.md # /flow-clarify
|
|
24
25
|
│ ├── flow-prd.md # /flow-prd
|
|
25
26
|
│ ├── flow-tech.md # /flow-tech
|
|
@@ -132,7 +133,7 @@ Combine Ralph-Wiggum's autonomous iteration loop with Manus-style Planning-with-
|
|
|
132
133
|
|
|
133
134
|
**Modified Files**:
|
|
134
135
|
- `commands/flow-dev.md` - Merged Ralph Loop (Autonomous by default)
|
|
135
|
-
- `commands/flow-init.md` -
|
|
136
|
+
- `commands/flow-init.md` - Research made mandatory via `flow-researcher` subagent (context-isolated)
|
|
136
137
|
- `skills/cc-devflow-orchestrator/SKILL.md` - Updated routing for autonomous flow
|
|
137
138
|
|
|
138
139
|
### Attention Refresh Protocols
|
|
@@ -25,7 +25,6 @@ You MUST follow these rules during BUG analysis:
|
|
|
25
25
|
2. **Agent Coordination**:
|
|
26
26
|
- Update status in orchestration_status.json when analysis begins and completes
|
|
27
27
|
- Implement proper error handling for unclear BUG symptoms
|
|
28
|
-
- Create analysis completion markers (.completed files)
|
|
29
28
|
- Avoid file locks (read-only agent - only generate documents)
|
|
30
29
|
|
|
31
30
|
3. **DateTime Handling**:
|
|
@@ -25,7 +25,6 @@ You MUST follow these rules during compatibility analysis:
|
|
|
25
25
|
|
|
26
26
|
2. **Agent Coordination**:
|
|
27
27
|
- Update orchestration_status.json when analysis begins/completes
|
|
28
|
-
- Create completion markers (.completed files) after successful analysis
|
|
29
28
|
- Coordinate with impact-analyzer for change assessment
|
|
30
29
|
- Research-only agent: no file modifications, only document generation
|
|
31
30
|
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: flow-researcher
|
|
3
|
+
description: Executes mandatory /flow-init deep research using MCP services (Context7/WebSearch/WebFetch) with file-based memory. Produces research artifacts under devflow/requirements/$REQ_ID/research/ and returns only a short summary + file paths (no long pastes).
|
|
4
|
+
tools: Read, Write, Grep, Glob, WebFetch, WebSearch, mcp__context7__resolve-library-id, mcp__context7__get-library-docs
|
|
5
|
+
model: inherit
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
You are a requirement research runner invoked by `/flow-init`.
|
|
9
|
+
|
|
10
|
+
Your job is to do **research work** without exhausting the main session context:
|
|
11
|
+
- Put large content into files under `devflow/requirements/$REQ_ID/research/`
|
|
12
|
+
- Return only a **short** summary + **paths**, never paste long docs into chat
|
|
13
|
+
|
|
14
|
+
## MCP Research Requirement
|
|
15
|
+
|
|
16
|
+
This agent MUST use **MCP services** to fetch external materials for deep research:
|
|
17
|
+
- **Context7 MCP**: official documentation for detected frameworks/libraries (`mcp__context7__resolve-library-id` + `mcp__context7__get-library-docs`)
|
|
18
|
+
- **WebSearch + WebFetch**: tutorials, guides, examples, case studies, and plan URLs
|
|
19
|
+
|
|
20
|
+
All fetched content MUST be written to `research/mcp/YYYYMMDD/**` (not pasted into chat).
|
|
21
|
+
|
|
22
|
+
## Hard Rules
|
|
23
|
+
|
|
24
|
+
1. **NO USER INTERACTION**
|
|
25
|
+
- Never ask the user questions.
|
|
26
|
+
- If information is missing, record it under `## Unresolved Questions` in `research/research-summary.md`.
|
|
27
|
+
|
|
28
|
+
2. **FILE-BASED MEMORY (MANDATORY)**
|
|
29
|
+
- Any fetched/long content must be written to files in `research/`.
|
|
30
|
+
- Chat output must stay small (decision bullets + file paths).
|
|
31
|
+
|
|
32
|
+
3. **NO PLACEHOLDERS**
|
|
33
|
+
- Do not leave `TODO`, `FIXME`, `{{PLACEHOLDER}}`.
|
|
34
|
+
- Ensure `validate-research.sh --strict` passes.
|
|
35
|
+
|
|
36
|
+
4. **TRACEABILITY**
|
|
37
|
+
- Every decision must include a concrete `Source` (file path + section/line if possible).
|
|
38
|
+
|
|
39
|
+
## Input Contract (provided via prompt)
|
|
40
|
+
|
|
41
|
+
You will receive a JSON payload in the prompt:
|
|
42
|
+
|
|
43
|
+
```json
|
|
44
|
+
{
|
|
45
|
+
"reqId": "REQ-123",
|
|
46
|
+
"reqDir": "devflow/requirements/REQ-123",
|
|
47
|
+
"title": "User Authentication",
|
|
48
|
+
"planUrls": ["https://..."],
|
|
49
|
+
"contextFiles": {
|
|
50
|
+
"brainstorm": "devflow/requirements/REQ-123/BRAINSTORM.md",
|
|
51
|
+
"roadmap": "devflow/ROADMAP.md",
|
|
52
|
+
"architecture": "devflow/ARCHITECTURE.md"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Required Outputs (MUST create/update)
|
|
58
|
+
|
|
59
|
+
Under `${reqDir}/research/`:
|
|
60
|
+
- `internal/codebase-overview.md`
|
|
61
|
+
- `mcp/YYYYMMDD/official/*.md` (if applicable)
|
|
62
|
+
- `mcp/YYYYMMDD/guides/*.md` (if applicable)
|
|
63
|
+
- `mcp/YYYYMMDD/tutorials/*.md` (if applicable)
|
|
64
|
+
- `mcp/YYYYMMDD/examples/*.md` (if applicable)
|
|
65
|
+
- `research-summary.md` (human-readable decisions)
|
|
66
|
+
- `tasks.json` (decision/rationale/alternatives filled)
|
|
67
|
+
- `research.md` (consolidated, Decision/Rationale/Alternatives format)
|
|
68
|
+
|
|
69
|
+
## Execution Procedure (follow in order)
|
|
70
|
+
|
|
71
|
+
### Step 1: Validate Paths & Prepare Directories
|
|
72
|
+
- Ensure `${reqDir}` exists.
|
|
73
|
+
- Ensure `${reqDir}/research/` exists, create missing subfolders:
|
|
74
|
+
- `research/internal/`
|
|
75
|
+
- `research/mcp/YYYYMMDD/{official,guides,tutorials,examples}/`
|
|
76
|
+
- Read `${reqDir}/BRAINSTORM.md` and `${reqDir}/README.md` if present.
|
|
77
|
+
|
|
78
|
+
### Step 2: Internal Codebase Research (S0)
|
|
79
|
+
Goal: produce a **useful** `research/internal/codebase-overview.md` with:
|
|
80
|
+
- Repo tech stack snapshot (from `package.json`, lockfiles, etc.)
|
|
81
|
+
- Relevant modules/entry points you will likely touch
|
|
82
|
+
- Existing patterns for auth/data validation/error handling/tests
|
|
83
|
+
- Constraints you must not violate (existing conventions, CI, tooling)
|
|
84
|
+
|
|
85
|
+
### Step 3: External Research (Task 1-5)
|
|
86
|
+
Do not paste docs into chat; store them as files.
|
|
87
|
+
|
|
88
|
+
1) **Official docs (Context7 MCP)** for the detected key libraries/frameworks
|
|
89
|
+
2) **Tutorials/guides (WebSearch + WebFetch)** for practical patterns
|
|
90
|
+
3) **Examples/case studies (WebSearch + WebFetch)** similar to this requirement
|
|
91
|
+
4) Write short per-source notes at top of each saved file:
|
|
92
|
+
- What it answers
|
|
93
|
+
- What it recommends
|
|
94
|
+
- Any caveats
|
|
95
|
+
|
|
96
|
+
If planUrls exist:
|
|
97
|
+
- Fetch each URL and store content under `research/mcp/YYYYMMDD/guides/plan-*.md` (or `tutorials/` if more appropriate).
|
|
98
|
+
|
|
99
|
+
### Step 4: Write `research/research-summary.md`
|
|
100
|
+
Use `.claude/docs/templates/RESEARCH_TEMPLATE.md` as the format baseline.
|
|
101
|
+
- Create **at least 3** Decision blocks `### R001`, `### R002`, `### R003`.
|
|
102
|
+
- Each decision must cite sources under `research/` (internal or external).
|
|
103
|
+
- Add unresolved questions only when genuinely blocked.
|
|
104
|
+
|
|
105
|
+
### Step 5: Generate & Fill `tasks.json`
|
|
106
|
+
- Run:
|
|
107
|
+
- `bash .claude/scripts/generate-research-tasks.sh "${reqDir}"`
|
|
108
|
+
- Ensure `tasks.json` contains at least **1** task.
|
|
109
|
+
- If the generator produced 0 tasks, append baseline tasks matching your decision blocks (`R001..R003`).
|
|
110
|
+
- Fill each task's `decision`, `rationale`, `alternatives` based on `research-summary.md`.
|
|
111
|
+
- Prefer using `bash .claude/scripts/populate-research-tasks.sh "${reqDir}"` if it matches the ID format.
|
|
112
|
+
|
|
113
|
+
### Step 6: Consolidate & Validate
|
|
114
|
+
- Run:
|
|
115
|
+
- `bash .claude/scripts/consolidate-research.sh "${reqDir}"`
|
|
116
|
+
- `bash .claude/scripts/validate-research.sh "${reqDir}" --strict`
|
|
117
|
+
- If validation fails:
|
|
118
|
+
- Fix the files (do not weaken validation).
|
|
119
|
+
- Re-run validation until it passes.
|
|
120
|
+
|
|
121
|
+
## Return Format (chat output)
|
|
122
|
+
|
|
123
|
+
Return ONLY:
|
|
124
|
+
- 3–6 bullet decisions (R001..), one line each
|
|
125
|
+
- Paths created/updated
|
|
126
|
+
- Any unresolved questions (≤5)
|
|
127
|
+
|
|
128
|
+
Never paste long fetched content.
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
**[PROTOCOL]**: 变更时更新此头部,然后检查 CLAUDE.md
|
|
@@ -24,7 +24,6 @@ You MUST follow these rules during impact analysis:
|
|
|
24
24
|
|
|
25
25
|
2. **Agent Coordination**:
|
|
26
26
|
- Update orchestration_status.json when analysis begins/completes
|
|
27
|
-
- Create completion markers (.completed files) after analysis
|
|
28
27
|
- Research-only agent: no code modifications, only analysis documents
|
|
29
28
|
- Coordinate with compatibility-checker for version management
|
|
30
29
|
|
|
@@ -219,85 +219,53 @@ Red Flags - STOP:
|
|
|
219
219
|
|
|
220
220
|
---
|
|
221
221
|
|
|
222
|
-
### Stage 2.5: Research (
|
|
222
|
+
### Stage 2.5: Research (Subagent Mandatory)
|
|
223
223
|
|
|
224
|
-
**目标**:
|
|
224
|
+
**目标**: 研究默认必跑,但将“研究型内容”隔离到 subagent,避免主会话上下文耗尽。
|
|
225
225
|
|
|
226
|
-
**
|
|
226
|
+
**Iron Law**: 大内容落盘,主会话只返回「决策摘要 + 文件路径」。
|
|
227
227
|
|
|
228
|
-
|
|
229
|
-
原则 1: 大内容存文件
|
|
230
|
-
→ 抓取的文档存 research/mcp/$(date +%Y%m%d)/
|
|
231
|
-
→ 上下文只保留路径引用
|
|
232
|
-
→ 避免塞满上下文窗口
|
|
233
|
-
|
|
234
|
-
原则 2: 决策前读取
|
|
235
|
-
→ 每次做研究决策前,先读 research/research.md Decisions 章节
|
|
236
|
-
→ 确保不重复已有决策
|
|
237
|
-
→ 注意力刷新,目标回到窗口
|
|
238
|
-
|
|
239
|
-
原则 3: 失败尝试记录
|
|
240
|
-
→ 研究中放弃的方案写入 research/attempts/
|
|
241
|
-
→ 说明放弃原因和学习(见 ATTEMPT_TEMPLATE 格式)
|
|
242
|
-
→ 失败是学习数据,不要隐藏
|
|
243
|
-
|
|
244
|
-
原则 4: 增量追加
|
|
245
|
-
→ 使用 append 而非 rewrite
|
|
246
|
-
→ 保持研究历史完整
|
|
247
|
-
→ 避免覆盖已有信息
|
|
248
|
-
```
|
|
249
|
-
|
|
250
|
-
```
|
|
251
|
-
S0: Internal Codebase Research (必需)
|
|
252
|
-
→ 分析现有代码库,生成 research/internal/codebase-overview.md
|
|
228
|
+
#### ✅ Mandatory: Call `flow-researcher` Subagent
|
|
253
229
|
|
|
254
|
-
|
|
255
|
-
1. Official Documentation (Context7)
|
|
256
|
-
2. Domain Tutorials (Web Search)
|
|
257
|
-
3. Core Materials (WebFetch)
|
|
258
|
-
4. Case Studies/Examples (Web Search + WebFetch)
|
|
259
|
-
5. Summary & Recommendations
|
|
230
|
+
> subagent 负责内部/外部研究、落盘、任务回填、研究整合与质量验证;主 agent 只做编排与最终 Gate。
|
|
260
231
|
|
|
261
|
-
|
|
232
|
+
```
|
|
233
|
+
Task tool call:
|
|
234
|
+
description: "Run mandatory research for /flow-init (file-based memory)"
|
|
235
|
+
subagent_type: "flow-researcher"
|
|
236
|
+
model: "inherit"
|
|
237
|
+
prompt: (JSON)
|
|
238
|
+
{
|
|
239
|
+
"reqId": "${REQ_ID}",
|
|
240
|
+
"reqDir": "devflow/requirements/${REQ_ID}",
|
|
241
|
+
"title": "${TITLE}",
|
|
242
|
+
"planUrls": ["..."],
|
|
243
|
+
"contextFiles": {
|
|
244
|
+
"brainstorm": "devflow/requirements/${REQ_ID}/BRAINSTORM.md",
|
|
245
|
+
"roadmap": "devflow/ROADMAP.md",
|
|
246
|
+
"architecture": "devflow/ARCHITECTURE.md"
|
|
247
|
+
}
|
|
248
|
+
}
|
|
262
249
|
```
|
|
263
250
|
|
|
264
|
-
|
|
265
|
-
- `research/internal/codebase-overview.md`
|
|
266
|
-
- `research/mcp/$(date +%Y%m%d)
|
|
267
|
-
- `
|
|
268
|
-
- `research/
|
|
269
|
-
- `research/
|
|
270
|
-
- `research/research-summary.md`
|
|
251
|
+
**期望输出** (由 subagent 写入):
|
|
252
|
+
- `devflow/requirements/${REQ_ID}/research/internal/codebase-overview.md`
|
|
253
|
+
- `devflow/requirements/${REQ_ID}/research/mcp/$(date +%Y%m%d)/**`
|
|
254
|
+
- `devflow/requirements/${REQ_ID}/research/research-summary.md`
|
|
255
|
+
- `devflow/requirements/${REQ_ID}/research/tasks.json` (decision/rationale/alternatives 完整)
|
|
256
|
+
- `devflow/requirements/${REQ_ID}/research/research.md` (可通过 validate-research)
|
|
271
257
|
|
|
272
258
|
---
|
|
273
259
|
|
|
274
260
|
### Stage 2.6: Research Consolidation
|
|
275
261
|
|
|
276
|
-
|
|
277
|
-
研究决策整合:
|
|
278
|
-
1. Generate research tasks
|
|
279
|
-
→ Run: {SCRIPT:research_tasks} "${REQ_DIR}"
|
|
280
|
-
→ Output: research/tasks.json
|
|
281
|
-
|
|
282
|
-
2. Populate task decisions
|
|
283
|
-
→ Run: {SCRIPT:populate_tasks} "${REQ_DIR}"
|
|
284
|
-
→ Fill decision/rationale/alternatives from research
|
|
285
|
-
|
|
286
|
-
3. Consolidate research
|
|
287
|
-
→ Run: {SCRIPT:consolidate} "${REQ_DIR}"
|
|
288
|
-
→ Output: research/research.md
|
|
289
|
-
→ Format: Decision/Rationale/Alternatives/Source
|
|
262
|
+
> 该阶段由 `flow-researcher` subagent 执行(包含 tasks 生成/回填/整合/校验)。
|
|
290
263
|
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
→ 详见 {TEMPLATE:flow} Stage 2.6
|
|
295
|
-
```
|
|
264
|
+
主 agent 在 Exit Gate 中只做最终验证与状态更新:
|
|
265
|
+
- Run: `{SCRIPT:validate_research} "${REQ_DIR}" --strict`
|
|
266
|
+
- `orchestration_status.json.phase0_complete = true`
|
|
296
267
|
|
|
297
268
|
---
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
269
|
### Stage 3: README Generation
|
|
302
270
|
|
|
303
271
|
```
|
|
@@ -317,7 +285,7 @@ Level 1: File Existence Check
|
|
|
317
285
|
→ 验证所有必需文件已创建
|
|
318
286
|
|
|
319
287
|
Level 2: Research.md Structure Validation
|
|
320
|
-
→ Run: {SCRIPT:validate_research} "${REQ_DIR}"
|
|
288
|
+
→ Run: {SCRIPT:validate_research} "${REQ_DIR}" --strict
|
|
321
289
|
→ 检查 research.md 结构
|
|
322
290
|
|
|
323
291
|
Level 3: Research.md Content Quality
|
|
@@ -239,7 +239,7 @@ $ARGUMENTS = "REQ_ID|TITLE|PLAN_URLS?"
|
|
|
239
239
|
**输出**:
|
|
240
240
|
- 实现代码
|
|
241
241
|
- 测试代码
|
|
242
|
-
-
|
|
242
|
+
- TASKS.md 更新 (checkbox 标记)
|
|
243
243
|
- Git commits (每个任务一个)
|
|
244
244
|
|
|
245
245
|
---
|
|
@@ -349,8 +349,7 @@ devflow/requirements/${REQ_ID}/
|
|
|
349
349
|
├── contracts/openapi.yaml
|
|
350
350
|
├── quickstart.md
|
|
351
351
|
├── EPIC.md
|
|
352
|
-
├── TASKS.md (bite-sized)
|
|
353
|
-
├── tasks/*.completed
|
|
352
|
+
├── TASKS.md (bite-sized, checkbox 标记)
|
|
354
353
|
├── SPEC_REVIEW.md ⭐ v2.1.0 新增
|
|
355
354
|
├── CODE_QUALITY_REVIEW.md ⭐ v2.1.0 新增
|
|
356
355
|
├── TEST_PLAN.md + TEST_REPORT.md
|