The capabilities section describes additional capabilities that you can refer to.
When you need specific examples to understand how to apply the bug-fixing planning approach, load the relevant example file from the examples folder:
- Simple Logic Bugs: When fixing bugs related to incorrect logic, timing, or calculation errors, read
examples/simple-logic-bug.md
- Type-Related Bugs: When fixing bugs related to TypeScript types, optional fields, or type safety issues, read
examples/type-related-bug.md
- Data Persistence Bugs: When fixing bugs related to database operations, async handling, or data loss issues, read
examples/data-persistence-bug.md
Only load example files when they are directly relevant to the current bug being fixed to minimize context size.
The rules section outlines decision criteria that determine which capabilities to apply based on the current context and user inputs.
If the user reports a bug, apply the identifying-bug-root-cause capability to identify the root cause of the bug.
After identifying the root cause of the bug, apply the adapting-tdd-approach capability to evaluate whether to adapt TDD approach based on the bug complexity and type.
Apply the bug-fixing-planning capability to generate a detailed bug-fixing plan, incorporating baseline validation and step consolidation strategies.
Always validate the baseline state before starting bug fixes to ensure a clean starting point.
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: bug-fix-planner3description: First, determine the root cause of the reported bug. Then, create a clear, step-by-step plan for the bug fixing. Use this skill whenever a user reports a bug. Use when this capability is needed.4---56<when-to-use-this-skill>7- User reports a bug.8</when-to-use-this-skill>910<capabilities>1112The capabilities section describes additional capabilities that you can refer to.1314<identifying-bug-root-cause>15- Gather relevant information from the codebase, knowledge base, test results and user input to clearly identify the bug.16- Analyze the information to identify patterns, inconsistencies, or anomalies that may indicate the root cause of the bug.17- Formulate hypotheses about potential causes and systematically test them through code inspection, debugging, or additional logging.18- Ask questions to the user to narrow down the possibilities until the most likely root cause is identified.19- Present the identified root cause and the reasoning process to the user and request confirmation or refinements.20</identifying-bug-root-cause>2122<adapting-tdd-approach>23- Recognize when the full TDD cycle may be adapted or streamlined based on the bug complexity:24 - **Simple bugs** (typos, minor logic errors, incorrect constants): May consolidate test writing and fixing in fewer steps if existing tests provide adequate coverage25 - **Type-related bugs** (missing/incorrect TypeScript types): Focus on type-checking validation rather than test-first approach26 - **Configuration bugs** (incorrect environment settings, build config): Validate with build/run rather than unit tests27 - **Performance bugs**: Require performance tests and benchmarks in addition to functional tests28 - **Complex logic bugs**: Always follow full TDD cycle for safety and thorough validation29- When adapting the approach, always ensure existing tests pass before and after changes30- Document the rationale for adapting the TDD approach in the plan31</adapting-tdd-approach>3233<bug-fixing-planning>34- **Validate Baseline**: Run existing tests, linting, and type-checking to ensure the codebase is in a clean state before bug fixing begins.35- Break down the identified bug root cause into specific, independently testable issues.36- Map out dependencies between issues to establish an efficient bug-fixing sequence.37- **Consolidate Steps**: Group related issues together when they share context or can be tested together, reducing the total step count while maintaining clarity.38- Create a detailed step-by-step bug-fixing plan following the TDD approach. For each issue, the steps should include:39 - **Write Focused Tests**: Create precise unit tests targeting the specific bug issue, ensuring comprehensive coverage of all scenarios, edge cases, and invalid inputs.40 - **Confirm Test Failure**: Execute the tests to verify they fail initially, validating that the tests correctly identify the current code behavior before fixing begins.41 - **Fix Code**: Modify the minimum amount of code necessary to pass the tests while addressing the bug, avoiding over-engineering or introducing unrelated changes.42 - **Verify Fix**: Re-run all tests to confirm the fix works successfully. Debug and refine as necessary to ensure correctness.43 - **Clean Up Unused Code**: Remove any obsolete or redundant code that is no longer needed after the bug fix.44 - **Clean Up Tests**: Update or remove tests that are no longer relevant due to the bug fix, ensuring the test suite remains accurate and effective.45 - **Verify Cleanup**: Re-run all tests to ensure that the cleanup process has not introduced any regressions or issues.46 - **Validate Linting, Formatting and Type Checking**: Run linting, formatting and type checking tools to ensure code quality and adherence to coding standards.47- Ensure the total number of steps in the plan is manageable and does not exceed 20 steps.48- Summarize the complete plan to the user. For example:49 """50 To fix the bug of [bug summary], the plan is as follows:51 - Step 1: Validate Baseline (run existing tests, lint, type-check)52 - Step 2: Write Focused Tests for issue A53 - Step 3: Confirm Test Failure for issue A54 - Step 4: Fix Code for issue A55 - Step 5: Verify Fix for issue A56 - Step 6: Clean Up Unused Code for issue A57 - Step 7: Clean Up Tests for issue A58 - Step 8: Verify Cleanup for issue A59 - Step 9: Validate Linting, Formatting and Type Checking for issue A60 - Step 10: Write Focused Tests for issue B61 - Step 11: Confirm Test Failure for issue B62 - Step 12: Fix Code for issue B63 - Step 13: Verify Fix for issue B64 - Step 14: Clean Up Unused Code for issue B65 - Step 15: Clean Up Tests for issue B66 - Step 16: Verify Cleanup for issue B67 - Step 17: Validate Linting, Formatting and Type Checking for issue B68 - ...69 I will apply **plan-executor** skill to fix the bug step by step as outlined.70 """71</bug-fixing-planning>7273<bug-fixing-planning-examples>7475When you need specific examples to understand how to apply the bug-fixing planning approach, load the relevant example file from the examples folder:7677- **Simple Logic Bugs**: When fixing bugs related to incorrect logic, timing, or calculation errors, read `examples/simple-logic-bug.md`78- **Type-Related Bugs**: When fixing bugs related to TypeScript types, optional fields, or type safety issues, read `examples/type-related-bug.md`79- **Data Persistence Bugs**: When fixing bugs related to database operations, async handling, or data loss issues, read `examples/data-persistence-bug.md`8081Only load example files when they are directly relevant to the current bug being fixed to minimize context size.8283</bug-fixing-planning-examples>84</capabilities>8586<rules>8788The rules section outlines decision criteria that determine which capabilities to apply based on the current context and user inputs.8990<rule> If the user reports a bug, apply the **identifying-bug-root-cause** capability to identify the root cause of the bug. </rule>91<rule> After identifying the root cause of the bug, apply the **adapting-tdd-approach** capability to evaluate whether to adapt TDD approach based on the bug complexity and type. </rule>92<rule> Apply the **bug-fixing-planning** capability to generate a detailed bug-fixing plan, incorporating baseline validation and step consolidation strategies. </rule>93<rule> Always validate the baseline state before starting bug fixes to ensure a clean starting point. </rule>94</rules>9596---97> Converted and distributed by [TomeVault](https://tomevault.io/claim/sjmyuan) — claim your Tome and manage your conversions.98<!-- tomevault:4.0:skill_md:2026-04-14 -->