Task: Contextual Bug Diagnosis System
Description
Implement the /oden:bug command that provides contextual diagnosis and automatic fixing of common development issues. This system should analyze project structure, identify error patterns, and apply solutions with user confirmation.
Functional Requirements
- Project Type Detection: Automatically detect React, Next.js, Node.js, React Native project types
- Error Pattern Matching: Database of 50+ common development issues with solutions
- Environment Analysis: Check OS, Node version, package manager compatibility
- Solution Application: Apply fixes automatically with rollback capability
- Success Validation: Verify solution works before completing
Technical Implementation
Files to Create/Modify:
.claude/commands/oden/bug.md - Command definition
lib/commands/bug.js - Main command implementation
lib/diagnosis/pattern-matcher.js - Error pattern recognition
lib/diagnosis/solution-applier.js - Solution application system
lib/diagnosis/project-analyzer.js - Project type and environment detection
data/bug-patterns.json - Error pattern database
Architecture:
- Pattern Matching Engine: SQLite database with error signatures
- Project Context Analysis: Package.json, lock files, config files analysis
- Solution Pipeline: Staged application with rollback support
- Validation System: Post-fix verification of solution effectiveness
Acceptance Criteria
Core Functionality:
Error Patterns Coverage:
Performance:
User Experience:
Dependencies
- Internal: Oden command infrastructure
- External: Node.js filesystem APIs, child_process for command execution
- Tools: Package manager detection (npm, yarn, pnpm)
Implementation Notes
- Build pattern database incrementally, starting with most common issues
- Use child_process.spawn for running diagnostic commands
- Implement solution templates for each error type
- Ensure all file system changes are reversible
- Test with multiple project types and error scenarios
Risks
- High: Solution application could break working projects
- Medium: Pattern matching might miss edge cases
- Low: Performance impact on large codebases
Mitigation Strategies
- Comprehensive backup system before applying fixes
- Staged rollout with manual approval for each solution type
- Extensive testing on various project configurations
- Clear documentation of what each solution does
Task: Contextual Bug Diagnosis System
Description
Implement the
/oden:bugcommand that provides contextual diagnosis and automatic fixing of common development issues. This system should analyze project structure, identify error patterns, and apply solutions with user confirmation.Functional Requirements
Technical Implementation
Files to Create/Modify:
.claude/commands/oden/bug.md- Command definitionlib/commands/bug.js- Main command implementationlib/diagnosis/pattern-matcher.js- Error pattern recognitionlib/diagnosis/solution-applier.js- Solution application systemlib/diagnosis/project-analyzer.js- Project type and environment detectiondata/bug-patterns.json- Error pattern databaseArchitecture:
Acceptance Criteria
Core Functionality:
/oden:bug "project won't start"analyzes common startup issuesError Patterns Coverage:
Performance:
User Experience:
Dependencies
Implementation Notes
Risks
Mitigation Strategies