# Bug

> Bug is an open-source agent skill for developer tools. Guides the agent to reproduce a reported bug with a failing test before fixing it. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/JasGujral/mokata-oss/tree/main/src/mokata/skills/bug
- **Repository:** https://github.com/jasgujral/mokata-oss
- **GitHub stars:** 19
- **License:** Apache-2.0
- **Skill name:** bug
- **Collection:** https://github.com/JasGujral/mokata-oss
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-01

## About

This skill walks an AI coding agent through fixing a concrete defect. It starts from a user-supplied reproducer, has the agent write a failing test that captures the bug, and only then changes code until that test passes. The test is kept afterward as a regression guard, and the agent is told not to weaken the test to make it pass.

The workflow asks the agent to read the failing code path and trace it with the project's structural code queries before editing, rather than guessing at the cause. Progress is tracked through the stages reported, reproduced, fixing and verified, and test runs are recorded against the full test node id. Durable changes are meant to be gated behind a human preview and approval.

The skill expects a reproducer or bug report from the user and a project where the mokata tooling is available. It is part of the mokata project, which also ships a matching /mokata:bug command, and it is packaged as a Claude Code plugin.

## When your agent uses it

> mokata · Start from a reproducer and a failing test, then fix.

## What it can access

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

- [Instructions only, no scripts](https://github.com/JasGujral/mokata-oss/tree/HEAD/src/mokata/skills/bug)
- [License: Apache-2.0](https://github.com/JasGujral/mokata-oss/tree/HEAD/src/mokata/skills/bug)

## Features

- **Reproducer first workflow:** Requires a concrete reproducer and a failing test before any fix is made.
- **Root cause tracing:** Directs the agent to read the failing path and trace callers and callees before changing code.
- **Regression test retention:** Keeps the failing test in place as a guard against the bug returning.
- **Progress and test recording:** Tracks the bug through reported, reproduced, fixing and verified stages with per-test run records.
- **Scope discipline:** Limits changes to the reported bug and avoids altering unrelated behaviour.

## Good for

- Fix a bug from a user's report that includes steps to reproduce
- Turn a known failing behaviour into a regression test and then a fix
- Investigate a crash by tracing the failing code path before editing
- Add a guarding test for a defect that was already fixed by hand

## Install

### Claude Code

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

```sh
/plugin marketplace add JasGujral/mokata-oss
/plugin install mokata@mostack
```

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

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

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

### Codex

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

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/JasGujral/mokata-oss.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/bug &&
cp -R "$tmp/src/mokata/skills/bug" ~/.agents/skills/bug &&
rm -rf "$tmp"
```

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

### Cursor

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

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/JasGujral/mokata-oss.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/bug &&
cp -R "$tmp/src/mokata/skills/bug" ~/.cursor/skills/bug &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/bug` 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/JasGujral/mokata-oss.git --path src/mokata/skills/bug
```

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

### VS Code

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

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/JasGujral/mokata-oss.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/bug &&
cp -R "$tmp/src/mokata/skills/bug" ~/.copilot/skills/bug &&
rm -rf "$tmp"
```

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

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/JasGujral/mokata-oss.git
```

Then copy `mokata-oss/src/mokata/skills/bug` into your agent's skills folder as `bug`. Agents that support SKILL.md read one folder per skill.

## FAQ

### Does Bug need a reproducer to run?

Yes. The skill says it should not engage without a reproducer to start from, and a failing test must exist before any fix.

### Can the agent change the test to make Bug pass?

No. The skill instructs the agent to fix the code and keep the test unchanged in intent, not weaken it to go green.

### Which clients does Bug work with?

It is published as a Claude Code plugin through a plugin marketplace, so its listed platform support follows the shared agent skills format.

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

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

### Does Bug run scripts?

No. It is instructions only, with no scripts. 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?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Bug?

The closest alternatives to Bug are Debug, Bug fix, TDD, Reproduce bug and Bug reproduction brief.

## Where this comes from

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

## Alternatives

- [Debug](https://ai-powered.com/skills/debug-jasgujral): Debug is an open-source agent skill for developer tools.
- [Bug fix](https://ai-powered.com/skills/bug-fix): Bug fix 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.
- [Reproduce bug](https://ai-powered.com/skills/reproduce-bug): Reproduce bug is an open-source agent skill for developer tools.
- [Bug reproduction brief](https://ai-powered.com/skills/bug-reproduction-brief): Bug reproduction brief 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.
- [Develop](https://ai-powered.com/skills/develop): Develop 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.

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