handoff-ai
Version:
AI collaboration framework for persistent project knowledge and smooth handoffs
347 lines (274 loc) ⢠12.5 kB
Markdown
# Feature Implementation EPIC: Building with Handoff
This EPIC provides a structured approach for implementing new features while maintaining consistency with existing architectural patterns and leveraging the knowledge preserved in your Handoff system.
## Goal
To implement new features that seamlessly integrate with existing codebase patterns, maintain architectural consistency, and build upon the accumulated knowledge in your Handoff documentation.
## š Implementation-Area Pattern Communication Protocol
### **When AI Encounters Pattern Conflicts in Implementation Area**
**Only flag inconsistencies in code directly related to current implementation:**
**Scope of Analysis:**
- ā
Files you need to modify for this feature
- ā
Functions you need to integrate with
- ā
Modules you need to extend or call
- ā
Similar functionality you need to match
- ā Unrelated parts of the codebase
- ā Files you won't touch
- ā Legacy code that doesn't affect current work
**Communication Process:**
1. **Stop and inform user** about conflicts in the implementation area
2. **Show specific examples** from files you'll be working with
3. **Offer clear options** for the current implementation
4. **Get user approval** before continuing
5. **Document the decision** in assumptions.md for future reference
### **Communication Template**
```
ā ļø PATTERN INCONSISTENCY IN IMPLEMENTATION AREA
I found conflicting [pattern type] in the code I need to work with:
**Files I need to modify/integrate with:**
- File A (I need to modify): [specific example of pattern 1]
- File B (I need to integrate with): [specific example of pattern 2]
- File C (similar functionality): [specific example of pattern 3]
**For this new implementation, I can:**
A) Follow Pattern 1 approach (matches File A I'm modifying)
B) Follow Pattern 2 approach (matches File B I'm integrating with)
C) Follow Pattern 3 approach (matches similar functionality)
D) Create adapter to work with existing patterns
**Which approach would you prefer?**
```
### **Common Pattern Conflicts to Watch For**
- **Async patterns**: callbacks vs promises vs async/await
- **Error handling**: exceptions vs error objects vs result types
- **Component patterns**: class vs functional components
- **State management**: local state vs global state vs context
- **API patterns**: REST vs GraphQL vs RPC
- **Testing patterns**: unit vs integration test approaches
- **Import patterns**: ES6 vs CommonJS vs dynamic imports
## Engagement Level Selection
### š¤ High Engagement (Collaborative)
- Detailed feature planning and architectural discussions
- Best for: Complex features, new architectural patterns, or learning-focused development
### šÆ Medium Engagement (Guided)
- AI proposes implementation approach, human approves key decisions
- Best for: Standard features following established patterns
### š Auto-Pilot (Autonomous)
- AI implements features based on existing patterns and requirements
- Best for: Simple features, CRUD operations, or well-defined specifications
## Phase 1: Feature Analysis & Planning
### Requirements Gathering
**All Modes Include**:
- Analyze feature requirements and acceptance criteria
- Identify affected components and systems
- Review existing similar implementations
- Assess impact on current architecture
### š¤ High Engagement Analysis
**AI Actions**:
- Present detailed feature analysis
- Propose multiple implementation approaches
- Discuss architectural implications
**Human Actions**:
- Clarify requirements and constraints
- Choose implementation approach
- Provide domain-specific context
### šÆ Medium Engagement Analysis
**AI Actions**:
- Analyze requirements against existing patterns
- Propose recommended implementation approach
- Highlight key decision points
**Human Actions**:
- Approve/modify proposed approach
- Provide high-level guidance
### š Auto-Pilot Analysis
**AI Actions**:
- Analyze requirements automatically
- Choose implementation approach based on existing patterns
- Document decisions in assumptions log
## Phase 2: Architecture & Design
### Design Considerations
- **Consistency**: Follow established architectural patterns
- **Integration**: Seamless integration with existing systems
- **Scalability**: Consider future growth and modifications
- **Testing**: Plan for comprehensive test coverage
- **Documentation**: Maintain documentation standards
### Design Artifacts
- **Component Design**: Structure and responsibilities
- **API Design**: Interfaces and contracts
- **Data Model**: Database or state changes
- **Integration Points**: How feature connects to existing code
- **Testing Strategy**: Unit, integration, and E2E test plans
### š¤ High Engagement Design
- Collaborative design sessions
- Detailed review of each design decision
- Exploration of alternative approaches
### šÆ Medium Engagement Design
- AI proposes design, human reviews key decisions
- Focus on integration points and public APIs
- Quick approval process for standard patterns
### š Auto-Pilot Design
- AI designs based on existing patterns
- Conservative choices following established conventions
- Comprehensive assumption documentation
## Phase 3: Implementation Strategy
### Implementation Phases
1. **Foundation**: Core data structures and basic functionality
2. **Integration**: Connect with existing systems
3. **User Interface**: Frontend components (if applicable)
4. **Testing**: Comprehensive test suite
5. **Documentation**: Update relevant documentation
### Development Approach
- **Incremental Development**: Small, reviewable commits
- **Test-Driven Development**: Write tests alongside implementation
- **Pattern Consistency**: Follow established coding patterns
- **Error Handling**: Implement robust error handling
- **Performance**: Consider performance implications
### š¤ High Engagement Implementation
- Step-by-step implementation with human review
- Detailed explanation of implementation choices
- Collaborative problem-solving
### šÆ Medium Engagement Implementation
- Implement in logical chunks with checkpoint reviews
- Human approval for significant architectural decisions
- Regular progress updates
### š Auto-Pilot Implementation
- Full implementation following established patterns
- Comprehensive logging of all decisions
- Safety-first approach with conservative choices
## Phase 4: Testing & Quality Assurance
### Testing Strategy
- **Unit Tests**: Test individual components and functions
- **Integration Tests**: Test feature integration with existing systems
- **E2E Tests**: Test complete user workflows
- **Performance Tests**: Validate performance requirements
- **Security Tests**: Ensure security best practices
### Quality Checks
- **Code Review**: Review implementation quality
- **Pattern Compliance**: Ensure consistency with existing code
- **Documentation**: Verify documentation is updated
- **Error Handling**: Test error scenarios
- **Edge Cases**: Test boundary conditions
### Testing Implementation
- Write tests that follow existing test patterns
- Ensure good test coverage (aim for >80%)
- Include both positive and negative test cases
- Test integration points thoroughly
## Phase 5: Integration & Deployment
### Integration Checklist
- [ ] Feature integrates with existing authentication/authorization
- [ ] Database migrations (if needed) are safe and reversible
- [ ] API endpoints follow established conventions
- [ ] Frontend components match design system
- [ ] Error handling follows project patterns
- [ ] Logging and monitoring are implemented
### Deployment Considerations
- **Feature Flags**: Consider using feature flags for gradual rollout
- **Database Changes**: Plan safe database migrations
- **Backward Compatibility**: Ensure existing functionality isn't broken
- **Rollback Plan**: Prepare rollback strategy if needed
### Documentation Updates
- Update API documentation
- Add feature to user documentation
- Update architectural documentation if needed
- Record implementation decisions in Handoff system
## Phase 6: Monitoring & Iteration
### Post-Deployment Monitoring
- **Performance Metrics**: Monitor feature performance
- **Error Tracking**: Watch for new errors or issues
- **User Adoption**: Track feature usage
- **System Impact**: Monitor overall system health
### Iteration Planning
- Collect user feedback
- Identify improvement opportunities
- Plan future enhancements
- Update Handoff documentation with lessons learned
## Common Implementation Patterns
### CRUD Operations
- Follow established data access patterns
- Implement standard validation rules
- Use consistent error handling
- Follow naming conventions
### API Endpoints
- Follow REST conventions or existing API patterns
- Implement proper authentication/authorization
- Use consistent response formats
- Include proper error responses
### Frontend Components
- Follow component architecture patterns
- Use established styling approaches
- Implement proper state management
- Follow accessibility guidelines
### Database Changes
- Use migration scripts
- Follow naming conventions
- Implement proper indexing
- Consider performance implications
## Handoff Integration
### Knowledge Preservation
- Document new patterns introduced
- Update architectural documentation
- Record implementation decisions
- Add to golden paths if applicable
### Assumption Documentation
- Record all implementation assumptions
- Document rationale for architectural choices
- Note any deviations from established patterns
- Flag areas for future review
## Risk Management
### Low-Risk Features
- Simple CRUD operations
- Features following well-established patterns
- Minor UI enhancements
- Configuration changes
### Medium-Risk Features
- Features requiring new integrations
- Performance-sensitive implementations
- Features affecting multiple systems
- New user-facing functionality
### High-Risk Features
- Major architectural changes
- Features affecting core business logic
- New external integrations
- Features requiring database schema changes
## Success Criteria
- Feature meets all requirements and acceptance criteria
- Implementation follows established architectural patterns
- Comprehensive test coverage is achieved
- Documentation is updated and accurate
- Feature integrates seamlessly with existing systems
- Performance requirements are met
- Security best practices are followed
## Phase 7: Documentation Sync & Handoff Preparation
### **Goal**
Update project documentation with new patterns, decisions, and functionality before PR/merge, ensuring knowledge is preserved for future AI sessions and team members.
### š¤ High Engagement Mode
**AI Actions**:
- Present documentation update plan to human
- Collaborate on updating each type of documentation
- Get approval for each major documentation change
**Human Actions**:
- Review and approve documentation updates
- Provide context for business logic changes
- Validate that new patterns are accurately documented
### šÆ Medium Engagement Mode
**AI Actions**:
- Automatically update obvious documentation (API changes, new components)
- Present summary of major changes for approval
- Update assumptions log with implementation decisions
**Human Actions**:
- Quick review and approval of documentation changes
- Provide feedback on any inaccuracies
### š Auto-Pilot Mode
**AI Actions**:
- Automatically update all relevant documentation
- Log all changes in assumptions for later review
- Flag any complex changes that might need human review
### **Documentation Update Checklist**
- [ ] **Golden paths** updated for new user flows
- [ ] **Architecture docs** reflect new components/patterns
- [ ] **BDD features** cover new functionality
- [ ] **API docs** updated for new/modified endpoints
- [ ] **Assumptions log** updated with implementation decisions
- [ ] **Test documentation** reflects new test patterns
- [ ] **Configuration files** updated if new dependencies added
- [ ] **README** updated if setup process changed
### **Output**
Updated project documentation ready for PR review and team handoff, ensuring the next developer (or AI session) has complete context about the changes made.
## Conclusion
This EPIC ensures that new features are implemented consistently, safely, and in alignment with your project's established patterns while contributing to the growing knowledge base in your Handoff system.