# Bug fix

> Bug fix is an open-source agent skill for developer tools. Walks an agent through diagnosing, proving and fixing a reported bug with a regression. It is available on Claude Code.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code
- **Website:** https://github.com/ramboz/jig/tree/main/hosts/claude/skills/bug-fix
- **Repository:** https://github.com/ramboz/jig
- **GitHub stars:** 6
- **License:** MIT
- **Skill name:** bug-fix
- **Collection:** https://github.com/ramboz/jig
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-01

## About

This skill gives the agent a staged lifecycle for reported defects: it records the bug, forms several competing hypotheses, establishes a root cause, checks whether the bug still reproduces on fresh main, and writes a regression test that must fail before the fix and pass after. A bundled Python helper (bug.py) manages the bug record and enforces these checks, so the agent cannot skip to a patch without the evidence.

The workflow can stop once the root cause is recorded, or continue through the fix and review passes to completion. It also sorts work by size: trivial one-liners are sent to a separate test-driven loop, while cross-layer or security-relevant bugs get the full set of gates. Bugs that turn out to be missing behaviour can be escalated into a spec.

It expects a Python 3 environment and a git repository with an origin/main branch, and uses a project test command or auto-detected test runner for the red-to-green check. Review passes rely on other reviewer skills when they are installed.

## When your agent uses it

> Drive the teeth-gated lifecycle for reported defects: diagnose root cause, prove it, and prevent regression through REPORTED → DIAGNOSING → ROOT_CAUSED → FIXING → REVIEWED → DONE, with VERIFIED, ESCALATED, and RESOLVED_ON_MAIN paths where needed. Auto-fires on fix this bug, debug this, root-cause this, this regressed, this broke again, why is this failing, diagnose before fixing, or investigate this failure. Two modes: `diagnose` stops at ROOT_CAUSED; `diagnose_and_fix` runs through DONE. Uses a durable bug record, multiple hypotheses, a fresh-main recheck, and a witnessed red→green test. Do not use for spec-shaped work (use `spec-workflow`) — including a pure visual design-fidelity gap against an agreed mockup, which is spec-shaped, not a bug (see "Design-fidelity triage" below) — or trivial one-liners (use `tdd-loop`).

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Runs Python scripts](https://github.com/ramboz/jig/tree/HEAD/hosts/claude/skills/bug-fix)
- [Network calls found in its scripts](https://github.com/ramboz/jig/tree/HEAD/hosts/claude/skills/bug-fix)
- [License: MIT](https://github.com/ramboz/jig/tree/HEAD/hosts/claude/skills/bug-fix)

## Features

- **Staged bug lifecycle:** Moves a defect through recorded states from report to done, with named back-edges for failed reviews.
- **Root-cause diagnosis:** Requires multiple candidate hypotheses and a leading explanation before a root cause is accepted.
- **Fresh-main recheck:** Confirms the bug still reproduces on origin/main so duplicate fixes are avoided.
- **Red-to-green regression test:** Machine-checks that a regression test fails before the fix and passes after it.
- **Repository closure inventory:** Asks for a recorded search of existing helpers and call sites before the fix is written.
- **Proportional triage:** Routes trivial fixes away from the record and gates, keeping heavier rigor for complex bugs.

## Good for

- Diagnose why a login test started failing after a recent change
- Find the root cause of a regression before deciding on a fix
- Fix a reported crash and add a test that proves it stays fixed
- Decide whether a reported defect is really a missing feature needing a spec
- Investigate an intermittent failure and record the evidence for each hypothesis

## Install

### Claude Code

This skill ships in the `jig` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add ramboz/jig
/plugin install jig@jig
```

Or copy only this skill to `~/.claude/skills/bug-fix`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ramboz/jig.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/bug-fix &&
cp -R "$tmp/hosts/claude/skills/bug-fix" ~/.claude/skills/bug-fix &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/bug-fix` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/bug-fix` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ramboz/jig.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/bug-fix &&
cp -R "$tmp/hosts/claude/skills/bug-fix" ~/.agents/skills/bug-fix &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/bug-fix` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/bug-fix` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ramboz/jig.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/bug-fix &&
cp -R "$tmp/hosts/claude/skills/bug-fix" ~/.cursor/skills/bug-fix &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/bug-fix` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/ramboz/jig.git --path hosts/claude/skills/bug-fix
```

Or copy the folder to `~/.gemini/skills/bug-fix` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/bug-fix`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ramboz/jig.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/bug-fix &&
cp -R "$tmp/hosts/claude/skills/bug-fix" ~/.copilot/skills/bug-fix &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/bug-fix` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/ramboz/jig.git
```

Then copy `jig/hosts/claude/skills/bug-fix` into your agent's skills folder as `bug-fix`. Agents that support SKILL.md read one folder per skill.

## FAQ

### What does the skill need to run?

It uses a Python 3 helper script and a git repository. The regression test is run through a test command, which can be set in a .jig/test-command file for stacks that are not auto-detected.

### When does Bug fix trigger?

It is meant for requests such as fix this bug, debug this, root-cause this, this regressed, or why is this failing. Feature work and trivial one-line changes are routed to other workflows.

### Does Bug fix change my code without asking?

Its two modes differ: diagnose stops at the recorded root cause, while diagnose_and_fix continues through the fix and review steps.

### Can I skip the checks?

Each gate can be bypassed with a specific environment variable, which the instructions describe as a deliberate escape rather than the default.

### How do I install Bug fix in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/bug-fix to use it in all your projects, or to .claude/skills/bug-fix in one project. Or install the jig plugin, which includes it: /plugin marketplace add ramboz/jig, then /plugin install jig@jig.

### Does Bug fix run scripts?

Yes. It runs Python scripts. Its scripts contain network calls. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Bug fix?

Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.

### What are the best alternatives to Bug fix?

The closest alternatives to Bug fix are Bug, Debug, Principle fix root causes, Patching bugs and TDD.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Bug](https://ai-powered.com/skills/bug-jasgujral): Bug is an open-source agent skill for developer tools.
- [Debug](https://ai-powered.com/skills/debug-jasgujral): Debug is an open-source agent skill for developer tools.
- [Principle fix root causes](https://ai-powered.com/skills/principle-fix-root-causes): Principle fix root causes is an open-source agent skill for developer tools.
- [Patching bugs](https://ai-powered.com/skills/patching-bugs): Patching bugs is an open-source agent skill for developer tools.
- [TDD](https://ai-powered.com/skills/tdd-michael-denyer): TDD is an open-source agent skill for developer tools.
- [Diagnostic reasoning](https://ai-powered.com/skills/diagnostic-reasoning): Diagnostic reasoning is an open-source agent skill for developer tools.
- [Correct](https://ai-powered.com/skills/correct): Correct is an open-source agent skill for developer tools.
- [Ci](https://ai-powered.com/skills/ci-chachamaru127): Ci is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/bug-fix
