/gavel-skills:gavel-triagefrom gavel-skills
Triage a Gavel TODO backlog by sorting work into keep, shape, investigate, retire, merge, or duplicate; detecting completed or duplicate work; setting priority, labels and status; and preparing survivors for external execution with scope, acceptance criteria, and an executable definition of done. Use for backlog cleanup, choosing the next task, shaping raw TODOs, or investigating stuck work.
Ships in gavel-skills. 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.
Triage decides each TODO's fate and prepares survivors for the external executor. An untriaged backlog is a pile of titles that cannot be implemented reliably.
Division of labour with the sibling skills:
| Skill | Owns |
|---|---|
| gavel-triage (this) | Deciding what a TODO is, whether it still matters, and shaping it for external execution |
gavel-todos | TODO creation, lifecycle review, checking, and import/export without starting implementation |
gavel-fixture-tester | Authoring the ## Verification executable definition of done |
A TODO is ready when someone who has never seen it could implement it and Gavel could prove it done without asking a question. Everything below serves that bar.
gavel todos sync (source TODO/FIXME comments) or
quick captures.failed / unverified and nobody knows whether they are broken, stale, or already
fixed on main.gavel todos list # pending work in this workspace
gavel todos list --all # every registered project
gavel todos list --done # include verified + completed
gavel todos list --status failed # one status
gavel todos list --since 30d # created or updated in a window
gavel todos list --group-by directory # file | directory | repo | all | none
--format json (identical to --json) is the machine-readable form and carries the triage signals
directly. Per-item fields:
| Field | Use in triage |
|---|---|
short_id, id, title, workspace | Identity |
status | Projected state — see status model |
provider_state | Durable state: open, draft, verified, closed |
execution_state | Captain's view: idle, running, failed, verification_failed, … |
priority | high | medium | low |
created, last_run | Staleness |
attempts | Repeated-failure signal — high attempts with no progress means the TODO is wrong, not the code |
run_mode | run or plan — a TODO stuck in plan never got approved |
markdown_body | Absent ⇒ title-only, not implementable |
acceptance_criteria | [{text}]. Absent ⇒ no definition of done |
verification | Parsed executable definition of done. Absent ⇒ nothing can prove it done |
The global --filter takes a CEL expression over those fields:
gavel todos list --filter 'priority == "high"'
gavel todos list --filter 'attempts > 2'
gavel todos list --format json > .tmp/todos.json
jq 'length' .tmp/todos.json # backlog size
jq '[.[] | select(has("markdown_body") | not)] | length' .tmp/todos.json # title-only
jq '[.[] | select(has("acceptance_criteria") | not)] | length' .tmp/todos.json
jq '[.[] | select(has("verification") | not)] | length' .tmp/todos.json
# Title-only items — always the first triage batch:
jq -r '.[] | select(has("markdown_body") | not) | "\(.short_id) \(.title)"' .tmp/todos.json
# Shaped but unprovable — has criteria, no fixture:
jq -r '.[] | select(has("acceptance_criteria") and (has("verification") | not))
| "\(.short_id) \(.title)"' .tmp/todos.json
# Burned attempts — the spec is probably the bug:
jq -r '.[] | select(.attempts > 1) | "\(.short_id) attempts=\(.attempts) \(.title)"' .tmp/todos.json
# Stale: no run in 30 days (compare against today's date, not a hardcoded one):
jq -r --arg cut "$(date -v-30d +%Y-%m-%d 2>/dev/null || date -d '30 days ago' +%Y-%m-%d)" \
'.[] | select(.last_run < $cut) | "\(.short_id) \(.last_run[0:10]) \(.title)"' .tmp/todos.json
gavel todos get 1b495fb9 # short id, full id, title, or alias
get renders body, event history, plan, and verification as pretty text. It ignores --format json — it always prints the pretty detail. For machine-readable single-TODO detail, use the
dashboard API (below), which returns the readiness booleans hasPlan and hasVerification
alongside criteria, body, verificationMarkdown, planStatus, and events.
PORT="$(cat ~/.config/gavel/pr-ui.port 2>/dev/null || echo 9092)"
curl -s "http://localhost:$PORT/api/todos/item?ref=1b495fb9&dir=$PWD" | jq '{
title, status, priority, planStatus, hasPlan, hasVerification,
criteriaCount: (.criteria | length)
}'
Read the event history before judging a TODO — attempts, last_run, and the event kinds tell
you whether it failed on the spec, on the environment, or was never started.
Every TODO leaves triage with exactly one of these:
| Verdict | When | Action |
|---|---|---|
| Ready | Body, scope, criteria, and fixture all present and still accurate | Leave pending; correct the priority if wrong |
| Shape | Real work, under-specified (title-only, no criteria, no fixture) | Rewrite the body — §4 |
| Investigate | Real problem, solution genuinely unknown | Leave pending and hand it to the external planner |
| Already done | Suspect the code has moved on | gavel todos check <ref> — let the fixture decide |
| Retire | Obsolete or won't-fix, and NOT a duplicate | Comment the reason, then close — §6 |
| Merge into | Several TODOs are one piece of work and this one should survive | Write the combined body, then close the others into it — §6 |
| Duplicate of | Another TODO covers this entirely, with nothing here worth keeping | Link to the survivor and close this one — §6 |
Never guess "already done". gavel todos check <ref> executes the persisted definition of done through the fixture/CEL pipeline. Passing work becomes
verified; failing work becomes unverified with evidence on the issue. A check needs a fixture, so shape a TODO with no verification before checking it.
gavel todos check 1b495fb9
gavel todos check 1b495fb9 # re-test a TODO that failed its gate
Rewrite the whole body — gavel todos edit replaces it, it does not append.
gavel todos edit 1b495fb9 --title "Default /todos/new status to pending, matching the dialog"
gavel todos edit 1b495fb9 --body @.tmp/body.md
--body takes inline text or @path; relative paths resolve from --cwd, and \@text escapes a
literal leading @. Write the file with the Write tool, not a heredoc.
A shaped body has four parts — problem statement, then these headings:
The TODO ask state currently offers only **Send & resume**. If the user cannot answer the pending
question, manually moving the TODO to pending does not resolve the waiting Captain prompt run, so
the runtime projection returns the TODO to ask.
## Acceptance Criteria
- [ ] Every TODO ask form shows **Reject question** left of **Send & resume**.
- [ ] Rejecting posts `rejected: true` without requiring text or a selection.
- [ ] A failed rejection preserves the draft and displays the request error.
## Scope
- Extend the internal answer input with `rejected?: boolean`.
- Reuse the existing backend behavior; do not add an endpoint, status, or dialog.
## Verification
---
timeout: 30m
codeBlocks: [test, lint]
ai: {}
verify:
scope: diff
threshold: 80
---
```yaml test
paths: [./pr/ui]
framework: [vitest]
```
```yaml lint
changed: true
fix: false
```
Rules that make the difference between an execution-ready TODO and a wish:
## Verification fixture is the executable definition of done. Do not invent a parallel checking flow. Author it with
gavel-fixture-tester, inspect it with gavel fixtures outline .tmp/verification.md, and execute it standalone with
gavel fixtures .tmp/verification.md while iterating.verify.scope: diff so review is bounded to the TODO's own changes.todos create --verification omits the outer ## Verification
heading; inside a --body it keeps it.For an item whose solution is unclear rather than its specification, do not invent a plan during triage. Leave it pending and hand it to the external planner. After a reviewed plan appears, triage may request revision or reject it:
gavel todos plan revise 1b495fb9 --feedback "..."
gavel todos plan reject 1b495fb9 # clear the plan, back to pending
status is two different things wearing one name. Only the durable half is writable; the rest is
projected from Captain execution and any attempt to set it is declined.
| Status | Kind | Writable? |
|---|---|---|
draft | Durable → draft | Yes — parked, not ready for external execution |
pending | Durable → open | Yes — the actionable queue |
verified | Durable → verified | Yes — definition of done passed |
completed | Durable → closed | Yes — closed |
skipped | Durable → verified | Yes — precondition already satisfied |
in_progress, review, ask, failed, unverified | Projected from Captain | No |
So "mark it failed" is not a triage move — failed and unverified are reports from the last run.
Both the CLI and the API reject them loudly rather than accepting a write that would change nothing.
To retire failing work, comment why and then gavel todos delete it. To retry it, fix the specification and return it to the external executor.
gavel todos edit sets any combination of --title, --body, --status, and --priority, and
requires at least one:
gavel todos edit 1b495fb9 --priority high
gavel todos edit 1b495fb9 --status completed
gavel todos edit 1b495fb9 --title "Fix parser panic" --priority low
A projected status is refused with the assignable set named in the error, so a mistake is visible rather than silent:
$ gavel todos edit 1b495fb9 --status failed
Error: status "failed" is projected from the last run and cannot be assigned;
assignable statuses: draft, pending, verified, completed, skipped
--status and --priority do not carry a rationale. When the change needs one, comment first
(§6) or use the dashboard API, which takes the transition and the comment in one request:
PORT="$(cat ~/.config/gavel/pr-ui.port 2>/dev/null || echo 9092)"
curl -s -X PATCH "http://localhost:$PORT/api/todos/item?ref=1b495fb9&dir=$PWD" \
-H 'Content-Type: application/json' \
-d '{"status":"completed","comment":"Superseded by 8f1fb6e9 — same defect, wider scope."}'
The endpoint accepts any combination of status, priority, title, body, comment, and
requires at least one; dir is the workspace path. It rejects projected statuses with 400, and
needs a running dashboard (gavel serve, or gavel pr list --ui, default port 9092). Filtering is
unaffected — --status in_progress reads fine, it just cannot be written.
gavel todos reopen <ref> is the transition worth preferring over edit --status pending: it
returns a completed TODO to the queue and takes the rationale inline, via --comment /
--comment-file.
Every retirement gets a comment first, then the close — a closed TODO with no rationale is indistinguishable from a lost one.
gavel todos comment 1b495fb9 "Obsolete: the /todos/new route was deleted in 1060a1b0."
gavel todos comment 1b495fb9 --body @.tmp/rationale.md
Pick the survivor first — the one with the better body, criteria, or fixture, not the older id — then choose by what would be lost:
Nothing to carry over. Link and close the duplicate. Both writes are needed: a close with no link loses the pointer to where the work went.
gavel todos comment <duplicate> "Duplicate of <survivor> — <title>."
gavel todos link <duplicate> <survivor>
gavel todos delete <duplicate> # soft: cancelled, history kept
The others hold criteria, a fixture or context worth keeping. Use gavel todos merge, which runs an
AI pass to write one title, body, fixture and plan onto the survivor and retires the rest into it:
gavel todos merge <survivor> <other> <other> --into <survivor> --dry-run
gavel todos merge <survivor> <other> <other> --into <survivor>
A triage run does both by itself. Its duplicate-of verdict performs the first sequence, and merge-into
performs the fold from the survivor's side — it names the TODOs to absorb in merges and writes the combined
body, so no second AI pass is needed. Either way the priority never drops: a survivor that absorbs
higher-priority work inherits it.
Both close TODOs, which no later run undoes, so check the call before trusting it on a batch:
gavel todos run <ref> --step triage --preview
The agent runs and every other verdict applies as usual, but a merge-into or duplicate-of is reported
instead of performed — including the combined body, which is held back with the fold rather than written to a
survivor whose duplicates are still open. --dry-run cannot do this: it stops before the agent runs, so there
is no verdict to show.
Two relations are writable; the third is derived and read-only.
| Relation | Meaning | Writable? |
|---|---|---|
related_to | Symmetric, non-blocking — duplicates, overlapping scope, read-together work (the default) | Yes |
depends_on | <ref> is blocked until <target-ref> is verified or completed | Yes |
blocks | The reverse view of someone else's depends_on | No — add depends_on from the blocked TODO |
gavel todos link 1b495fb9 8f1fb6e9 # related_to
gavel todos link 1b495fb9 8f1fb6e9 --relation depends-on # 1b495fb9 waits on 8f1fb6e9
gavel todos links 1b495fb9 # every edge, from this TODO's side
gavel todos links 1b495fb9 --format json
gavel todos unlink 1b495fb9 8f1fb6e9 --relation depends-on
Dependency cycles, cross-workspace links, duplicate edges, and self-links are all rejected — a link
that does not appear is an error, never a silent no-op. Before ordering a sprint, read the
dependencies: a pending TODO whose depends_on target is unverified is not actually ready, whatever
its status says.
Candidate pairs surface from title overlap and shared paths:
jq -r '.[] | "\(.short_id) \(.title)"' .tmp/todos.json | sort -k2
A TODO in the wrong project moves rather than closes:
gavel todos transfer 1b495fb9 --to <project>
# 1. Snapshot and size the problem.
gavel todos list --format json > .tmp/todos.json
jq 'length' .tmp/todos.json
# 2. Anything claiming to be done? Let the fixtures decide before humans read them.
gavel todos check 1b495fb9
# 3. Title-only items — shape or retire, one batch.
jq -r '.[] | select(has("markdown_body") | not) | "\(.short_id) \(.title)"' .tmp/todos.json
# 4. Shaped-but-unprovable — attach fixtures.
jq -r '.[] | select(has("acceptance_criteria") and (has("verification") | not))
| "\(.short_id) \(.title)"' .tmp/todos.json
# 5. Re-prioritise the survivors, then report the ready queue for external execution.
gavel todos list --filter 'priority == "high"'
Report the pass as counts per verdict plus the ids retired, not as a per-item narrative.
gavel todos edit carries no rationale. --status/--priority change state silently; pair
them with todos comment, or use the PATCH endpoint's comment field to do both atomically.gavel todos get ignores --format json and always prints pretty text. Use
/api/todos/item?ref=…&dir=… for machine-readable single-TODO detail.failed and unverified are not writable. They are projections of the last run, and both the
CLI and the API reject them — but they filter fine (todos list --status failed).blocks cannot be written. It is the reverse view of depends_on; add the dependency from the
blocked TODO instead.cancelled cannot be assigned, and there is no wontfix status at all. Retirement is a comment
carrying the reason, then gavel todos delete <ref> — a soft delete to cancelled that keeps the
history and reads as completed in listings. gavel todos reopen <ref> undoes it. Reserve
edit --status completed for work that genuinely finished.gavel todos criteria subcommand. Acceptance criteria live in the body under
## Acceptance Criteria and are edited with todos edit --body.todos edit --body replaces the whole body. Read the current body first and re-emit it with
your additions, or you will silently drop the fixture.--body-file flag is retired for create/edit/comment — use --body @path. Only
todos reopen --comment-file still takes a file flag.todos check needs a fixture. A TODO with no verification cannot be resolved by checking;
shape it first.~/.config/gavel/pr-ui.port, defaulting to 9092..tmp/ for scratch snapshots, never /tmp.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub flanksource/gavel --plugin gavel-skills6 skills in this plugin
/gavel-ci-migratorMigrate a repo's GitHub Actions lint and test workflows onto the flanksource/gavel composite action — discover existing golangci-lint / go test / make lint|test jobs, ask the user per-workflow whether to replace, add alongside, or skip, rewrite YAML with the right permissions and checkout depth, and verify with actionlint without auto-committing/gavel-fixture-testerCreate and run Gavel fixture-based tests and TODO executable definitions of done using Markdown command blocks, tables, test/lint steps, acceptance checklists, and CEL assertions. Use when authoring standalone fixtures or persisted TODO Verification content./gavel-gitUse gavel instead of gh/git for pull requests, CI status, and commits — check a PR's checks with gavel pr status, open PRs with AI-generated content, and commit with gavel commit/gavel-runnerRun gavel test and lint, focus on a subset, re-run only failures (defaults to .gavel/last.json), filter noise with baselines, and pull JSON/markdown results from finished or live runs/gavel-todosCreate, inspect, review, verify, and maintain PostgreSQL-backed Gavel TODOs without starting implementation runs. Use for creating or syncing TODOs, attaching durable plans, authoring fixture-backed executable definitions of done, reviewing plans, running gavel todos check, inspecting history, or importing and exporting portable .todos Markdown.