Drive an issue file from `issues/` to done in validated deliverables (understanding, spec and plan written in the issue then validated in one stop, then per deliverable test, code, docs, review, human validation, issue update, commit). Use when the user hands over an issue file (e.g. `issues/foo.md`) or says to start, continue or resume an issue, or hands over the next few issues of the queue to chain, so the process doesn't have to be re-explained in each prompt.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Issue Workflow?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/electron-libre-issue-workflow)
---
name: issue-workflow
description: Drive an issue file from `issues/` to done in validated deliverables (understanding, spec and plan written in the issue then validated in one stop, then per deliverable test, code, docs, review, human validation, issue update, commit). Use when the user hands over an issue file (e.g. `issues/foo.md`) or says to start, continue or resume an issue, or hands over the next few issues of the queue to chain, so the process doesn't have to be re-explained in each prompt.
---
# Work an issue
The user hands over an issue file in `issues/`. Never skip a validation stop: they make the autonomy safe. Only
those of steps 3.6 and 3.8 can be lifted, by the Autonomous mode. [details.md](details.md)
holds the rare branches, each named below by the case that sends there: read its section when that case comes up.
Handed the next few issues of the queue to chain: "Drive a queue".
## 0. Resume or start
**Work where the session was started**: the main worktree, or a worktree the user opened on the branch they picked.
Never create, enter or leave a worktree yourself (no `cardinal run worktree open`, no `EnterWorktree`), nor redirect
to the main one from a linked worktree (`git -C`, its paths). **Claim the issue first**: `cardinal run issue-claim
issues/<name>.md`; when it refuses (another session's claim, uncommitted changes), or the worktree lock refuses your
commands, stop and tell the user what it names. In the main worktree, also stop when a branch `<stem>` exists.
Details: "Worktree".
Read the issue file. A `Blocked:` or `On hold:` issue: "Pick the next issue" first. No `# Tracking` section: start
at step 1. Else check before the cases of "Resume" (`Plan: proposed`, a `Queue:` line, a spec missing, a plan over
the size limit by `cardinal run deliverable-size <base commit>`). None applies, `Plan: validated`, signed or not, or
no marker (planned before it existed): show where it stands in two `next` / `left` lines (the next unchecked
deliverable with the recorded mode, the deliverables left by name) and continue at step 3 in the mode recorded
(none recorded: validation at each deliverable).
## 1. Prepare in the files (no stop)
The understanding, the spec and the plan go in the files, which keep the history; the console shows the links and
the questions.
- Read the issue, plus the resources it names (docs, `git log`, the `roadmap` documents of `.claude/cardinal.toml`,
the memory files the `MEMORY.md` index points to).
- **Spec**, when the issue changes what a capability does, in a project that has `specs/README.md` (skip it for docs,
harness, pure refactor, a measure): **invoke `skill:write-spec` with the Skill tool** before the first `Write` or
`Edit` under `specs/`, even when the format seems known. Follow it up to its step 4 (`check-specs`), the spec left
`draft`; skip its step 5: step 2 replaces it. The tests of step 3 come from these requirements.
- **Write `# Tracking`** at the end of the issue:
```markdown
# Tracking
Plan: proposed
## Understanding
<Three lines at most: the goal in your words, what is out of scope, the means if it differs from the issue's.>
## Plan
1. [ ] <deliverable>: <what it does>; verified by <test or check>; makes true <ABC-n>.
## Decisions
- Mode: autonomous
- Base commit: <`git rev-parse HEAD`, set at validation>
```
Small deliverables, each independently testable and committable, ordered by value and dependency; an issue
that fits one deliverable has a one-line plan. A decision of architecture also gets its ADR draft in `docs/adr/` now. The spec and ADR drafts are committed with the first
deliverable.
- **Size limit**: estimate the changed lines of each deliverable as `cardinal run deliverable-size` counts them
(added + removed, outside `issues/` and lock files): at most ~1,000 per deliverable, ~3,000 and 6 deliverables per
issue. A move that also edits counts twice: move in a deliverable of its own (in the issue total, a moved file
edited later still counts twice). A deliverable over the limit is cut; an issue over it gets a split proposed at
step 2 ("Split an issue").
- **File size**: for each file the plan touches that `cardinal run file-size --all` lists, or that the estimate
pushes over its `file_size_limit`, the plan says where the new code goes: a module of its own, or a first
deliverable that splits the file by responsibility with no change of behaviour.
## 2. Validate (STOP)
Show, and nothing else:
- The links to the files written in step 1 (the issue, the spec, the ADR), the issue summed up in two or three lines,
one more when the means differs from the issue's, and the ids of the requirements written.
- The questions you can't answer from the repo, if any, as a table `# | question | options | why | impact`: questions
numbered `1`, `2`…, options lettered `a`, `b`… with the recommended one marked, so the user answers `1 a, 2 c` (a bare
`ok` takes every recommendation). Don't ask what has a conventional default. Each `[NEEDS CLARIFICATION: ...]`
marker of the spec is one row; the answer replaces the marker in the spec.
- With an advisor tool, consult it on the plan before this stop (its other moments: "Advisor").
- One line: the mode of step 3, **autonomous (default)** or a validation at each deliverable.
- When the plan exceeds the size limit: the proposed cuts (issue, deliverables, estimated lines), as a question.
**Wait for the user.** Apply their answers and corrections to the files (the answers go to `## Decisions`). When an answer changes
the plan itself (deliverables, their order), show the new plan lines and stop again. Then set `Plan: validated by
<name> <<email>> on <YYYY-MM-DD>` (the `user.name` and `user.email` of `git config`, today's date; either unset: ask
the user, never guess one) and the base commit. The signature states who validated, it proves nothing. The spec file
is the record of the requirements; `## Decisions` doesn't copy them.
## 3. For each deliverable, in order
1. **Gather**: read the code and docs it touches; ask about missing information (one batch of questions).
2. **Test first**: write a behavior or end-to-end test that fails for the right reason. When the capability has a
spec and the project has `specs/README.md`, the test proves a requirement and carries `// spec: ABC-n` (placement in `specs/README.md`), through the
binary when that is cheap and stable, else internal with its reason, `// spec: ABC-n (internal: <reason>)`; the
deliverable that traces the last untraced requirement sets the spec `accepted`. Follow the test conventions of the
project (the `test_conventions` note of `.claude/cardinal.toml`). Write the test of a hook, a skill or a script
like the others, never in bash.
3. **Implement** until the test passes, then **refactor** under the green tests, no new behaviour. The lint gate
hook keeps the code warning-free; fix what it reports. Never skip, weaken or delete a test to reach green: ask.
4. **Docs**: run `skill:update-docs` (it covers the specs). An architectural decision also gets its ADR in
`docs/adr/` (template in `docs/adr/README.md`), and the diagrams of the `architecture` document of
`.claude/cardinal.toml` follow a changed flow.
5. **Review (mandatory)**: run `cardinal run project-check`; when `cardinal run deliverable-size` exits 1, cut the
deliverable first; when `cardinal run file-size` lists a file, split it in this deliverable or say why not in the
summary of step 6. Then **invoke `/code-review low <target>` with the Skill tool**, `<target>` the line
`cardinal run review-target` prints (always name the level; it refuses an untracked file: mark it with the
`git add -N` it prints), and wait for its findings; reread the docs you changed. Fix the findings on the
deliverable's own change, or say why one is not fixed. A finding outside the requirements of the deliverable
is not fixed in this deliverable: it becomes an issue (`skill:create-issue`) only when a real case shows it (a real input, a run, a report of the user)
or its cost is measured; otherwise it is listed `not filed: <why>` with the findings of step 6. Re-run
`cardinal run project-check` after the fixes. The `pre-commit` hook refuses a commit whose diff holds a file the
last review never saw, so write the tracking and the summary of steps 6 and 7 in the issue **before** the review,
all but the signature of step 7 (a diff under `issues/` only, or a close by `close-issue`, needs no review). Only
the user can waive the review: "Review waiver".
6. **Human review (STOP, except in autonomous mode)**: show one line `done` (what changed, not the diff), a table
`check | result` (tests, lint, specs, docs, code review), one line `red:` opening with the ids its tests trace,
then the failure message the test of step 3.2 gave before the code (`red: ABC-3, ABC-4: <failure>`; `none` for a
deliverable with no test), then the line `Code review: <n> findings` (`Code review: no findings` if clean) with
what was done about each, then the lists `not verified` and `decisions needed`, empty when nothing applies. Wait for the user's validation; don't commit
before it. In autonomous mode, write this summary in the issue and go on.
7. **Track**: tick the deliverable in `# Tracking`, ending its line with `(validated by <name> <<email>> on
<YYYY-MM-DD>)` for the person who validated it at step 6, or `(autonomous)`, and note decisions or follow-ups.
8. **Commit**: run `skill:commit-message`, with the trailer `Validated-by: <name> <<email>>` of step 7 for a
deliverable a person validated, none for an autonomous one. Commit only the files of this deliverable (leave
unrelated or personal files such as `settings.local.json`) and report the hash. If the user wants to commit
themselves, output just the message.
Then move to the next deliverable (autonomous mode: chain into it), never without saying so if the user asked to stop. After the last deliverable, run
`skill:update-docs` on `<base>..HEAD` (the base commit of `## Decisions`), then invoke `/code-review high <target>`
once, `<target>` the line `cardinal run review-target <base>` prints; the docs edits and the review fixes are one
more deliverable, steps 3.2 to 3.8 with their own `low` review; a `high` finding outside the requirements of the
issue follows the rule of step 3.5.
## Autonomous mode
The default once the plan is validated, unless the user asked for a validation at each deliverable; recorded first
in `## Decisions`, so it survives a `/clear`. The user can switch it at any time.
- **Lifted**: step 3.6 stops and the wait before step 3.8: write the 3.6 summary in the issue, commit locally and
chain into the next deliverable.
- **Never lifted**: the reviews and their checks, the stop of step 2; no push, deletion or history rewrite unasked
(the `rebase-issue` of "Merge back" is asked by the agreement to close).
- **Stops the chain**: a blocking question, a decision the summary needs from the user, a review finding you can't
settle, a failing check you can't fix (never commit or build on a red base). After the last deliverable, give a
table `deliverable | commit`, then `left`; ask whether to close the issue.
## Close the issue
When the issue is fully done, mark it in the issue and say what remains, then **ask the user whether to close it**;
never move it unasked. On their agreement, on the trunk: `cardinal run close-issue issues/<name>.md`, then commit
what it staged on its own with a bare `git commit` and a message from `skill:commit-message`; the report ends on the
Markdown link to the next issue it prints (`[<title>](issues/<stem>.md)`), or its line saying there is none. On
another branch: "Merge back". What `close-issue` prints (a milestone done, files staged before the close): "Close".
A `cardinal sync` that adds a hook: "A sync that adds a hook". Which issue comes next: "Pick the next issue".