Code:Implement
Purpose: Research a technical challenge thoroughly and deliver an implementation plan with phased approach and minimal validation…
Claude CodeGeneric
# /code:implement
**Purpose**: Research a technical challenge thoroughly and deliver an implementation plan with phased approach and minimal validation criteria for main agent execution.
## Usage
- `/code:implement` - Research and deliver implementation plan for a specified technical challenge
- `/code:implement [topic]` - Research specific topic and create phased implementation plan
## Critical Rules
- NEVER output intermediate solutions to preserve tokens
- ALWAYS analyze at least 20 different approaches internally before proposing
- ALWAYS use specialized sub-agents for each phase of the workflow
- NEVER skip the clarifying questions phase
- ALWAYS analyze existing codebase before proposing solutions
- NEVER propose without understanding the full context and constraints
- ALWAYS structure plan with clear phases and acceptance criteria
- ALWAYS include testable acceptance criteria for each phase
- NEVER implement - only deliver the plan for main agent execution
- ALWAYS format plan to facilitate TODO tool usage
- ALWAYS clarify backwards compatibility requirements explicitly
- ALWAYS recommend aggressive code deletion when backwards compatibility not needed
- ALWAYS follow minimal testing approach - test code 25-50% of feature size
- ALWAYS implement first, then add minimal validation tests
- NEVER create excessive test coverage - each test validates unique failure
- ALWAYS respect 20% time budget for testing
## Workflow/Process
1. **Clarification Phase** (use `acceptance-criteria-agent`)
- Ask targeted questions about requirements, constraints, and goals
- Understand performance requirements, scalability needs, and integration points
- Identify any technical debt or migration considerations
- Clarify success criteria and validation requirements
- **CRITICAL: Determine backwards compatibility requirements**
- If no backwards compatibility needed, plan for aggressive code deletion
- Continue until all ambiguities are resolved
2. **Codebase Analysis** (use `codebase-specialist`)
- First check `documentation/agents/codebase-specialist/` for existing analysis
- Discover and analyze all relevant existing code
- Map current architecture and patterns
- Identify integration points and dependencies
- Note existing conventions and standards
- Document technical constraints from current implementation
- **Analyze existing test coverage and test patterns**
- Identify code that can be deleted if no backwards compatibility
- Update codebase-specialist knowledge base with new findings
3. **Silent Solution Generation** (use `technology-specialist`)
- Generate at least 20 distinct solution approaches in memory
- Consider various architectural patterns
- Evaluate different technology choices
- Think through edge cases for each approach
- Consider maintenance and scalability implications
- Plan code organization for each approach
- Consider how existing tests can be adapted for each approach
- DO NOT output these to the user
4. **Solution Synthesis**
- Analyze all generated solutions for strengths and weaknesses
- Identify common successful patterns across solutions
- Combine best aspects of multiple approaches
- Eliminate approaches with critical flaws
- Synthesize into the optimal solution
- Ensure solution follows implementation-first approach
- Plan for minimal validation testing (1-3 tests max per feature)
5. **Implementation Plan Generation**
- Present the synthesized best solution with clear rationale
- Break implementation into logical phases (3-5 phases typical)
- For each phase, specify: organization → implementation → validation criteria
- Include existing test analysis results for each phase
- Include risk assessment and mitigation strategies
- Specify testing approach emphasizing test reuse
- Format plan for easy TODO tool conversion by main agent
## Error Handling
- If clarification reveals infeasible requirements: Propose alternatives
- If backwards compatibility unclear: Default to maintaining it
- If existing tests conflict with new requirements: Document conflicts and propose resolution
- If existing tests cannot be adapted: Justify why new tests are needed
- If codebase analysis shows blockers: Document and suggest refactoring
- If no viable solution exists: Explain constraints and suggest scope changes
- If token limit approached: Summarize findings and offer to continue
## Sub-Agent Instructions
When executing this command:
1. Use `acceptance-criteria-agent` for requirements clarification and criteria generation
2. Use `codebase-specialist` for comprehensive codebase analysis and architecture mapping
3. Use `technology-specialist` for researching solution approaches and technology choices
4. Lead the research and planning process
5. Keep all clarification context in memory during the session
6. Use efficient analysis patterns to minimize token usage
7. Keep internal deliberations truly internal
8. Present only refined, actionable output to the user
9. Always clarify backwards compatibility requirements
10. Analyze existing test coverage during codebase review
11. Plan for test reuse and updates before new test creation
12. Deliver structured implementation plan and exit
13. NOT begin implementation - that's the main agent's role
14. CRITICAL: During phase execution, MUST use codebase-specialist to find ALL existing test files before creating any new tests
15. NEVER create one-off test files - always extend existing test suites
## Implementation Plan Structure
Each plan must include:
- **Backwards Compatibility Decision**: Explicit statement on requirements
- **Phase Overview**: 3-5 distinct phases with clear boundaries
- **Phase Details**: For each phase:
- Phase name and objective
- Code organization plan
- Key tasks and components
- Existing test analysis (what can be reused/updated)
- Acceptance criteria (specific, testable)
- Dependencies on p
Maintain Code:Implement?
Let people know it's listed here — add the badge (live metrics, light/dark aware) or a plain link to your README or docs.
[Code:Implement on getagentictools](https://getagentictools.com/loops/aroton-code-implement?ref=badge)