/software-factory:tackle-issues <N> [--label <label>] [--skip <glob>] [--issues <N,N,...>] [--repo <owner/repo>] [--draft] [--sort oldest|newest] [--screen]from software-factory
Tackle N open GitHub issues in parallel using worktree-isolated subagents, producing one PR per issue. Lightweight wrapper — PRs are proposals, not mutations; the safety net is /pr-triage on the next pass.
Ships in software-factory. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Dispatch parallel subagents in worktrees to tackle open GitHub issues and make PRs.
Parse from the input:
| Arg | Default | Meaning |
|---|---|---|
<N> (positional) | 5 | How many issues to tackle |
--issues 201,203,207 | (auto-discover) | Specific issue numbers |
--label <label> | (none) | Filter issues by GitHub label |
--skip <glob> | (none) | Skip issues whose title matches this pattern |
--repo owner/repo | (cwd git remote) | Target repository |
--draft | off | Create draft PRs instead of ready-for-review |
--sort oldest|newest | newest | Issue selection order. newest (default) tackles recently opened issues first; oldest clears the backlog |
--screen | off | Reject issues whose body is too thin to produce a good PR. Screened issues appear in the Skipped table. |
Repo match check (fail closed): If --repo was provided, run:
gh repo view --json nameWithOwner -q .nameWithOwner
If gh repo view exits with a nonzero status, stop immediately with Blocked: unable to verify cwd repository identity (gh repo view failed). Do not proceed.
On success, this returns the owner/repo of the cwd checkout. Compare it without regard to case to the --repo value. If they differ, stop immediately with:
Blocked:
--repo <value>does not match the cwd checkout (<cwd-repo>). Run this command from a checkout of<value>.
Do not run git fetch, discover issues, or dispatch any subagents until this check passes.
Run git fetch origin once. Record:
<default-branch> via gh repo view --json defaultBranchRef -q .defaultBranchRef.name<head-sha> via git rev-parse origin/<default-branch>This fetch also determines where isolated subagent worktrees start: the runtime bases isolation: "worktree" on the cached remote default ref, so after the fetch every subagent worktree will begin at <head-sha>.
If --issues provided, fetch those issue records directly with gh issue view <n> --json number,title,body,labels,assignees for each. Do not apply --label, --skip, or assignee filters to explicit --issues; those flags apply only to auto-discovered issues. Otherwise:
Build and run exactly one discovery command using these rules:
--sort oldest was provided, use only the first form below. Otherwise, including explicit --sort newest or no --sort, use only the second form. Never run both forms.--label is provided, replace <label-filter> in the selected form with --label followed by the supplied label as one shell argument, using shell quoting as needed. Otherwise, remove <label-filter>. GitHub applies this filter before the limit, so only matching issues count toward <N * 2>.<N * 2> with the integer result of multiplying the requested issue count by 2, then run the selected command.# --sort oldest
gh issue list --state open <label-filter> --limit <N * 2> --search "sort:created-asc" --json number,title,body,labels,assignees
# default (--sort newest)
gh issue list --state open <label-filter> --limit <N * 2> --search "sort:created-desc" --json number,title,body,labels,assignees
Filter out issues that (auto-discover only):
--skip patterngh issue view <number> --json closedByPullRequestsReferences (linked PRs) plus gh pr list --state open --search "#<number> in:title,body" and scan open PRs whose branch name suggests the issue number. If any linked or referencing open PR exists, skip.Before selecting issues to dispatch, verify every candidate (including explicit --issues) against <head-sha>. For each candidate issue <N>:
git log origin/<default-branch> --oneline -E --grep "#<N>([^0-9]|$)" to find commits that reference the issue (the ([^0-9]|$) suffix prevents #20 from matching #200; do not use \b, which POSIX ERE does not support, so git silently matches nothing; any match still warrants inspection).gh pr list --state merged --search "#<N>" --json number,title,body,closingIssuesReferences to find merged PRs that mention the issue. Prefer closingIssuesReferences for an authoritative match; fall back to scanning titles and bodies for an exact #<N> reference (GitHub full-text search tokenizes #20 loosely, so a keyword hit alone is not conclusive).If any merged commits or merged PRs exist for a candidate, inspect the issue's remaining acceptance items against HEAD. If nothing remains unaddressed, skip and report as already-done. If partial work was merged but items remain, note the remaining items and include the candidate (the subagent will address only what is left).
When --screen is set, apply an additional quality filter to each remaining candidate. Read the issue body and reject candidates that are too thin for a subagent to produce a useful PR:
bug (case-insensitive) and the body contains none of: a fenced code block, an error indicator (Error:, Traceback, panic:, FAIL, or at followed by a file path), numbered steps, or a heading matching repro/steps/how to. Skip with reason screened: bug without reproduction.- [ ] or - [x]), no numbered list, and is under 200 characters. Skip with reason screened: underspecified.Apply criteria in order; skip with the first matching reason. An issue with a label containing bug and a body under 50 characters after stripping whitespace is caught by no description before it reaches bug without reproduction.
Take the first <N> issues that pass filters, verification, and screening.
If 0 issues pass, report Done with "No eligible issues found" and stop.
Show the operator what's about to happen:
## Tackling <N> issues — <repo>
| # | Title | Labels |
|---|-------|--------|
| 201 | Add null check in auth.ts:47 | bug, low |
| 203 | Remove unused import in config.ts | cleanup |
| 207 | Add test for edge case in parser | test-gap |
Dispatching <N> parallel subagents in worktrees...
If any candidates were skipped during selection, append a "Skipped at selection" table:
### Skipped at selection
| # | Title | Reason |
|---|-------|--------|
| 198 | Fix typo in README | Already fixed on <head-sha> |
| 200 | Update auth flow | Claimed by open PR #211 |
| 202 | Crash on null input | screened: bug without reproduction |
| 205 | Add retry logic | Already done — merged in PR #198, PR #201 |
Dispatch one agent tool call per issue. Issue all calls for the current wave in a single reply so they run in parallel.
agent_type: "general-purpose"isolation: "worktree" — each agent gets its own worktree; dirty/ahead worktrees are preserved and locked by the runtime; clean ones are torn down automaticallymodel: "claude-sonnet-4-6"id_prefix: "issue #<number>" — prefixes the subagent id for log and trace correlation; on runtimes without task_slug support also gives the worktree branch an iso-issue-<number>-... name (note: when agent_type is set the live view label shows the agent type name, not this prefix)task_slug: "issue-<number>-<title-slug>" — where <title-slug> is the issue title lowercased, non-alphanumerics collapsed to single hyphens, first 3–4 words (e.g. issue-4112-telegram-retry-logic). Gives the worktree branch a readable name like afk/iso-issue-4112-telegram-retry-logic-x7k2qp. Requires an agent-afk version with task_slug support; ignored on older versions.gh pr list --state open --search "#<N> in:title,body" and gh issue view <N> --json closedByPullRequestsReferences. A PR that opens AND merges within one wave span could slip through both checks, but that window is temporally negligible and safe to ignore. If gh exits non-zero during either recheck call, log the issue number as UNCHECKED; UNCHECKED candidates are eligible for dispatch — treat them as unclaimed and proceed rather than skipping them. Then dispatch the next wave.Each agent's prompt:
You are fixing GitHub issue #<number> in <repo>.
**Issue title:** <title>
**Default-branch HEAD:** <head-sha> (<default-branch>)
**Issue body:**
<body>
Instructions:
1. Run `git rev-parse HEAD` and record it as `<worktree-sha>`. Verify the base is reachable: `git merge-base --is-ancestor <head-sha> HEAD`. If the exit code is non-zero (exit 1 means not an ancestor; exit 128 means the SHA is unresolvable — either way, stop without editing any file and report **STALE-BASE** with `<worktree-sha>` and `<head-sha>`). Otherwise, before any edit, verify the issue comments and open referencing PRs have not made the remaining ask obsolete; if obsolete, report **OBSOLETE** and stop.
2. For a **BUG**, establish on current HEAD either a failing reproduction (test or command) or a concrete source-level demonstration (file:line of the defective code path and why it is reachable). If neither is possible, do not fix it; report **UNREPRODUCED** and what you checked.
3. For a **PREVENTIVE/refactor/hygiene** issue, show evidence of the current risk on HEAD (for example, the hand-rolled site still exists at file:line, the gate fails, or the size remains over its ceiling). Cosmetic findings with no current risk are reported, not fixed.
4. For any **other issue type** (feature, test-gap, docs, or anything not covered above), confirm on HEAD that the requested change is not already present: cite the relevant file:line or paste the grep output showing absence. If already present, report **OBSOLETE** and stop.
5. Make the fix only after whichever of steps 2, 3, or 4 applies. Run relevant tests and `pnpm lint` (or the project's lint command) to verify the change compiles.
6. Commit with message: `fix(#<number>): <short description>`
Write the message to a temp file inside your worktree (not /tmp, which forked
subagents are denied) using the file-write tool or a quoted heredoc redirected
to the file. Do not commit the temp file. Then run:
`git commit -F <tmpfile>`
Do not: inline the message with `-m`; use `git commit -F - <<'EOF'` stdin
heredocs; or use `$(cat <<'EOF' ...)` command substitution (macOS bash 3.2
mis-parses apostrophes inside it, exit 2).
7. Create a PR. Choose the closing keyword carefully:
- Use `Closes #<number>` when this PR completes **every remaining acceptance item**
for the issue (including cases where earlier partial PRs used `Refs #<number>`
and this PR addresses what was left).
- Use `Refs #<number>` only when this PR covers **partial work** and items remain.
In that case, immediately post a comment on the issue listing the exact remaining
items so the next agent can find them. Write the comment body to a temp file
inside your worktree (not /tmp), then run:
`gh issue comment <number> --body-file <tmpfile>`
- For a **tracking/checklist issue**, you may address one unchecked box per PR
using `Refs #<number>` and naming the checkbox in the PR title and body.
- Write the PR body to a temp file inside your worktree (not /tmp), then run:
`gh pr create --title "fix(#<number>): <short description>" --body-file <tmpfile>`
- PR body must include the chosen closing/refs keyword, a brief description of the
change, and a **Verified on HEAD** section citing <head-sha> and the reproduction,
demonstration, or risk evidence.
- Add `--draft` flag if instructed.
8. Report what you did: PR URL, files changed, tests run.
Do NOT:
- Touch files unrelated to the issue
- Make architectural changes or large refactors
- Combine multiple issues into one PR
- Force push or modify other branches
- Add entries to `.filesize-baseline.json`, `.funcsize-baseline.json`, or similar
audit baseline files. If a file exceeds its size ceiling, extract one whole
concern into a new sibling file instead of raising the baseline. Update all
imports in every file that referenced the extracted symbols, then run
`pnpm lint` (or the project's lint command) and relevant tests to confirm no
import or runtime references are broken before committing.
After all agent calls complete (all waves if batched), collect each agent's final message and summarize:
## Results
| # | Issue | PR | Status | Summary |
|---|-------|----|--------|---------|
| 201 | Add null check in auth.ts:47 | #212 | ✅ | Added guard + test |
| 203 | Remove unused import | #213 | ✅ | Removed 3 unused imports |
| 207 | Add parser test | — | UNREPRODUCED | Couldn't reproduce edge case |
| 209 | Document config options | — | OBSOLETE | Change already present on <head-sha> |
| 210 | Migrate auth helper | — | STALE-BASE | base <head-sha> not ancestor of worktree <worktree-sha> |
Status legend: ✅ PR opened | ❌ failed | UNREPRODUCED (no reproduction found) | OBSOLETE (already done or ask gone) | STALE-BASE (base SHA not an ancestor of worktree HEAD, or unresolvable) | cosmetic (reported, not fixed)
<N>/<M> issues tackled. Run `/pr-triage` to review and merge.
Worktree lifecycle is managed automatically by the agent tool when isolation: "worktree" is used — no manual cleanup needed. Dirty or ahead worktrees are preserved and locked so the operator can inspect; clean worktrees are torn down by the runtime.
No merge gates, no human checkpoints on PR creation — PRs are proposals.
The safety net is /pr-triage on the next pass, which reviews with full gates.
What SKILL.md sets; muted values are Claude Code's defaults
When you have open issues to burn down in parallel. Triggers on 'tackle issues', 'work on open issues', 'burn down issues', 'make PRs for issues'.
Other plugins' skills for the same job
Generated from the plugin's indexed repository (griffinwork40/software-factory) — no native marketplace selected
npx claudepluginhub p/griffinwork40-software-factory3 skills in this plugin
/landTake ONE open PR all the way to merged: review it, fix blocking findings + red CI + merge conflicts, re-review until the blocking set is empty (bounded, convergence-checked), merge the exact SHA that was reviewed, then file every deferred finding as a deduplicated follow-up issue. Chains /review and /fix-pr into a closed loop with a per-finding completeness ledger, so the operator types one verb instead of babysitting review → fix → re-review → 'merge and make issues for any follow-ups'. Emits LANDED / READY / STALLED / BLOCKED / ALREADY-LANDED./pr-triageBatch-review open PRs in parallel, triage into merge/fix/follow-up buckets, then execute each bucket with per-action human gates on every irreversible operation. Parallel reviews in worktrees compress wall-clock; sequential human-gated merges and diff-only fixes keep blast radius bounded.