<!-- Source: .cursor/skills/fix-feature-bug/SKILL.md -->
Fix Feature Bug
Fix a bug in a feature or module.
Configuration is read from foundation-config.yaml.
This workflow can also be triggered automatically via .claude/rules/bug_fix_detection.md (or foundation/agent_instructions/cursor_rules/bug_fix_detection.md) when you mention bug/error-related patterns in natural language (e.g., "bug", "error", "fix", "broken"). Both paths execute the same workflow.
Workflow
- Load configuration:
- Read
foundation-config.yamlfor bug fix settings - Check if error classification is configured
- Determine feature/module directory structure
- Identify feature/module from error, path, or context.
- Load relevant documents:
- Repository navigation guide (if configured)
- Feature/module spec and manifest (if available)
- Error classification documentation (if configured)
- Relevant subsystem/module documentation (if configured)
- Classify bug (if error classification configured):
- Use configured error classification system
- Determine correction approach based on class
- Apply correction rules:
- If Class 1 (Implementation bug): Patch code only
- If Class 2 (Spec bug): Update spec/manifest first, then align code/tests
- If Class 3 (Architectural bug): Update subsystem/architecture docs first, then rebuild
- If no classification: Fix bug and update relevant documentation
- Always add a regression test.
- Run tests:
- Run configured test commands
- Verify fix doesn't break existing functionality
- Output:
- Error class (if classification configured)
- Reason for classification
- Corrected files
- Tests added/updated
Error Classification (Configurable)
If development.bug_fix.error_classification.enabled: true in foundation-config:
- Class 1: Implementation bug - spec is correct, code doesn't match spec
- Action: Patch code only
- Class 2: Spec bug - spec is incomplete or wrong, code matches spec but spec is wrong
- Action: Update spec/manifest first, then align code/tests
- Class 3: Architectural bug - subsystem/architecture docs are wrong or incomplete
- Action: Update architecture docs first, then rebuild
Configuration
Bug fix workflow uses settings from foundation-config.yaml:
development:
bug_fix:
enabled: true
error_classification:
enabled: false # Enable if you have error classification system
classes:
- name: "Class 1"
description: "Implementation bug"
correction: "Patch code only"
- name: "Class 2"
description: "Spec bug"
correction: "Update spec first, then code"
- name: "Class 3"
description: "Architectural bug"
correction: "Update architecture docs first"
require_regression_test: true
test_commands: # Optional, repo-specific test commands
- "npm test"
- "npm run test:integration"
Inputs
feature_idormodule_name(optional): The feature/module identifier to fix