The tracker's state labels (`state/*`): what each means, which skill sets it at which event, from triage until the fix merges, and the line where the work's state passes to the team's release and tracking tools. Ships a script that checks or fixes an issue's state label against the PRs that fix it, and a GitHub Action that does the same the moment a PR merges. Use whenever a skill sets, checks or counts a state label, when a fix starts or merges, or to set up the Action.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Is that skill safe to install?
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
Are you the author of Issue Labels?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/mattbrailsford-issue-labels)
---
name: issue-labels
description: >-
The tracker's state labels (`state/*`): what each means, which skill sets it at which
event, from triage until the fix merges, and the line where the work's state passes to the
team's release and tracking tools. Ships a script that checks or fixes an issue's state
label against the PRs that fix it, and a GitHub Action that does the same the moment a PR
merges. Use whenever a skill sets, checks or counts a state label, when a fix starts or
merges, or to set up the Action.
user-invocable: false
---
# issue-labels
One home for the state labels, so the skills that move an issue along (triage,
investigation, fixing, PR review, the backlog) all follow the same table, and the part that
needs no judgment runs as code.
The rules follow the [Work state on GitHub](https://gist.github.com/mattbrailsford/5e5265d25f324542cce52110d2023427/f019abd1a0f392d70b548c93af9635a6297e9bdc)
contract, version 1.0, which other tools that write to the same issues follow too. If this
skill and the contract ever differ, the contract wins and this skill needs updating.
## Scope
- IN: the state label names and meanings, the lifecycle table, the `issue-labels.mjs`
script, the `issue-state` Action, and the `Hold label` and `Release tags` lines in
`CLAUDE.md`'s `## Issue tracker`.
- OUT: picking an issue's first state (`issue-triage`'s Picking the state), proving a cause
(`investigate-bug`), type labels and tracker comments (`issue-triage`), and every label a
team's planning or tracking tool owns.
## State labels
The tracker holds the state, so there's no separate log to commit or keep in sync. An open
issue with no state label is untriaged.
| Label | Means |
|---|---|
| `state/needs-investigation` | Looks real, but nobody has proven it yet |
| `state/needs-info` | Waiting on the reporter for detail only they can give |
| `state/needs-decision` | Clear, but waiting on a maintainer to agree to it |
| `state/blocked` | Can't be fixed here until something outside the project changes |
| `state/ready` | Verified and ready to fix |
| `state/in-progress` | Someone is working on it now (designing or building), or a PR that fixes it is open or held |
- An issue carries one state label at a time. Setting one removes the others.
- A closed issue carries none. Whatever closes it removes the label in the same write.
- Use the names in `## Issue tracker`'s `State labels` line when the project maps these onto
its own. Never invent a label the tracker doesn't have; create one only with the user's yes.
## Label lifecycle
Two kinds of state sit on an issue, each with one owner:
- **Work task state:** where the code work is. The state labels above, written by devkit
skills from triage until the fix merges.
- **Work tracking state:** where the work stands for the people who plan it, worked out by
whatever tracking tool the team uses, from its own labels, merges and release tags. No
devkit skill writes those labels or keeps a copy of their rules. The only one read here is
the `Hold label`.
The line between them is **ready to ship**: every PR that fixes the issue has merged, and
none carries the `Hold label`. Before it, the issue is code work. After it, the issue is
closed, and shipping belongs to the release process and the tracking tool.
| Event | State label | Set by |
|---|---|---|
| Triaged | the first state, by `issue-triage`'s Picking the state | `issue-triage` |
| Cause proven, or not a bug | `state/ready`, `state/needs-info`, `state/blocked`, or a close | `investigate-bug` |
| Request agreed | `state/needs-decision` → `state/ready` | `issue-triage`'s Decision run, or the team's planning tool |
| Work starts: a fix lane, or a design for one | `state/in-progress` and the person doing it assigned, in the same yes that starts it | `issue-resolve` |
| Work put down before a PR: a spec parked to think on, or waiting for time | back to `state/ready`, unassigned, with a comment: why it was put down, what exists (spec, brief, branch, linked), and where to pick up | the skill working on it, on the user's yes |
| Work found bigger than agreed, and worth asking whether to do it | back to `state/needs-decision`, with a comment saying what grew | the same |
| A PR that fixes it is found | `state/in-progress` | `issue-triage` |
| Ready to ship | closed as completed, no state label | the `issue-state` Action; without it, the skill that merges, or the next check |
| Merged but held | stays `state/in-progress` until the hold comes off | the same |
| Released | no label change; a comment naming the version | the release process |
`state/in-progress` means someone holds the issue now, whether designing or building, so the
team can trust it, and the assignee says who. Waiting on a reviewer still counts as held.
Putting it down doesn't: it goes back to `state/ready` and is unassigned, or to
`state/needs-decision` when whether to do it, or how big it is, is now in doubt.
`state/ready` always means the same three things: nothing left to prove or decide, nobody
holds it, and anything already written is linked from the issue, so the next person starts
from there. An issue fixed on several version lines, one PR each, is ready to ship only
once the last of them merges.
## The script
`scripts/issue-labels.mjs`, Node with no dependencies, reading and writing GitHub through
`gh`. It holds the merge rules above as code; nothing else should work them out by hand.
```bash
node "<skill folder>/scripts/issue-labels.mjs" check 928 929 # or --all; --json for data
node "<skill folder>/scripts/issue-labels.mjs" fix 928 # only on the user's yes
node "<skill folder>/scripts/issue-labels.mjs" board --json # open issues per state
```
- **`check`** reads each issue's labels and the PRs linked to close it, and says per issue
`ok`, `out of step` with the change that fixes it, or no opinion (no linked PR: the state
is a judgment, not the script's). Read-only. Run it before saying where an issue stands.
- **`fix`** makes the changes `check` names: swaps the state label, closes as completed. A
tracker write, so only on a yes, like any other.
- **`sync-pr <pr>`** is what the Action runs: `fix` for every issue the merged PR closes.
- **`board`** counts open issues per state label, for `issue-backlog`'s board. Its To
triage count is unlabelled issues only; replies and timeouts are still `issue-triage`'s.
Label names, the tracker repo and the hold label come from `CLAUDE.md`'s `## Issue
tracker`; `--repo` and `--hold` override them. Exit 0 answered, 1 couldn't, 2 bad usage.
## The Action
A merge on github.com doesn't pass through a session, so a session can only catch it later.
The `issue-state` Action handles it when it happens: on every merged PR, and when a label
comes off a merged PR (the hold), it runs `sync-pr`.
Offer it once per project, when `## Issue tracker` is GitHub Issues and
`.github/workflows/issue-state.yml` doesn't exist:
1. Copy `templates/issue-state.yml` to `.github/workflows/issue-state.yml`, and
`scripts/issue-labels.mjs` to `.github/scripts/issue-labels.mjs`, unchanged.
2. If the issues live in another repo than the code, the built-in token can't write there.
Say so: the project adds a secret named `ISSUES_TOKEN` that can write issues in that repo.
Never create or ask for the token's value.
3. Commit them as `git-workflow` says, on a branch with a PR; the Action runs once merged.
It uses `pull_request_target` so it runs for PRs from forks too, and never checks out their
code. When the plugin's copy of the script is newer than the project's, offer to update the
project's copy.
## Config lines
Two lines in `## Issue tracker`, asked for the first time a merged fix needs them, then
added:
```markdown
- Hold label: none <!-- or the label that keeps a merged PR back, e.g. flag/held -->
- Release tags: none <!-- or the tag pattern and when it's made, e.g. v{version}, after deploy -->
```
`Release tags` says whether a tag means "about to ship" or "shipped", so the release comment
says "releasing" or "released". Some teams tag to trigger the deploy, others after it.
## Rules
- Never write a state label or close an issue without the user's yes, except through the
Action the project installed for that. A backlog run the user started is that yes for
the label changes its own work makes, as `issue-backlog`'s "Tracker writes in a run" says;
a close still waits for the user.
- Never write a label from the team's tracking tool, and never copy its stage rules.
- Merge-time label changes go through the script, never worked out by hand.