bug-fix

Diagnose and fix tracked bugs test-first with evidence-backed root cause analysis.

Updated May 26, 2026
One-click install
npx skills add https://github.com/cagriy/dev-skills --skill bug-fix-cagriy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bug-fix
Source: https://github.com/cagriy/dev-skills/tree/main/skills/bug-fix
Command: npx skills add https://github.com/cagriy/dev-skills --skill bug-fix-cagriy

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Fixing bugs without a confirmed root cause leads to speculative patches, regressions, and recurring defects. This Skill enforces a disciplined workflow that diagnoses the root cause with evidence, fixes it test-first, and closes the bug with a clean audit trail. ## Core Features & Use Cases - Evidence-driven diagnosis: Reproduces the bug, traces code paths, and confirms a fact-based root cause before touching production code. - Test-driven fixing: Writes a failing regression test first, applies the minimal fix, and verifies no regressions against a pre-recorded baseline. - Full bug lifecycle: Clarifies ambiguous reports with the user, archives resolved bugs into bugs/archive/, regenerates the tracker, and makes exactly one commit. - Use Case: You have several open bugs filed under bugs/ in your repo. Run the skill to automatically pick the lowest-numbered open bug, diagnose it, fix it with TDD, and close it with a single commit. ## Quick Start Ask the assistant to fix the next open bug in the repository, or specify a bug number such as "fix bug #3" to target a specific issue.

Frequently Asked Questions about bug-fix

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix a bug with test-driven development?

Write a failing regression test that captures the buggy behavior, confirm it fails for the expected reason, then make the minimal change at the root cause until the test passes. Finally run the full test suite to verify no regressions against the baseline.

How do I find the root cause of a bug before fixing it?

Reproduce the bug, trace the affected code paths end to end, and gather evidence such as failing assertions, logs, or printed values. Never change production code until the cause is confirmed with observable evidence at a specific file and line.

Can I fix a specific bug instead of the lowest-numbered one?

Yes, pass a bug number as an argument, such as 3, #3, or bug-3, and the skill targets that bug folder under bugs/. Without a number, it automatically selects the lowest-numbered open bug.

What happens if a bug report is ambiguous or unclear?

The skill asks a focused clarification round using structured questions with concrete options and a recommendation before diagnosing. This step is mandatory even in autonomous mode, since fixing the wrong thing wastes more time than one round of questions.

Does the bug-fix workflow push commits or create branches?

No, it works on the current branch only, makes exactly one commit after the fix is confirmed, and never pushes. It also never bypasses pre-commit hooks or stages unrelated files.

What if the bug cannot be verified with automated tests?

For UI or external-only behavior, the skill adds tests at whatever layer is testable, then asks the user to manually verify with precise reproduction steps. It waits for explicit confirmation before closing and archiving the bug.