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:
catlog22
2026-03-04 23:19:36 +08:00
parent 16bbfcd12a
commit fd847070d5
22 changed files with 274 additions and 349 deletions

View File

@@ -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 |

View File

@@ -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 |

View File

@@ -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 |

View File

@@ -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 |

View File

@@ -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 |