mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-03-05 16:13:08 +08:00
Refactor architecture optimization and issue resolution workflows
- Enhanced multi-perspective discussion capabilities in discuss-subagent for architecture optimization, integrating CLI tools for structured analysis and recommendations. - Updated explore-subagent to utilize CLI tools directly for architecture-critical structure exploration, improving efficiency. - Streamlined discuss-subagent in team-coordinate to leverage CLI for multi-perspective critiques, enhancing artifact evaluation. - Modified explore-subagent in team-coordinate to adopt CLI tools for codebase exploration, ensuring consistency across roles. - Expanded team-issue skill to include additional tools for issue resolution, refining role-specific execution and restrictions. - Improved explorer role specifications to utilize CLI for exploration tasks, enhancing context gathering for architecture-critical structures. - Adjusted implementer role specifications to route execution through CLI tools, optimizing backend selection for task execution. - Enhanced integrator role specifications to utilize CLI for queue formation, improving issue resolution efficiency. - Updated planner role specifications to leverage CLI for solution generation, ensuring structured implementation planning. - Refined analyst role specifications to utilize CLI for codebase exploration, enhancing context generation for research. - Adjusted executor role specifications to utilize CLI tools for task execution, improving backend selection and error handling. - Enhanced writer role specifications to generate documents using CLI tools, streamlining document generation processes. - Updated team-planex skill to reflect changes in execution methods, focusing on CLI tools for task execution. - Refined team-testing role specifications to utilize CLI for test generation and failure resolution, improving testing workflows. - Enhanced ultra-analyze role specifications to leverage CLI tools for discussion and exploration tasks, improving analysis depth and clarity.
This commit is contained in:
@@ -49,7 +49,7 @@ Parse the following fields from your prompt:
|
||||
- `prefix`: Task prefix to filter (e.g., `RESEARCH`, `DRAFT`, `IMPL`)
|
||||
- `inner_loop`: Override from frontmatter if present
|
||||
- `discuss_rounds`: Array of discuss round IDs this role handles
|
||||
- `subagents`: Array of subagent types this role may call
|
||||
- `subagents`: (DEPRECATED - team workers cannot call subagents) Array for documentation only
|
||||
- `message_types`: Success/error/fix message type mappings
|
||||
3. Parse **body** (content after frontmatter) to get Phase 2-4 execution instructions
|
||||
4. Store parsed metadata and instructions for use in execution phases
|
||||
@@ -74,7 +74,7 @@ Entry:
|
||||
inner_loop=false OR no more tasks? → Phase 5-F → STOP
|
||||
```
|
||||
|
||||
**Inner loop** (`inner_loop=true`): Processes ALL same-prefix tasks sequentially in a single agent instance. `context_accumulator` is passed to each subsequent subagent as `## Prior Context` for knowledge continuity.
|
||||
**Inner loop** (`inner_loop=true`): Processes ALL same-prefix tasks sequentially in a single agent instance. `context_accumulator` maintains context across task iterations for knowledge continuity.
|
||||
|
||||
| Step | Phase 5-L (loop) | Phase 5-F (final) |
|
||||
|------|-----------------|------------------|
|
||||
@@ -123,107 +123,42 @@ After claiming a task, check if output artifacts already exist (indicates resume
|
||||
|
||||
The role_spec contains Phase 2, Phase 3, and Phase 4 sections with domain-specific logic. Follow those instructions exactly. Key integration points with built-in infrastructure:
|
||||
|
||||
### Subagent Delegation
|
||||
## CRITICAL LIMITATION: No Subagent Delegation
|
||||
|
||||
When role_spec instructs to call a subagent, use these templates:
|
||||
**Team workers CANNOT call the Agent() tool to spawn subagents.**
|
||||
|
||||
**Discuss subagent** (for inline discuss rounds):
|
||||
Test evidence shows that team members spawned via Agent tool do not have access to the Agent tool themselves. Only the coordinator (main conversation context) can spawn agents.
|
||||
|
||||
### Alternatives for Team Workers
|
||||
|
||||
When role-spec instructions require analysis or exploration:
|
||||
|
||||
**Option A: CLI Tools** (Recommended)
|
||||
```javascript
|
||||
Bash(`ccw cli -p "..." --tool gemini --mode analysis`, { run_in_background: false })
|
||||
```
|
||||
Agent({
|
||||
subagent_type: "cli-discuss-agent",
|
||||
run_in_background: false,
|
||||
description: "Discuss <round-id>",
|
||||
prompt: `## Multi-Perspective Critique: <round-id>
|
||||
|
||||
### Input
|
||||
- Artifact: <artifact-path>
|
||||
- Round: <round-id>
|
||||
- Perspectives: <perspective-list-from-role-spec>
|
||||
- Session: <session-folder>
|
||||
- Discovery Context: <session-folder>/spec/discovery-context.json
|
||||
**Option B: Direct Tools**
|
||||
Use Read, Grep, Glob, mcp__ace-tool__search_context directly.
|
||||
|
||||
### Perspective Routing
|
||||
|
||||
| Perspective | CLI Tool | Role | Focus Areas |
|
||||
|-------------|----------|------|-------------|
|
||||
| Product | gemini | Product Manager | Market fit, user value, business viability |
|
||||
| Technical | codex | Tech Lead | Feasibility, tech debt, performance, security |
|
||||
| Quality | claude | QA Lead | Completeness, testability, consistency |
|
||||
| Risk | gemini | Risk Analyst | Risk identification, dependencies, failure modes |
|
||||
| Coverage | gemini | Requirements Analyst | Requirement completeness vs discovery-context |
|
||||
|
||||
### Execution Steps
|
||||
1. Read artifact from <artifact-path>
|
||||
2. For each perspective, launch CLI analysis in background
|
||||
3. Wait for all CLI results
|
||||
4. Divergence detection + consensus determination
|
||||
5. Synthesize convergent/divergent themes + action items
|
||||
6. Write discussion record to: <session-folder>/discussions/<round-id>-discussion.md
|
||||
|
||||
### Return Value
|
||||
JSON with: verdict (consensus_reached|consensus_blocked), severity (HIGH|MEDIUM|LOW), average_rating, divergences, action_items, recommendation, discussion_path`
|
||||
})
|
||||
```
|
||||
|
||||
**Explore subagent** (for codebase exploration):
|
||||
|
||||
```
|
||||
Agent({
|
||||
subagent_type: "cli-explore-agent",
|
||||
run_in_background: false,
|
||||
description: "Explore <angle>",
|
||||
prompt: `Explore codebase for: <query>
|
||||
|
||||
Focus angle: <angle>
|
||||
Keywords: <keyword-list>
|
||||
Session folder: <session-folder>
|
||||
|
||||
## Cache Check
|
||||
1. Read <session-folder>/explorations/cache-index.json (if exists)
|
||||
2. Look for entry with matching angle
|
||||
3. If found AND file exists -> read cached result, return summary
|
||||
4. If not found -> proceed to exploration
|
||||
|
||||
## Output
|
||||
Write JSON to: <session-folder>/explorations/explore-<angle>.json
|
||||
Update cache-index.json with new entry
|
||||
|
||||
Return summary: file count, pattern count, top 5 files, output path`
|
||||
})
|
||||
```
|
||||
|
||||
**Doc-generation subagent** (for writer document generation):
|
||||
|
||||
```
|
||||
Agent({
|
||||
subagent_type: "universal-executor",
|
||||
run_in_background: false,
|
||||
description: "Generate <doc-type>",
|
||||
prompt: `## Document Generation: <doc-type>
|
||||
|
||||
### Session
|
||||
- Folder: <session-folder>
|
||||
- Spec config: <spec-config-path>
|
||||
|
||||
### Document Config
|
||||
- Type: <doc-type>
|
||||
- Template: <template-path>
|
||||
- Output: <output-path>
|
||||
- Prior discussion: <discussion-file or "none">
|
||||
|
||||
### Writer Accumulator (prior decisions)
|
||||
<JSON array of prior task summaries from context_accumulator>
|
||||
|
||||
### Output Requirements
|
||||
1. Write document to <output-path>
|
||||
2. Return JSON: { artifact_path, summary, key_decisions[], sections_generated[], warnings[] }`
|
||||
**Option C: Request Coordinator Help**
|
||||
Send message to coordinator requesting subagent delegation:
|
||||
```javascript
|
||||
mcp__ccw-tools__team_msg({
|
||||
operation: "log",
|
||||
session_id: sessionId,
|
||||
from: role,
|
||||
to: "coordinator",
|
||||
type: "subagent_request",
|
||||
summary: "Request exploration subagent for X",
|
||||
data: { reason: "...", scope: "..." }
|
||||
})
|
||||
SendMessage({ recipient: "coordinator", content: "..." })
|
||||
```
|
||||
|
||||
### Consensus Handling
|
||||
|
||||
After a discuss subagent returns, handle the verdict:
|
||||
When role-spec instructions require consensus/discussion, handle the verdict:
|
||||
|
||||
| Verdict | Severity | Action |
|
||||
|---------|----------|--------|
|
||||
@@ -374,7 +309,7 @@ After Phase 4 verification, the worker MUST publish its contributions:
|
||||
1. **Artifact**: Write deliverable to `<session>/artifacts/<prefix>-<task-id>-<name>.md`
|
||||
2. **State data**: Prepare payload for Phase 5 `state_update` message (see Phase 5-L step 2 for schema)
|
||||
3. **Wisdom**: Append new patterns to `learnings.md`, decisions to `decisions.md`, issues to `issues.md`
|
||||
4. **Context accumulator** (inner_loop only): Append summary (see Phase 5-L step 3 for schema). Pass full accumulator to subsequent subagents as `## Prior Context`.
|
||||
4. **Context accumulator** (inner_loop only): Append summary (see Phase 5-L step 3 for schema). Maintain full accumulator for context continuity across iterations.
|
||||
|
||||
### Wisdom Files
|
||||
|
||||
@@ -444,7 +379,7 @@ ccw team log --session-id <session_id> --from <role> --type <type> --json
|
||||
|---------|-----------|
|
||||
| Process own prefix tasks | Process other role's prefix tasks |
|
||||
| SendMessage to coordinator | Directly communicate with other workers |
|
||||
| Use declared subagents (discuss, explore, doc-gen) | Create tasks for other roles |
|
||||
| Use CLI tools for analysis/exploration | Create tasks for other roles |
|
||||
| Fast-advance simple successors | Spawn parallel worker batches |
|
||||
| Write to own artifacts + wisdom | Modify resources outside own scope |
|
||||
|
||||
@@ -455,9 +390,7 @@ ccw team log --session-id <session_id> --from <role> --type <type> --json
|
||||
| Scenario | Resolution |
|
||||
|----------|------------|
|
||||
| Role spec file not found | Report error via SendMessage, STOP |
|
||||
| Subagent failure | Retry once with alternative subagent_type. Still fails → log warning, continue if possible |
|
||||
| Discuss subagent failure | Skip discuss, log warning in report. Proceed without discuss verdict |
|
||||
| Explore subagent failure | Continue without codebase context |
|
||||
| CLI tool failure | Retry once. Still fails → log warning, continue with available data |
|
||||
| Cumulative errors >= 3 | SendMessage to coordinator with error summary, STOP |
|
||||
| No tasks found | SendMessage idle status, STOP |
|
||||
| Context missing (prior doc, template) | Request from coordinator via SendMessage |
|
||||
|
||||
@@ -10,12 +10,46 @@ Complex refactoring decisions (e.g., choosing between dependency inversion vs me
|
||||
|
||||
Called by designer, reviewer after their primary analysis when complexity warrants multi-perspective evaluation:
|
||||
|
||||
```javascript
|
||||
// Multi-perspective discussion using CLI tools
|
||||
Bash({
|
||||
command: `ccw cli -p "PURPOSE: Conduct multi-perspective discussion on <topic> for architecture optimization
|
||||
TASK: • Evaluate architecture impact • Assess risks and trade-offs • Consider maintainability • Explore alternatives
|
||||
MODE: analysis
|
||||
CONTEXT: @<session-folder>/discussions/<round-id>.md | Memory: <relevant-context-from-calling-role>
|
||||
EXPECTED: Structured recommendation with consensus verdict (proceed/revise/escalate), confidence level, key trade-offs, recommended approach with rationale, dissenting perspectives
|
||||
CONSTRAINTS: Focus on <round-id> topic
|
||||
|
||||
Round: <round-id>
|
||||
Topic: <discussion-topic>
|
||||
Session: <session-folder>
|
||||
|
||||
Context:
|
||||
<relevant-context-from-calling-role>
|
||||
|
||||
Perspectives to consider:
|
||||
- Architecture impact: Will this actually improve the target structural metric?
|
||||
- Risk assessment: What could break? Dangling references? Behavioral changes? Migration risk?
|
||||
- Maintainability: Is the refactored code more understandable and maintainable?
|
||||
- Alternative approaches: Are there simpler or safer ways to achieve the same structural improvement?
|
||||
|
||||
Evaluate trade-offs and provide a structured recommendation with:
|
||||
- Consensus verdict: proceed / revise / escalate
|
||||
- Confidence level: high / medium / low
|
||||
- Key trade-offs identified
|
||||
- Recommended approach with rationale
|
||||
- Dissenting perspectives (if any)" --tool gemini --mode analysis`,
|
||||
run_in_background: false
|
||||
})
|
||||
```
|
||||
Agent({
|
||||
subagent_type: "cli-discuss-agent",
|
||||
run_in_background: false,
|
||||
description: "Discuss <round-id>: <topic> for architecture optimization",
|
||||
prompt: `Conduct a multi-perspective discussion on the following topic.
|
||||
|
||||
**Alternative: Direct multi-perspective analysis**
|
||||
|
||||
For simpler discussions, call CLI tool directly without wrapper:
|
||||
|
||||
```javascript
|
||||
Bash({
|
||||
command: `ccw cli -p "Conduct a multi-perspective discussion on the following topic.
|
||||
|
||||
Round: <round-id>
|
||||
Topic: <discussion-topic>
|
||||
|
||||
@@ -12,7 +12,7 @@ Called by analyzer, refactorer after needing codebase context for architecture a
|
||||
|
||||
```
|
||||
Agent({
|
||||
subagent_type: "cli-explore-agent",
|
||||
subagent_type: "Explore",
|
||||
run_in_background: false,
|
||||
description: "Explore codebase for architecture-critical structures in <target-scope>",
|
||||
prompt: `Explore the codebase to identify architecture-critical structures.
|
||||
|
||||
@@ -10,12 +10,11 @@ Unlike team-lifecycle-v4's fixed perspective definitions (product, technical, qu
|
||||
|
||||
Called by roles after artifact creation:
|
||||
|
||||
```
|
||||
Agent({
|
||||
subagent_type: "cli-discuss-agent",
|
||||
run_in_background: false,
|
||||
description: "Discuss <round-id>",
|
||||
prompt: `## Multi-Perspective Critique: <round-id>
|
||||
```javascript
|
||||
// Multi-perspective critique using CLI tools
|
||||
// The coordinator reads the artifact and launches parallel CLI analyses for each perspective
|
||||
Bash({
|
||||
command: `ccw cli -p "## Multi-Perspective Critique: <round-id>
|
||||
|
||||
### Input
|
||||
- Artifact: <artifact-path>
|
||||
|
||||
@@ -6,7 +6,7 @@ Shared codebase exploration utility with centralized caching. Callable by any ro
|
||||
|
||||
```
|
||||
Agent({
|
||||
subagent_type: "cli-explore-agent",
|
||||
subagent_type: "Explore",
|
||||
run_in_background: false,
|
||||
description: "Explore <angle>",
|
||||
prompt: `Explore codebase for: <query>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
name: team-issue
|
||||
description: Unified team skill for issue resolution. All roles invoke this skill with --role arg for role-specific execution. Triggers on "team issue".
|
||||
allowed-tools: TeamCreate(*), TeamDelete(*), SendMessage(*), TaskCreate(*), TaskUpdate(*), TaskList(*), TaskGet(*), Agent(*), AskUserQuestion(*), Read(*), Write(*), Edit(*), Bash(*), Glob(*), Grep(*)
|
||||
allowed-tools: TeamCreate(*), TeamDelete(*), SendMessage(*), TaskCreate(*), TaskUpdate(*), TaskList(*), TaskGet(*), Agent(*), AskUserQuestion(*), Read(*), Write(*), Edit(*), Bash(*), Glob(*), Grep(*), mcp__ace-tool__search_context(*), mcp__ccw-tools__team_msg(*)
|
||||
---
|
||||
|
||||
# Team Issue Resolution
|
||||
@@ -136,7 +136,7 @@ Cross-task knowledge accumulation. Coordinator creates `wisdom/` directory at se
|
||||
| Use tools declared in Toolbox | Create tasks for other roles |
|
||||
| Delegate to reused agents | Modify resources outside own responsibility |
|
||||
|
||||
Coordinator additional restrictions: Do not write/modify code directly, do not call implementation subagents (issue-plan-agent etc.), do not execute analysis/review directly.
|
||||
Coordinator additional restrictions: Do not write/modify code directly, do not execute analysis/review directly. Team members use CLI tools for analysis/implementation tasks.
|
||||
|
||||
### Output Tagging
|
||||
|
||||
|
||||
@@ -53,31 +53,22 @@ Bash("ccw issue status <issueId> --json")
|
||||
| Complexity | Execution |
|
||||
|------------|-----------|
|
||||
| Low | Direct ACE search: `mcp__ace-tool__search_context(project_root_path, query)` |
|
||||
| Medium/High | Spawn cli-explore-agent: `Agent({ subagent_type: "cli-explore-agent", run_in_background: false })` |
|
||||
| Medium/High | CLI exploration: `Bash("ccw cli -p \"<exploration_prompt>\" --tool gemini --mode analysis", { run_in_background: false })` |
|
||||
|
||||
**cli-explore-agent prompt template**:
|
||||
**CLI exploration prompt template**:
|
||||
|
||||
```
|
||||
## Issue Context
|
||||
ID: <issueId>
|
||||
Title: <issue.title>
|
||||
Description: <issue.context>
|
||||
Priority: <issue.priority>
|
||||
PURPOSE: Explore codebase for issue <issueId> to identify relevant files, dependencies, and impact scope; success = comprehensive context report written to <session>/explorations/context-<issueId>.json
|
||||
|
||||
## MANDATORY FIRST STEPS
|
||||
1. Run: ccw tool exec get_modules_by_depth '{}'
|
||||
2. Execute ACE searches based on issue keywords
|
||||
3. Run: ccw spec load --category exploration
|
||||
TASK: • Run ccw tool exec get_modules_by_depth '{}' • Execute ACE searches for issue keywords • Map file dependencies and integration points • Assess impact scope • Find existing patterns • Check git log for related changes
|
||||
|
||||
## Exploration Focus
|
||||
- Identify files directly related to this issue
|
||||
- Map dependencies and integration points
|
||||
- Assess impact scope (how many modules/files affected)
|
||||
- Find existing patterns relevant to the fix
|
||||
- Check for previous related changes (git log)
|
||||
MODE: analysis
|
||||
|
||||
## Output
|
||||
Write findings to: <session>/explorations/context-<issueId>.json
|
||||
CONTEXT: @**/* | Memory: Issue <issueId> - <issue.title> (Priority: <issue.priority>)
|
||||
|
||||
EXPECTED: JSON report with: relevant_files (path + relevance), dependencies, impact_scope (low/medium/high), existing_patterns, related_changes, key_findings, complexity_assessment
|
||||
|
||||
CONSTRAINTS: Focus on issue context | Write output to <session>/explorations/context-<issueId>.json
|
||||
```
|
||||
|
||||
**Report schema**:
|
||||
|
||||
@@ -15,9 +15,9 @@ Load solution plan, route to execution backend (Agent/Codex/Gemini), run tests,
|
||||
|
||||
| Backend | Condition | Method |
|
||||
|---------|-----------|--------|
|
||||
| agent | task_count <= 3 or explicit | `Agent({ subagent_type: "code-developer", run_in_background: false })` |
|
||||
| codex | task_count > 3 or explicit | `ccw cli --tool codex --mode write --id issue-<issueId>` |
|
||||
| gemini | explicit | `ccw cli --tool gemini --mode write --id issue-<issueId>` |
|
||||
| gemini | task_count <= 3 or explicit | `ccw cli --tool gemini --mode write --id issue-<issueId>` |
|
||||
| qwen | explicit | `ccw cli --tool qwen --mode write --id issue-<issueId>` |
|
||||
|
||||
## Phase 2: Load Solution & Resolve Executor
|
||||
|
||||
@@ -26,7 +26,7 @@ Load solution plan, route to execution backend (Agent/Codex/Gemini), run tests,
|
||||
| Issue ID | Task description (GH-\d+ or ISS-\d{8}-\d{6}) | Yes |
|
||||
| Bound solution | `ccw issue solutions <id> --json` | Yes |
|
||||
| Explorer context | `<session>/explorations/context-<issueId>.json` | No |
|
||||
| Execution method | Task description (`execution_method: Agent|Codex|Gemini|Auto`) | Yes |
|
||||
| Execution method | Task description (`execution_method: Codex|Gemini|Qwen|Auto`) | Yes |
|
||||
| Code review | Task description (`code_review: Skip|Gemini Review|Codex Review`) | No |
|
||||
|
||||
1. Extract issue ID from task description
|
||||
@@ -34,7 +34,7 @@ Load solution plan, route to execution backend (Agent/Codex/Gemini), run tests,
|
||||
3. Load bound solution: `Bash("ccw issue solutions <issueId> --json")`
|
||||
4. If no bound solution -> report error, STOP
|
||||
5. Load explorer context (if available)
|
||||
6. Resolve execution method (Auto: task_count <= 3 -> agent, else codex)
|
||||
6. Resolve execution method (Auto: task_count <= 3 -> gemini, else codex)
|
||||
7. Update issue status: `Bash("ccw issue update <issueId> --status in-progress")`
|
||||
|
||||
## Phase 3: Implementation (Multi-Backend Routing)
|
||||
@@ -69,9 +69,9 @@ Dependencies: <explorerContext.dependencies>
|
||||
```
|
||||
|
||||
Route by executor:
|
||||
- **agent**: `Agent({ subagent_type: "code-developer", run_in_background: false, prompt: <prompt> })`
|
||||
- **codex**: `Bash("ccw cli -p \"<prompt>\" --tool codex --mode write --id issue-<issueId>")`
|
||||
- **gemini**: `Bash("ccw cli -p \"<prompt>\" --tool gemini --mode write --id issue-<issueId>")`
|
||||
- **codex**: `Bash("ccw cli -p \"<prompt>\" --tool codex --mode write --id issue-<issueId>", { run_in_background: false })`
|
||||
- **gemini**: `Bash("ccw cli -p \"<prompt>\" --tool gemini --mode write --id issue-<issueId>", { run_in_background: false })`
|
||||
- **qwen**: `Bash("ccw cli -p \"<prompt>\" --tool qwen --mode write --id issue-<issueId>", { run_in_background: false })`
|
||||
|
||||
On CLI failure, resume: `ccw cli -p "Continue" --resume issue-<issueId> --tool <tool> --mode write`
|
||||
|
||||
|
||||
@@ -34,32 +34,25 @@ Bash("ccw issue solutions <issueId> --json")
|
||||
| All issues bound | Proceed to Phase 3 |
|
||||
| Any issue unbound | Report error to coordinator, STOP |
|
||||
|
||||
## Phase 3: Queue Formation via issue-queue-agent
|
||||
## Phase 3: Queue Formation via CLI
|
||||
|
||||
**Agent invocation**:
|
||||
**CLI invocation**:
|
||||
|
||||
```
|
||||
Agent({
|
||||
subagent_type: "issue-queue-agent",
|
||||
run_in_background: false,
|
||||
description: "Form queue for <count> issues",
|
||||
prompt: "
|
||||
## Issues to Queue
|
||||
Issue IDs: <issueIds>
|
||||
Bash("ccw cli -p \"
|
||||
PURPOSE: Form execution queue for <count> issues with conflict detection and optimal ordering; success = DAG-based queue with parallel groups written to execution-queue.json
|
||||
|
||||
## Bound Solutions
|
||||
<solution list with issue_id, solution_id, task_count>
|
||||
TASK: • Load all bound solutions from .workflow/issues/solutions/ • Analyze file conflicts between solutions • Build dependency graph • Determine optimal execution order (DAG-based) • Identify parallel execution groups • Write queue JSON
|
||||
|
||||
## Instructions
|
||||
1. Load all bound solutions from .workflow/issues/solutions/
|
||||
2. Analyze file conflicts between solutions using Gemini CLI
|
||||
3. Determine optimal execution order (DAG-based)
|
||||
4. Produce ordered execution queue
|
||||
MODE: analysis
|
||||
|
||||
## Expected Output
|
||||
Write queue to: .workflow/issues/queue/execution-queue.json
|
||||
"
|
||||
})
|
||||
CONTEXT: @.workflow/issues/solutions/**/*.json | Memory: Issues to queue: <issueIds>
|
||||
|
||||
EXPECTED: Queue JSON with: ordered issue list, conflict analysis, parallel_groups (issues that can run concurrently), depends_on relationships
|
||||
Write to: .workflow/issues/queue/execution-queue.json
|
||||
|
||||
CONSTRAINTS: Resolve file conflicts | Optimize for parallelism | Maintain dependency order
|
||||
\" --tool gemini --mode analysis", { run_in_background: true })
|
||||
```
|
||||
|
||||
**Parse queue result**:
|
||||
|
||||
@@ -35,39 +35,38 @@ Read("<session>/explorations/context-<issueId>.json")
|
||||
- Design alternative approach addressing reviewer concerns
|
||||
5. Load wisdom files for accumulated codebase knowledge
|
||||
|
||||
## Phase 3: Solution Generation via issue-plan-agent
|
||||
## Phase 3: Solution Generation via CLI
|
||||
|
||||
**Agent invocation**:
|
||||
**CLI invocation**:
|
||||
|
||||
```
|
||||
Agent({
|
||||
subagent_type: "issue-plan-agent",
|
||||
run_in_background: false,
|
||||
description: "Plan solution for <issueId>",
|
||||
prompt: "
|
||||
issue_ids: [\"<issueId>\"]
|
||||
project_root: \"<projectRoot>\"
|
||||
Bash("ccw cli -p \"
|
||||
PURPOSE: Design solution for issue <issueId> and decompose into implementation tasks; success = solution bound to issue with task breakdown
|
||||
|
||||
## Explorer Context (pre-gathered)
|
||||
TASK: • Load issue details from ccw issue status • Analyze explorer context • Design solution approach • Break down into implementation tasks • Generate solution JSON • Bind solution to issue
|
||||
|
||||
MODE: analysis
|
||||
|
||||
CONTEXT: @**/* | Memory: Issue <issueId> - <issue.title> (Priority: <issue.priority>)
|
||||
Explorer findings: <explorerContext.key_findings>
|
||||
Relevant files: <explorerContext.relevant_files>
|
||||
Key findings: <explorerContext.key_findings>
|
||||
Complexity: <explorerContext.complexity_assessment>
|
||||
|
||||
## Revision Required (if SOLVE-fix)
|
||||
Previous solution was rejected by reviewer. Feedback:
|
||||
<reviewFeedback>
|
||||
EXPECTED: Solution JSON with: issue_id, solution_id, approach, tasks (ordered list with descriptions), estimated_files, dependencies
|
||||
Write to: <session>/solutions/solution-<issueId>.json
|
||||
Then bind: ccw issue bind <issueId> <solution_id>
|
||||
|
||||
Design an ALTERNATIVE approach that addresses the reviewer's concerns.
|
||||
"
|
||||
})
|
||||
CONSTRAINTS: Follow existing patterns | Minimal changes | Address reviewer feedback if SOLVE-fix task
|
||||
\" --tool gemini --mode analysis", { run_in_background: true })
|
||||
```
|
||||
|
||||
**Expected agent result**:
|
||||
**Expected CLI output**: Solution file path and binding confirmation
|
||||
|
||||
| Field | Description |
|
||||
|-------|-------------|
|
||||
| `bound` | Array of auto-bound solutions: `[{issue_id, solution_id, task_count}]` |
|
||||
| `pending_selection` | Array of multi-solution issues: `[{issue_id, solutions: [...]}]` |
|
||||
**Parse result**:
|
||||
|
||||
```
|
||||
Read("<session>/solutions/solution-<issueId>.json")
|
||||
```
|
||||
|
||||
## Phase 4: Solution Selection & Reporting
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ role: analyst
|
||||
prefix: RESEARCH
|
||||
inner_loop: false
|
||||
discuss_rounds: [DISCUSS-001]
|
||||
subagents: [explore, discuss]
|
||||
subagents: [discuss]
|
||||
message_types:
|
||||
success: research_ready
|
||||
progress: research_progress
|
||||
@@ -44,18 +44,21 @@ EXPECTED: JSON with: problem_statement, target_users[], domain, constraints[], e
|
||||
| package.json / Cargo.toml / pyproject.toml / go.mod exists | Explore codebase |
|
||||
| No project files | Skip → codebase context = null |
|
||||
|
||||
**When project detected**: Call explore subagent with `angle: general`, `keywords: <from seed analysis>`.
|
||||
**When project detected**: Use CLI exploration with Gemini.
|
||||
|
||||
```
|
||||
Agent({
|
||||
subagent_type: "cli-explore-agent",
|
||||
run_in_background: false,
|
||||
description: "Explore general context",
|
||||
prompt: "Explore codebase for: <topic>\nFocus angle: general\nKeywords: <seed analysis keywords>\nSession folder: <session-folder>\n..."
|
||||
Bash({
|
||||
command: `ccw cli -p "PURPOSE: Explore codebase for general context to inform spec generation
|
||||
TASK: • Identify tech stack and frameworks • Map architecture patterns • Document conventions • List integration points
|
||||
MODE: analysis
|
||||
CONTEXT: @**/* | Memory: Seed analysis keywords: <keywords>
|
||||
EXPECTED: JSON with: tech_stack[], architecture_patterns[], conventions[], integration_points[]
|
||||
CONSTRAINTS: Focus on general context" --tool gemini --mode analysis --rule analysis-analyze-code-patterns`,
|
||||
run_in_background: false
|
||||
})
|
||||
```
|
||||
|
||||
Use exploration results to build codebase context: tech_stack, architecture_patterns, conventions, integration_points.
|
||||
Parse CLI output to build codebase context: tech_stack, architecture_patterns, conventions, integration_points.
|
||||
|
||||
## Phase 4: Context Packaging + Inline Discuss
|
||||
|
||||
@@ -89,5 +92,5 @@ Handle discuss verdict per team-worker consensus handling protocol.
|
||||
| Gemini CLI failure | Fallback to direct Claude analysis |
|
||||
| Codebase detection failed | Continue as new project |
|
||||
| Topic too vague | Report with clarification questions |
|
||||
| Explore subagent fails | Continue without codebase context |
|
||||
| CLI exploration fails | Continue without codebase context |
|
||||
| Discuss subagent fails | Proceed without discuss, log warning |
|
||||
|
||||
@@ -42,9 +42,9 @@ message_types:
|
||||
|
||||
| Backend | Invocation | Use Case |
|
||||
|---------|-----------|----------|
|
||||
| agent | `Agent({ subagent_type: "code-developer", run_in_background: false })` | Simple, direct edits |
|
||||
| codex | `ccw cli --tool codex --mode write` (background) | Complex, architecture |
|
||||
| gemini | `ccw cli --tool gemini --mode write` (background) | Analysis-heavy |
|
||||
| gemini | `ccw cli --tool gemini --mode write` (foreground) | Simple, direct edits |
|
||||
| codex | `ccw cli --tool codex --mode write` (foreground) | Complex, architecture |
|
||||
| qwen | `ccw cli --tool qwen --mode write` (foreground) | Alternative backend |
|
||||
|
||||
## Phase 4: Self-Validation
|
||||
|
||||
@@ -63,5 +63,5 @@ message_types:
|
||||
|----------|------------|
|
||||
| Syntax errors | Retry with error context (max 3) |
|
||||
| Missing dependencies | Request from coordinator |
|
||||
| Backend unavailable | Fallback to agent |
|
||||
| Backend unavailable | Fallback to alternative tool |
|
||||
| Circular dependencies | Abort, report graph |
|
||||
|
||||
@@ -42,8 +42,8 @@ message_types:
|
||||
|
||||
| Task Size | Strategy |
|
||||
|-----------|----------|
|
||||
| Simple (<= 3 files, single component) | `Agent({ subagent_type: "code-developer", run_in_background: false })` |
|
||||
| Complex (system, multi-component) | `ccw cli --tool gemini --mode write` (background) |
|
||||
| Simple (<= 3 files, single component) | `ccw cli --tool gemini --mode write` (foreground) |
|
||||
| Complex (system, multi-component) | `ccw cli --tool codex --mode write` (foreground) |
|
||||
|
||||
**Coding standards** (include in agent/CLI prompt):
|
||||
- Use design token CSS variables, never hardcode colors/spacing
|
||||
@@ -76,4 +76,4 @@ Contribute to wisdom/conventions.md. Update shared-memory.json with component in
|
||||
|----------|------------|
|
||||
| Design tokens not found | Use project defaults |
|
||||
| Tech stack undetected | Default HTML + CSS |
|
||||
| Subagent failure | Fallback to CLI write mode |
|
||||
| CLI failure | Retry with alternative tool |
|
||||
|
||||
@@ -3,7 +3,7 @@ role: planner
|
||||
prefix: PLAN
|
||||
inner_loop: true
|
||||
discuss_rounds: []
|
||||
subagents: [explore]
|
||||
subagents: []
|
||||
message_types:
|
||||
success: plan_ready
|
||||
revision: plan_revision
|
||||
@@ -30,14 +30,17 @@ If `<session-folder>/spec/` exists → load requirements/_index.md, architecture
|
||||
| Medium | 200-500 chars or moderate scope | 2-3 angle explore subagent |
|
||||
| High | > 500 chars, refactor/architecture, multi-module | 3-5 angle explore subagent |
|
||||
|
||||
For each angle, call explore subagent (cache-aware — check cache-index.json before each call):
|
||||
For each angle, use CLI exploration (cache-aware — check cache-index.json before each call):
|
||||
|
||||
```
|
||||
Agent({
|
||||
subagent_type: "cli-explore-agent",
|
||||
run_in_background: false,
|
||||
description: "Explore <angle>",
|
||||
prompt: "Explore codebase for: <task>\nFocus angle: <angle>\nKeywords: <keywords>\nSession folder: <session-folder>\n..."
|
||||
Bash({
|
||||
command: `ccw cli -p "PURPOSE: Explore codebase from <angle> perspective to inform planning
|
||||
TASK: • Search for <angle>-specific patterns • Identify relevant files • Document integration points
|
||||
MODE: analysis
|
||||
CONTEXT: @**/* | Memory: Task keywords: <keywords>
|
||||
EXPECTED: JSON with: relevant_files[], patterns[], integration_points[], recommendations[]
|
||||
CONSTRAINTS: Focus on <angle> perspective" --tool gemini --mode analysis --rule analysis-analyze-code-patterns`,
|
||||
run_in_background: false
|
||||
})
|
||||
```
|
||||
|
||||
@@ -50,20 +53,17 @@ Agent({
|
||||
| Low | Direct planning → single TASK-001 with plan.json |
|
||||
| Medium/High | cli-lite-planning-agent with exploration results |
|
||||
|
||||
**Agent call** (Medium/High):
|
||||
**CLI call** (Medium/High):
|
||||
|
||||
```
|
||||
Agent({
|
||||
subagent_type: "cli-lite-planning-agent",
|
||||
run_in_background: false,
|
||||
description: "Generate implementation plan",
|
||||
prompt: "Generate plan.
|
||||
Output: <plan-dir>/plan.json + <plan-dir>/.task/TASK-*.json
|
||||
Schema: cat ~/.ccw/workflows/cli-templates/schemas/plan-overview-base-schema.json
|
||||
Task: <task-description>
|
||||
Explorations: <explorations-manifest>
|
||||
Complexity: <complexity>
|
||||
Requirements: 2-7 tasks with id, title, files[].change, convergence.criteria, depends_on"
|
||||
Bash({
|
||||
command: `ccw cli -p "PURPOSE: Generate structured implementation plan from exploration results
|
||||
TASK: • Create plan.json with overview • Generate TASK-*.json files (2-7 tasks) • Define dependencies • Set convergence criteria
|
||||
MODE: write
|
||||
CONTEXT: @<session-folder>/explorations/*.json | Memory: Complexity: <complexity>
|
||||
EXPECTED: Files: plan.json + .task/TASK-*.json. Schema: ~/.ccw/workflows/cli-templates/schemas/plan-overview-base-schema.json
|
||||
CONSTRAINTS: 2-7 tasks, include id/title/files[].change/convergence.criteria/depends_on" --tool gemini --mode write --rule planning-breakdown-task-steps`,
|
||||
run_in_background: false
|
||||
})
|
||||
```
|
||||
|
||||
@@ -91,8 +91,8 @@ Requirements: 2-7 tasks with id, title, files[].change, convergence.criteria, de
|
||||
|
||||
| Scenario | Resolution |
|
||||
|----------|------------|
|
||||
| Exploration agent failure | Plan from description only |
|
||||
| Planning agent failure | Fallback to direct planning |
|
||||
| CLI exploration failure | Plan from description only |
|
||||
| CLI planning failure | Fallback to direct planning |
|
||||
| Plan rejected 3+ times | Notify coordinator, suggest alternative |
|
||||
| Schema not found | Use basic structure |
|
||||
| Cache index corrupt | Clear cache, re-explore all angles |
|
||||
|
||||
@@ -3,7 +3,7 @@ role: writer
|
||||
prefix: DRAFT
|
||||
inner_loop: true
|
||||
discuss_rounds: [DISCUSS-002, DISCUSS-003, DISCUSS-004, DISCUSS-005]
|
||||
subagents: [discuss, doc-generation]
|
||||
subagents: [discuss]
|
||||
message_types:
|
||||
success: draft_ready
|
||||
revision: draft_revision
|
||||
@@ -56,42 +56,23 @@ message_types:
|
||||
|
||||
## Phase 3: Subagent Document Generation
|
||||
|
||||
**Objective**: Delegate document generation to doc-generation subagent.
|
||||
**Objective**: Generate document using CLI tool.
|
||||
|
||||
Do NOT execute CLI calls in main agent. Delegate to subagent:
|
||||
Use Gemini CLI for document generation:
|
||||
|
||||
```
|
||||
Agent({
|
||||
subagent_type: "universal-executor",
|
||||
run_in_background: false,
|
||||
description: "Generate <doc-type> document",
|
||||
prompt: `<from subagents/doc-generation-subagent.md>
|
||||
|
||||
## Task
|
||||
- Document type: <doc-type>
|
||||
- Session folder: <session-folder>
|
||||
- Template: <template-path>
|
||||
|
||||
## Context
|
||||
- Spec config: <spec-config content>
|
||||
- Discovery context: <discovery-context summary>
|
||||
- Prior discussion feedback: <discussion-file content if exists>
|
||||
- Prior decisions (from writer accumulator):
|
||||
<context_accumulator serialized>
|
||||
|
||||
## Expected Output
|
||||
Return JSON:
|
||||
{
|
||||
"artifact_path": "<output-path>",
|
||||
"summary": "<100-200 char summary>",
|
||||
"key_decisions": ["<decision-1>", ...],
|
||||
"sections_generated": ["<section-1>", ...],
|
||||
"warnings": ["<warning if any>"]
|
||||
}`
|
||||
Bash({
|
||||
command: `ccw cli -p "PURPOSE: Generate <doc-type> document following template and standards
|
||||
TASK: • Load template from <template-path> • Apply spec config and discovery context • Integrate prior discussion feedback • Generate all required sections
|
||||
MODE: write
|
||||
CONTEXT: @<session-folder>/spec/*.json @<template-path> | Memory: Prior decisions: <context_accumulator summary>
|
||||
EXPECTED: Document at <output-path> with: YAML frontmatter, all template sections, cross-references, session_id
|
||||
CONSTRAINTS: Follow document-standards.md" --tool gemini --mode write --rule development-implement-feature --cd <session-folder>`,
|
||||
run_in_background: false
|
||||
})
|
||||
```
|
||||
|
||||
Main agent receives only the JSON summary. Document is written to disk by subagent.
|
||||
Parse CLI output for artifact path and summary. Document is written to disk by CLI.
|
||||
|
||||
## Phase 4: Self-Validation + Inline Discuss
|
||||
|
||||
@@ -119,7 +100,7 @@ Handle discuss verdict per team-worker consensus handling protocol.
|
||||
|
||||
| Scenario | Resolution |
|
||||
|----------|------------|
|
||||
| Subagent failure | Retry once with alternative subagent_type. Still fails → log error, continue next task |
|
||||
| CLI failure | Retry once with alternative tool. Still fails → log error, continue next task |
|
||||
| Discuss subagent fails | Skip discuss, log warning |
|
||||
| Cumulative 3 task failures | SendMessage to coordinator, STOP |
|
||||
| Prior doc not found | Notify coordinator, request prerequisite |
|
||||
|
||||
@@ -99,11 +99,10 @@ When coordinator needs to execute a command (dispatch, monitor):
|
||||
|
||||
## Execution Method Selection
|
||||
|
||||
支持 3 种执行后端:
|
||||
支持 2 种执行后端:
|
||||
|
||||
| Executor | 后端 | 适用场景 |
|
||||
|----------|------|----------|
|
||||
| `agent` | code-developer subagent | 简单任务、同步执行 |
|
||||
| `codex` | `ccw cli --tool codex --mode write` | 复杂任务、后台执行 |
|
||||
| `gemini` | `ccw cli --tool gemini --mode write` | 分析类任务、后台执行 |
|
||||
|
||||
@@ -111,12 +110,11 @@ When coordinator needs to execute a command (dispatch, monitor):
|
||||
|
||||
| Condition | Execution Method |
|
||||
|-----------|-----------------|
|
||||
| `--exec=agent` specified | Agent |
|
||||
| `--exec=codex` specified | Codex |
|
||||
| `--exec=gemini` specified | Gemini |
|
||||
| `-y` or `--yes` flag present | Auto (default Agent) |
|
||||
| `-y` or `--yes` flag present | Auto (default Gemini) |
|
||||
| No flags (interactive) | AskUserQuestion -> user choice |
|
||||
| Auto + task_count <= 3 | Agent |
|
||||
| Auto + task_count <= 3 | Gemini |
|
||||
| Auto + task_count > 3 | Codex |
|
||||
|
||||
---
|
||||
|
||||
@@ -30,37 +30,26 @@ Single-issue implementation agent. Loads solution from artifact file, routes to
|
||||
|
||||
### Backend Selection
|
||||
|
||||
| Method | Backend | Agent Type |
|
||||
|--------|---------|------------|
|
||||
| `agent` | code-developer subagent | Inline delegation |
|
||||
| Method | Backend | CLI Tool |
|
||||
|--------|---------|----------|
|
||||
| `codex` | `ccw cli --tool codex --mode write` | Background CLI |
|
||||
| `gemini` | `ccw cli --tool gemini --mode write` | Background CLI |
|
||||
|
||||
### Agent Backend
|
||||
|
||||
```
|
||||
Agent({
|
||||
subagent_type: "code-developer",
|
||||
description: "Implement <issue-title>",
|
||||
prompt: `Issue: <issueId>
|
||||
Title: <solution.title>
|
||||
Solution: <solution JSON>
|
||||
Implement all tasks from the solution plan.`,
|
||||
run_in_background: false
|
||||
})
|
||||
```
|
||||
|
||||
### CLI Backend (Codex/Gemini)
|
||||
|
||||
```bash
|
||||
ccw cli -p "Issue: <issueId>
|
||||
ccw cli -p "PURPOSE: Implement solution for issue <issueId>; success = all tasks completed, tests pass
|
||||
TASK: <solution.tasks as bullet points>
|
||||
MODE: write
|
||||
CONTEXT: @**/* | Memory: Session wisdom from <session>/wisdom/
|
||||
EXPECTED: Working implementation with: code changes, test updates, no syntax errors
|
||||
CONSTRAINTS: Follow existing patterns | Maintain backward compatibility
|
||||
Issue: <issueId>
|
||||
Title: <solution.title>
|
||||
Solution Plan: <solution JSON>
|
||||
Implement all tasks. Follow existing patterns. Run tests." \
|
||||
--tool <codex|gemini> --mode write
|
||||
Solution: <solution JSON>" --tool <codex|gemini> --mode write --rule development-implement-feature
|
||||
```
|
||||
|
||||
Wait for CLI completion before proceeding.
|
||||
Wait for CLI completion before proceeding to verification.
|
||||
|
||||
## Phase 4: Verification + Commit
|
||||
|
||||
@@ -95,7 +84,7 @@ Send `impl_complete` message to coordinator via team_msg + SendMessage.
|
||||
| Allowed | Prohibited |
|
||||
|---------|-----------|
|
||||
| Load solution from file | Create or modify issues |
|
||||
| Implement via Agent/Codex/Gemini | Modify solution artifacts |
|
||||
| Run tests | Spawn additional agents |
|
||||
| Implement via CLI tools (Codex/Gemini) | Modify solution artifacts |
|
||||
| Run tests | Spawn subagents (use CLI tools instead) |
|
||||
| git commit | Direct user interaction |
|
||||
| Update issue status | Create tasks for other roles |
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
---
|
||||
prefix: PLAN
|
||||
inner_loop: true
|
||||
subagents: [issue-plan-agent]
|
||||
message_types:
|
||||
success: issue_ready
|
||||
error: error
|
||||
@@ -36,18 +35,19 @@ For each issue, execute in sequence:
|
||||
|
||||
### 3a. Generate Solution
|
||||
|
||||
Delegate to `issue-plan-agent` subagent:
|
||||
Use CLI tool for issue planning:
|
||||
|
||||
```bash
|
||||
ccw cli -p "PURPOSE: Generate implementation solution for issue <issueId>; success = actionable task breakdown with file paths
|
||||
TASK: • Load issue details • Analyze requirements • Design solution approach • Break down into implementation tasks • Identify files to modify/create
|
||||
MODE: analysis
|
||||
CONTEXT: @**/* | Memory: Session context from <session>/wisdom/
|
||||
EXPECTED: JSON solution with: title, description, tasks array (each with description, files_touched), estimated_complexity
|
||||
CONSTRAINTS: Follow project patterns | Reference existing implementations
|
||||
" --tool gemini --mode analysis --rule planning-breakdown-task-steps
|
||||
```
|
||||
Agent({
|
||||
subagent_type: "issue-plan-agent",
|
||||
description: "Plan issue <issueId>",
|
||||
prompt: `issue_ids: ["<issueId>"]
|
||||
project_root: "<project-root>"
|
||||
Generate solution for this issue. Auto-bind single solution.`,
|
||||
run_in_background: false
|
||||
})
|
||||
```
|
||||
|
||||
Parse CLI output to extract solution JSON. If CLI fails, fallback to `ccw issue solution <issueId> --json`.
|
||||
|
||||
### 3b. Write Solution Artifact
|
||||
|
||||
|
||||
@@ -59,11 +59,16 @@ Bash("<test-command> 2>&1 || true")
|
||||
**Auto-fix delegation** (on failure):
|
||||
|
||||
```
|
||||
Agent({
|
||||
subagent_type: "code-developer",
|
||||
run_in_background: false,
|
||||
description: "Fix test failures (iteration <N>)",
|
||||
prompt: "Fix these test failures:\n<test-output>\nOnly fix test files, not source code."
|
||||
Bash({
|
||||
command: `ccw cli -p "PURPOSE: Fix test failures to achieve pass rate >= 0.95; success = all tests pass
|
||||
TASK: • Analyze test failure output • Identify root causes • Fix test code only (not source) • Preserve test intent
|
||||
MODE: write
|
||||
CONTEXT: @<session>/<test-dir>/**/* | Memory: Test framework: <framework>, iteration <N>/3
|
||||
EXPECTED: Fixed test files with: corrected assertions, proper async handling, fixed imports, maintained coverage
|
||||
CONSTRAINTS: Only modify test files | Preserve test structure | No source code changes
|
||||
Test failures:
|
||||
<test-output>" --tool gemini --mode write --cd <session>`,
|
||||
run_in_background: false
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
@@ -58,17 +58,21 @@ For revision mode:
|
||||
2. Generate test code: happy path, edge cases, error handling
|
||||
3. Write test file
|
||||
|
||||
**Agent delegation** (medium/high complexity):
|
||||
**CLI delegation** (medium/high complexity):
|
||||
|
||||
```
|
||||
Agent({
|
||||
subagent_type: "code-developer",
|
||||
run_in_background: false,
|
||||
description: "Generate <layer> tests",
|
||||
prompt: "Generate <layer> tests using <framework>...
|
||||
<file-list-with-content>
|
||||
<if-revision: previous failures + effective patterns>
|
||||
Write test files to: <session>/tests/<layer>/"
|
||||
Bash({
|
||||
command: `ccw cli -p "PURPOSE: Generate <layer> tests using <framework> to achieve coverage target; success = all priority files covered with quality tests
|
||||
TASK: • Analyze source files • Generate test cases (happy path, edge cases, errors) • Write test files with proper structure • Ensure import resolution
|
||||
MODE: write
|
||||
CONTEXT: @<source-files> @<session>/strategy/test-strategy.md | Memory: Framework: <framework>, Layer: <layer>, Round: <round>
|
||||
<if-revision: Previous failures: <failure-details>
|
||||
Effective patterns: <patterns-from-meta>>
|
||||
EXPECTED: Test files in <session>/tests/<layer>/ with: proper test structure, comprehensive coverage, correct imports, framework conventions
|
||||
CONSTRAINTS: Follow test strategy priorities | Use framework best practices | <layer>-appropriate assertions
|
||||
Source files to test:
|
||||
<file-list-with-content>" --tool gemini --mode write --cd <session>`,
|
||||
run_in_background: false
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
prefix: DISCUSS
|
||||
inner_loop: false
|
||||
subagents: [cli-explore-agent]
|
||||
subagents: []
|
||||
message_types:
|
||||
success: discussion_processed
|
||||
error: error
|
||||
@@ -46,27 +46,39 @@ Select strategy by discussion type:
|
||||
|
||||
**initial**: Cross-perspective summary -- identify convergent themes, conflicting views, top 5 discussion points and open questions from all analyses.
|
||||
|
||||
**deepen**: Spawn cli-explore-agent focused on open questions and uncertain insights:
|
||||
```
|
||||
Agent({
|
||||
subagent_type: "cli-explore-agent",
|
||||
run_in_background: false,
|
||||
prompt: "Focus on open questions: <questions>. Find evidence for uncertain insights. Write to: <session>/discussions/deepen-<num>.json"
|
||||
**deepen**: Use CLI tool for deep investigation:
|
||||
```javascript
|
||||
Bash({
|
||||
command: `ccw cli -p "PURPOSE: Investigate open questions and uncertain insights; success = evidence-based findings
|
||||
TASK: • Focus on open questions: <questions> • Find supporting evidence • Validate uncertain insights • Document findings
|
||||
MODE: analysis
|
||||
CONTEXT: @**/* | Memory: Session <session-folder>, previous analyses
|
||||
EXPECTED: JSON output with investigation results | Write to <session>/discussions/deepen-<num>.json
|
||||
CONSTRAINTS: Evidence-based analysis only
|
||||
" --tool gemini --mode analysis --rule analysis-trace-code-execution`,
|
||||
run_in_background: false
|
||||
})
|
||||
```
|
||||
|
||||
**direction-adjusted**: CLI re-analysis from adjusted focus:
|
||||
```
|
||||
ccw cli -p "Re-analyze '<topic>' with adjusted focus on '<userFeedback>'" --tool gemini --mode analysis
|
||||
```javascript
|
||||
Bash({
|
||||
command: `ccw cli -p "Re-analyze '<topic>' with adjusted focus on '<userFeedback>'" --tool gemini --mode analysis`,
|
||||
run_in_background: false
|
||||
})
|
||||
```
|
||||
|
||||
**specific-questions**: Spawn cli-explore-agent targeting user's questions:
|
||||
```
|
||||
Agent({
|
||||
subagent_type: "cli-explore-agent",
|
||||
description: "Answer specific user questions",
|
||||
run_in_background: false,
|
||||
prompt: "Answer: <userFeedback>. Write to: <session>/discussions/questions-<num>.json"
|
||||
**specific-questions**: Use CLI tool for targeted Q&A:
|
||||
```javascript
|
||||
Bash({
|
||||
command: `ccw cli -p "PURPOSE: Answer specific user questions about <topic>; success = clear, evidence-based answers
|
||||
TASK: • Answer: <userFeedback> • Provide code references • Explain context
|
||||
MODE: analysis
|
||||
CONTEXT: @**/* | Memory: Session <session-folder>
|
||||
EXPECTED: JSON output with answers and evidence | Write to <session>/discussions/questions-<num>.json
|
||||
CONSTRAINTS: Direct answers with code references
|
||||
" --tool gemini --mode analysis`,
|
||||
run_in_background: false
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
prefix: EXPLORE
|
||||
inner_loop: false
|
||||
subagents: [cli-explore-agent]
|
||||
subagents: []
|
||||
message_types:
|
||||
success: exploration_ready
|
||||
error: error
|
||||
@@ -40,39 +40,23 @@ Explore codebase structure through cli-explore-agent, collecting structured cont
|
||||
|
||||
## Phase 3: Codebase Exploration
|
||||
|
||||
Spawn `cli-explore-agent` subagent for actual exploration:
|
||||
Use CLI tool for codebase exploration:
|
||||
|
||||
```
|
||||
Agent({
|
||||
subagent_type: "cli-explore-agent",
|
||||
run_in_background: false,
|
||||
description: "Explore codebase: <topic> (<perspective>)",
|
||||
prompt: `
|
||||
## Analysis Context
|
||||
Topic: <topic>
|
||||
Perspective: <perspective> -- <strategy.focus>
|
||||
Dimensions: <dimensions>
|
||||
Session: <session-folder>
|
||||
|
||||
## MANDATORY FIRST STEPS
|
||||
1. Run: ccw tool exec get_modules_by_depth '{}'
|
||||
2. Execute searches based on topic + perspective keywords
|
||||
3. Run: ccw spec load --category exploration
|
||||
|
||||
## Exploration Focus (<perspective> angle)
|
||||
<dimension-specific exploration instructions>
|
||||
|
||||
## Output
|
||||
Write findings to: <session>/explorations/exploration-<num>.json
|
||||
Schema: { perspective, relevant_files: [{path, relevance, summary}], patterns: [string],
|
||||
key_findings: [string], module_map: {module: [files]}, questions_for_analysis: [string],
|
||||
_metadata: {agent, perspective, search_queries, timestamp} }
|
||||
`
|
||||
```javascript
|
||||
Bash({
|
||||
command: `ccw cli -p "PURPOSE: Explore codebase for <topic> from <perspective> perspective; success = structured findings with relevant files and patterns
|
||||
TASK: • Run module depth analysis • Search for topic-related patterns • Identify key files and their relationships • Extract architectural insights
|
||||
MODE: analysis
|
||||
CONTEXT: @**/* | Memory: Session <session-folder>, perspective <perspective>
|
||||
EXPECTED: JSON output with: relevant_files (path, relevance, summary), patterns, key_findings, module_map, questions_for_analysis, _metadata (perspective, search_queries, timestamp)
|
||||
CONSTRAINTS: Focus on <perspective> angle - <strategy.focus> | Write to <session>/explorations/exploration-<num>.json
|
||||
" --tool gemini --mode analysis --rule analysis-analyze-code-patterns`,
|
||||
run_in_background: false
|
||||
})
|
||||
```
|
||||
|
||||
**ACE fallback** (when cli-explore-agent produces no output):
|
||||
```
|
||||
**ACE fallback** (when CLI produces no output):
|
||||
```javascript
|
||||
mcp__ace-tool__search_context({ project_root_path: ".", query: "<topic> <perspective>" })
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user