Skip to content
Back to skills

Issue Pr Triage

ASecurity

GitHub issue/PR triage that ends in action: survey open issues and PRs, classify what is solved, in progress, or workable, apply the one-command verdicts (close, label, comment) on the spot, then pick exactly one item, deliver a new PR or an updated PR, and prove it with the prove-work-done skill before the final report. Ranks core and foundational work above surface fixes, and slices a large item across runs instead of skipping it. Stops at the open PR: never merges unless a rule in the targ...

  • 45 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added December 1, 2026
documentationrustgoshellbashgitapidocumentation

Works with

  • cursor
  • cli
  • api

Security analysis

A100/100

Scanned December 1, 2026

npx -y skills add ericmjl/skills --skill issue-pr-triage --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Issue Pr Triage?

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

Security grade badge for Issue Pr Triage
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ericmjl-issue-pr-triage/badge)](https://www.skillsdirectory.com/skills/ericmjl-issue-pr-triage)

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: issue-pr-triage
description: "GitHub issue/PR triage that ends in action: survey open issues and PRs, classify what is solved, in progress, or workable, apply the one-command verdicts (close, label, comment) on the spot, then pick exactly one item, deliver a new PR or an updated PR, and prove it with the prove-work-done skill before the final report. Ranks core and foundational work above surface fixes, and slices a large item across runs instead of skipping it. Stops at the open PR: never merges unless a rule in the target repo lets the agent merge. The final report recaps the picked issue in plain words for a reader who was away. Use when asked to triage, sweep the backlog, find what can be closed, or pick something to work on."
license: MIT
---

# Issue & PR triage → one fix

A repeatable triage sweep using the GitHub CLI. Survey is read-only; every run
ends with exactly one item selected, worked to an open PR (new or updated), and
proven with the `prove-work-done` skill. The run stops there. A human merges
the PR unless a rule in the target repo lets the agent merge (see *Repo rules
that grant merge authority*).

## Usage

Use this skill when the user asks to triage issues or PRs, or asks variants of:

- "Triage issues for me. What's been solved and can be closed? What's still
  open? What is already being addressed by an open PR?"
- "Pick one issue to work on."
- "Update my open PRs."

Inputs you should accept: repo (default: current checkout's `origin`), optional
issue/PR numbers, optional label filter, optional `--dry-run` for survey only.

## Requirements

- `gh` authenticated (`gh auth status`)
- A git checkout of the target repo (for claim verification and fixes)
- Optional: `jq`

## What it does

Six phases: **survey** (read-only) → **classify** → **map the core** →
**select one** → **execute to a PR** → **prove it**. Housekeeping is not a
separate output. Every item on the backlog gets a verdict, a verdict that
costs one command is applied on the spot, and anything larger competes for the
single pick. No run ends with a pending list or an unproven PR.

## How it works

### Phase 1 — Survey (strictly read-only)

Gather the full picture before judging anything:

```bash
# Open issues and PRs
gh issue list --state open --limit 100 --json number,title,labels,updatedAt,author
gh pr list --state open --limit 100 --json number,title,updatedAt,headRefName,statusCheckRollup

# What each open issue is linked to (cross-references, closing PRs)
gh issue view <N> --json closedByPullRequestsReferences,body,comments

# PRs that reference an issue ("Fixes #N" in body)
gh pr list --state open --search "linked:issue"

# Was it already fixed by a recently merged PR or commit?
gh pr list --state merged --search "fixes #<N>" --limit 10
git log --oneline --since="<issue createdAt>" -- <affected paths>
```

Do not judge an item by its title alone. Read the body, the comments, any logs
or stack traces, and for PRs run `gh pr diff <N>`.

### Phase 2 — Classify

Assign exactly one disposition to each open issue:

| Disposition   | Criteria                                                                 |
| ------------- | ------------------------------------------------------------------------ |
| `solved`      | A merged PR or commit fixes it since the report. Verify before claiming. |
| `in-progress` | An open PR references it (`closedByPullRequestsReferences`, "Fixes #N"). |
| `needs-info`  | Bug report missing repro steps, versions, or environment.                |
| `duplicate`   | An open or closed canonical issue covers it. Verify the similarity.      |
| `workable`    | Actionable, unblocked work. This is the candidate pool for Phase 3.      |
| `blocked`     | Needs something this run cannot supply: a maintainer decision, an upstream fix, access. Record what it waits on. |

Open PRs get their own classification:

- `ready` — passing CI, no unaddressed review comments → waits for a
  maintainer to merge; not a candidate
- `needs-work` — failing CI, or unaddressed review comments → **workable**
- `stale` — author gone, no activity, conflicts → comment with an update
  request and a close-by date

**Map dependencies between items.** Build a dependency graph of the open
pool before ranking anything, grounded in **strong reasoning over the
codebase** — not just issue titles and linked references. These references are
hypotheses; the code is the evidence.

Sources, cheapest first, escalating as needed:

- **Issue → issue:** "blocks", "depends on", "parent of" mentions in bodies
  and comments (`gh issue view <N> --json body,comments`), plus tracking-issue
  checklists (`- [ ] #123`). Hypotheses only.
- **Issue → PR:** PRs that fix an issue (`closedByPullRequestsReferences`).
- **PR → PR:** stacked PRs (`gh pr view <N> --json headRefName,body` — "based on
  #X", "requires #X"), shared branch bases, and review chains.
- **Codebase:** for each candidate cluster, study the affected paths
  (`git log`, `rg`, reading the modules involved) to verify whether two issues
  actually trace to the same root cause or the same code path. A "depends on #N"
  claim the code contradicts is dropped; a code-derived dependency nobody
  wrote down is added.

The deliverable is a graph you trust: issues sharing a root-cause path in code
form a cluster whose root is the prerequisite; explicit references confirm or
extend what the code shows. Phase 3 adds conceptual edges to it.

Record for each workable item: what it blocks (its dependents) and what it is
blocked by (its prerequisites, whether open, closed, or external). A dependent
item is not `workable` until its prerequisites land — classify it as
`in-progress` or `workable` accordingly, but remember that finishing its
prerequisite unblocks it.

**Verify before believing.** Spot-check 1–3 of the reporter's testable claims
against the codebase: does the referenced setting/command/API exist, does the
error string appear in the code, does the described behavior match the
implementation? Record each as confirmed, disputed, or unverifiable. If no
claims can be verified, cap your confidence at low and prefer `needs-info`
over a verdict. For `solved`, actually confirm the fix landed in a merged PR
or commit — a merged PR that does not touch the reported symptom is not `solved`.

Cite evidence for every disposition, prefixed `[issue]`, `[shell]`, or `[code]`.

### Phase 3 — Map the core

Ranking by dependencies alone leads to small fixes. A foundational change often
has no open issue that names it, so it reads as a leaf, and every run ends on a
bug. Before ranking, name what the product is made of and place each item by
depth.

**Build the concept table** (5–8 rows):

| Concept | Lives in | Imported by | Open items that touch it |
| ------- | -------- | ----------- | ------------------------ |

Sources, in this order:

- **Stated goals.** The HLD, README, or product docs name the central concepts
  and rules. An item that rewrites one of these goals is `core`.
- **Fan-in.** The modules that the most other modules import are where the
  concepts live. Adapt the pattern to the language:

  ```bash
  rg -o --no-filename "from ['\"](\.\.?|@)/[^'\"]+" src \
    | sort | uniq -c | sort -rn | head -20
  rg -l "<SymbolOrTable>" src | wc -l   # importers of one concept
  ```

- **The data model.** Schema, migrations, and shared types. An item that
  changes these is `core`.
- **Cascade history.** Past changes that forced edits in many modules
  (`git log --stat`). Each of them touched a core concept.

**Label each `workable` item with one depth:**

| Depth        | The item… | Evidence |
| ------------ | --------- | -------- |
| `core`       | Changes what a central concept means or how it behaves. | Rewrites a stated goal, a domain rule, or the data model. |
| `foundation` | Sets a rule or capability that later work must follow. | Says "must follow" or "before adding more"; introduces a shared component or spec. |
| `surface`    | Adds or fixes one screen, bug, or piece of content. No concept or rule changes. | Touches a concept's row without changing it. |

Foundation examples: a design system, a test suite, an architecture boundary,
the user flow. `core` and `foundation` form the **structural band**; `surface`
is the band below it.

Back each label with two estimates:

- **Fan-out.** How many modules change if the concept changes? A high count
  shows that the item is central. It raises the rank.
- **Rework if deferred.** How much finished work would be redone if this lands
  later: screens built before a design system, games added before a test
  suite. A high estimate raises the rank.

**Mark `fire`** on an item only when all three hold: it is on the production
deployment, it stops a user from completing a core flow (sign in, play, pay,
save), and you can reproduce it. A visual defect that a user can work around is
not a fire.

**Add conceptual edges to the dependency graph.** An item is a dependent of a
structural item when its text says to follow that item, or when the structural
item would dissolve it. A dependent waits for its prerequisite.

### Phase 4 — Select exactly one

Pick **one and only one** item.

**First, continue what is in flight.** An item with a slice list on the issue
is the pick unless it is `blocked` or a `fire` exists. Starting a second
structural item while the first is open is the drift that this rule exists to
stop.

Otherwise, rank the `workable` pool in bands:

1. **Structural band.** `core` and `foundation` items, topologically sorted by
   the dependency graph. Roots come first: an item that others depend on, and
   whose own prerequisites are resolved, comes before a leaf. A PR that cannot
   merge until its base lands makes the base the pick.
2. **Surface band.** `surface` items, ordered by dependents, then impact
   (severity, maintainer-marked labels such as `high priority` or
   `help wanted`), then freshness.

In either band, an item with an open prerequisite does not compete; its
prerequisite is ranked instead.

**Size is never a reason to skip.** "It touches many files" and "it takes more
than one run" are handled by slicing (Phase 5), not by choosing a smaller item.

**A `surface` item wins only when one of these holds.** Write down which:

- `fire`. Fix the minimum. The report names the structural item that was
  deferred; it is the default pick next run. A second fire run in a row on the
  same area is a sign that the structural item is the real fix. Say so.
- The top structural item is `blocked` by something external (maintainer
  decision, upstream repo, missing access). Record the blocker and take the
  next structural item. The surface band competes only when every structural
  item is blocked.

State the pick in three or four sentences: first **what the issue is**, then
**why it won**. Say what is wrong today or what the reporter wants, in the
reporter's words, as if to a maintainer who has not read the issue. Then give
its depth and the reason. E.g. "Working on #12, the design system: today each
screen styles its own buttons and tiles, so they drift. Depth: foundation,
four issues must follow it. This run delivers the first slice, the design
docs." Or "Working on #40: checkout fails in production at the payment step.
Depth: surface, fire. Deferred: #12 (foundation), the default pick next
run." If nothing is workable (everything is `needs-info`, `in-progress`,
`solved`, or `blocked`), say so instead of inventing work, and report the
blockers.

### Phase 5 — Execute the pick

**Issue selected → new PR:**

The code study from Phases 2 and 3 already grounded the pick. Now go deep on
this one item:

1. Reproduce the bug (or verify the feature gap). If you cannot reproduce, say
   so honestly — do not guess at causes; report and stop.
2. A `core` or `foundation` item is **sliced before any code**. Write the
   slice list on the issue: an ordered checklist of PRs, each complete on its
   own. The first slice is the first of these that the repo supports:
   - The design, when the repo has a design process (HLD, LLD, specs): a
     docs-only PR.
   - The new concept added beside the old one, with tests, and no call sites
     migrated yet.
   - The first piece that ships on its own.

   A later run stacks the next slice on the open PR. It waits, and the item is
   `blocked` for that run, when the open slice needs the maintainer's approval
   first (a design, a schema).
3. Create a branch from the default branch, or from the open PR's branch when
   the slice stacks on it. Implement; add or adjust a test when practical.
4. Open the PR. Its body starts with `Part of #<N>` or `Fixes #<N>`, then
   says in two sentences what the issue is (the recap from Phase 4), then
   gives a short evidence summary (symptom → root cause → fix; for a slice,
   what it adds and what it leaves to the next slice). Only the last slice of
   an item uses `Fixes #<N>`; earlier slices use `Part of #<N>`, so the issue
   stays open until the item is done.
5. Run relevant checks/linters before pushing.

A `fire` gets the minimum change that restores the flow. Leave the surrounding
code alone; the structural item owns that.

**PR selected → updated PR:**

1. Fetch its branch (`gh pr checkout <N>` or fetch `headRefName`).
2. Address failing CI and each open review comment; rebase if conflicts.
3. Push updates; note what changed in a PR comment if the change is substantive.

**Stop at the open PR.** Both paths end with a PR that is open and waits for
a maintainer. Do not merge it, approve it, or enable auto-merge (`gh pr merge
--auto`). An approval can trigger an auto-merge that the author already
enabled. This holds even when CI is green and every review comment is handled:
a green PR is still a human's call to merge. The only way a run goes further
is a rule in the target repo that grants merge authority (next section).

**Then prove the PR.** Green checks do not finish a run. Before the final
report, run the `prove-work-done` skill on the PR, on both paths above. It
backs each claim in the PR with evidence and ends with a verdict:

- **Proven.** Carry the verdict and its head SHA into the final report.
- **Partly proven.** Report what is proven and what is not. A check that
  needs the merge (a production-only path) is recorded for after the merge.
  The run never merges to finish a proof.
- **Not proven, or the proof finds a bug.** Fix the PR, push, and prove it
  again. This is the same item, not a second pick. When the fix does not fit
  this run, the report says what is not proven and why. A PR that fails its
  proof is not ready for a merge.

Proof does not grant merge authority. *Stop at the open PR* above still
holds.

**Do not start a second item.** Everything else goes in the final report as
backlog. If the slice turns out larger than one session, post what you found
on the issue under the slice list; that comment is the result of the run, and
it opens with the same recap of the issue. A later run continues the same item
(Phase 4), not a different one, and states the recap again: the maintainer may
be returning to it after days.

### Repo rules that grant merge authority

Some repos give the agent limited merge authority, for example: "the agent may
merge docs-only PRs that touch no code". A rule like that overrides the
default, but only within the limits it states.

Look for one before assuming there is none. Search the places where a repo
states policy for agents and contributors:

```bash
rg -n -i --hidden -g '!.git' merge \
  -g 'AGENTS.md' -g 'CLAUDE.md' -g 'CONTRIBUTING.md' \
  -g '.cursorrules' -g '.github/**'
```

Also check project-level skills or rules the repo keeps under `.agents/` or
`.claude/`.

A rule counts only if, read plainly, it lets the agent merge a defined class
of PRs. None of these count:

- A merge method ("use rebase merges").
- A repo setting (auto-merge allowed, no branch protection).
- A relaxed requirement ("docs-only PRs need no review"). It removes a
  barrier; it does not give the agent permission.

Before acting on a rule:

1. Check the PR against the rule with a command, not by impression. For a
   docs-only rule, run `gh pr diff <N> --name-only` and confirm every file is
   documentation, as the repo defines it. A workflow, script, config, or
   dependency file is code.
2. If the PR matches fully and its proof passed, merge the way the rule says:
   at once, or through auto-merge. Wait for CI first unless the rule allows
   skipping it; if that wait is too long for the session, leave the PR open
   and report it. If the rule names no method, follow the `gh-cli` skill's
   merge policy. Never bypass branch protection (`--admin`).
3. If the PR matches only partly, or the rule is ambiguous, leave the PR open
   and report the rule as a possible match.

Quote the rule and the check in the final report.

### Verdicts are applied, not proposed

Housekeeping belongs inside triage. A run that defers it to a confirmation
list ends with a list that no one acts on, and the pile grows with every run.

Every disposition is a verdict. When the verdict's action is one `gh` command
whose content is fully determined by the evidence that Phase 2 already
gathered, apply it on the spot:

- `solved` → close, with a comment that cites the fixing PR or commit.
- `duplicate` → close, with a comment that links the canonical issue.
- `needs-info` → label, and comment with what is missing.
- A wrong or missing label → fix it, when the evidence supports the label and
  not just the title. Keep labels minimal: one type label is usually enough.
- `stale` PR → comment with an update request and a close-by date. A later run
  closes the PR once that date passes without a reply.

These do not count against "one and only one". The one is a deliverable that
needs investigation and judgment (a PR). Closing three solved issues is three
verdicts, not three picks.

**Bright line.** If you would have to decide *what* to say beyond restating
the evidence, it is not a verdict application. It is a work item: put it in
the `workable` pool and let it compete for the pick. Typical cases: a
commenter's question that needs a real answer, an unaddressed change request
on someone's PR, a duplicate claim you could not verify.

**Never leave a verdict half-made.** "Close as solved, or keep open?" and
"which of these two is the duplicate?" are Phase 2 work that was not
finished, not questions for the user. Verify and act. If you cannot verify,
do not act: leave the item open, mark the claim as unverified in the evidence
column, and say so. That is a complete outcome.

**What only the user can do** — merge, review as the maintainer, make a
product call — is `blocked`. Record what it waits on in the disposition
table. That is a state, not a request: the run is complete without a reply.

Ask before acting only when a step is destructive and hard to undo
(force-push, deleting a branch) or falls outside the target repo. `--dry-run`
applies nothing, verdicts included.

## Rules

- Phase 1 is read-only. From Phase 2 on, act: apply verdicts, open or update
  the PR. Ask first only for destructive steps (force-push, deleting a branch)
  or actions outside the target repo.
- Never close a bug report. Close only duplicates, questions, invalid items,
  and `solved` items with evidence.
- Never dismiss an issue without investigation; never relabel based on title.
- Be honest: cannot reproduce or cannot verify → say so, do not guess.
- One and only one pick per run. Two items "in progress" is a failure.
  Verdicts applied on the spot are not picks. An item's slice list and its open
  PR stack are one item.
- Depth before size. "Touches many files" and "takes more than one run" never
  lower an item's rank; they are evidence that it is central.
- Prove the PR before the report. After Phase 5, run `prove-work-done` on the
  PR's current head. Green checks alone do not end a run. A proof that fails
  sends you back to the same item.
- Stop at the open PR. Merging is never a step in a run: not at the end of
  Phase 5, not to finish a proof, not as an applied verdict, not under blanket
  approval, and not on an instruction given before the PR existed. Inside a
  run, the only exception is a repo rule that grants merge authority. A later
  request from the user to merge a named PR is not triage: handle it with the
  `gh-cli` skill.
- Prefer finishing an existing PR over opening a new one when both are workable
  and in the same band.
- The report stands alone. It recaps the picked issue in plain words before it
  gives the reasons, and it names every item by number and a few words.

## Final report

A run can last hours. The maintainer often left in the middle and, on
returning, reads only this report, usually without the issue open. So the
report opens with a recap, then gives the evidence.

End every run with:

1. **Recap** — four short parts, in plain words:
   - **The issue:** number, title, and what is wrong today or what the
     reporter wants. For a PR that has no issue, what the PR changes.
   - **What this run did:** what is different now. Say what a user will notice
     first. File names and identifiers come after, if at all.
   - **Where it stands:** the PR URL, the proof verdict, what is left, and
     what needs the maintainer (a merge, a decision, access).
   - **Next run:** the default pick, by number and a few words.

   E.g. "**The issue:** #22: the export button does nothing for guests. **This
   run:** the button now explains that export needs an account. **Where it
   stands:** PR #24 is open, proven on head `a1b2c3d`, and it waits on your
   merge. **Next run:** #16, the slow dashboard load."
2. **Why this pick** — its depth and the reason it won. If a `surface` item
   won: which exception applied, and the structural item that is the default
   pick next run.
3. **Disposition table** — every open issue/PR with its disposition, its depth
   (for `workable` items), and evidence. Each row names the item in a few
   words, not by number alone. For each verdict, say whether it was applied
   (closed, commented, labeled) or why it was not. For each `blocked` item,
   say what it waits on.
4. **The result** — the new/updated PR URL, left open for a maintainer to
   merge, or honest blockers if nothing qualified. Then the proof verdict
   (proven, partly proven, or not proven), the head SHA it was taken on, and
   anything still not proven. For a sliced item: the slice list and which
   slice this run delivered. If a repo rule authorized a merge: the merged
   PR URL, the rule quoted word for word, and the check you ran against it.

**Write it for that reader.** The analysis terms you worked in (`root`,
`leaf`, `dependents`, `structural band`, `fan-out`, `cascade`, `cluster`,
`topo default`) stay out of the report. Say what they mean instead: "#6 is a
root with four dependents" becomes "four issues wait on #6 before they can
start". The first mention of any issue or PR carries a few plain words after
its number ("#8, the login loop on an expired session"). A bare number is not
a description.

Nothing is left pending. The report has no "say which of these to apply" list:
every verdict is applied, or has a recorded reason that it could not be.

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 documentation →

Comments

Loading comments…

Newsletter

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