<!-- skill-size-exception: scripts/plugin-compliance-check.sh check_skill_body (git-issue blocks, #3061) -->
When to Use This Skill
| Use this skill when... | Use X instead when... |
|------------------------|----------------------|
| Implementing a fix for one or more open issues with TDD and PR creation | Performing administrative ops (transfer, pin, lock, bulk edit) on issues (/git:issue-manage) |
| Picking issues from the backlog to work on, optionally in parallel | Periodically grooming open issues and PRs to close stale or completed ones (/git:triage) |
| Going from an issue number to a merged-ready PR end-to-end | Hierarchical sub-issue planning and tracking (/git:issue-hierarchy) |
Context
- Git remotes: !
git remote -v - Current branch: !
git branch --show-current - Working tree clean: !
git status --porcelain=v2
Open issues, open PRs, and available labels are fetched during execution (requires a configured git remote).
Parameters
Parse these parameters from the command:
| Parameter | Description |
|-----------|-------------|
| <issues...> | One or more issues as bare numbers, #N, or full GitHub issue URLs (https://github.com/<owner>/<repo>/issues/<N>), in any space- or comma-separated mix (see Step 0) |
| --auto | Claude selects and prioritizes issues |
| --filter <label> | Filter issues by label |
| --limit <n> | Maximum number of issues to process |
| --parallel | Process parallel groups simultaneously using Task agents |
| --labels <label1,label2> | Apply labels to created PRs (defaults to issue's labels) |
Your Task
Process GitHub issues using a TDD workflow, cutting each issue's branch from origin/main — except verification-only issues, which are verified and evidenced first (Step 2, item 4).
Mode Detection
Step 0: Normalize issue references
Before counting tokens or detecting mode, normalize every non-flag token in
$ARGUMENTS into a (number, repo) pair. Accept these forms, in any space- or
comma-separated mix:
| Input form | Extract |
|------------|---------|
| 123 | number 123, repo = current remote |
| #123 | number 123, repo = current remote |
| https://github.com/<owner>/<repo>/issues/123 | number 123, repo = <owner>/<repo> |
| .../issues/123#issuecomment-... | number 123 (drop the #... fragment), repo = <owner>/<repo> |
Rules:
- Split on whitespace and commas; strip a leading
#; strip a URL
#... fragment after the number.
- A token is an issue ref only if, after stripping, it is all digits or
matches the /issues/<digits> URL shape (require trailing digits — a
/pull/<N>, /discussions/<N>, or bare /issues list URL is not a
ref). Leave --flag tokens and their values (e.g. --filter bug,enhancement)
untouched — never split a flag's comma-separated value into refs.
- For a URL whose
<owner>/<repo>differs from the current remote (Context
git remote -v), record it as cross-repo and carry -R <owner>/<repo>
on every gh call for that issue (gh issue view <N> -R …,
gh api repos/<owner>/<repo>/…, gh pr edit … -R …). PR creation for a
cross-repo issue needs a branch in that repo — if the current checkout is not
that repo, surface it with AskUserQuestion rather than pushing to the wrong
remote.
- After normalization, dedupe and count refs: 0 → No-Arguments interactive;
1 → Single; ≥2 → Multiple.
With no issue refs, prompt via AskUserQuestion; with two or more, analyse and group them before processing; with --auto, run the already-implemented check against merged work, then score, recommend, and wait for approval. See references/selection-modes.md for the question options and each mode's steps.
Single Issue (`/git:issue 123`)
Process directly with standard TDD workflow.
Issue Analysis Engine
Before processing multiple issues, run the blocker check, conflict detection,
confidence scoring, and parallel-work detection described in
REFERENCE.md. Never silently work on a blocked issue, and
surface a sub-70% confidence score to the user rather than guessing.
Execution Workflow
Step 1: Prepare Working Directory
- Ensure clean working directory (commit or stash if needed)
- Fetch the remote:
git fetch origin— never rely on localmainbeing current
Step 2: For Each Issue (or Parallel Group)
Standard Flow (Sequential or Single Issue)
- Fetch issue details AND the comment thread:
gh issue view $N --json title,body,state,assignees,labels,comments
The comments field is not optional — the body is the opening position, not the
decision. Scope from git-plugin:git-issue-scoping, which carries the full protocol
(re-verify cited evidence at HEAD; a later comment may have narrowed, reversed, or
already resolved the ask).
- Capture issue labels for later PR creation
- Identify requirements and acceptance criteria. A part the issue itself
defers until a condition in the source comes true ("if the list ever grows
past ten…") becomes a tripwire test in this PR (testing-plugin:test-tripwire),
not an unfinished part left on the issue.
- Classify the criteria before any branch exists. Criteria that are
observations — a run passes, a value appears, a prerequisite PR has landed —
make the issue verification-only: take the
Verification-Only Flow — confirm the
prerequisite PR via state,mergedAt, post evidence with --body-file, close
with --reason completed — and cut no branch unless a check fails. Criteria
that need a code change (or a mix) continue here.
- Plan the implementation approach
- Cut the branch from
origin/main:git switch -c fix/issue-$N origin/main
Base the branch on origin/main, never on local main — local main may carry
unpushed commits that would ride into this issue's PR (see
git-branch-pr-workflow § "Branch Comparison: Always Use origin/main").
TDD Workflow
- RED phase: Write failing tests first
- Create test file if needed
- Write tests that define expected behavior
- Run tests to verify they fail
- GREEN phase: Implement fix
- Write minimal code to make tests pass
- Run tests to verify they pass
- REFACTOR phase: Improve code quality
- Clean up implementation
- Ensure tests still pass
Commit and Push
- Stage changes:
git add -uandgit add <new-files> - Run pre-commit if configured
- Commit on the issue branch with message format:
<type>: <description>
<optional body explaining the change>
Fixes #N
- Verify the branch carries only this issue's commits:
git log --oneline origin/main..HEAD - Push the issue branch:
git push -u origin fix/issue-$N
Create PR
Use mcp__github__create_pull_request with:
head:fix/issue-$Nbase:maintitle: From issue title withfix:prefixbody: IncludeFixes #$Nto auto-link
After PR creation, apply labels:
gh pr edit <pr-number> --add-label "<labels>"
Step 3: Parallel Execution (--parallel flag)
When --parallel is set, spawn one agent per parallel group as described in references/parallel-execution.md: each cuts its branch from origin/main, gets the issue title and body verbatim, and reads the full comment thread itself.
Workflow harness (template)
Two templates ship beside this skill.
workflows/issue-group-wave.workflow.js covers the --parallel path only.
workflows/issue-triage.workflow.js is the read-only pre-pass before it: one
assessor per caller batch classifies each issue by whether an agent can finish it
unattended and re-verifies its evidence at origin/main, then one slicing agent
groups the autonomous issues into conflict-free slices. It returns waves, each
{ units, standalone }, and lands nothing. A wave with standalone: false holds
2–5 units and its units is a valid args.units for
workflow-orchestration-plugin:workflow-implement-verify. A wave with
standalone: true holds one unit, which implement-verify would abort below its
floor of two, so implement it through this skill's single-issue flow.
Each is a TEMPLATE to adapt, not a script to run verbatim.
Read it, then rewrite it for the work in front of you.
Adapt freely: the grouping, assessment, slicing and implementation agent
prompts, the default wave width, the conflict heuristics, the deferral
vocabulary, the per-project meaning of each triage class (args.classes, an
object { <class>: "<what it also means here>" }; an array aborts as
bad-classes), and the
project-specific test and commit commands.
Preserve across any adaptation: (a) the loop bound is args.issues — the
refs Step 0 normalised — and the grouping agent partitions that set, never
extends it: the template validates the returned partition against the input,
discards invented issues, keeps the first placement of a duplicate, and
re-dispatches an omitted issue standalone rather than dropping it; (b) the
GROUP_SCHEMA shape, where every input issue lands in exactly one group or
in deferred with a closed blocked|low-confidence|cross-repo|not-open reason,
plus IMPL_SCHEMA's implemented|no-change|failed outcome — so "skipped it" is
not expressible, and an issue already fixed at HEAD stays distinguishable from a
failed one; (c) the Group stage is a real barrier — conflict detection is
pairwise over the whole set (file overlap, opposing requirements, blocked_by
chains, sub-issue ordering), so no group can be dispatched until every issue has
been read, and you cannot partition work by a partition the work itself
discovers, which is why the grouping lane is always ONE agent. For
issue-triage, also preserve: (d) the closed class enum
autonomous|needs_human|decision_needed|needs_env|already_done|too_large|stale,
where only autonomous is ever sliced and an environment need is needs_env plus
a reason, never a new class; (e) the Slice stage is ONE agent over every batch's
assessments, because two issues assessed in different batches can touch one
file; (f) the plain-JS steps around it: before slicing, an autonomous issue
whose assessment names an overlapping open PR or a blocker is deferred as
overlaps-open-pr or blocked, on every path including the single-issue one
that runs no slicer; after it, the projection validates the partition, adds
a dependency between any two slices that share a file, defers a dependency cycle,
defers as blocked a slice that depends on a slice whose issues were all
deferred, and splits each layer evenly between implement-verify's floor of two
and cap of five (6 slices → 3 + 3, not 5 + 1), so only a one-slice layer yields a
standalone wave — and no wave can hand two units the same file, whatever the
slicer returned.
Agent budget: 1 + groups — issue-group-wave: one grouping agent plus one
implementation agent per issue group; issue-triage: one slicing agent plus one
assessment agent per caller batch (its groups are args.batches). The wave width
bounds concurrency, not the total. The scale guard asks before every run, because
the list comes from the caller at runtime.
issue-group-wave stops at commit-local branches with no independent check. To have
each group verified by a fresh agent and repaired once before its PR opens, pass
the partition as units to workflow-orchestration-plugin:workflow-implement-verify.
Skip the harness when: a single issue was supplied — the modal case — or the
partition collapses to one group because every issue conflicts with every other;
that is a linear pass and the harness is pure overhead (the template aborts
below two issues, and returns the partition rather than dispatching when only
one group survives). Skip issue-triage when the caller has one batch — one agent
can assess and slice it in a single pass, and the template aborts below two
batches; pass git-triage.sh output as args.progress rather than asking its
assessors to re-derive merged-PR links. The steps above remain the authoritative description of
what each stage must produce; the harness only fixes how the work is split.
One thing the harness changes rather than splits: AskUserQuestion cannot run
inside a workflow, so the blocked-issue and sub-70%-confidence prompts above
become deferrals the caller adjudicates — the issue is neither silently
attempted nor silently dropped.
Two clauses issue-group-wave carries. Both are unconditional there — every
fanned-out group runs in its own worktree, and this skill's deliverable is a PR.
issue-triage dispatches no worktree agent and lands nothing:
Never
Workflow({resumeFromRunId})to retry a few failed worktree agents — a
resume re-runs agents that already succeeded and opens duplicate PRs (#1868).
Re-dispatch the failed units fresh and sequentially after checking
gh pr list --head <branch> --state all --json number,state.
Push and PR creation happen only in the single sequential finalise stage,
never inside a fanned-out agent. Under the harness the Execution Workflow's
"Commit and Push" and "Create PR" steps move there: each agent commits on
fix/issue-<n>inside its own worktree, and the returnedfinalisePlanis
what the orchestrator pushes and opens PRs from, one at a time.
Summary Report
After processing, report the issues processed, PRs created, conflicts detected,
and issues skipped — see REFERENCE.md for the table shape.
Resuming work on an existing PR branch
When a follow-up request continues an issue whose branch already has a PR, invoke
/git:pr-sync-check before adding commits. A pr_merged verdict means the PR
already landed — start a fresh branch off the updated default rather than building
on the merged branch; a behind verdict means a teammate / agent / CI auto-fix
pushed under you, so reconcile first. See .claude/rules/pr-branch-sync.md.
See Also
- git-pr-sync-check skill to confirm a PR branch is live and in sync before building on it
- git-branch-pr-workflow skill for workflow patterns
- test-tier-selection skill for test strategy
- git-cli-agentic skill for optimized git commands
- gh-cli-agentic skill for optimized GitHub CLI commands
For the issue-analysis heuristics (blocker check, conflict detection, confidence
scoring, parallel-work detection), commit-message formats, the branch-from-remote
pattern, and the summary-report table, see REFERENCE.md.