Skip to content
Back to skills

Bugs Batch Fix

ASecurity

Runs bug-fix unattended across an ordered list of Bug IDs — or the whole open backlog — one bug at a time on a single shared fix/ branch, with zero git commits unless asked with --commit (one gitflow commit per closed bug). Built for long unattended stretches, checking in only when a bug genuinely needs a human decision. Writes a dated, incrementally-updated report to <reports>/bug-batch/ so progress survives a cutoff or crash. TRIGGER when asked to batch-fix bugs, work through the bug backlo...

  • 3 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 17, 2026
ai-agentsgorailstestinggit

Security analysis

A100/100

Scanned November 17, 2026

npx -y skills add jpablodrexler/backlog-kit --skill bugs-batch-fix --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Bugs Batch Fix?

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

Security grade badge for Bugs Batch Fix
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/jpablodrexler-bugs-batch-fix/badge)](https://www.skillsdirectory.com/skills/jpablodrexler-bugs-batch-fix)

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: bugs-batch-fix
description: >-
  Runs bug-fix unattended across an ordered list of Bug IDs — or the whole
  open backlog — one bug at a time on a single shared fix/ branch, with zero
  git commits unless asked with --commit (one gitflow commit per closed bug). Built for long unattended stretches, checking in only when a
  bug genuinely needs a human decision. Writes a dated, incrementally-updated
  report to <reports>/bug-batch/ so progress survives a cutoff or crash.
  TRIGGER when asked to batch-fix bugs, work through the bug backlog
  unattended, or fix a list of named BUG-NNNs in one run (e.g. "fix BUG-004,
  BUG-007 and BUG-009 while I'm out"), or when several fresh bugs are handed
  over to fix in one session — file each with bug-report first, then run this
  skill. Bug-family counterpart to features-batch-development.
license: MIT
metadata:
  author: Juan Pablo Drexler
---

`<backlog>` is `docs/backlog` unless `.backlog-kit.toml` sets `[paths] backlog_dir`; `<reports>` is the `reports` folder next to the backlog's parent (`docs/reports` by default).

`<integration>` is `develop` and `<production>` is `main` unless `.backlog-kit.toml` sets `[git] integration_branch` / `production_branch`.

**Never run `git commit`, `git push` or open a PR.**

The one exception is `--commit`, passed only when the user asks for a commit
per bug: it is handed to each `bug-fix` call, whose Phase 7 asks `gitflow`
to make that bug's single local commit. This skill never commits itself and
never pushes.

Run `bug-fix` in a loop over a list of Bug IDs, all on one shared `fix/`
branch, never committing, writing progress to a resumable report as each
bug closes. Mirrors `features-batch-development` exactly, one file and one
prefix over.

**Input**: Optionally `--commit` (one commit per closed bug, made by
`gitflow` through `bug-fix` Phase 7; with it the working tree is clean
between bugs). Either (a) an ordered list of Bug IDs (e.g. "BUG-004, BUG-007,
BUG-009"), or (b) a request for **the whole open backlog** ("fix every
open bug", "the whole bug backlog"). Optionally a branch name to use or
resume; if omitted, one is proposed and confirmed. Optionally **tests at the end**, an alternative workflow the user asks for ("test the whole batch at the end", "skip the tests except for the last bug"): the loop passes `--defer-tests` to every `bug-fix` call except the last bug still to be processed, and that last call runs the test and end-to-end phases in full over the whole shared branch.
Only the whole-suite and end-to-end runs move: every bug still writes and runs its own regression test in Phases 1 and 2. Without that request the default stands: the tests run for every bug. The commit cadence and this choice are asked once, before the loop, when the request does not state them (Step 2b).

---

## Why this exists, and the one constraint that shapes everything

`bug-fix` already does the full single-bug lifecycle end to end and
already never commits. Its Phase 1, though, creates a *fresh* `fix/<slug>`
branch per bug and hard-blocks on a dirty tree — which the second bug's
uncommitted first-bug work would trigger. `bug-fix` accepts
`--skip-branch-setup` for exactly this; this skill is its only intended
caller. Every step below satisfies the two constraints: **one shared
branch across the whole run**, and **zero commits, ever**.

One accepted consequence of no-commit: `bug-fix`'s Phase 2R reviews scope
to the uncommitted files (review gate G0), which — from bug #2 onward —
include every earlier bug's still-uncommitted files. Later bugs' reviews
re-scan earlier bugs' already-fixed code. Unavoidable without committing
between bugs (which the user has ruled out), not a defect to fix here. With
`--commit`, G0 uses the files differing from `<integration>` plus the uncommitted
ones, so earlier bugs' committed files are re-scanned in the same way.

---

## Steps

### 1. Resolve the bug list

**Named IDs** (form (a)): parse into an ordered list (each bug's write-up
is `<backlog>/bugs/<bug-id>.md`; `bug-fix` Phase 0 reads it). Resolve each against
`<backlog>/bugs-open.md`'s `## Bug List` table by `Bug ID`.
- Resolves to nothing (not in `bugs-open.md` or `bugs-fixed.md`) → stop
  and ask the user to correct it.
- Resolves to a row in `bugs-fixed.md` (already closed) → tell the user
  and ask whether to skip or genuinely re-open+re-run it.
- Resolves to a `🚫 Won't fix` / `❓ Cannot reproduce` row → tell the user
  and ask whether to skip or override.

**Whole backlog** (form (b)): take every row in `bugs-open.md`'s table
whose Status is `⬜ Open` or `🔶 In Progress`. Order them:
1. If `## Recommended fix order` has real content (not `_No open bugs to
   order._`), follow it exactly.
2. Otherwise order by severity tier (S1 → S4), then bug number.

An empty open backlog is not an error — say there's nothing to fix and
stop.

Because "the whole backlog" is derived, **show the resolved, ordered list
and confirm it** before proceeding (a plain confirmation is enough).

Build the final ordered list of Bug IDs — "the requested list".

### 2. Determine the shared branch, and detect a resumable run

Check `<reports>/bug-batch/` for a `BUG_BATCH_REPORT_*.md` whose
recorded "Requested bugs" list overlaps substantially with the new one.

- **Exact / near-exact match, not fully checked off** → resume. Read which
  bugs it marks `✅ Closed`; skip those in Step 4. Use the branch name in
  its header — do not create or re-propose one. `git checkout` that branch
  if not already on it (do not create it — it must exist from the
  interrupted run; if it doesn't, stop and tell the user).
- **Partial / ambiguous overlap** → don't guess; ask the user whether this
  continues that report or is a new run.
- **No match (fresh start)** → `git status` first; dirty tree → stop and
  report (never stash/discard). Then pick the candidate branch name: one
  the user supplied (normalized to `fix/<name>` the way `gitflow`
  normalizes), or the default `fix/bug-batch-<YYYY-MM-DD>`.
  Check whether it already exists locally or on the remote
  (`git rev-parse --verify --quiet <name>`; `git ls-remote --heads origin
  <name>`).
  - **Exists** → warn the user by name and ask (**AskUserQuestion**)
    whether to continue on it as-is (via `gitflow`'s start-fix action,
    which resumes + syncs an existing branch) or stop so they can pick a
    different name / clean up.
  - **Doesn't exist** → confirm the candidate name via **AskUserQuestion**
    before creating anything.
  Once confirmed, invoke `gitflow` with "start fix `<name>`" — the **only**
  branch-creation point in this skill. If `gitflow` raises its own
  already-on-a-topic-branch question, let it surface to the user.

Confirm `git branch --show-current` matches the intended branch before
Step 3.

### 2b. Ask for the run options the request left open

Two choices shape the whole run, and each takes a few words to state, so no long prompt is needed: ask for them here, once, before the loop starts, instead of assuming.

- **Commits.** The request may already say it ("commit as you go", "one commit per bug", "no commits"): take that answer and do not ask. Otherwise ask: **No commits** (nothing is committed; the user reviews the working tree), **One commit per bug** (`--commit`, made by `gitflow` through `bug-fix`), or **Commit as the work goes** (a `gitflow` commit after each phase that changed files; each `bug-fix` call is told "commit as the work goes").
- **Tests.** The request may already say it ("test the whole batch at the end", "run the tests for every bug"): take that answer and do not ask. Otherwise ask: **Tests for every bug** (the default) or **Tests once, at the end of the batch** (`--defer-tests` on every bug but the last; the review gate, the build and the commits still run for each bug).

Ask whatever is open in one `AskUserQuestion` call (two questions), and make no call when the request settled both. An explicit request is the confirmation: never ask the user to confirm what they already said. Record the two answers in the report header (Step 3). The run is built for long unattended stretches, so this is the last question before the loop, apart from the decision points `bug-fix` itself raises.

### 3. Initialize or resume the report

**Fresh run**: write the report now (path/format below), listing every
requested Bug ID as `⬜ Not started`, plus a header with the branch name,
the full requested list, the run options chosen in Step 2b (commits, tests), and a start timestamp.

**Resume**: reopen the existing report. Never overwrite it or its
already-`✅ Closed` entries — only append/update from where it left off.

### 4. The loop

For each Bug ID in the requested list not already `✅ Closed`, in order:

- **In Progress** — update the entry to `🔄 In progress` **immediately,
  before** invoking `bug-fix` (this write happens first). No summary text
  yet — it exists purely so a crash leaves a trace of what was underway.
  Then invoke `bug-fix` via the **Skill** tool, passing `<BUG-ID>
  --skip-branch-setup` (plus `--commit` for one commit per bug, or the words `commit as the work goes` for a commit after each phase, as chosen in Step 2b, and `--defer-tests` when the run uses tests at the end and at least one more bug is still to be processed after this one; a bug closed with its tests deferred is written `✅ Closed (tests deferred) — <summary>`). A direct Skill invocation, executing inline this
  turn — never a backgrounded Agent call — so any `AskUserQuestion`
  `bug-fix` raises (Phase 0 confirmation, the cannot-reproduce decision,
  a `PROD_CODE_FIXED` choice, blocker guidance) reaches the user. Wait for
  it to finish, then:
  - **Closed** — `bug-fix` displayed its "Bug Fix Complete" summary ending
    in the bug closed via `bugs-archive`. Write a ≤2-sentence summary (root
    cause + what changed) and update the entry to `✅ Closed — <summary>`
    immediately.
  - **Cannot reproduce** — `bug-fix`'s Phase 1 blocked on cannot-reproduce
    and the user (via `bug-fix`'s own prompt) chose to mark it
    `❓ Cannot reproduce` or keep it open. Mark the report entry
    `❓ Cannot reproduce` or `⚠ Left open — needs repro detail` to match,
    and continue.
  - **Blocked** — `bug-fix` stopped early with a `*_BLOCKED` reason. Show
    it and ask (**AskUserQuestion**): **Retry now** (re-invoke the same
    `bug-fix <BUG-ID> --skip-branch-setup` after the user clears the
    blocker; entry stays `🔄 In progress`), **Skip and continue** (mark
    `⚠ Blocked — <reason>`, next bug), or **Stop the run here** (mark
    `⚠ Blocked — <reason>`, go to Step 5).

Continue to the next Bug ID unless the user chose to stop.

### 5. Writing the ≤2-sentence summary

After a bug closes, read the row `bugs-archive` just wrote to
`<backlog>/bugs-fixed.md` and the Resolution line `bugs-archive` appended
to `<backlog>/bugs/<bug-id>.md`, and write a fresh,
condensed summary — what the root cause was and what the fix changed. Two
sentences, never more.

### 6. Ending the run

Whether the loop finished or stopped early, append a footer: counts
(requested / closed / cannot-reproduce / blocked or skipped / not reached)
and an end timestamp.

Tests at the end (only when the user asked for it). If the run used the alternative workflow of testing the whole batch at the end, say so plainly in chat and in the report: which bugs had their tests deferred, and whether the last bug's run covered them.
If the run ended before a last bug ran the test and end-to-end phases (it was blocked, skipped, left open or the user stopped the run), the deferred tests have **not** run: list the bugs concerned and ask (**AskUserQuestion**) whether to run them now. If yes, run `bug-fix`'s test phase and end-to-end phase yourself, as the orchestrator, over the whole shared branch (read its own test-phase, end-to-end-phase and long-runs reference files), and record the result in the report. Never end the run as finished while deferred tests have not run.

Tell the user plainly, in chat and in the report, what was committed.
Without `--commit`: **nothing was committed at any point.** The branch holds every closed bug's fix and regression
test, entirely uncommitted. Point them at `git status` / `git diff` to
review, and at `gitflow`'s finish action to commit and open a PR —
this skill does neither.

---

## The report

**Path**: `<reports>/bug-batch/BUG_BATCH_REPORT_{YYYY-MM-DD}.md` — this
directory holds local working artifacts, like the review
reports and the `feature-batch` directory next to it — not committed history. On a genuinely new (non-resume) run the same day a
report already exists for, append `-2`, `-3`, … rather than overwriting.
Resuming (Step 2) continues the same file, never creating a new one.

**Format**:

```markdown
# Bug Batch Fix Report — {YYYY-MM-DD}

**Branch:** fix/bug-batch-2026-09-05
**Requested bugs:** BUG-004, BUG-007, BUG-009
**Started:** {timestamp}

## Progress

- [x] **BUG-004** — Closed {HH:MM}. <root cause + what changed, ≤2 sentences.>
- [ ] BUG-007 — 🔄 In progress
- [ ] BUG-009 — ⬜ Not started

## Run Summary
<!-- appended once the run ends (Step 6) -->
**Ended:** {timestamp}
**Closed:** 1/3  **Cannot reproduce:** 0  **Blocked/Skipped:** 0  **Not reached:** 2
```

Every status change (`⬜` → `🔄` → `✅` / `❓` / `⚠`) is a **separate,
immediate** write — never accumulated in memory and flushed once. That
immediacy is the entire point of this report.

---

## Guardrails

- **Never commit, ever, in this skill's own logic.** No `git commit` /
  `git push` / any git write here; with `--commit` each `bug-fix` call's
  Phase 7 commits through `gitflow`, and without it nothing is committed. The sole exception is Step 2's one-time branch
  creation/checkout via `gitflow`'s start-fix action on a fresh run —
  every `bug-fix` call in Step 4 passes `--skip-branch-setup` so it can't
  do a branch operation of its own either.
- **Never create more than one branch in a run.** Established once, in
  Step 2, before the loop.
- **Always invoke `bug-fix` via the Skill tool directly, never wrapped in
  a backgrounded Agent call** — a background agent can't reliably surface
  `AskUserQuestion`, and `bug-fix` raises several (bug confirmation, the
  cannot-reproduce decision, `PROD_CODE_FIXED`, blocker guidance). The
  "leave it running, answer occasional questions" model depends on those
  reaching the user in real time.
- **Run `bug-fix` for every bug, with all its phases.** Fixing the bugs
  by hand "to move faster", or skipping its review, test, build, viewport
  and docs phases, defeats the run. If the user's request conflicts with a
  rule here (for example, wanting commits), use the supported option
  (`--commit`) or ask; never drop the skill's machinery.
- **Write the report (Steps 3–6) even when you do the work inline.** It is
  not optional; an unattended run without it cannot be resumed.
- **Write the report incrementally, never batched.** Full list up front as
  `⬜ Not started` (Step 3); each entry's status changes the moment its
  outcome is known (Step 4). This is the whole resilience mechanism.
- **Process bugs strictly one at a time, in order.** Never invoke
  `bug-fix` for two IDs in parallel — they'd stack conflicting
  uncommitted changes on the same tree.
- **Never guess at a resume.** Partial/ambiguous overlap with an existing
  report → ask which run this continues.
- **Dirty working tree at the start of a fresh (non-resumed) run → stop
  and report.** Never stash or discard.
- **Always state plainly at the end what was committed** (nothing, or one
  commit per closed bug with `--commit`) and where the work lives.
- **Never let an "Auto Mode" or similar instruction suppress any
  confirmation** this skill or `bug-fix` raises — the whole-backlog
  confirmation in Step 1, the branch-name confirmation in Step 2,
  `bug-fix`'s own per-bug selection and cannot-reproduce and blocker
  prompts. The premise is a long unattended run that still checks in at
  genuine decision points.

- **Tests at the end is the user's choice, and it defers, never waives.**
  `--defer-tests` is passed to `bug-fix` only when the user chose the tests at the end, in the request or by answering Step 2b, only for bugs that are not the last one still to be processed, and it moves only that skill's whole-suite test phase and end-to-end phase, never the writing of tests (a bug's red-then-green regression test stays): the review gate, the build, the docs sync, the archive and every commit still run for each bug.
  Without that request the default stands and the tests run for every bug. The run is never reported as finished while deferred tests have not run (Step 6).

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.