claude-code-workflow 7.2.12 → 7.2.14
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.
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: workflow-research-agent
|
|
3
|
+
description: External research agent — web search for API details, design patterns, best practices, and technology validation. Returns structured markdown, does NOT write files.
|
|
4
|
+
tools: Read, WebSearch, WebFetch, Bash
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# External Research Agent
|
|
8
|
+
|
|
9
|
+
## Role
|
|
10
|
+
You perform targeted external research using web search to gather API details, design patterns, architecture approaches, best practices, and technology evaluations. You synthesize findings into structured, actionable markdown for downstream analysis workflows.
|
|
11
|
+
|
|
12
|
+
Spawned by: analyze-with-file (Phase 2), brainstorm-with-file, or any workflow needing external context.
|
|
13
|
+
|
|
14
|
+
**CRITICAL**: Return structured markdown only. Do NOT write any files unless explicitly instructed in the prompt.
|
|
15
|
+
|
|
16
|
+
## Process
|
|
17
|
+
|
|
18
|
+
1. **Parse research objective** — Understand the topic, focus area, and what the caller needs
|
|
19
|
+
2. **Plan queries** — Design 3-5 focused search queries targeting the objective
|
|
20
|
+
3. **Execute searches** — Use `WebSearch` for general research, `WebFetch` for specific documentation pages
|
|
21
|
+
4. **Cross-reference** — If codebase files are provided in prompt, `Read` them to ground research in actual code context
|
|
22
|
+
5. **Synthesize findings** — Extract key insights, patterns, and recommendations from search results
|
|
23
|
+
6. **Return structured output** — Markdown-formatted research findings
|
|
24
|
+
|
|
25
|
+
## Research Modes
|
|
26
|
+
|
|
27
|
+
### Detail Verification (default for analyze)
|
|
28
|
+
Focus: verify assumptions, check best practices, validate technology choices, confirm patterns.
|
|
29
|
+
Queries target: benchmarks, production postmortems, known issues, compatibility matrices, official docs.
|
|
30
|
+
|
|
31
|
+
### API Research (for implementation planning)
|
|
32
|
+
Focus: concrete API details, library versions, integration patterns, configuration options.
|
|
33
|
+
Queries target: official documentation, API references, migration guides, changelog entries.
|
|
34
|
+
|
|
35
|
+
### Design Research (for brainstorm/architecture)
|
|
36
|
+
Focus: design alternatives, architecture patterns, competitive analysis, UX patterns.
|
|
37
|
+
Queries target: design systems, pattern libraries, case studies, comparison articles.
|
|
38
|
+
|
|
39
|
+
## Execution
|
|
40
|
+
|
|
41
|
+
### Query Strategy
|
|
42
|
+
```
|
|
43
|
+
1. Parse topic → extract key technologies, patterns, concepts
|
|
44
|
+
2. Generate 3-5 queries:
|
|
45
|
+
- Q1: "{technology} best practices {year}"
|
|
46
|
+
- Q2: "{pattern} vs {alternative} comparison"
|
|
47
|
+
- Q3: "{technology} known issues production"
|
|
48
|
+
- Q4: "{specific API/library} documentation {version}"
|
|
49
|
+
- Q5: "{domain} architecture patterns"
|
|
50
|
+
3. Execute queries via WebSearch
|
|
51
|
+
4. For promising results, WebFetch full content for detail extraction
|
|
52
|
+
5. Synthesize across all sources
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Codebase Grounding
|
|
56
|
+
When the prompt includes `codebase_context` (file paths, patterns, tech stack):
|
|
57
|
+
- Read referenced files to understand actual usage
|
|
58
|
+
- Compare external best practices against current implementation
|
|
59
|
+
- Flag gaps between current code and recommended patterns
|
|
60
|
+
|
|
61
|
+
## Output Format
|
|
62
|
+
|
|
63
|
+
Return structured markdown (do NOT write files):
|
|
64
|
+
|
|
65
|
+
```markdown
|
|
66
|
+
## Research: {topic}
|
|
67
|
+
|
|
68
|
+
### Key Findings
|
|
69
|
+
- **{Finding 1}**: {detail} (confidence: HIGH|MEDIUM|LOW, source: {url_or_reference})
|
|
70
|
+
- **{Finding 2}**: {detail} (confidence: HIGH|MEDIUM|LOW, source: {url_or_reference})
|
|
71
|
+
|
|
72
|
+
### Technology / API Details
|
|
73
|
+
- **{Library/API}**: version {X}, {key capabilities}
|
|
74
|
+
- Integration: {how to integrate}
|
|
75
|
+
- Caveats: {known issues or limitations}
|
|
76
|
+
|
|
77
|
+
### Best Practices
|
|
78
|
+
- {Practice 1}: {rationale} (source: {reference})
|
|
79
|
+
- {Practice 2}: {rationale} (source: {reference})
|
|
80
|
+
|
|
81
|
+
### Recommended Approach
|
|
82
|
+
{Prescriptive recommendation with rationale — "use X" not "consider X or Y" when evidence is strong}
|
|
83
|
+
|
|
84
|
+
### Alternatives Considered
|
|
85
|
+
| Option | Pros | Cons | Verdict |
|
|
86
|
+
|--------|------|------|---------|
|
|
87
|
+
| {A} | ... | ... | Recommended / Viable / Avoid |
|
|
88
|
+
|
|
89
|
+
### Pitfalls & Known Issues
|
|
90
|
+
- {Issue 1}: {mitigation} (source: {reference})
|
|
91
|
+
|
|
92
|
+
### Codebase Gaps (if codebase_context provided)
|
|
93
|
+
- {Gap}: current code does {X}, best practice recommends {Y}
|
|
94
|
+
|
|
95
|
+
### Sources
|
|
96
|
+
- {source title}: {url} — {key takeaway}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Error Handling
|
|
100
|
+
- If WebSearch returns no results for a query: note "no results" and proceed with remaining queries
|
|
101
|
+
- If WebFetch fails for a URL: skip and note the intended lookup
|
|
102
|
+
- If all searches fail: return "research unavailable — proceed with codebase-only analysis" and list the queries that were attempted
|
|
103
|
+
- If codebase files referenced in prompt don't exist: proceed with external research only
|
|
104
|
+
|
|
105
|
+
## Constraints
|
|
106
|
+
- Be prescriptive ("use X") not exploratory ("consider X or Y") when evidence is strong
|
|
107
|
+
- Assign confidence levels (HIGH/MEDIUM/LOW) to all findings
|
|
108
|
+
- Cite sources for claims — include URLs
|
|
109
|
+
- Keep output under 200 lines
|
|
110
|
+
- Do NOT write any files — return structured markdown only
|
|
111
|
+
- Do NOT fabricate URLs or sources — only cite actual search results
|
|
112
|
+
- Bash calls MUST use `run_in_background: false` (subagent cannot receive hook callbacks)
|
|
@@ -10,11 +10,11 @@ allowed-tools: TodoWrite(*), Agent(*), AskUserQuestion(*), Read(*), Grep(*), Glo
|
|
|
10
10
|
When `--yes` or `-y`: Auto-confirm exploration decisions, use recommended analysis angles.
|
|
11
11
|
|
|
12
12
|
<purpose>
|
|
13
|
-
Interactive collaborative analysis workflow combining codebase exploration (cli-explore-agent)
|
|
13
|
+
Interactive collaborative analysis workflow combining codebase exploration (cli-explore-agent), external research (workflow-research-agent), and CLI-assisted analysis (Gemini/Codex). Produces a documented discussion timeline with evolving understanding, decision trails, and actionable conclusions.
|
|
14
14
|
|
|
15
15
|
Invoked when user needs deep, multi-perspective analysis of a topic or codebase question — e.g., architecture review, implementation analysis, concept exploration, or decision evaluation.
|
|
16
16
|
|
|
17
|
-
Produces: `discussion.md` (evolving analysis document with TOC, rounds, narrative synthesis), `explorations.json`/`perspectives.json` (structured findings), `conclusions.json` (final synthesis with recommendations). All artifacts stored in `.workflow/.analysis/{session-id}/`.
|
|
17
|
+
Produces: `discussion.md` (evolving analysis document with TOC, rounds, narrative synthesis), `explorations.json`/`perspectives.json` (structured findings), `research.json` (external research findings), `conclusions.json` (final synthesis with recommendations). All artifacts stored in `.workflow/.analysis/{session-id}/`.
|
|
18
18
|
</purpose>
|
|
19
19
|
|
|
20
20
|
<conventions>
|
|
@@ -72,6 +72,12 @@ All `AskUserQuestion` calls MUST comply:
|
|
|
72
72
|
|
|
73
73
|
**Principles**: Immediacy (record as-it-happens), Completeness (context+options+chosen+reason+rejected), Traceability (later phases trace back), Depth (capture reasoning, not just outcomes)
|
|
74
74
|
|
|
75
|
+
**Technical Solution Triggers** — record using Technical Solution Record Format when ANY of:
|
|
76
|
+
- An implementation approach is described with specific files/patterns/code changes
|
|
77
|
+
- Two or more alternatives are compared with trade-offs
|
|
78
|
+
- User confirms, modifies, or rejects a proposed approach
|
|
79
|
+
- A concrete code change strategy emerges (what to modify, how, why)
|
|
80
|
+
|
|
75
81
|
### Output Artifacts
|
|
76
82
|
|
|
77
83
|
| Phase | Artifact | Description |
|
|
@@ -80,8 +86,9 @@ All `AskUserQuestion` calls MUST comply:
|
|
|
80
86
|
| 1 | Session variables | Dimensions, focus areas, analysis depth |
|
|
81
87
|
| 2 | `exploration-codebase.json` | Shared Layer 1 discovery (files, modules, patterns) — always created |
|
|
82
88
|
| 2 | `explorations/*.json` | Per-perspective Layer 2-3 deep-dives (multi-perspective only, max 4) |
|
|
83
|
-
| 2 | `
|
|
84
|
-
| 2 | `
|
|
89
|
+
| 2 | `research.json` | External research findings (best practices, API details, known issues) — from workflow-research-agent |
|
|
90
|
+
| 2 | `explorations.json` | Single perspective aggregated findings (Layer 1 + CLI analysis + research) |
|
|
91
|
+
| 2 | `perspectives.json` | Multi-perspective findings (Layer 1 shared + per-perspective deep-dives + research) with synthesis |
|
|
85
92
|
| 2 | Updated `discussion.md` | Round 1 + Initial Intent Coverage Check + Current Understanding replaced |
|
|
86
93
|
| 3 | Updated `discussion.md` | Round 2-N: feedback, insights, narrative synthesis; TOC + Current Understanding updated each round |
|
|
87
94
|
| 4 | `conclusions.json` | Final synthesis with recommendations (incl. steps[] + review_status) |
|
|
@@ -177,6 +184,52 @@ Schema: {relevant_files: [{path, annotation, dimensions[]}], patterns[], module_
|
|
|
177
184
|
})
|
|
178
185
|
```
|
|
179
186
|
|
|
187
|
+
**Phase A2 — External Research** (parallel with Phase A, runs when topic involves technologies/patterns/APIs):
|
|
188
|
+
|
|
189
|
+
Determine if external research would add value — skip for purely internal codebase questions (e.g., "how does module X work"), run for topics involving technology choices, best practices, architecture patterns, API usage, or comparison with industry standards.
|
|
190
|
+
|
|
191
|
+
```javascript
|
|
192
|
+
// External research — runs in PARALLEL with Phase A codebase exploration
|
|
193
|
+
// Skip if topic is purely internal codebase navigation
|
|
194
|
+
const needsResearch = dimensions.some(d =>
|
|
195
|
+
['architecture', 'comparison', 'decision', 'performance', 'security'].includes(d)
|
|
196
|
+
) || topic_or_question.match(/best practice|pattern|vs|compare|approach|standard|library|framework/i)
|
|
197
|
+
|
|
198
|
+
if (needsResearch) {
|
|
199
|
+
Agent({
|
|
200
|
+
subagent_type: "workflow-research-agent",
|
|
201
|
+
run_in_background: false,
|
|
202
|
+
description: `Research: ${topicSlug}`,
|
|
203
|
+
prompt: `
|
|
204
|
+
## Research Objective
|
|
205
|
+
Topic: ${topic_or_question}
|
|
206
|
+
Mode: detail-verification
|
|
207
|
+
Dimensions: ${dimensions.join(', ')}
|
|
208
|
+
|
|
209
|
+
## Focus
|
|
210
|
+
${dimensions.includes('architecture') ? '- Architecture patterns and best practices for this domain' : ''}
|
|
211
|
+
${dimensions.includes('performance') ? '- Performance benchmarks and optimization patterns' : ''}
|
|
212
|
+
${dimensions.includes('security') ? '- Security best practices and known vulnerabilities' : ''}
|
|
213
|
+
${dimensions.includes('comparison') ? '- Technology comparison and trade-off analysis' : ''}
|
|
214
|
+
${dimensions.includes('decision') ? '- Decision frameworks and industry recommendations' : ''}
|
|
215
|
+
- Verify assumptions about technologies/patterns involved
|
|
216
|
+
- Known issues and pitfalls in this area
|
|
217
|
+
- Recommended approaches with evidence
|
|
218
|
+
|
|
219
|
+
## Codebase Context (from Phase A if available)
|
|
220
|
+
Tech stack: ${techStack || 'detect from project files'}
|
|
221
|
+
Key patterns observed: ${sharedDiscovery?.patterns?.join(', ') || 'pending Phase A results'}
|
|
222
|
+
|
|
223
|
+
## Output
|
|
224
|
+
Return structured markdown per your output format.
|
|
225
|
+
Do NOT write files.
|
|
226
|
+
`
|
|
227
|
+
})
|
|
228
|
+
// Parse research agent output → save to ${sessionFolder}/research.json
|
|
229
|
+
// Schema: {topic, mode, findings[], best_practices[], alternatives[], pitfalls[], sources[], _metadata}
|
|
230
|
+
}
|
|
231
|
+
```
|
|
232
|
+
|
|
180
233
|
**Phase B — Perspective Deep-Dive** (parallel, only for multi-perspective, max 4):
|
|
181
234
|
Each perspective agent receives shared Layer 1 results, performs only Layer 2-3 on its relevant subset.
|
|
182
235
|
Skip if single-perspective (single mode proceeds directly to Step 2 CLI analysis with Layer 1 results).
|
|
@@ -262,9 +315,12 @@ CONSTRAINTS: Focus on ${dimensions.join(', ')} | Do NOT re-discover files — us
|
|
|
262
315
|
```
|
|
263
316
|
|
|
264
317
|
**Step 3: Aggregate Findings**
|
|
265
|
-
- Consolidate explorations + CLI results
|
|
318
|
+
- Consolidate explorations + CLI results + research findings (if research.json exists)
|
|
319
|
+
- Merge research best_practices[] and pitfalls[] into discussion points
|
|
320
|
+
- Cross-reference: flag gaps where codebase patterns diverge from research best practices
|
|
266
321
|
- Multi: Extract synthesis (convergent themes, conflicting views, unique contributions)
|
|
267
322
|
- Write to `explorations.json` (single) or `perspectives.json` (multi)
|
|
323
|
+
- If research.json exists, add `external_research` section to explorations/perspectives with: key findings, best practices, codebase gaps
|
|
268
324
|
|
|
269
325
|
**Step 4: Update discussion.md** — Append Round 1 with sources, key findings, discussion points, open questions
|
|
270
326
|
|
|
@@ -275,24 +331,7 @@ CONSTRAINTS: Focus on ${dimensions.join(', ')} | Do NOT re-discover files — us
|
|
|
275
331
|
- Present to user at beginning of Phase 3: "初始探索完成后,以下意图的覆盖情况:[list]。接下来的讨论将重点关注未覆盖的部分。"
|
|
276
332
|
- Purpose: Early course correction — catch drift before spending multiple interactive rounds
|
|
277
333
|
|
|
278
|
-
|
|
279
|
-
- `session_id`, `timestamp`, `topic`, `dimensions[]`
|
|
280
|
-
- `relevant_files[]`: {path, annotation, dimensions[]}
|
|
281
|
-
- `patterns[]`, `module_map`: {}
|
|
282
|
-
- `questions_for_user[]`, `_metadata`
|
|
283
|
-
|
|
284
|
-
**explorations.json Schema** (single — Layer 1 + CLI analysis merged):
|
|
285
|
-
- `session_id`, `timestamp`, `topic`, `dimensions[]`
|
|
286
|
-
- `sources[]`: {type, file/summary}
|
|
287
|
-
- `key_findings[]`, `code_anchors[]`: {file, lines, snippet, significance}
|
|
288
|
-
- `call_chains[]`: {entry, chain, files}
|
|
289
|
-
- `discussion_points[]`, `open_questions[]`
|
|
290
|
-
- `technical_solutions[]`: {round, solution, problem, rationale, alternatives, status: proposed|validated|rejected, evidence_refs[], next_action}
|
|
291
|
-
|
|
292
|
-
**perspectives.json Schema** (multi — Layer 1 shared + per-perspective Layer 2-3):
|
|
293
|
-
- `shared_discovery`: {relevant_files[], patterns[], module_map}
|
|
294
|
-
- `perspectives[]`: [{name, tool, findings, insights, questions, code_anchors[], call_chains[]}]
|
|
295
|
-
- `synthesis`: {convergent_themes, conflicting_views, unique_contributions}
|
|
334
|
+
> All JSON schemas consolidated in `<schemas>` section below.
|
|
296
335
|
|
|
297
336
|
| Condition | Action |
|
|
298
337
|
|-----------|--------|
|
|
@@ -334,28 +373,36 @@ const priorContext = `
|
|
|
334
373
|
|
|
335
374
|
3. **Gather Feedback** (AskUserQuestion, single-select, header: "分析反馈"):
|
|
336
375
|
- **继续深入**: Direction correct — deepen automatically or user specifies direction (combines agree+deepen and agree+suggest)
|
|
376
|
+
- **外部研究**: Need external research on specific technology/pattern/best practice (spawns workflow-research-agent)
|
|
337
377
|
- **调整方向**: Different focus or specific questions to address
|
|
338
|
-
- **补充信息**: User has additional context, constraints, or corrections to provide
|
|
339
378
|
- **分析完成**: Sufficient -> exit to Phase 4
|
|
340
379
|
|
|
341
380
|
4. **Process Response** (always record user choice + impact to discussion.md):
|
|
342
381
|
|
|
382
|
+
**Record-Before-Continue Rule**: Each path below MUST write findings and discussion synthesis to `discussion.md` BEFORE proceeding to Step 5. Specifically, after agent/CLI returns results:
|
|
383
|
+
- Append the exploration results, reasoning, and any technical approaches discussed to the current round section
|
|
384
|
+
- Apply **Technical Solution Triggers** (see Decision Recording Protocol) — if triggered, record using Technical Solution Record Format
|
|
385
|
+
- Only THEN proceed to Step 5 for Current Understanding replacement and TOC update
|
|
386
|
+
|
|
343
387
|
**继续深入** -> Sub-question to choose direction (AskUserQuestion, single-select, header: "深入方向"):
|
|
344
388
|
- Dynamically generate **max 3** context-driven options from: unresolved questions, low-confidence findings, unexplored dimensions, user-highlighted areas
|
|
345
389
|
- Add **1** heuristic option that breaks current frame (e.g., "compare with best practices", "review from security perspective", "explore simpler alternatives")
|
|
346
390
|
- Total: **max 4 options**. Each specifies: label, description, tool (cli-explore-agent for code-level / Gemini CLI for pattern-level), scope
|
|
347
391
|
- **"Other" is auto-provided** by AskUserQuestion — covers user-specified custom direction (no need for separate "suggest next step" option)
|
|
348
|
-
- Execute selected direction -> merge new code_anchors/call_chains -> record confirmed assumptions + deepen angle
|
|
392
|
+
- Execute selected direction -> merge new code_anchors/call_chains into explorations.json -> **write exploration results, analysis reasoning, and any proposed approaches to discussion.md** -> record confirmed assumptions + deepen angle
|
|
349
393
|
|
|
350
|
-
|
|
394
|
+
**外部研究** -> Spawn workflow-research-agent for targeted research:
|
|
395
|
+
- AskUserQuestion (header: "研究主题", freetext via "Other"): What specific technology/pattern/approach needs external research?
|
|
396
|
+
- Spawn research agent with topic + current codebase context (from explorations.json)
|
|
397
|
+
- Merge research findings into explorations.json `external_research` section
|
|
398
|
+
- Update research.json with new findings (append, don't overwrite)
|
|
399
|
+
- Record research findings as Key Findings in discussion.md
|
|
351
400
|
|
|
352
|
-
|
|
401
|
+
**调整方向** -> AskUserQuestion (header: "新方向", user selects or provides custom via "Other") -> new CLI exploration -> Record Decision (old vs new direction, reason, impact)
|
|
353
402
|
|
|
354
403
|
**分析完成** -> Exit loop -> Record why concluding
|
|
355
404
|
|
|
356
|
-
5. **Update discussion.md
|
|
357
|
-
- **Append** Round N: user input, direction adjustment, Q&A, corrections, new insights
|
|
358
|
-
- **Append Technical Solutions** — for every solution proposed, validated, or rejected this round, record immediately using Technical Solution Record Format in `#### Technical Solutions`
|
|
405
|
+
5. **Update discussion.md** (after Record-Before-Continue writes are done):
|
|
359
406
|
- **Replace** `## Current Understanding` block with latest consolidated understanding (follow Consolidation Rules)
|
|
360
407
|
- **Update** `## Table of Contents` with links to new Round N sections
|
|
361
408
|
|
|
@@ -554,7 +601,45 @@ ${implScope.map((item, i) => `${i+1}. **${item.objective}** [${item.priority}]
|
|
|
554
601
|
|
|
555
602
|
**TodoWrite**: Update `next-step` -> `"completed"` after user selection is handled
|
|
556
603
|
|
|
557
|
-
|
|
604
|
+
> conclusions.json schema: see `<schemas>` section below.
|
|
605
|
+
</step>
|
|
606
|
+
|
|
607
|
+
</process>
|
|
608
|
+
|
|
609
|
+
<schemas>
|
|
610
|
+
|
|
611
|
+
**exploration-codebase.json** (shared Layer 1):
|
|
612
|
+
- `session_id`, `timestamp`, `topic`, `dimensions[]`
|
|
613
|
+
- `relevant_files[]`: {path, annotation, dimensions[]}
|
|
614
|
+
- `patterns[]`, `module_map`: {}
|
|
615
|
+
- `questions_for_user[]`, `_metadata`
|
|
616
|
+
|
|
617
|
+
**research.json** (external research findings):
|
|
618
|
+
- `topic`, `mode` (detail-verification|api-research|design-research), `timestamp`
|
|
619
|
+
- `findings[]`: {finding, detail, confidence, source_url}
|
|
620
|
+
- `best_practices[]`: {practice, rationale, source}
|
|
621
|
+
- `alternatives[]`: {option, pros, cons, verdict}
|
|
622
|
+
- `pitfalls[]`: {issue, mitigation, source}
|
|
623
|
+
- `codebase_gaps[]`: {gap, current_approach, recommended_approach}
|
|
624
|
+
- `sources[]`: {title, url, key_takeaway}
|
|
625
|
+
- `_metadata`: {queries_executed, results_found}
|
|
626
|
+
|
|
627
|
+
**explorations.json** (single — Layer 1 + CLI analysis + research merged):
|
|
628
|
+
- `session_id`, `timestamp`, `topic`, `dimensions[]`
|
|
629
|
+
- `sources[]`: {type, file/summary}
|
|
630
|
+
- `key_findings[]`, `code_anchors[]`: {file, lines, snippet, significance}
|
|
631
|
+
- `call_chains[]`: {entry, chain, files}
|
|
632
|
+
- `discussion_points[]`, `open_questions[]`
|
|
633
|
+
- `technical_solutions[]`: {round, solution, problem, rationale, alternatives, status: proposed|validated|rejected, evidence_refs[], next_action}
|
|
634
|
+
- `external_research`: {findings[], best_practices[], codebase_gaps[], sources[]} — merged from research.json if available
|
|
635
|
+
|
|
636
|
+
**perspectives.json** (multi — Layer 1 shared + per-perspective Layer 2-3 + research):
|
|
637
|
+
- `shared_discovery`: {relevant_files[], patterns[], module_map}
|
|
638
|
+
- `perspectives[]`: [{name, tool, findings, insights, questions, code_anchors[], call_chains[]}]
|
|
639
|
+
- `external_research`: {findings[], best_practices[], codebase_gaps[], sources[]} — merged from research.json if available
|
|
640
|
+
- `synthesis`: {convergent_themes, conflicting_views, unique_contributions}
|
|
641
|
+
|
|
642
|
+
**conclusions.json**:
|
|
558
643
|
- `session_id`, `topic`, `completed`, `total_rounds`, `summary`
|
|
559
644
|
- `key_conclusions[]`: {point, evidence, confidence, code_anchor_refs[]}
|
|
560
645
|
- `code_anchors[]`: {file, lines, snippet, significance}
|
|
@@ -564,9 +649,8 @@ ${implScope.map((item, i) => `${i+1}. **${item.objective}** [${item.priority}]
|
|
|
564
649
|
- `decision_trail[]`: {round, decision, context, options_considered, chosen, rejected_reasons, reason, impact}
|
|
565
650
|
- `narrative_trail[]`: {round, starting_point, key_progress, hypothesis_impact, updated_understanding, remaining_questions}
|
|
566
651
|
- `intent_coverage[]`: {intent, status, where_addressed, notes}
|
|
567
|
-
</step>
|
|
568
652
|
|
|
569
|
-
</
|
|
653
|
+
</schemas>
|
|
570
654
|
|
|
571
655
|
<error_codes>
|
|
572
656
|
|
|
@@ -579,6 +663,8 @@ ${implScope.map((item, i) => `${i+1}. **${item.objective}** [${item.priority}]
|
|
|
579
663
|
| E005 | error | No relevant findings from exploration — broaden search, ask user for clarification | cli_exploration |
|
|
580
664
|
| E006 | warning | Session folder conflict — append timestamp suffix | session_init |
|
|
581
665
|
| E007 | error | Gemini unavailable — fallback to Codex or manual analysis | cli_exploration |
|
|
666
|
+
| E008 | warning | Research agent WebSearch failed — continue with codebase-only analysis, note limitation | cli_exploration |
|
|
667
|
+
| E009 | warning | Research findings conflict with codebase patterns — flag as codebase_gaps for user review | cli_exploration |
|
|
582
668
|
|
|
583
669
|
</error_codes>
|
|
584
670
|
|
|
@@ -588,6 +674,8 @@ ${implScope.map((item, i) => `${i+1}. **${item.objective}** [${item.priority}]
|
|
|
588
674
|
- [ ] Dimensions identified and user preferences captured (Phase 1)
|
|
589
675
|
- [ ] discussion.md initialized with TOC, Current Understanding, metadata
|
|
590
676
|
- [ ] Codebase exploration completed with code_anchors and call_chains (Phase 2)
|
|
677
|
+
- [ ] External research executed if topic warrants it (architecture/comparison/decision/performance/security dimensions)
|
|
678
|
+
- [ ] Research findings merged into explorations/perspectives with codebase_gaps flagged
|
|
591
679
|
- [ ] CLI analysis executed and findings aggregated
|
|
592
680
|
- [ ] Initial Intent Coverage Check appended to discussion.md
|
|
593
681
|
- [ ] Interactive discussion rounds documented with narrative synthesis (Phase 3)
|
|
@@ -650,9 +738,6 @@ Present 2-3 top directions per dimension, allow multi-select + custom.
|
|
|
650
738
|
| Preserve key learnings | Keep insights valuable for future reference |
|
|
651
739
|
|
|
652
740
|
</configuration>
|
|
653
|
-
|
|
654
|
-
> **Lite-plan handoff**: Phase 4「执行任务」builds structured `handoff-spec` JSON (implementation_scope with acceptance_criteria, code_anchors, key_findings) embedded in `## Prior Analysis` block. lite-plan parses `json:handoff-spec` to directly map scope items → tasks, skipping exploration and using acceptance_criteria as convergence.criteria.
|
|
655
|
-
|
|
656
741
|
---
|
|
657
742
|
|
|
658
743
|
**Now execute analyze-with-file for**: $ARGUMENTS
|
|
@@ -340,9 +340,6 @@ Generate implementation plan and write plan.json.
|
|
|
340
340
|
- ${sessionFolder}/plan.json (plan overview — NO embedded tasks[])
|
|
341
341
|
- ${sessionFolder}/.task/TASK-*.json (independent task files, one per task)
|
|
342
342
|
|
|
343
|
-
## Schema Reference
|
|
344
|
-
Execute: cat ~/.ccw/workflows/cli-templates/schemas/plan-overview-base-schema.json
|
|
345
|
-
|
|
346
343
|
## Project Context (MANDATORY)
|
|
347
344
|
Execute: ccw spec load --category planning
|
|
348
345
|
**CRITICAL**: All generated tasks MUST comply with constraints in specs/*.md
|
|
@@ -392,7 +389,6 @@ ${complexity}
|
|
|
392
389
|
## Requirements
|
|
393
390
|
- _metadata.exploration_angles: ${JSON.stringify(manifest.explorations.map(e => e.angle))}
|
|
394
391
|
- Two-layer output: plan.json (task_ids[], NO tasks[]) + .task/TASK-*.json
|
|
395
|
-
- Follow plan-overview-base-schema.json for plan.json, task-schema.json for .task/*.json
|
|
396
392
|
- Field names: files[].change (not modification_points), convergence.criteria (not acceptance)
|
|
397
393
|
|
|
398
394
|
## Task Grouping Rules
|
|
@@ -405,9 +401,9 @@ ${complexity}
|
|
|
405
401
|
7. **Prefer parallel**: Most tasks should be independent
|
|
406
402
|
|
|
407
403
|
## Execution
|
|
408
|
-
1.
|
|
409
|
-
|
|
410
|
-
|
|
404
|
+
1. ccw spec load → 2. Read ALL exploration files → 3. Synthesize + generate
|
|
405
|
+
4. Write: planning-context.md, .task/TASK-*.json, plan.json (task_ids[], NO tasks[])
|
|
406
|
+
5. Return brief completion summary
|
|
411
407
|
`
|
|
412
408
|
)
|
|
413
409
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-code-workflow",
|
|
3
|
-
"version": "7.2.
|
|
3
|
+
"version": "7.2.14",
|
|
4
4
|
"description": "JSON-driven multi-agent development framework with intelligent CLI orchestration (Gemini/Qwen/Codex), context-first architecture, and automated workflow execution",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "ccw/dist/index.js",
|