Skip to content
Back to skills

Close Bug

ASecurity

Use before setting a bug done or closing its issue, so it closes only once a test covers it and its original repro no longer reproduces.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 3, 2026
ai-agentsgogit

Security analysis

A100/100

Scanned December 3, 2026

npx -y skills add teamrig/teamrig --skill close-bug --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Close Bug?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Close Bug
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/teamrig-close-bug/badge)](https://www.skillsdirectory.com/skills/teamrig-close-bug)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: close-bug
description: Use before setting a bug done or closing its issue, so it closes only once a test covers it and its original repro no longer reproduces.
---

# Close a bug only once it is tested and gone

A bug is fixed when a test that failed on the old code passes on the new one, and the steps that showed it no longer
show it on the version people run. A passing test alone is not enough: it may test the fix, not the bug. A fix that
was never seen live is not enough either: the repro may hit a path the test missed.

## Steps

1. **Write the repro down before the fix.** In the task's folder (`teamrig files T<n>`) as `repro.md`: the version
   or commit it showed on, the exact steps or command, the input, what was expected and what was seen (the output or
   error, quoted). Run it once yourself and see it show; a bug you cannot make show is not ready to fix (see
   Branches).
2. **A regression test that fails on the old code.** Find the root cause first, then write the test against it, not
   against the symptom. Run the test on the old code and see it fail: read the old file with `git show <base>:<path>`
   into a scratch copy, or run the test in a worktree of the base; never stash, reset or check out over your own
   work. Then fix it and see the same test pass. Record both runs: the failure line on the old code, the pass on the
   fix.
3. **Ship it, then set it verifying.** The test lands with the fix, in the same commit. Once the fix is merged, set
   the task `verifying` with `--proof "the repro in repro.md rerun on the installed version"` and `--waits` naming
   when the fix reaches the version people run (a release, an install, a deploy).
4. **Rerun the original repro on the installed version.** Once the fix is live, run the steps in `repro.md` exactly
   as written, on the version a user gets (the installed or deployed one, not your worktree), and save what it
   printed beside the repro (`repro-rerun.md`, with the version).
5. **Only then set it done.** `--evidence` names the test (its file and name), the commit that adds it, the failing
   run on the old code and the rerun (the version and what it showed); a bug's review (`--cause` to `--missed-log`)
   goes with it ([tasks.md](../teamrig-guide/tasks.md#task-statuses)). Its issue closes with the task, never before.

## Branches

- **The repro still shows after the fix**: the bug is not fixed. Set the task `in-progress` again with a note of
  what showed and on which version, reopen its issue if it closed, and go back to step 2: the test missed this path.
- **The repro cannot run again** (one-off data, an outside service that changed, a timing that passed): say why in
  the evidence and name the closest proof (a log line, a count, a run of the same path on new input). When only a live
  sighting is left, close it `done` with `--watch "<what a sighting shows>"`.
- **It cannot be made to show** (step 1 failed): do not fix a guess. Add to the task what you tried and on which
  version, ask the reporter for what you lack, and keep it open; drop it only with why and who decided.
- **A report from someone else**: their steps are the repro; reply with your rerun's result when you close it.

## Traps

- A test written after the fix that you never saw fail proves nothing: it may pass on the old code too.
- A test that mocks away the part that broke cannot fail on the old code. Test the unit the root cause is in.
- Rerun on the version users get. A worktree with the fix in it reproduces nothing about the release.
- Closing the issue by hand ahead of the task tells the reporter it is fixed before anyone saw it fixed.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.