feat: Complete v1.2 system enhancements and agent coordination improvements

- Update action-planning-agent to use gemini-wrapper for improved CLI analysis
- Enhance task execution with simplified control structure and context requirements
- Improve plan-deep command with input validation and clarity requirements
- Add intelligent context acquisition rules to CLAUDE.md with required analysis patterns
- Strengthen agent workflow coordination with TodoWrite management and context rules
- Remove deprecated execution controls and streamline task execution flow

System now enforces proper context gathering before implementation and provides
better coordination between agents through structured TODO management.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
catlog22
2025-09-14 11:22:41 +08:00
parent 89fadb5708
commit b01140ae33
5 changed files with 35 additions and 9 deletions

View File

@@ -32,7 +32,7 @@ You are a pure execution agent specialized in creating actionable implementation
1. Parse input requirements and extract control flags
2. IF DEEP_ANALYSIS_REQUIRED flag present:
→ Check for analysis method markers:
- [GEMINI_CLI_REQUIRED] → Execute comprehensive Gemini CLI analysis
- [GEMINI_CLI_REQUIRED] → Execute comprehensive Gemini CLI analysis using gemini-wrapper
- [CODEX_CLI_REQUIRED] → Execute autonomous Codex CLI analysis
→ Use analysis results for planning context
3. Assess task complexity (simple/medium/complex)

View File

@@ -126,12 +126,6 @@ FUNCTION on_execution_failure(checkpoint):
END FUNCTION
```
### ✨ **Advanced Execution Controls**
- **Dry Run (`--dry-run`)**: Simulates execution, showing the agent, estimated time, and files affected without making changes.
- **Custom Checkpoints (`--checkpoints="..."`)**: Overrides the default checkpoints with a custom, comma-separated list (e.g., `"design,implement,deploy"`).
- **Conditional Execution (`--if="..."`)**: Proceeds with execution only if a specified condition (e.g., `"tests-pass"`) is met.
- **Rollback (`--rollback`)**: Reverts file modifications and restores the previous task state.
### 📄 **Simplified Context Structure (JSON)**

View File

@@ -47,12 +47,18 @@ Creates comprehensive implementation plans through deep codebase analysis using
### 1. Input Processing
```
Input Analysis:
├── Validate input clarity (reject vague descriptions)
├── Parse task description or file
├── Extract key technical terms
├── Identify potential affected domains
└── Prepare context for agent
```
**Clarity Requirements**:
- **Minimum specificity**: Must include clear technical goal and affected components
- **Auto-rejection**: Vague inputs like "optimize system", "refactor code", "improve performance" without context
- **Response**: `❌ Input too vague. Deep planning requires specific technical objectives and component scope.`
### 2. Agent Invocation with Deep Analysis Flag
The command invokes action-planning-agent with special parameters that **enforce** Gemini CLI analysis.
@@ -86,7 +92,7 @@ Task(action-planning-agent):
- Skip session inheritance (standalone planning)
- Force GEMINI_CLI_REQUIRED flag = true
- Set analysis_source = "gemini" (深度分析固定值)
- Generate hierarchical task decomposition
- Generate hierarchical task decomposition (max 2 levels: impl-N.M)
- Create detailed IMPL_PLAN.md with subtasks
- Generate TODO_LIST.md for tracking
@@ -102,7 +108,7 @@ Task(action-planning-agent):
### 4. Output Generation (by Agent)
The action-planning-agent generates in `.workflow/WFS-[session-id]/`:
- **IMPL_PLAN.md** - Hierarchical implementation plan with stages
- **TODO_LIST.md** - Task tracking checklist (if complexity > simple)
- **TODO_LIST.md** - Unified hierarchical task tracking with ▸ container tasks and indented subtasks
- **.task/*.json** - Task definitions for complex projects
- **workflow-session.json** - Session tracking
- **gemini-analysis.md** - Consolidated Gemini analysis results
@@ -145,6 +151,11 @@ def process_plan_deep_command(input):
### Common Issues and Solutions
**Input Processing Errors**
- **Vague text input**: Auto-reject without guidance
- Rejected examples: "optimize system", "refactor code", "make it faster", "improve architecture"
- Response: Direct rejection message, no further assistance
**Agent Execution Errors**
- Verify action-planning-agent availability
- Check for context size limits

View File

@@ -8,9 +8,11 @@ description: Core coordination principles for multi-agent development workflows
**Purpose**: Thorough upfront planning reduces risk, improves quality, and prevents costly rework.
### TodoWrite Coordination Rules
1. **TodoWrite FIRST**: Always create TodoWrite entries *before* complex task execution begins.
2. **Context Before Implementation**: Context gathering must complete before implementation tasks begin.
3. **Agent Coordination**: Each agent is responsible for updating the status of its assigned todo.
4. **Progress Visibility**: Provides clear workflow state visibility to stakeholders.

View File

@@ -8,6 +8,25 @@ For all CLI tool usage, command syntax, and integration guidelines:
- **Gemini (Analysis)**: @~/.claude/workflows/gemini-unified.md
- **Codex (Analysis)**: @~/.claude/workflows/codex-unified.md
### Intelligent Context Acquisition
**Core Rule**: No task execution without sufficient context. Must gather project understanding before implementation.
**Context Tools**:
- **Structure**: Bash(~/.claude/scripts/get_modules_by_depth.sh) for project hierarchy
- **Module Analysis**: Bash(cd [module] && ~/.claude/scripts/gemini-wrapper -p "analyze patterns")
- **Full Analysis**:
Bash(cd [module] && ~/.claude/scripts/gemini-wrapper -p "analyze [scope] architecture")
Bash(codex --full-auto exec "analyze [scope] architecture")
**Context Requirements**:
- Identify 3+ existing similar patterns before implementation
- Map dependencies and integration points
- Understand testing framework and coding conventions
- Use Task agents for parallel context gathering when needed
## Philosophy
### Core Beliefs