From b01140ae3345f94ae59da196d087542f08a50000 Mon Sep 17 00:00:00 2001 From: catlog22 Date: Sun, 14 Sep 2025 11:22:41 +0800 Subject: [PATCH] feat: Complete v1.2 system enhancements and agent coordination improvements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- .claude/agents/action-planning-agent.md | 2 +- .claude/commands/task/execute.md | 6 ------ .claude/commands/workflow/plan-deep.md | 15 +++++++++++++-- .../agent-workflow-coordination.md | 2 ++ CLAUDE.md | 19 +++++++++++++++++++ 5 files changed, 35 insertions(+), 9 deletions(-) diff --git a/.claude/agents/action-planning-agent.md b/.claude/agents/action-planning-agent.md index 4284df88..2c9e7db4 100644 --- a/.claude/agents/action-planning-agent.md +++ b/.claude/agents/action-planning-agent.md @@ -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) diff --git a/.claude/commands/task/execute.md b/.claude/commands/task/execute.md index b97f0791..f6207a46 100644 --- a/.claude/commands/task/execute.md +++ b/.claude/commands/task/execute.md @@ -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)** diff --git a/.claude/commands/workflow/plan-deep.md b/.claude/commands/workflow/plan-deep.md index edc2a86b..7804bcb5 100644 --- a/.claude/commands/workflow/plan-deep.md +++ b/.claude/commands/workflow/plan-deep.md @@ -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 diff --git a/.claude/output-styles/agent-workflow-coordination.md b/.claude/output-styles/agent-workflow-coordination.md index aeaa49e6..c33ad0fc 100644 --- a/.claude/output-styles/agent-workflow-coordination.md +++ b/.claude/output-styles/agent-workflow-coordination.md @@ -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. diff --git a/CLAUDE.md b/CLAUDE.md index 62aef51b..88eaac93 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -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