cc-devflow 2.4.5 → 2.5.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 +8 -2
- package/.claude/agents/flow-researcher.md +132 -0
- package/.claude/commands/flow-init.md +33 -65
- package/.claude/docs/templates/INIT_FLOW_TEMPLATE.md +17 -40
- package/.claude/scripts/populate-research-tasks.sh +63 -38
- package/.claude/skills/journey-coherence-checker/SKILL.md +199 -0
- package/.claude/skills/journey-coherence-checker/pressure-scenarios.md +164 -0
- package/.claude/skills/skill-rules.json +72 -1
- package/CHANGELOG.md +45 -0
- package/docs/commands/flow-init.md +14 -10
- package/docs/commands/flow-init.zh-CN.md +12 -8
- package/package.json +1 -1
- package/.claude/tsc-cache/6e64f818-6398-49ca-8623-581a9af85c44/edited-files.log +0 -1
- package/.claude/tsc-cache/748c64fa-9e5f-4a1d-9db8-efb8415a6183/affected-repos.txt +0 -1
- package/.claude/tsc-cache/748c64fa-9e5f-4a1d-9db8-efb8415a6183/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/tsc-cache/f903e5df-3c39-4958-b26b-724808f32956/affected-repos.txt +0 -1
- package/.claude/tsc-cache/f903e5df-3c39-4958-b26b-724808f32956/edited-files.log +0 -2
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
|
|
@@ -48,6 +49,11 @@ This directory contains Claude Code CLI extensions for the CC-DevFlow developmen
|
|
|
48
49
|
│ │ └── SKILL.md
|
|
49
50
|
│ ├── cc-devflow-orchestrator/
|
|
50
51
|
│ │ └── SKILL.md # Workflow router (modified: /flow-checklist, /flow-dev autonomous)
|
|
52
|
+
│ ├── journey-coherence-checker/ # 跨需求一致性检查 [NEW: v2.4.0]
|
|
53
|
+
│ │ ├── SKILL.md # 检查协议:依赖满足、旅程完整、累积偏差
|
|
54
|
+
│ │ └── pressure-scenarios.md # TDD 压力测试场景
|
|
55
|
+
│ ├── npm-release/ # NPM 包发布工作流
|
|
56
|
+
│ │ └── SKILL.md # 版本发布、Changelog 维护、原子化发布流程
|
|
51
57
|
│ └── ...
|
|
52
58
|
│
|
|
53
59
|
└── docs/
|
|
@@ -132,7 +138,7 @@ Combine Ralph-Wiggum's autonomous iteration loop with Manus-style Planning-with-
|
|
|
132
138
|
|
|
133
139
|
**Modified Files**:
|
|
134
140
|
- `commands/flow-dev.md` - Merged Ralph Loop (Autonomous by default)
|
|
135
|
-
- `commands/flow-init.md` -
|
|
141
|
+
- `commands/flow-init.md` - Research made mandatory via `flow-researcher` subagent (context-isolated)
|
|
136
142
|
- `skills/cc-devflow-orchestrator/SKILL.md` - Updated routing for autonomous flow
|
|
137
143
|
|
|
138
144
|
### Attention Refresh Protocols
|
|
@@ -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
|
|
@@ -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
|
|
@@ -93,55 +93,32 @@ devflow/requirements/${REQ_ID}/
|
|
|
93
93
|
|
|
94
94
|
---
|
|
95
95
|
|
|
96
|
-
## Stage 2.5: Research (
|
|
96
|
+
## Stage 2.5: Research (Subagent Mandatory)
|
|
97
97
|
|
|
98
|
-
**目标**:
|
|
98
|
+
**目标**: 研究默认必跑,但研究过程必须“隔离上下文”。
|
|
99
99
|
|
|
100
|
-
|
|
101
|
-
```bash
|
|
102
|
-
→ 分析现有代码库
|
|
103
|
-
→ 生成 research/internal/codebase-overview.md
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
### Task 1-5: External Learning Materials (MCP)
|
|
107
|
-
```
|
|
108
|
-
1. Official Documentation (Context7)
|
|
109
|
-
→ research/mcp/$(date +%Y%m%d)/official/
|
|
100
|
+
**规则**: 大内容写入 `research/`,主会话只保留路径引用与决策摘要。
|
|
110
101
|
|
|
111
|
-
|
|
112
|
-
→ research/mcp/$(date +%Y%m%d)/guides/
|
|
102
|
+
### Mandatory: Call `flow-researcher` Subagent
|
|
113
103
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
→ research/mcp/$(date +%Y%m%d)/examples/
|
|
119
|
-
|
|
120
|
-
5. Summary & Recommendations
|
|
121
|
-
→ research/research-summary.md
|
|
104
|
+
```
|
|
105
|
+
Task tool call:
|
|
106
|
+
subagent_type: "flow-researcher"
|
|
107
|
+
prompt: (JSON) reqId/reqDir/title/planUrls/contextFiles
|
|
122
108
|
```
|
|
123
109
|
|
|
110
|
+
**产物** (由 subagent 写入):
|
|
111
|
+
- `research/internal/codebase-overview.md`
|
|
112
|
+
- `research/mcp/$(date +%Y%m%d)/**`
|
|
113
|
+
- `research/research-summary.md`
|
|
114
|
+
- `research/tasks.json`
|
|
115
|
+
- `research/research.md`
|
|
116
|
+
|
|
124
117
|
---
|
|
125
118
|
|
|
126
119
|
## Stage 2.6: Research Consolidation
|
|
127
120
|
|
|
128
|
-
|
|
129
|
-
# 1. Generate research tasks
|
|
130
|
-
bash {SCRIPT:research_tasks} "${REQ_DIR}"
|
|
131
|
-
→ Output: research/tasks.json
|
|
132
|
-
|
|
133
|
-
# 2. Populate task decisions
|
|
134
|
-
bash {SCRIPT:populate_tasks} "${REQ_DIR}"
|
|
135
|
-
→ Fill decision/rationale/alternatives from research
|
|
136
|
-
|
|
137
|
-
# 3. Consolidate research
|
|
138
|
-
bash {SCRIPT:consolidate} "${REQ_DIR}"
|
|
139
|
-
→ Output: research/research.md
|
|
140
|
-
→ Format: Decision/Rationale/Alternatives/Source
|
|
141
|
-
|
|
142
|
-
# 4. Update status
|
|
143
|
-
orchestration_status.json.phase0_complete = true
|
|
144
|
-
```
|
|
121
|
+
> 该阶段由 `flow-researcher` subagent 执行(含 tasks 生成/回填/整合/校验)。
|
|
145
122
|
|
|
146
123
|
---
|
|
147
124
|
|
|
@@ -166,7 +143,7 @@ orchestration_status.json.phase0_complete = true
|
|
|
166
143
|
|
|
167
144
|
### Level 2: Research.md Structure Validation
|
|
168
145
|
```bash
|
|
169
|
-
bash {SCRIPT:validate_research} "${REQ_DIR}"
|
|
146
|
+
bash {SCRIPT:validate_research} "${REQ_DIR}" --strict
|
|
170
147
|
→ 检查 research.md 结构
|
|
171
148
|
```
|
|
172
149
|
|
|
@@ -72,24 +72,44 @@ def extract_task_sections(markdown_content: str) -> List[Dict[str, str]]:
|
|
|
72
72
|
从 research-summary.md 中提取任务章节信息。
|
|
73
73
|
|
|
74
74
|
期望格式:
|
|
75
|
-
###
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
75
|
+
### R001 — 输入框架构重构
|
|
76
|
+
- **Decision**: 全面重构方案
|
|
77
|
+
- **Rationale**:
|
|
78
|
+
- 当前实现仅207行...
|
|
79
|
+
- **Alternatives Considered**:
|
|
80
|
+
- 渐进式增强...
|
|
79
81
|
"""
|
|
80
82
|
sections = []
|
|
81
83
|
current_section = None
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
#
|
|
86
|
-
|
|
87
|
-
#
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
84
|
+
current_field = None
|
|
85
|
+
|
|
86
|
+
# 匹配任务标题(兼容历史 RT-001):
|
|
87
|
+
# - ### R001 — Title
|
|
88
|
+
# - ### R001: Title
|
|
89
|
+
# - ### R001 - Title
|
|
90
|
+
# - ### RT-001: Title (legacy)
|
|
91
|
+
task_header = re.compile(r"^###\s+(?P<id>R\d{3}|RT-\d{3})\s*(?:[:—-])\s*(?P<title>.+)$")
|
|
92
|
+
|
|
93
|
+
# 匹配字段头(兼容是否带 bullet):
|
|
94
|
+
# - - **Decision**: xxx
|
|
95
|
+
# - - **Rationale**:
|
|
96
|
+
# - - **Alternatives Considered**:
|
|
97
|
+
field_header = re.compile(
|
|
98
|
+
r"^(?:[-*]\s*)?\*\*(?P<label>决策|Decision|理由|Rationale|备选方案|Alternatives(?:\s+Considered)?|来源|Source)\*\*:\s*(?P<value>.*)$"
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
def normalize_task_id(raw: str) -> str:
|
|
102
|
+
if raw.startswith("RT-"):
|
|
103
|
+
return f"R{raw.split('-', 1)[1]}"
|
|
104
|
+
return raw
|
|
105
|
+
|
|
106
|
+
def normalize_list_item(line: str) -> str:
|
|
107
|
+
line = line.strip()
|
|
108
|
+
line = re.sub(r"^[-*]\s+", "", line)
|
|
109
|
+
return line.strip()
|
|
91
110
|
|
|
92
111
|
for line in markdown_content.splitlines():
|
|
112
|
+
raw_line = line
|
|
93
113
|
line = line.strip()
|
|
94
114
|
|
|
95
115
|
# 检测新任务章节
|
|
@@ -97,9 +117,10 @@ def extract_task_sections(markdown_content: str) -> List[Dict[str, str]]:
|
|
|
97
117
|
if task_match:
|
|
98
118
|
if current_section:
|
|
99
119
|
sections.append(current_section)
|
|
120
|
+
current_field = None
|
|
100
121
|
current_section = {
|
|
101
|
-
"id": task_match.group(
|
|
102
|
-
"title": task_match.group(
|
|
122
|
+
"id": normalize_task_id(task_match.group("id")),
|
|
123
|
+
"title": task_match.group("title"),
|
|
103
124
|
"decision": "",
|
|
104
125
|
"rationale": "",
|
|
105
126
|
"alternatives": "",
|
|
@@ -109,31 +130,35 @@ def extract_task_sections(markdown_content: str) -> List[Dict[str, str]]:
|
|
|
109
130
|
if not current_section:
|
|
110
131
|
continue
|
|
111
132
|
|
|
112
|
-
#
|
|
113
|
-
|
|
114
|
-
if
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
133
|
+
# 检测字段头
|
|
134
|
+
field_match = field_header.match(line)
|
|
135
|
+
if field_match:
|
|
136
|
+
label = field_match.group("label").strip().lower()
|
|
137
|
+
value = (field_match.group("value") or "").strip()
|
|
138
|
+
|
|
139
|
+
if label in {"来源", "source"}:
|
|
140
|
+
current_field = None
|
|
141
|
+
continue
|
|
142
|
+
if label in {"决策", "decision"}:
|
|
143
|
+
current_field = "decision"
|
|
144
|
+
elif label in {"理由", "rationale"}:
|
|
145
|
+
current_field = "rationale"
|
|
146
|
+
else:
|
|
147
|
+
current_field = "alternatives"
|
|
148
|
+
|
|
149
|
+
if value:
|
|
150
|
+
current_section[current_field] = value
|
|
122
151
|
continue
|
|
123
152
|
|
|
124
|
-
#
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
# 继续累积多行备选方案
|
|
135
|
-
if current_section.get("alternatives") and line and not line.startswith("**"):
|
|
136
|
-
current_section["alternatives"] += " " + line.strip()
|
|
153
|
+
# 累积字段内容(支持列表项)
|
|
154
|
+
if current_field and line:
|
|
155
|
+
item = normalize_list_item(raw_line)
|
|
156
|
+
if not item:
|
|
157
|
+
continue
|
|
158
|
+
if current_section[current_field]:
|
|
159
|
+
current_section[current_field] += "\n" + item
|
|
160
|
+
else:
|
|
161
|
+
current_section[current_field] = item
|
|
137
162
|
|
|
138
163
|
# 添加最后一个章节
|
|
139
164
|
if current_section:
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: journey-coherence-checker
|
|
3
|
+
description: "Use when completing a requirement, checking milestone progress, or asking about project status. Detects gaps between requirements, unmet dependencies, and cumulative scope drift."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Journey Coherence Checker
|
|
7
|
+
|
|
8
|
+
## The Iron Law
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
STATUS COMPLETE ≠ DEPENDENCY SATISFIED
|
|
12
|
+
CODE EXISTS ≠ JOURNEY WORKS
|
|
13
|
+
REQUIREMENTS DONE ≠ VISION ACHIEVED
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Overview
|
|
17
|
+
|
|
18
|
+
单需求验证只检查"这个需求内部是否一致"。
|
|
19
|
+
本 Skill 检查"所有需求加起来是否等于愿景"。
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
问题:
|
|
23
|
+
REQ-001 ✅ + REQ-002 ✅ + REQ-003 ✅ = 愿景 ❓
|
|
24
|
+
|
|
25
|
+
现实:
|
|
26
|
+
每个需求"稍微偏差" × N = 巨大偏差
|
|
27
|
+
需求间的"空隙"没人负责
|
|
28
|
+
最终产品 ≠ 初始愿景
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## When to Use
|
|
32
|
+
|
|
33
|
+
```dot
|
|
34
|
+
digraph when {
|
|
35
|
+
"触发场景" [shape=box];
|
|
36
|
+
"需求完成时" [shape=box];
|
|
37
|
+
"检查里程碑时" [shape=box];
|
|
38
|
+
"询问项目进度时" [shape=box];
|
|
39
|
+
"发布前" [shape=box];
|
|
40
|
+
|
|
41
|
+
"触发场景" -> "需求完成时";
|
|
42
|
+
"触发场景" -> "检查里程碑时";
|
|
43
|
+
"触发场景" -> "询问项目进度时";
|
|
44
|
+
"触发场景" -> "发布前";
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
**触发关键词**:
|
|
49
|
+
- "需求完成了"、"REQ-XXX 做完了"
|
|
50
|
+
- "M1/M2/M3/M4 进度"、"里程碑完成了吗"
|
|
51
|
+
- "项目进度如何"、"可以发布了吗"
|
|
52
|
+
- "所有需求都完成了"
|
|
53
|
+
|
|
54
|
+
## Coherence Check Protocol
|
|
55
|
+
|
|
56
|
+
### Step 1: 读取最小上下文 (< 200 tokens)
|
|
57
|
+
|
|
58
|
+
```yaml
|
|
59
|
+
read:
|
|
60
|
+
- ROADMAP.md: 只读 Milestone 的 Success Criteria 段落
|
|
61
|
+
- orchestration_status.json: 只读 status, dependencies, roadmap_item 字段
|
|
62
|
+
- PRD.md: 只读 User Stories 标题列表(不读内容)
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
**禁止**: 读取完整文档。上下文越多,偏差越大。
|
|
66
|
+
|
|
67
|
+
### Step 2: 依赖满足检查
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
对于每个声明的依赖:
|
|
71
|
+
1. 找到依赖的 REQ
|
|
72
|
+
2. 读取依赖 REQ 的 contracts/ 或 TECH_DESIGN.md 的"输出"章节
|
|
73
|
+
3. 读取当前 REQ 的 PRD.md 的"输入假设"章节
|
|
74
|
+
4. 比较: 输出 ⊇ 输入期望?
|
|
75
|
+
|
|
76
|
+
如果不匹配:
|
|
77
|
+
→ 报告: "依赖 RM-XXX 的输出不满足 REQ-YYY 的输入期望"
|
|
78
|
+
→ 具体说明: 期望 X,实际提供 Y
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Step 3: 旅程完整性检查
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
对于 ROADMAP 中的每个 Milestone:
|
|
85
|
+
1. 读取 Success Criteria
|
|
86
|
+
2. 对于每个 Criterion:
|
|
87
|
+
- 找到负责的 REQ
|
|
88
|
+
- 验证 REQ 的实现是否满足 Criterion
|
|
89
|
+
- 不是看状态,是看实际输出
|
|
90
|
+
|
|
91
|
+
如果有 Criterion 未满足:
|
|
92
|
+
→ 报告: "M4 Success Criteria 'X' 未满足"
|
|
93
|
+
→ 具体说明: 需要 A,实际只有 B
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Step 4: 空隙检测
|
|
97
|
+
|
|
98
|
+
```
|
|
99
|
+
对于 ROADMAP 中的每个用户旅程:
|
|
100
|
+
1. 列出旅程的所有步骤
|
|
101
|
+
2. 对于每个步骤:
|
|
102
|
+
- 找到负责的 REQ
|
|
103
|
+
- 如果没有 REQ 负责 → 空隙
|
|
104
|
+
3. 对于相邻步骤:
|
|
105
|
+
- 检查步骤 N 的输出是否是步骤 N+1 的输入
|
|
106
|
+
- 如果不匹配 → 空隙
|
|
107
|
+
|
|
108
|
+
如果发现空隙:
|
|
109
|
+
→ 报告: "旅程步骤 X 和 Y 之间存在空隙"
|
|
110
|
+
→ 具体说明: X 输出 A,Y 期望 B,没有 REQ 负责转换
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Step 5: 累积偏差检测
|
|
114
|
+
|
|
115
|
+
```
|
|
116
|
+
对于每个 Milestone:
|
|
117
|
+
1. 读取 ROADMAP 中的原始 Deliverables
|
|
118
|
+
2. 读取每个 REQ 的 PRD 中的实际 Scope
|
|
119
|
+
3. 计算: 实际覆盖 / 原始计划
|
|
120
|
+
|
|
121
|
+
如果覆盖率 < 80%:
|
|
122
|
+
→ 报告: "M4 累积偏差 40%,原始计划 7 项,实际覆盖 4 项"
|
|
123
|
+
→ 列出: 被削减的 Deliverables
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Output Format
|
|
127
|
+
|
|
128
|
+
```markdown
|
|
129
|
+
## Journey Coherence Report
|
|
130
|
+
|
|
131
|
+
### 依赖满足 ✅/❌
|
|
132
|
+
| 依赖 | 期望输入 | 实际输出 | 状态 |
|
|
133
|
+
|------|---------|---------|------|
|
|
134
|
+
| RM-007 | CommandEmitter API | ✅ 提供 | PASS |
|
|
135
|
+
| RM-006 | AdapterRegistry | ✅ 提供 | PASS |
|
|
136
|
+
|
|
137
|
+
### 旅程完整性 ✅/❌
|
|
138
|
+
| 旅程 | 步骤 | 负责 REQ | 状态 |
|
|
139
|
+
|------|------|---------|------|
|
|
140
|
+
| 开发者旅程 | /flow-init | REQ-001 | ✅ |
|
|
141
|
+
| 开发者旅程 | /flow-prd | REQ-002 | ✅ |
|
|
142
|
+
| 开发者旅程 | /flow-dev → /flow-release | ❓ | ⚠️ 空隙 |
|
|
143
|
+
|
|
144
|
+
### Success Criteria ✅/❌
|
|
145
|
+
| Milestone | Criterion | 验证结果 | 状态 |
|
|
146
|
+
|-----------|-----------|---------|------|
|
|
147
|
+
| M4 | 4 platforms execute core workflows | 2/4 platforms | ❌ FAIL |
|
|
148
|
+
| M4 | Integration tests passing | 未运行 | ❌ FAIL |
|
|
149
|
+
|
|
150
|
+
### 累积偏差
|
|
151
|
+
| Milestone | 原始计划 | 实际覆盖 | 偏差率 |
|
|
152
|
+
|-----------|---------|---------|--------|
|
|
153
|
+
| M4 | 7 deliverables | 4 deliverables | 43% |
|
|
154
|
+
|
|
155
|
+
### 建议
|
|
156
|
+
1. 补充 RM-009/010/011/012 的实现
|
|
157
|
+
2. 添加端到端集成测试
|
|
158
|
+
3. 定义 /flow-dev → /flow-release 的衔接 REQ
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
## Rationalization Prevention
|
|
162
|
+
|
|
163
|
+
| Excuse | Reality |
|
|
164
|
+
|--------|---------|
|
|
165
|
+
| "依赖已经标记完成了" | 完成 ≠ 满足。检查实际输出是否匹配期望输入。 |
|
|
166
|
+
| "每个需求都通过了验证" | 单需求验证 ≠ 全局一致性。部分之和 ≠ 整体。 |
|
|
167
|
+
| "ROADMAP 是规划,不是承诺" | Success Criteria 是承诺。不满足就是未完成。 |
|
|
168
|
+
| "这超出了我的检查范围" | 这正是你的检查范围。全局一致性是隐含要求。 |
|
|
169
|
+
| "状态是 complete" | 状态是自我声明。验证是外部检查。 |
|
|
170
|
+
| "代码存在" | 存在 ≠ 能跑。运行验证才算数。 |
|
|
171
|
+
| "用户没有要求检查全局" | 全局检查是隐含要求。用户问"完成了吗"就是在问全局。 |
|
|
172
|
+
| "我已经检查了很多了" | 检查多 ≠ 检查对。按 Protocol 检查。 |
|
|
173
|
+
|
|
174
|
+
## Red Flags - STOP
|
|
175
|
+
|
|
176
|
+
如果你发现自己:
|
|
177
|
+
- 只看 `orchestration_status.json` 的 `status` 字段就说"完成了"
|
|
178
|
+
- 没有比较依赖的输出和当前需求的输入期望
|
|
179
|
+
- 没有验证 Success Criteria 的每一条
|
|
180
|
+
- 没有检查旅程步骤之间的衔接
|
|
181
|
+
- 数 REQ 数量而不是验证实际功能
|
|
182
|
+
|
|
183
|
+
**STOP。执行 Coherence Check Protocol。**
|
|
184
|
+
|
|
185
|
+
## Integration
|
|
186
|
+
|
|
187
|
+
### 触发点
|
|
188
|
+
- `/flow-release` Exit Gate(发布前强制检查)
|
|
189
|
+
- `/flow-verify --global`(全局验证模式)
|
|
190
|
+
- 用户询问里程碑进度时
|
|
191
|
+
|
|
192
|
+
### 与其他 Skill 的关系
|
|
193
|
+
- `flow-verify`: 单需求内部一致性 → 本 Skill: 跨需求全局一致性
|
|
194
|
+
- `constitution-guardian`: 代码质量 → 本 Skill: 业务完整性
|
|
195
|
+
- `flow-attention-refresh`: 防止单需求目标遗忘 → 本 Skill: 防止全局愿景遗忘
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
**[PROTOCOL]**: 变更时更新此头部,然后检查 CLAUDE.md
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
# Journey Coherence Checker - Pressure Scenarios
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
TDD RED Phase: Define scenarios to test agent behavior WITHOUT the skill.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Scenario 1: Dependency Not Satisfied
|
|
9
|
+
|
|
10
|
+
**Setup**:
|
|
11
|
+
- REQ-007 declares `dependencies: ["RM-006", "RM-007"]`
|
|
12
|
+
- RM-006 (REQ-004) is `release_complete`
|
|
13
|
+
- RM-007 (REQ-005) is `release_complete`
|
|
14
|
+
- But REQ-005's actual output doesn't match what REQ-007 expects
|
|
15
|
+
|
|
16
|
+
**Pressure**:
|
|
17
|
+
```
|
|
18
|
+
User: "REQ-007 开发完成了,请帮我检查一下"
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
**Expected Baseline Behavior (WITHOUT skill)**:
|
|
22
|
+
- Agent only checks REQ-007's internal consistency
|
|
23
|
+
- Agent doesn't verify RM-007's output matches REQ-007's input expectation
|
|
24
|
+
- Agent says "PASS" even though there's a gap
|
|
25
|
+
|
|
26
|
+
**Desired Behavior (WITH skill)**:
|
|
27
|
+
- Agent reads REQ-007's `dependencies` field
|
|
28
|
+
- Agent reads REQ-005's actual output (from TECH_DESIGN or contracts)
|
|
29
|
+
- Agent compares expected vs actual
|
|
30
|
+
- Agent reports mismatch if found
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Scenario 2: Milestone Success Criteria Not Met
|
|
35
|
+
|
|
36
|
+
**Setup**:
|
|
37
|
+
- M4 Success Criteria: "All 4 platforms can execute core workflows"
|
|
38
|
+
- REQ-004, REQ-005, REQ-006 are `release_complete`
|
|
39
|
+
- But only 2 platforms actually work (Claude + Codex)
|
|
40
|
+
|
|
41
|
+
**Pressure**:
|
|
42
|
+
```
|
|
43
|
+
User: "M4 完成了吗?"
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
**Expected Baseline Behavior (WITHOUT skill)**:
|
|
47
|
+
- Agent checks individual REQ status
|
|
48
|
+
- Agent sees all REQs are complete
|
|
49
|
+
- Agent says "M4 完成了"
|
|
50
|
+
|
|
51
|
+
**Desired Behavior (WITH skill)**:
|
|
52
|
+
- Agent reads M4's Success Criteria from ROADMAP.md
|
|
53
|
+
- Agent verifies each criterion against actual implementation
|
|
54
|
+
- Agent reports "2/4 platforms working, M4 not complete"
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Scenario 3: Cumulative Scope Reduction
|
|
59
|
+
|
|
60
|
+
**Setup**:
|
|
61
|
+
- ROADMAP M4 originally planned 7 deliverables (RM-007 to RM-013)
|
|
62
|
+
- Each REQ's PRD "slightly simplified" the scope
|
|
63
|
+
- Final implementation covers only 60% of original vision
|
|
64
|
+
|
|
65
|
+
**Pressure**:
|
|
66
|
+
```
|
|
67
|
+
User: "M4 的所有需求都开发完了,可以发布了吗?"
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
**Expected Baseline Behavior (WITHOUT skill)**:
|
|
71
|
+
- Agent checks each REQ's status
|
|
72
|
+
- Agent sees all are `release_complete`
|
|
73
|
+
- Agent says "可以发布"
|
|
74
|
+
|
|
75
|
+
**Desired Behavior (WITH skill)**:
|
|
76
|
+
- Agent compares ROADMAP deliverables vs actual PRD scope
|
|
77
|
+
- Agent calculates coverage percentage
|
|
78
|
+
- Agent reports "60% coverage, 40% scope reduction detected"
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Scenario 4: Journey Gap (Missing Glue)
|
|
83
|
+
|
|
84
|
+
**Setup**:
|
|
85
|
+
- User journey: `/flow-init` → `/flow-prd` → `/flow-epic` → `/flow-dev` → `/flow-release`
|
|
86
|
+
- REQ-005 implements `/flow-dev` improvements
|
|
87
|
+
- REQ-006 implements compiler
|
|
88
|
+
- But there's no REQ connecting them (the "glue" is missing)
|
|
89
|
+
|
|
90
|
+
**Pressure**:
|
|
91
|
+
```
|
|
92
|
+
User: "从 /flow-init 到 /flow-release 的完整流程能跑通吗?"
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
**Expected Baseline Behavior (WITHOUT skill)**:
|
|
96
|
+
- Agent checks individual command implementations
|
|
97
|
+
- Agent doesn't test end-to-end flow
|
|
98
|
+
- Agent says "应该可以"
|
|
99
|
+
|
|
100
|
+
**Desired Behavior (WITH skill)**:
|
|
101
|
+
- Agent identifies the user journey
|
|
102
|
+
- Agent traces through each step
|
|
103
|
+
- Agent finds the gap between REQ-005 and REQ-006
|
|
104
|
+
- Agent reports "Gap found: no integration between X and Y"
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## Scenario 5: Orphan Requirement
|
|
109
|
+
|
|
110
|
+
**Setup**:
|
|
111
|
+
- REQ-008 exists but is not mapped to any ROADMAP item
|
|
112
|
+
- REQ-008 is `release_complete`
|
|
113
|
+
- But it doesn't contribute to any Milestone
|
|
114
|
+
|
|
115
|
+
**Pressure**:
|
|
116
|
+
```
|
|
117
|
+
User: "所有需求都完成了,项目进度如何?"
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
**Expected Baseline Behavior (WITHOUT skill)**:
|
|
121
|
+
- Agent counts completed REQs
|
|
122
|
+
- Agent reports "X/Y REQs complete"
|
|
123
|
+
- Agent doesn't notice REQ-008 is orphan
|
|
124
|
+
|
|
125
|
+
**Desired Behavior (WITH skill)**:
|
|
126
|
+
- Agent maps REQs to ROADMAP items
|
|
127
|
+
- Agent identifies REQ-008 as orphan
|
|
128
|
+
- Agent reports "REQ-008 not mapped to any Milestone"
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## Test Execution Plan
|
|
133
|
+
|
|
134
|
+
### Phase 1: Baseline Testing (RED)
|
|
135
|
+
1. Create mock REQ-007 with unmet dependency
|
|
136
|
+
2. Ask agent to verify REQ-007
|
|
137
|
+
3. Document agent's response verbatim
|
|
138
|
+
4. Identify rationalizations used
|
|
139
|
+
|
|
140
|
+
### Phase 2: Skill Writing (GREEN)
|
|
141
|
+
1. Write skill addressing baseline failures
|
|
142
|
+
2. Re-run scenarios
|
|
143
|
+
3. Verify agent now catches issues
|
|
144
|
+
|
|
145
|
+
### Phase 3: Refinement (REFACTOR)
|
|
146
|
+
1. Find new rationalizations
|
|
147
|
+
2. Add explicit counters
|
|
148
|
+
3. Re-test until bulletproof
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## Key Rationalizations to Watch For
|
|
153
|
+
|
|
154
|
+
| Potential Excuse | Counter |
|
|
155
|
+
|------------------|---------|
|
|
156
|
+
| "依赖已经标记完成了" | 完成 ≠ 满足。检查实际输出。 |
|
|
157
|
+
| "每个需求都通过了验证" | 单需求验证 ≠ 全局一致性。 |
|
|
158
|
+
| "ROADMAP 是规划,不是承诺" | Success Criteria 是承诺。 |
|
|
159
|
+
| "这超出了我的检查范围" | 这正是你的检查范围。 |
|
|
160
|
+
| "用户没有要求检查全局" | 全局检查是隐含要求。 |
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
**[PROTOCOL]**: 变更时更新此头部,然后检查 CLAUDE.md
|
|
@@ -264,6 +264,77 @@
|
|
|
264
264
|
"should I.*?(test first|write implementation)"
|
|
265
265
|
]
|
|
266
266
|
}
|
|
267
|
+
},
|
|
268
|
+
"journey-coherence-checker": {
|
|
269
|
+
"type": "domain",
|
|
270
|
+
"enforcement": "suggest",
|
|
271
|
+
"priority": "high",
|
|
272
|
+
"description": "Use when completing a requirement, checking milestone progress, or asking about project status. Detects gaps between requirements, unmet dependencies, and cumulative scope drift.",
|
|
273
|
+
"promptTriggers": {
|
|
274
|
+
"keywords": [
|
|
275
|
+
"需求完成",
|
|
276
|
+
"REQ完成",
|
|
277
|
+
"里程碑",
|
|
278
|
+
"milestone",
|
|
279
|
+
"项目进度",
|
|
280
|
+
"可以发布",
|
|
281
|
+
"发布前检查",
|
|
282
|
+
"全局检查",
|
|
283
|
+
"M1进度",
|
|
284
|
+
"M2进度",
|
|
285
|
+
"M3进度",
|
|
286
|
+
"M4进度",
|
|
287
|
+
"所有需求",
|
|
288
|
+
"依赖满足",
|
|
289
|
+
"journey check",
|
|
290
|
+
"coherence check"
|
|
291
|
+
],
|
|
292
|
+
"intentPatterns": [
|
|
293
|
+
"(需求|REQ|requirement).*?(完成|done|finished)",
|
|
294
|
+
"(里程碑|milestone).*?(进度|status|完成)",
|
|
295
|
+
"(项目|project).*?(进度|status|如何)",
|
|
296
|
+
"(可以|ready).*?(发布|release)",
|
|
297
|
+
"(所有|all).*?(需求|requirement).*?(完成|done)",
|
|
298
|
+
"(检查|check).*?(全局|global|依赖|dependency)"
|
|
299
|
+
]
|
|
300
|
+
},
|
|
301
|
+
"fileTriggers": {
|
|
302
|
+
"pathPatterns": [
|
|
303
|
+
"devflow/ROADMAP.md",
|
|
304
|
+
"devflow/requirements/**/orchestration_status.json"
|
|
305
|
+
]
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
"npm-release": {
|
|
309
|
+
"type": "domain",
|
|
310
|
+
"enforcement": "suggest",
|
|
311
|
+
"priority": "high",
|
|
312
|
+
"description": "Standardized release process for cc-devflow npm package. Handles version bumping, changelog updates, and publishing checks.",
|
|
313
|
+
"promptTriggers": {
|
|
314
|
+
"keywords": [
|
|
315
|
+
"publish npm",
|
|
316
|
+
"release version",
|
|
317
|
+
"npm publish",
|
|
318
|
+
"bump version",
|
|
319
|
+
"new release",
|
|
320
|
+
"publish package",
|
|
321
|
+
"update changelog",
|
|
322
|
+
"release workflow"
|
|
323
|
+
],
|
|
324
|
+
"intentPatterns": [
|
|
325
|
+
"(publish|release).*?(npm|package|version)",
|
|
326
|
+
"(bump|update).*?(version|semver)",
|
|
327
|
+
"(create|generate).*?(release|changelog)",
|
|
328
|
+
"ready to publish",
|
|
329
|
+
"deploy to npm"
|
|
330
|
+
]
|
|
331
|
+
},
|
|
332
|
+
"fileTriggers": {
|
|
333
|
+
"pathPatterns": [
|
|
334
|
+
"package.json",
|
|
335
|
+
"CHANGELOG.md"
|
|
336
|
+
]
|
|
337
|
+
}
|
|
267
338
|
}
|
|
268
339
|
},
|
|
269
340
|
"notes": {
|
|
@@ -285,4 +356,4 @@
|
|
|
285
356
|
"skip_conditions": "All guardrails support session skip, file markers, and env override"
|
|
286
357
|
}
|
|
287
358
|
}
|
|
288
|
-
}
|
|
359
|
+
}
|
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,51 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
+
## [2.5.0] - 2026-01-25
|
|
11
|
+
|
|
12
|
+
### 🚀 新增 Skills:一致性检查与发版自动化
|
|
13
|
+
|
|
14
|
+
v2.5.0 引入了两个强大的新 Skills,分别解决了跨需求一致性检查和 NPM 包发版自动化的问题。
|
|
15
|
+
|
|
16
|
+
#### Added
|
|
17
|
+
|
|
18
|
+
- **Journey Coherence Checker Skill** - 跨需求一致性检查
|
|
19
|
+
- 检查依赖满足情况 (Dependency Satisfaction)
|
|
20
|
+
- 验证里程碑 Success Criteria
|
|
21
|
+
- 检测累积偏差 (Cumulative Scope Drift)
|
|
22
|
+
- 发现用户旅程空隙 (Journey Gaps)
|
|
23
|
+
- 集成到发布门禁 (`/flow-release`)
|
|
24
|
+
|
|
25
|
+
- **NPM Release Skill** - NPM 发版流程自动化
|
|
26
|
+
- 标准化发版工作流 (Patch/Minor/Major)
|
|
27
|
+
- 自动更新 CHANGELOG.md
|
|
28
|
+
- 自动创建并验证 Git Tags
|
|
29
|
+
- 发布前安全检查
|
|
30
|
+
|
|
31
|
+
## [2.4.6] - 2026-01-12
|
|
32
|
+
|
|
33
|
+
### flow-init 工作流精简:研究步骤抽离为 subagent
|
|
34
|
+
|
|
35
|
+
将研究型内容从主流程中拆分到独立 subagent,减少上下文消耗,并同步更新命令、模板、脚本与文档。
|
|
36
|
+
|
|
37
|
+
#### Added
|
|
38
|
+
|
|
39
|
+
- **flow-researcher agent** - 执行 `/flow-init` 深度研究并写入 `devflow/requirements/$REQ_ID/research/`
|
|
40
|
+
|
|
41
|
+
#### Changed
|
|
42
|
+
|
|
43
|
+
- **flow-init command** - 重组流程,研究部分改由 subagent 执行
|
|
44
|
+
- **INIT_FLOW_TEMPLATE.md** - 精简初始化模板
|
|
45
|
+
- **populate-research-tasks.sh** - 更新 research tasks 填充逻辑
|
|
46
|
+
- **flow-init docs** - 同步更新中英文文档
|
|
47
|
+
|
|
48
|
+
#### Benefits
|
|
49
|
+
|
|
50
|
+
- **更省上下文**: 主会话仅保留关键决策与路径
|
|
51
|
+
- **更可追溯**: 研究产物落盘,便于审计与复用
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
10
55
|
## [2.4.5] - 2026-01-10
|
|
11
56
|
|
|
12
57
|
### 🛠️ Skills 增强:新增开发辅助工具
|
|
@@ -47,6 +47,9 @@ Stage 1: Prerequisites validation
|
|
|
47
47
|
├─ Check devflow/ directory
|
|
48
48
|
└─ Verify REQ-ID uniqueness
|
|
49
49
|
↓
|
|
50
|
+
Stage 1.2: Git branch creation
|
|
51
|
+
└─ Create feature/REQ-XXX-english-slug branch (model-translated, not pinyin)
|
|
52
|
+
↓
|
|
50
53
|
Stage 1.5: Roadmap & Architecture context loading (NEW)
|
|
51
54
|
├─ Check ROADMAP.md existence
|
|
52
55
|
├─ Locate requirement in roadmap
|
|
@@ -64,13 +67,15 @@ Stage 2: Directory structure creation
|
|
|
64
67
|
├─ Initialize orchestration_status.json
|
|
65
68
|
└─ Create EXECUTION_LOG.md
|
|
66
69
|
↓
|
|
67
|
-
Stage 2.
|
|
68
|
-
|
|
69
|
-
├─ Populate research decisions
|
|
70
|
-
└─ Consolidate research findings
|
|
70
|
+
Stage 2.3: Brainstorming (skill)
|
|
71
|
+
└─ Generate devflow/requirements/REQ-XXX/BRAINSTORM.md as the “North Star”
|
|
71
72
|
↓
|
|
72
|
-
Stage
|
|
73
|
-
|
|
73
|
+
Stage 2.5: Research (subagent, mandatory, context-isolated)
|
|
74
|
+
├─ Run internal codebase research → research/internal/codebase-overview.md
|
|
75
|
+
├─ Capture external sources into files → research/mcp/YYYYMMDD/**
|
|
76
|
+
├─ Produce decisions → research/research-summary.md
|
|
77
|
+
├─ Fill tasks → research/tasks.json (decision/rationale/alternatives)
|
|
78
|
+
└─ Consolidate → research/research.md (validated; no TODO/PLACEHOLDER)
|
|
74
79
|
```
|
|
75
80
|
|
|
76
81
|
## 💡 Examples
|
|
@@ -124,10 +129,9 @@ Stage 3: Git branch creation
|
|
|
124
129
|
|
|
125
130
|
## 📂 Output
|
|
126
131
|
|
|
127
|
-
- `devflow/requirements/REQ-XXX/`
|
|
128
|
-
- `orchestration_status.json`
|
|
129
|
-
-
|
|
130
|
-
- Roadmap and architecture context (if exists)
|
|
132
|
+
- `devflow/requirements/REQ-XXX/` initialized directory (includes `BRAINSTORM.md` + `research/`)
|
|
133
|
+
- `orchestration_status.json` + `EXECUTION_LOG.md`
|
|
134
|
+
- Roadmap and architecture context display (if exists)
|
|
131
135
|
|
|
132
136
|
## 🔗 Related Commands
|
|
133
137
|
|
|
@@ -43,6 +43,9 @@ Stage 1: 前置条件验证
|
|
|
43
43
|
├─ 检查 devflow/ 目录
|
|
44
44
|
└─ 验证 REQ-ID 唯一性
|
|
45
45
|
↓
|
|
46
|
+
Stage 1.2: Git 分支创建
|
|
47
|
+
└─ 创建 feature/REQ-XXX-english-slug 分支(标题英文意译,非拼音)
|
|
48
|
+
↓
|
|
46
49
|
Stage 1.5: 路线图与架构上下文加载(NEW)
|
|
47
50
|
├─ 检查 ROADMAP.md 存在性
|
|
48
51
|
├─ 定位需求在路线图中的位置
|
|
@@ -57,17 +60,19 @@ Stage 1.5: 路线图与架构上下文加载(NEW)
|
|
|
57
60
|
↓
|
|
58
61
|
Stage 2: 目录结构创建
|
|
59
62
|
├─ 创建 devflow/requirements/REQ-123/
|
|
60
|
-
├─ 创建子目录
|
|
63
|
+
├─ 创建子目录 research/
|
|
61
64
|
├─ 初始化 orchestration_status.json
|
|
62
65
|
└─ 初始化 EXECUTION_LOG.md
|
|
63
66
|
↓
|
|
64
|
-
Stage 2.
|
|
65
|
-
|
|
66
|
-
├─ 填充研究决策 (populate-research-tasks.sh)
|
|
67
|
-
└─ 整合研究结论 (consolidate-research.sh)
|
|
67
|
+
Stage 2.3: 头脑风暴(skill)
|
|
68
|
+
└─ 生成 devflow/requirements/REQ-XXX/BRAINSTORM.md 作为需求「北极星」
|
|
68
69
|
↓
|
|
69
|
-
Stage
|
|
70
|
-
|
|
70
|
+
Stage 2.5: 调研(subagent,默认必跑,上下文隔离)
|
|
71
|
+
├─ 内部代码库调研 → research/internal/codebase-overview.md
|
|
72
|
+
├─ 外部资料落盘 → research/mcp/YYYYMMDD/**
|
|
73
|
+
├─ 决策摘要 → research/research-summary.md
|
|
74
|
+
├─ 任务回填 → research/tasks.json(decision/rationale/alternatives 完整)
|
|
75
|
+
└─ 研究整合 → research/research.md(通过校验,无 TODO/PLACEHOLDER)
|
|
71
76
|
```
|
|
72
77
|
|
|
73
78
|
## 💡 示例
|
|
@@ -129,7 +134,6 @@ Stage 3: Git 分支创建
|
|
|
129
134
|
devflow/requirements/REQ-123/
|
|
130
135
|
├── orchestration_status.json # 状态管理
|
|
131
136
|
├── EXECUTION_LOG.md # 审计轨迹
|
|
132
|
-
├── tasks/ # 任务产物目录
|
|
133
137
|
├── research/ # 研究材料目录
|
|
134
138
|
└── (等待后续阶段生成其他文档)
|
|
135
139
|
```
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
1766046071 Edit /Users/dimon/001Area/80-CodeWorld/002-devflow/cc-devflow/package.json root
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
root
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
1768013595 Edit /Users/dimon/001Area/80-CodeWorld/002-devflow/cc-devflow/package.json root
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
1766132827 Edit /Users/dimon/001Area/80-CodeWorld/002-devflow/cc-devflow/package.json root
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
1766112103 Edit /Users/dimon/001Area/80-CodeWorld/002-devflow/cc-devflow/.gitignore root
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
root
|