UNPKG

context-forge

Version:

AI orchestration platform with autonomous teams, enhancement planning, migration tools, 25+ slash commands, checkpoints & hooks. Multi-IDE: Claude, Cursor, Windsurf, Cline, Copilot

453 lines (358 loc) 9.95 kB
# Enhance Guide - Context Forge ## What is Enhance? The `enhance` command is a powerful feature planning and implementation system for adding new features to existing projects. It creates structured, phased plans with detailed implementation guides, progress tracking, and validation checkpoints. ## When to Use Enhance Use the `enhance` command when you need to: - Add major new features to an existing project - Plan complex feature implementations - Coordinate multiple related features - Track implementation progress systematically - Ensure quality through validation checkpoints ## Core Concepts ### 1. Feature Requirements Each feature is defined with: - **Acceptance Criteria**: What defines "done" - **Technical Requirements**: Implementation specifics - **Dependencies**: Other features it relies on - **Risk Assessment**: Potential challenges - **Integration Points**: Where it connects to existing code ### 2. Implementation Phases Features are organized into phases: - **Sequential**: One phase at a time - **Parallel**: Multiple features simultaneously - **Hybrid**: Mix of sequential and parallel ### 3. Validation Strategy Built-in quality assurance: - Unit and integration tests - Performance benchmarks - Security scans - Code review checkpoints ## Step-by-Step Workflow ### 1. Start Enhancement Planning ```bash # Basic usage context-forge enhance # Quick mode (skip detailed analysis) context-forge enhance --quick # Target specific IDE context-forge enhance -i claude # Analysis only (no file generation) context-forge enhance --analyze-only ``` ### 2. Project Analysis Phase The command first analyzes your existing project: - Detects current tech stack - Evaluates code quality - Identifies integration points - Assesses project structure ### 3. Feature Definition You'll interactively define features: ``` ? Feature name: User Authentication System ? Priority: (Use arrow keys) critical - Must have, blocks other features high - Important, should be prioritized medium - Valuable, but not blocking low - Nice to have ? Complexity: simple - Basic implementation medium - Some integration required complex - Multiple components very-complex - Architecture changes ``` ### 4. Feature Details For each feature, provide: - **Description**: Clear explanation of the feature - **Acceptance Criteria**: Measurable success conditions - **Technical Requirements**: Implementation specifics - **Integration Points**: Where it connects to existing code - **Risks**: Potential challenges and mitigations ### 5. Implementation Strategy Choose how features will be implemented: - **Sequential**: Safe, one at a time - **Parallel**: Fast, multiple features - **Hybrid**: Balanced approach ## Generated Outputs ### 1. Enhancement Plan ``` ENHANCEMENT_PLAN.md ├── Executive Summary ├── Features Overview ├── Implementation Phases ├── Validation Strategy └── Success Criteria ``` ### 2. Feature PRPs ``` PRPs/ ├── enhancement-overview.md ├── feature-user-auth.md ├── feature-dashboard.md ├── feature-analytics.md └── implementation-guide.md ``` ### 3. Slash Commands (Claude Code) ``` .claude/commands/enhancement/ ├── enhancement-status.md # Overall progress ├── feature-status.md # Individual features ├── enhancement-validate.md # Run validations ├── feature-complete.md # Mark complete ├── enhancement-metrics.md # View metrics └── feature-dependencies.md # Dependency graph ``` ### 4. Validation Hooks ``` .claude/hooks/ ├── pre-implementation.py # Environment checks ├── feature-validation.py # Feature testing ├── integration-test.py # Integration verification ├── progress-tracker.py # Progress monitoring └── phase-completion.py # Phase validation ``` ## Feature Definition Examples ### 1. API Feature ```yaml Name: RESTful User API Category: api Priority: critical Complexity: medium Acceptance Criteria: - CRUD operations for users - JWT authentication - Rate limiting - OpenAPI documentation Technical Requirements: - Express.js routes - Middleware integration - Database models - Test coverage >80% ``` ### 2. UI Feature ```yaml Name: Admin Dashboard Category: ui Priority: high Complexity: complex Acceptance Criteria: - Real-time metrics display - User management interface - Responsive design - Accessibility compliant Dependencies: - RESTful User API - Analytics Service ``` ### 3. Infrastructure Feature ```yaml Name: Caching Layer Category: infrastructure Priority: medium Complexity: medium Integration Points: - API routes - Database queries - Session management Risks: - Cache invalidation complexity - Memory usage concerns ``` ## Implementation Strategies ### 1. Sequential Strategy Best for: - High-risk features - Features with many dependencies - Teams new to the codebase ``` Phase 1: Authentication (2 weeks) └── Complete before proceeding Phase 2: User Management (1 week) └── Depends on Phase 1 Phase 3: Dashboard (2 weeks) └── Depends on Phase 2 ``` ### 2. Parallel Strategy Best for: - Independent features - Experienced teams - Tight deadlines ``` Phase 1: Parallel Implementation (3 weeks) ├── Team A: Authentication ├── Team B: Analytics └── Team C: UI Components ``` ### 3. Hybrid Strategy Best for: - Mixed dependencies - Balanced risk/speed - Most real-world projects ``` Phase 1: Core Infrastructure (1 week) └── Sequential: Critical setup Phase 2: Parallel Features (3 weeks) ├── Authentication └── Basic UI Phase 3: Integration (1 week) └── Sequential: Careful integration ``` ## Working with AI Assistants ### 1. Using PRPs with Claude Code ```bash # After running enhance command cd your-project # In Claude Code, reference PRPs "Let's implement the user authentication feature. Please review PRPs/feature-user-auth.md first." # Use slash commands /feature-status user-auth /enhancement-validate --feature user-auth ``` ### 2. Progress Tracking ```bash # Check overall progress /enhancement-status # View specific feature /feature-status dashboard # Run validation /enhancement-validate # Mark feature complete /feature-complete user-auth ``` ### 3. Checkpoint Validation At each checkpoint: 1. Automated tests run 2. Code quality checks 3. Integration verification 4. Progress updates ## Advanced Features ### 1. Feature Dependencies Define complex dependency chains: ``` dashboard authentication user-model └→ analytics-api data-pipeline ``` Visualize with: ```bash /feature-dependencies ``` ### 2. Risk Management Track and mitigate risks: - Technical risks (complexity, integration) - Resource risks (time, expertise) - Business risks (user impact, downtime) ### 3. Metrics and Reporting ```bash # View implementation metrics /enhancement-metrics # Generate progress report /enhancement-metrics --export # Analyze velocity /enhancement-metrics --period 7d ``` ## Best Practices ### 1. Feature Definition - Keep features focused and specific - Write clear acceptance criteria - Identify all dependencies upfront - Consider integration points early ### 2. Phasing Strategy - Group related features together - Minimize cross-phase dependencies - Plan for validation between phases - Include buffer time for issues ### 3. Progress Management - Update feature status regularly - Run validations frequently - Document blockers immediately - Communicate progress to team ### 4. Quality Assurance - Enable all validation types - Write tests during implementation - Use checkpoints effectively - Don't skip validation phases ## Real-World Example ### E-commerce Enhancement ```bash # 1. Run enhance command context-forge enhance # 2. Define features: # - Shopping Cart (critical, complex) # - Payment Integration (critical, complex) # - Order Tracking (high, medium) # - Email Notifications (medium, simple) # - Analytics Dashboard (low, complex) # 3. Set dependencies: # - Payment → Shopping Cart # - Order Tracking → Payment # - Email → Order Tracking # - Analytics → All features # 4. Choose hybrid strategy: # Phase 1: Shopping Cart (2 weeks) # Phase 2: Payment + Email (parallel, 3 weeks) # Phase 3: Order Tracking (1 week) # Phase 4: Analytics (2 weeks) # 5. Generate enhancement plan # Total duration: 8 weeks # 5 features, 4 phases # 15 checkpoints ``` ## Troubleshooting ### 1. Feature Feasibility Issues ```bash # If analyzer shows low feasibility: - Review integration points - Simplify feature scope - Add more technical requirements - Consider breaking into smaller features ``` ### 2. Dependency Conflicts ```bash # Circular dependencies detected: - Restructure feature relationships - Extract common functionality - Use interface/adapter patterns ``` ### 3. Validation Failures ```bash # When /enhancement-validate fails: - Check specific test failures - Review integration points - Verify acceptance criteria - Run /feature-status for details ``` ## Integration with Other Commands ### 1. After Analyze ```bash # First understand your project context-forge analyze # Then plan enhancements context-forge enhance ``` ### 2. Before Migrate ```bash # Implement features in current stack context-forge enhance # Then consider migration context-forge migrate ``` ### 3. Continuous Enhancement ```bash # Regular enhancement cycles context-forge enhance --phase next # Track long-term progress context-forge enhance --metrics yearly ``` ## Next Steps 1. **Start Small** - Define 2-3 features initially - Use sequential strategy - Enable all validations 2. **Monitor Progress** - Use slash commands daily - Update feature status - Address blockers quickly 3. **Iterate and Improve** - Learn from first enhancement - Refine estimation skills - Build on success patterns