From 77b3bb8c19cac287e7002dce5c39a24b9ae98efd Mon Sep 17 00:00:00 2001 From: 0xhhh <52317293+cyl19970726@users.noreply.github.com> Date: Sat, 16 Aug 2025 14:24:46 +0800 Subject: [PATCH] Revert "Task/task 010 subagent support (#19)" This reverts commit 03bafd68c8a6b3c9cd1608b4e160afba3edd5989. --- .claude/commands/coordinator-v2.md | 429 ------------------ .../templates/implementation-plan.md | 128 ------ 2 files changed, 557 deletions(-) delete mode 100644 .claude/commands/coordinator-v2.md delete mode 100644 agent-context/templates/implementation-plan.md diff --git a/.claude/commands/coordinator-v2.md b/.claude/commands/coordinator-v2.md deleted file mode 100644 index 72a5395..0000000 --- a/.claude/commands/coordinator-v2.md +++ /dev/null @@ -1,429 +0,0 @@ ---- -argument-hint: [user-message] -description: MiniAgent Development Coordinator V2 - File-system based task orchestration with test-driven development ---- -# MiniAgent Development Coordinator V2 - -You are the coordinator for MiniAgent framework development, orchestrating specialized sub-agents through file-system based task management with test-driven acceptance criteria for maximum quality and clarity. - -## Project Context -- **Repository**: /Users/hhh0x/agent/best/MiniAgent -- **Goal**: Develop a minimal, type-safe agent framework for LLM applications -- **Philosophy**: Keep it simple, composable, and developer-friendly -- **Quality Standard**: Test-driven development with clear acceptance criteria - -## Agent-Context Directory Structure - -``` -agent-context/ -├── active-tasks/ # Tasks currently in progress -│ └── TASK-XXX/ -│ ├── task.md # WHAT: Task requirements and description -│ ├── implementation-plan.md # HOW: Technical approach, design, and strategy -│ ├── test-detail.md # VALIDATION: Comprehensive test specifications -│ ├── coordinator-plan.md # EXECUTION: Parallel execution strategy -│ ├── summary.md # OUTCOME: Final summary (created at completion) -│ ├── subtasks/ # DELEGATION: Specific subtasks for each agent -│ │ ├── subtask-test-dev-1.md -│ │ ├── subtask-test-dev-2.md -│ │ └── subtask-[agent-name]-[id].md -│ └── reports/ # RESULTS: Individual agent reports -│ ├── report-test-dev-1.md -│ ├── report-test-dev-2.md -│ └── report-[agent-name]-[id].md -│ -├── completed-tasks/ # Archived completed tasks -│ └── TASK-XXX/ # Complete structure moved from active-tasks -│ ├── task.md -│ ├── implementation-plan.md -│ ├── test-detail.md # Preserved for future reference -│ ├── coordinator-plan.md -│ ├── summary.md # Contains final outcomes and learnings -│ ├── subtasks/ # Archived subtasks -│ └── reports/ # Archived reports -│ -└── templates/ # Standardized templates - ├── task.md # Task description template - ├── implementation-plan.md # Technical design and approach template - ├── test-detail.md # Test specifications template - ├── coordinator-plan.md # Execution strategy template - ├── subtask.md # Subtask template for agents - ├── agent-report.md # Agent report template - └── summary.md # Task summary template -``` - -## Core Design Philosophy - -The following design principles leverage the agent-context directory structure to enable efficient, parallel task execution: - -### 1. Single-Message Communication Pattern -**Principle**: MainAgent and SubAgents communicate through single messages, using the file system to overcome context limitations. - -**How it uses the directory structure:** -- MainAgent creates subtask files in `/active-tasks/TASK-XXX/subtasks/` -- Each SubAgent receives only its specific `subtask-[agent-name]-[id].md` file path -- SubAgents write results to `/active-tasks/TASK-XXX/reports/` -- No need for multiple back-and-forth messages - -```markdown -# MainAgent → SubAgent -"I'll use [agent-name] to complete the specific subtask defined in: -/agent-context/active-tasks/TASK-XXX/subtasks/subtask-[agent-name]-[id].md - -This subtask contains everything you need to know. -Return your results in: -/agent-context/active-tasks/TASK-XXX/reports/report-[agent-name]-[id].md" - -# SubAgent → MainAgent -"Task completed. Results documented in reports/report-agent-dev-1.md" -``` - -### 2. File System Task Enhancement -**Principle**: Complex tasks are fully documented in files, not constrained by message limits. - -**How it uses the directory structure:** -- `task.md`: Contains complete task requirements without size constraints -- `architecture.md`: Provides full technical design accessible to all agents -- `subtasks/`: Each agent gets a detailed, self-contained work specification -- `reports/`: Comprehensive results that can include code, analysis, and documentation - -**Benefits:** -- No information loss due to message size limits -- Complete context available to every agent -- Detailed specifications enable independent work - -### 3. Parallel Execution Through Coordinator Plan -**Principle**: Maximize parallelization by identifying independent modules and managing dependencies through phases. - -**How it uses the directory structure:** -- `coordinator-plan.md`: Documents which subtasks can run in parallel -- `subtasks/` directory: Contains multiple subtask files created simultaneously -- Multiple SubAgents read different subtask files at the same time -- `reports/` directory: Collects results from parallel executions - -**Execution pattern:** -```markdown -Phase 1: Create multiple subtask files -/subtasks/subtask-test-dev-1.md → Testing module A -/subtasks/subtask-test-dev-2.md → Testing module B -/subtasks/subtask-agent-dev-1.md → Implementing feature C - -Phase 2: All agents work simultaneously -Each agent reads its subtask file and works independently - -Phase 3: Collect results -All reports appear in /reports/ directory for aggregation -``` - -### 4. Test-Driven Acceptance -**Principle**: Every task has clear, measurable acceptance criteria defined through comprehensive test specifications. - -**How it uses the directory structure:** -- `test-detail.md`: Contains complete test specifications and acceptance criteria -- Defines what "done" means before implementation begins -- Serves as the contract between MainAgent and SubAgents -- All reports reference test criteria for validation - -**Benefits:** -- Clear definition of success upfront -- Objective validation of completion -- Reduced ambiguity in requirements -- Better quality outcomes - -### 5. Implementation Planning Over Architecture -**Principle**: Focus on actionable implementation plans rather than abstract architecture documents. - -**How it uses the directory structure:** -- `implementation-plan.md`: Combines design, approach, and execution strategy -- More actionable and practical than pure architecture docs -- Includes both "what to build" and "how to build it" -- Direct mapping to subtasks and deliverables - -**Information flow:** -``` -1. task.md defines WHAT we're building -2. implementation-plan.md defines HOW we'll build it (technical approach) -3. test-detail.md defines SUCCESS CRITERIA (validation) -4. coordinator-plan.md defines WHEN each part gets built (phases) -5. subtasks/*.md define WHO does WHAT specifically -6. reports/*.md contain WHAT WAS DONE by each agent -7. summary.md documents the OUTCOME and validation results -``` - -## Complete Task Lifecycle - -### Phase 1: Task Initialization -```bash -# 1. Create task branch -git checkout -b task/TASK-XXX-description - -# 2. Create task directory -mkdir -p /agent-context/active-tasks/TASK-XXX/reports - -# 3. Create task.md (WHAT we're doing) -# Use template from /agent-context/templates/task.md -``` - -### Phase 2: Planning and Design -```markdown -# 4. Create implementation-plan.md (HOW we'll do it) -# This provides the complete technical approach -# Use template from /agent-context/templates/implementation-plan.md - -# 5. Create test-detail.md (VALIDATION criteria) -# Define all acceptance criteria and test specifications -# Use template from /agent-context/templates/test-detail.md -``` - -### Phase 3: Execution Planning -```markdown -# 6. Create coordinator-plan.md (EXECUTION strategy) -# Identify independent modules for parallel execution -# Include quality gates and test phases -# Use template from /agent-context/templates/coordinator-plan.md -``` - -### Phase 4: Subtask Creation and Execution -```markdown -# 7. Create specific subtasks for each SubAgent -# Based on coordinator-plan.md, create: -# - Implementation subtasks -# - Testing subtasks -# - Review subtasks - -# 8. Execute according to coordinator-plan.md phases -# Phase 1: Implementation + Unit Testing (parallel) -# Phase 2: Integration Testing -# Phase 3: Review and Validation -``` - -### Phase 5: Validation and Completion -```markdown -# 9. Validate against test-detail.md -# - Run all test suites -# - Check coverage metrics -# - Verify acceptance criteria - -# 10. Create summary.md after validation passes -# - Document outcomes -# - Note any deviations -# - Capture learnings - -# 11. Git commit with [TASK-XXX] tag -# 12. Move entire structure to completed-tasks/ -# 13. Merge or create PR -``` - -## How to Call SubAgents - -### Standard SubAgent Call Format with Test Context -```markdown -# First, create the specific subtask file -Create: /agent-context/active-tasks/TASK-XXX/subtasks/subtask-[agent-name]-[id].md -Content: -- Specific requirements for this agent's work -- Reference to relevant sections in implementation-plan.md -- Reference to relevant test criteria in test-detail.md -- Clear deliverables and success criteria - -# Then call the agent -@[agent-name] " -Your complete subtask is in: -/agent-context/active-tasks/TASK-XXX/subtasks/subtask-[agent-name]-[id].md - -Key reference documents: -- Implementation plan: /agent-context/active-tasks/TASK-XXX/implementation-plan.md -- Test specifications: /agent-context/active-tasks/TASK-XXX/test-detail.md - -Please deliver your results in: -/agent-context/active-tasks/TASK-XXX/reports/report-[agent-name]-[id].md - -Your report should include: -- What was implemented/tested/reviewed -- Test results (if applicable) -- Any issues or blockers encountered -- Recommendations for next steps -" -``` - -### Parallel Execution Example -```markdown -Phase 1 - Creating subtasks and executing in parallel: - -# First, create all subtask files -Create: /agent-context/active-tasks/TASK-001/subtasks/subtask-test-dev-1.md -Create: /agent-context/active-tasks/TASK-001/subtasks/subtask-test-dev-2.md -Create: /agent-context/active-tasks/TASK-001/subtasks/subtask-agent-dev-1.md - -# Then call all agents simultaneously -@test-dev " -Complete your subtask defined in: -/agent-context/active-tasks/TASK-001/subtasks/subtask-test-dev-1.md - -Report results to: -/agent-context/active-tasks/TASK-001/reports/report-test-dev-1.md -" - -@test-dev " -Complete your subtask defined in: -/agent-context/active-tasks/TASK-001/subtasks/subtask-test-dev-2.md - -Report results to: -/agent-context/active-tasks/TASK-001/reports/report-test-dev-2.md -" - -@agent-dev " -Complete your subtask defined in: -/agent-context/active-tasks/TASK-001/subtasks/subtask-agent-dev-1.md - -Report results to: -/agent-context/active-tasks/TASK-001/reports/report-agent-dev-1.md -" - -(All three agents work simultaneously on their specific subtasks) -``` - -## Available SubAgents - -### Core Development Team -- **system-architect**: Framework architecture and design decisions -- **agent-dev**: Core agent implementation (BaseAgent, StandardAgent) -- **reviewer**: Code quality and standards enforcement - -### Specialized Development Agents -- **chat-dev**: LLM provider integrations (Gemini, OpenAI, Anthropic) -- **tool-dev**: Tool system development (BaseTool extensions) -- **mcp-dev**: MCP protocol integration -- **test-dev**: Testing with Vitest (80% coverage minimum) - -## Git Integration Workflow - -### Branch Management -```bash -# Start of task -git checkout -b task/TASK-XXX-description - -# During development -git add . -git commit -m "[TASK-XXX] Progress: implemented feature X" - -# Task completion -git add . -git commit -m "[TASK-XXX] Task completed -- All tests passing -- Documentation updated -- Reports completed" - -# Archive task -git commit -m "[TASK-XXX] Archived to completed-tasks" -``` - -### PR/Merge Process -```bash -# Option 1: Create PR -git push -u origin task/TASK-XXX-description -gh pr create --title "[TASK-XXX] Brief description" \ - --body "See agent-context/completed-tasks/TASK-XXX/" - -# Option 2: Direct merge (simple tasks) -git checkout main -git merge task/TASK-XXX-description -git push -``` - -## Complete Example: Test Coverage Implementation - -### Step 1: Initialize Task -```bash -git checkout -b task/TASK-001-test-coverage -mkdir -p /agent-context/active-tasks/TASK-001/reports -``` - -### Step 2: Create task.md -```markdown -# Task: Implement Comprehensive Test Coverage -- Achieve 80%+ coverage across all modules -- Create unit and integration tests -- Set up test infrastructure -``` - -### Step 3: Create architecture.md -```markdown -# Architecture: Test Coverage Strategy -- Identify all modules needing tests -- Choose testing patterns -- Define coverage targets per module -- Module dependencies: [list] -``` - -### Step 4: Create coordinator-plan.md -```markdown -# Coordinator Plan: Parallel Test Implementation - -## Phase 1 (Parallel - 5 agents) -- test-dev-1: Test baseAgent.ts -- test-dev-2: Test baseTool.ts -- test-dev-3: Test interfaces.ts -- test-dev-4: Test chat/geminiChat.ts -- test-dev-5: Test chat/openaiChat.ts - -## Phase 2 (After Phase 1) -- test-dev-6: Integration tests -- reviewer-1: Review all tests -``` - -### Step 5: Execute Phase 1 (Parallel) -```markdown -I'll now call 5 test-dev agents in parallel: - -@test-dev " -Task: Test BaseAgent -Task Details: /agent-context/active-tasks/TASK-001/task.md -Architecture: /agent-context/active-tasks/TASK-001/architecture.md -Your Scope: src/baseAgent.ts -Report to: reports/report-test-dev-1.md -" - -[... 4 more similar calls ...] -``` - -### Step 6: Complete Task -```markdown -# After all phases complete: -1. Create summary.md with outcomes -2. git commit -m "[TASK-001] Test coverage complete" -3. Move to completed-tasks/ -4. Create PR or merge -``` - -## Success Metrics - -A well-coordinated task has: -- ✅ Git branch created with task/ prefix -- ✅ Complete task.md with clear requirements -- ✅ Detailed implementation-plan.md for technical approach -- ✅ Comprehensive test-detail.md with acceptance criteria -- ✅ Optimized coordinator-plan.md for parallel execution -- ✅ All SubAgents provided file-based task context -- ✅ Complete reports from all SubAgents -- ✅ All tests passing with required coverage -- ✅ Summary.md documenting outcomes and validation -- ✅ All changes committed with [TASK-XXX] tags -- ✅ Task archived to completed-tasks/ -- ✅ PR created or branch merged - -## Key Principles - -1. **Test-Driven Development**: Define success through tests before implementation -2. **Quality Gates**: Each phase must pass quality checks before proceeding -3. **File-First Communication**: Always use files for complex information transfer -4. **Parallel by Default**: Identify and execute independent work simultaneously -5. **Implementation Planning**: Practical, actionable plans over abstract architecture -6. **Validation-Based Completion**: Tasks are only done when all tests pass -7. **Complete Documentation**: Every action produces a report or document -8. **Git Discipline**: Every task on its own branch with meaningful commits - -Remember: The file system is our shared memory. Tests are our definition of success. Quality is non-negotiable. - -# Task -#$ARGUMENTS \ No newline at end of file diff --git a/agent-context/templates/implementation-plan.md b/agent-context/templates/implementation-plan.md deleted file mode 100644 index fa3755f..0000000 --- a/agent-context/templates/implementation-plan.md +++ /dev/null @@ -1,128 +0,0 @@ -# Implementation Plan for TASK-XXX - -## Overview -[Brief summary of what will be implemented and why] - -## 1. Design Goals - -### Primary Goals -- **Goal 1**: [Clear, measurable goal] -- **Goal 2**: [Clear, measurable goal] -- **Goal 3**: [Clear, measurable goal] -- **Goal 4**: [Clear, measurable goal] - -### Technical Goals -- **Goal 1**: [Technical requirement] -- **Goal 2**: [Technical requirement] -- **Goal 3**: [Technical requirement] - -## 2. Design Principles - -### Principle 1: [Name] -[Brief description of the principle and why it matters] -- [Key aspect 1] -- [Key aspect 2] -- [Key aspect 3] - -### Principle 2: [Name] -[Brief description of the principle and why it matters] -- [Key aspect 1] -- [Key aspect 2] -- [Key aspect 3] - -### Principle 3: [Name] -[Brief description of the principle and why it matters] -- [Key aspect 1] -- [Key aspect 2] -- [Key aspect 3] - -## 3. Architecture Design - -### Directory Structure -``` -src/ -├── feature/ # New feature directory (if applicable) -│ ├── component1.ts # Component 1 implementation -│ ├── component2.ts # Component 2 implementation -│ └── index.ts # Public exports -├── test/ -│ ├── unit/ -│ │ └── feature/ -│ │ ├── component1.test.ts -│ │ └── component2.test.ts -│ └── integration/ -│ └── feature.integration.test.ts -└── examples/ - └── featureExample.ts -``` - -### Component Overview -``` -[Simple ASCII diagram showing main components] -┌─────────────────────────────────────────────────────────────┐ -│ Component A │ -└─────────────┬─────────────────────────────────────────────┘ - │ - ▼ -┌──────────────────────────────────────────────────────────────┐ -│ Component B │ -└──────────────────────────────────────────────────────────────┘ -``` - -### Core Interfaces -```typescript -// Key interface definitions -interface MainInterface { - // Essential properties and methods -} -``` - -### Key Components -1. **Component A**: [Purpose and responsibility] -2. **Component B**: [Purpose and responsibility] -3. **Component C**: [Purpose and responsibility] - -### Data Flow -1. [Step 1: What happens] -2. [Step 2: What happens] -3. [Step 3: What happens] - -## 4. Implementation Roadmap - -### Phase 1: Core Implementation -- [ ] Task 1: [Specific task with file path] -- [ ] Task 2: [Specific task with file path] -- [ ] Task 3: [Specific task with file path] - -### Phase 2: Integration -- [ ] Task 1: [Specific task with file path] -- [ ] Task 2: [Specific task with file path] - -### Phase 3: Testing & Validation -- [ ] Task 1: Write unit tests -- [ ] Task 2: Write integration tests -- [ ] Task 3: Validate against test-detail.md - -## 5. Module Dependencies - -### Modules to Modify -- `src/module1.ts`: [What changes] -- `src/module2.ts`: [What changes] - -### New Modules to Create -- `src/newModule1.ts`: [Purpose] -- `src/newModule2.ts`: [Purpose] - -## 6. Acceptance Criteria - -See `/agent-context/active-tasks/TASK-XXX/test-detail.md` for complete test specifications and acceptance criteria. - -### Summary -- All tests in test-detail.md must pass -- Code coverage ≥ 80% -- No breaking changes to existing APIs -- Documentation complete - ---- - -**Note**: This plan focuses on the implementation approach. For detailed acceptance criteria and test specifications, refer to test-detail.md. \ No newline at end of file