Fix Feature Bug
Fix bugs using structured workflow with error classification and regression tests.
Get the complete skill folder, including its scripts and reference files.
·
When to use this skill
Use Fix Feature Bug when an AI agent needs a reusable SKILL.md workflow for this job: Fix bugs using structured workflow with error classification and regression tests.
When not to use it
Skip Fix Feature Bug when the task is outside the coding category, or when a more specific skill in this directory already covers the same workflow with clearer triggers.
How to install
Where will you use it?
mkdir -p ~/.claude/skills/fix-feature-bug # Save SKILL.md to ~/.claude/skills/fix-feature-bug/SKILL.md
- Claude Code personal install: place the skill and its bundled files at ~/.claude/skills/fix-feature-bug/SKILL.md. For a shared project, commit the folder at .claude/skills/fix-feature-bug/ instead.
- Current Claude Code detects SKILL.md changes in watched directories during the session. If you just created a top-level skills directory, run /reload-skills. Check that the skill is listed before testing its trigger.
- For Claude chat or Cowork in the Desktop app, manage uploaded skills in Customize > Skills; copying files into a local Claude Code folder is not a Desktop install. Other agents may use different install locations.
Full install guide for Claude, Cursor, and Codex →
Try a starter prompt
After installing the skill, paste this starter prompt into your agent to verify it triggers on a small task.
Use the Fix Feature Bug skill for this task: Load configuration:. Confirm any required inputs or files before making changes.
What supports this recommendation?
69/100 provisional content score. This measures documentation, practical detail and source signals. It is not a measured task success rate or a security certification.
- Documentation
- 72/100
- Practical detail
- 74/100
- Source evidence
- 56/100
- Source signals
- 70/100
Model compatibility evidence
- claudeuntested
No model-specific signal or recorded compatibility test was found.
- chatgptuntested
No model-specific signal or recorded compatibility test was found.
- geminiuntested
No model-specific signal or recorded compatibility test was found.
- copilotuntested
No model-specific signal or recorded compatibility test was found.
- llamauntested
No model-specific signal or recorded compatibility test was found.
- perplexityuntested
No model-specific signal or recorded compatibility test was found.
- mistraluntested
No model-specific signal or recorded compatibility test was found.
- grokuntested
No model-specific signal or recorded compatibility test was found.
Inferred compatibility is based on content signals. Check the app, its available tools and setup requirements before running a skill.
What this skill does
# 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 `.cursor/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
1. **Load configuration:** - Read `foundation-config.yaml` for bug fix settings - Check if error classification is configured - Determine feature/module directory structure
2. **Identify feature/module** from error, path, or context.
3. **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)
4. **Classify bug** (if error classification configured): - Use configured error classification system - Determine correction approach based on class
5. **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
6. **Always add a regression test.**
7. **Run tests:** - Run configured test commands - Verify fix doesn't break existing functionality
8. **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`:
```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_id` or `module_name` (optional): The feature/module identifier to fix
Intended uses
- Load configuration:
- Read foundation-config.yaml for 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:
Implementation notes
- Review the source instructions and adapt inputs before running the workflow.
Try it, then tell us how it went
A copied prompt does not tell us whether the task worked. Report your result after checking the output. We collect your tool and outcome, never your files or prompt.