home / skills / arjenschwarz / agentic-coding / bug-blitz

bug-blitz skill

/claude/skills/bug-blitz

This skill automates batch-fixing open bugs in parallel using git worktrees and subagents, speeding up transit bug resolution.

npx playbooks add skill arjenschwarz/agentic-coding --skill bug-blitz

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
2.9 KB
---
name: bug-blitz
description: Batch-fix all open bugs in parallel using git worktrees. Fetches bug-type tasks in "idea" status from Transit, creates an isolated worktree per bug, and spawns parallel subagents each running the fix-bug workflow. Use when you want to tackle all open bugs at once, e.g. "fix all open bugs", "bug blitz", "resolve all Transit bugs".
# model: inherit
# allowed-tools: Read,Write,Edit,Bash,Grep,Glob,Task
---

# Bug Blitz

Resolve all open bugs in parallel — one worktree and one subagent per bug.

## Workflow

### 1. Fetch Bugs

Query Transit for all bug-type tasks in "idea" status:

```
mcp__transit__query_tasks(type="bug", status="idea")
```

If the current project has a Transit project ID, filter by `projectId` as well.

If no bugs are found, inform the user and stop.

Present the list of bugs to the user with their `T-{displayId}` references and names. Ask for confirmation before proceeding. The user may choose to exclude specific bugs.

### 2. Create Worktrees

For each confirmed bug:

1. Derive a bug name in kebab-case from the task name
2. Create a worktree based off `main` with branch `T-{displayId}/bugfix-{bug-name}`:
   ```
   git worktree add ../{repo-name}-worktrees/T-{displayId} -b T-{displayId}/bugfix-{bug-name} main
   ```

All worktrees go in a sibling directory `../{repo-name}-worktrees/` to keep the main repo clean. Use the repo's directory name as `{repo-name}`.

If a worktree or branch already exists for a bug, skip creation and reuse it.

### 3. Spawn Subagents

Spawn one Task subagent per bug using `subagent_type="general-purpose"`. Run all subagents in parallel (single message, multiple Task tool calls).

Each subagent receives this prompt (fill in the values):

```
You are working in a git worktree at {worktree_path}.

Fix the bug described by Transit ticket T-{displayId}:
- Name: {task_name}
- Description: {task_description}

Run the /fix-bug skill with the ticket reference T-{displayId}.
The worktree already has the correct branch checked out — do NOT create a new branch or switch branches.
Work entirely within {worktree_path} as your working directory.
```

Important: The fix-bug skill handles branch creation as part of its Transit integration. Since the worktree already has the correct branch, the subagent's working directory ensures it operates in the right place. The fix-bug skill will detect the existing branch and skip branch creation.

### 4. Report Results

After all subagents complete, summarise results in a table:

| Bug | Branch | Status | PR |
|-----|--------|--------|----|
| T-{id}: {name} | T-{id}/bugfix-{name} | success/failed | #{pr} or — |

### 5. Cleanup

After reporting, offer to remove the worktrees:

```
git worktree remove ../{repo-name}-worktrees/T-{displayId}
```

Only remove worktrees for successfully resolved bugs (PR created). Keep worktrees for failed bugs so the user can investigate.

Overview

This skill automates a parallel bug-fixing campaign by creating one git worktree and one subagent per open bug. It queries Transit for bug tasks in the "idea" status, sets up isolated worktrees per bug, and runs the fix-bug workflow concurrently to produce PRs. After all subagents finish, it summarizes results and offers cleanup of successful worktrees.

How this skill works

The skill queries Transit for tasks of type "bug" with status "idea" and asks the user to confirm which bugs to process. For each confirmed bug it creates (or reuses) a sibling worktree and branch patterned as T-{displayId}/bugfix-{kebab-name}. It then spawns one general-purpose subagent per worktree in parallel, each instructed to run the /fix-bug skill inside its worktree. When subagents finish, the skill aggregates statuses and presents a concise table of branch, status, and PR links, then offers to remove worktrees for successful fixes.

When to use it

  • You want to fix many open bugs at once without disrupting the main repo.
  • You need isolated environments per bug so fixes don’t conflict.
  • You want to run identical automated fix workflows in parallel.
  • You have multiple small bug tickets in Transit labeled idea.
  • You prefer worktrees over branching inside the main working directory.

Best practices

  • Confirm and optionally exclude specific tickets before starting to avoid unwanted changes.
  • Keep worktrees in a sibling ../{repo-name}-worktrees/ directory to protect the main repo.
  • Let subagents run in parallel but monitor resource usage if your machine is limited.
  • Only remove worktrees after a successful PR is created; retain failed worktrees for debugging.
  • Use clear, descriptive task names so generated kebab-case branch names remain meaningful.

Example use cases

  • Run a single command to attempt fixes for all Transit bugs in idea status before a release sweep.
  • Triaging a backlog: quickly surface which bugs can be auto-fixed and which need manual work.
  • CI-assisted bug blitz where each subagent runs linters, tests, and the fix-bug flow in isolation.
  • Onboarding: let a junior developer review per-bug worktrees and the corresponding PRs.

FAQ

What if no bugs are found?

The skill reports that no matching bug tasks were found and stops without making changes.

Will branches be duplicated if they already exist?

If a worktree or branch already exists for a ticket, the skill reuses it and does not recreate it.