feat: Streamline agents to pure executor roles with enhanced workflow architecture

## Agent Streamlining
- **code-developer.md**: Reduce from 315 to 122 lines - pure code execution focus
- **action-planning-agent.md**: Reduce from 502 to 124 lines - pure planning execution
- Remove complex decision logic - commands layer now handles control flow
- Add clean code rules: minimize debug output, GBK compatibility, ASCII-only

## Workflow Architecture Enhancements
- Enhanced workflow-architecture.md with progressive complexity system
- Clear separation: Commands (control) → Agents (execution) → Output
- Improved task decomposition and TODO_LIST.md examples
- Added Gemini CLI standards references

## Command System Updates
- Updated task and workflow commands with enhanced functionality
- Better integration with streamlined agents
- Improved error handling and user experience

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
catlog22
2025-09-10 21:41:58 +08:00
parent 44287cf80e
commit 5b80c9c242
14 changed files with 777 additions and 874 deletions

View File

@@ -74,6 +74,43 @@ For each executable task:
"requirements": ["JWT authentication", "User model design"],
"scope": ["src/auth/models/*"],
"acceptance": ["Schema validates JWT tokens"]
},
"implementation": {
"files": [
{
"path": "src/auth/models/User.ts",
"location": {
"function": "UserSchema",
"lines": "10-50",
"description": "User model definition"
},
"original_code": "// Requires gemini analysis for current schema",
"modifications": {
"current_state": "Basic user model without auth fields",
"proposed_changes": [
"Add JWT token fields to schema",
"Include OAuth provider fields"
],
"logic_flow": [
"createUser() ───► validateSchema() ───► generateJWT()",
"◊─── if OAuth ───► linkProvider() ───► storeTokens()"
],
"reason": "Support modern authentication patterns",
"expected_outcome": "Flexible user schema supporting multiple auth methods"
}
}
],
"context_notes": {
"dependencies": ["mongoose", "jsonwebtoken"],
"affected_modules": ["auth-middleware", "user-service"],
"risks": [
"Schema changes require database migration",
"Existing user data compatibility"
],
"performance_considerations": "Index JWT fields for faster lookups",
"error_handling": "Graceful schema validation errors"
},
"analysis_source": "auto-detected"
}
},
"workflow": {
@@ -87,17 +124,33 @@ For each executable task:
```
**Context Assignment Rules:**
- **Complete Context**: Use full task JSON context for agent execution
- **Complete Context**: Use full task JSON context including implementation field for agent execution
- **Implementation Details**: Pass complete implementation.files array to agents for precise execution
- **Code Context**: Include original_code snippets and logic_flow diagrams in agent prompts
- **Risk Awareness**: Alert agents to implementation.context_notes.risks before execution
- **Workflow Integration**: Include session state and IMPL_PLAN.md context
- **Scope Focus**: Direct agents to specific files from task.context.scope
- **Gemini Flags**: Automatically add [GEMINI_CLI_REQUIRED] for multi-file tasks
- **Scope Focus**: Direct agents to specific files from implementation.files[].path
- **Gemini Flags**: Auto-add [GEMINI_CLI_REQUIRED] when analysis_source is "gemini"
### 4. Agent Execution & Progress Tracking
```bash
Task(subagent_type="code-developer",
prompt="[GEMINI_CLI_REQUIRED] Implement authentication logic based on schema",
description="Execute impl-1.2 with full workflow context and status tracking")
prompt="[GEMINI_CLI_REQUIRED] Implement authentication logic based on schema
Task Context: impl-1.2 - Implement auth logic
Implementation Details:
- Target File: src/auth/models/User.ts
- Function: UserSchema (lines 10-50)
- Current State: Basic user model without auth fields
- Required Changes: Add JWT token fields, Include OAuth provider fields
- Logic Flow: createUser() ───► validateSchema() ───► generateJWT()
- Dependencies: mongoose, jsonwebtoken
- Risks: Schema changes require database migration, Existing user data compatibility
- Performance: Index JWT fields for faster lookups
Use implementation details above for precise, targeted development.",
description="Execute impl-1.2 with full workflow context and implementation details")
```
**Execution Protocol:**
@@ -141,8 +194,8 @@ Based on discovered task data:
- **task.agent field**: Use specified agent from task JSON
- **task.type analysis**:
- "feature" → code-developer
- "test" → test-agent
- "docs" → docs-agent
- "test" → code-review-test-agent
- "docs" → code-developer
- "review" → code-review-agent
- **Gemini context**: Auto-assign based on task.context.scope and requirements

View File

@@ -80,6 +80,29 @@ The command automatically detects input type:
- Generates hierarchical task structure (max 3 levels)
- Updates session state with task references
### Implementation Field Requirements
⚠️ **CRITICAL**: All generated tasks must include detailed implementation guidance
**Auto-fill Strategy**:
1. **Sufficient Information**: Auto-fill implementation field based on user input and project context
2. **Insufficient Information**: Mark analysis_source as "gemini" and prompt:
```
⚠️ Implementation details incomplete, recommend using gemini analysis:
gemini --all-files -p "@{relevant-file-patterns} @{CLAUDE.md}
Analyze task: [task description]
Extract: 1) File locations and code snippets 2) Modification logic and data flow 3) Risks and dependencies"
```
**Required Implementation Sub-fields**:
- **files**: Must contain at least 1 file with detailed info (path, location, original_code, modifications)
- **context_notes**: Dependencies, risks, performance considerations
- **analysis_source**: manual|gemini|auto-detected
**Quality Standards**:
- logic_flow must use specified symbols (───►, ◊───, ◄───)
- Each file must have specific location (function name or line range)
- risks array cannot be empty, must contain at least 1 risk assessment
## Session Check Process
⚠️ **CRITICAL**: Check for existing active session before planning