gaia-issue-resolver
Execute the complete resolution pipeline on one already-triaged Gaia issue, selected
by priority (P0–P4) or assignee. Adapted from favorchurch/rock-steward's
rock-issue-resolver; the six-phase shape and the Kill Criteria discipline are its
contribution, the Gaia mechanics below are this repo's.
Prerequisite: the issue is triaged — it has a priority label, a size, and a stated
problem. If it doesn't, stop and run /gaia-triage on it first. This skill resolves; it
does not decide what is worth resolving.
1. Non-negotiables
- Zero follow-up debt. Do not close an issue by filing a trailing "clean up" issue
that carries its own unfinished work. Everything a reasonable reviewer would call a
direct consequence of this change belongs in this change. This is
gaia-skill-tree's
sprint-completeness rule applied at issue granularity: genuinely new, out-of-scope work
discovered along the way may still be filed; the issue's own remainder may not.
- Kill Criteria before code. Every acceptance requirement is written as an explicit
KC-1 … KC-N list, posted as a comment on the issue before implementation starts,
and checked off from evidence before closing. An issue with no Kill Criteria has no
definition of done.
- Draft PR first, push often. Branch, then open a draft PR as the first git
operation after the first commit — before the work is finished. Push after each phase.
Draft PRs stay draft until a human marks them ready.
- Programmatic-first. Registry mutations go through
gaia dev verbs, never hand-edits
to registry/nodes/ or registry/named/ frontmatter. If the right verb does not exist,
file it as a CLI + tech-debt issue and say so in the PR — do not work around it.
- Read-only during audit. Phase 2 observes and never mutates. No
gaia dev write
verb, no git push, no site regeneration, until the plan is posted.
- Class A / Class B dual delivery, where it applies. If the issue describes a
recurring drift rather than a one-off defect, ship a detector alongside the fix:
- Class A — a read-only, deterministic check that observes the condition
(
founder/steward/POLICY.yaml declares the Class A repairs Gaia Steward runs
unattended; scripts/verify_evidence.py and scripts/verify_lockstep.py are the
shape to copy).
- Class B — an operational routine,
--dry-run by default with an explicit
--apply gate, living in founder/steward/routines/.
A one-off typo fix does not need either. A fourth recurrence of the same drift does.
2. The six phases
Phase 1 — Intake & scope
export GAIA_HQ=gaia-research/gaia-skill-tree
gh issue list --repo "$GAIA_HQ" --label P0 --state open # or --assignee @me
gh issue view <n> --repo "$GAIA_HQ" --comments
Read the whole thread, not the title. Note which repo the fix lands in — the issue is
in HQ, the code may not be (see /wayfinder §1 for the target-repo convention). Confirm
the issue is still real before spending a session on it; a stale issue is a /gaia-triage
close, not a resolution.
Phase 2 — Baseline audit (read-only)
Establish what is actually true now, from the artifact, not from the issue text. Pick the
probes that match the domain:
| Domain |
Baseline probe |
| Registry data / evidence |
gaia dev list --generic --named, gaia dev audit, python3 scripts/verify_evidence.py |
| Trust Magnitude |
gaia dev calibrate-trust-magnitude --skill <id> --dry-run, /trust-appraise |
| Docs / Class S drift |
python scripts/build_docs.py --check (must exit 0) |
| CLI behaviour |
run the actual command; read src/gaia_cli/commands/ |
| Versioning |
python scripts/verify_lockstep.py |
| Site rendering |
/design-gate, or node scripts/visual-audit.mjs in gaia-research |
| Nomenclature |
npx tsx scripts/lexicon/check-lexicon.ts (in gaia-research) |
Capture the baseline output. It is what proves the fix later, and a number you did not
capture before the change cannot be claimed after it.
Phase 3 — Plan, Kill Criteria, draft PR
Write the plan, then formalize it as Kill Criteria covering, as applicable:
- the defect actually fixed, with the failing probe from Phase 2 named
- Class A detection (if the issue is recurring drift)
- Class B remediation routine,
--dry-run default (same condition)
- generated-artifact cohesion — Class S committed alongside the source change
- automated tests passing
- idempotency: a second run plans zero actions
- CI green
Post them:
gh issue comment <n> --repo "$GAIA_HQ" --body-file kill-criteria.md
Branch and open the draft PR against the correct base — an integration branch if the
effort spans multiple PRs, main otherwise:
git checkout -b fix/<topic>-<issue-number> # or feat/<workstream>-<slug>
gh pr create --draft --body-file pr-body.md
Branch prefix must satisfy the target repo's scope rules — in gaia-skill-tree,
.github/workflows/branch-scope.yml enforces which directories each prefix may touch
(schema/, cli/, docs/, design/, review/meta/, infra/, dev/, claude/).
Phase 4 — Implement & test
One logical change per commit; push after each. Registry mutations through gaia dev.
Tests are surgical during the loop and full once before review — CI runs on every push,
so read results rather than re-running locally.
When the issue warrants dual delivery:
- Class A check — deterministic, read-only, structured output, non-zero exit on detection.
- Class B routine in
founder/steward/routines/ — --dry-run by default, --apply gate,
a receipt of what it changed.
Cover in tests: the computation and its edge cases, the CLI flags and exit codes, and an
idempotency proof (second run ⇒ zero planned actions).
Phase 5 — Verify against the baseline
- Re-run the Phase 2 probe. It must now pass, and you must show both readings.
- Run the Class B routine
--dry-run, inspect the plan, --apply, then dry-run again and
show 0 planned actions.
- Re-run the Class A check → clean.
- Registry changes:
gaia dev docs, then commit the deterministic Class S set only —
docs/graph/*, docs/api/v1/**, docs/u/<handle>/index.html, docs/tree.md,
registry/registry.md, docs/graph/ledger/data.json — and not docs/og/*.svg,
docs/api/v1/trending/, layouts_3d.json, or docs/okf/. Confirm with
python scripts/build_docs.py --check exiting 0.
- Skills changed:
python scripts/sync_agent_skill_mirror.py --check must pass.
Phase 6 — Review, ready, closeout
- Independent review of the diff —
/code-review, or a subagent with a fresh context.
Confirm no secrets, tokens, or PII in the diff.
- Mark ready only if the change is not human-gated. Frontend changes are founder-gated
in
gaia-skill-tree: agents may open, iterate, and mark ready, but may not merge.
Attach the evidence page from /design-gate.gh pr ready <pr>
- Post the closeout comment: every Kill Criterion checked off with the evidence that
satisfied it (a command output, a file path, a commit sha), then close.
gh issue close <n> --repo "$GAIA_HQ" --reason completed --comment "$(cat closeout.md)"
- Merge verb is per repo, not per project — check before merging:
gh api repos/<owner>/<repo> --jq '{squash:.allow_squash_merge,merge:.allow_merge_commit,rebase:.allow_rebase_merge}'
gaia-skill-tree and gaia-research take merge commits (squash to main is
disallowed); gaia-skill-heaven squashes — a merge commit there is blocked by a
ruleset on main regardless of what the API reports. Rulesets can be stricter than repo
settings; treat the API answer as a floor.
- Report token spend for the session (
/pi-cost) as a comment on the PR, or on the issue
when there is no PR.
3. Priority behaviour
The P0–P4 ladder is the one /gaia-triage, /gaia-meta-audit, and /gaia-meta-sweep
already use — do not import a second one. What changes per priority is how much pipeline
the issue earns:
| Priority |
Pipeline |
P0 |
Full six phases. Interrupt other work. Dual delivery expected — a P0 that recurred once will recur again. |
P1 |
Full six phases. Class A detection expected; Class B if the remediation is repeatable. |
P2 |
Full six phases, dual delivery optional. |
P3 |
Phases 1, 3, 4, 6. Baseline probe only where a number is claimed. |
P4 |
Phases 1, 4, 6. Kill Criteria may be a single line. Do not over-ceremony a typo. |
4. Output
Close every run with:
- the issue and PR, by title and number
- each Kill Criterion, checked off with its evidence
- before/after readings of the Phase 2 probe
- what shipped as Class A vs Class B, or an explicit "one-off — neither warranted"
- anything genuinely out of scope that was filed separately, and why it was not this
issue's remainder
- session token spend and estimated cost
1---2name: gaia-issue-resolver3description: End-to-end plan → implement → review pipeline that takes one triaged Gaia issue to a merged-ready PR, with Kill Criteria on the issue and zero follow-up debt. Use when someone says: "resolve this issue", "take #N end-to-end", "work the P0 queue", "fix and ship this issue", "run the resolver", "close out this issue properly", or /gaia-issue-resolver. Works any gaia-research org repo — gaia-skill-tree, gaia-research, gaia-skill-heaven — while the issue itself lives on the headquarters tracker, gaia-research/gaia-skill-tree. Assumes the issue is already triaged and carries a P0–P4 label; if it does not, run /gaia-triage first.4---56# gaia-issue-resolver78Execute the complete resolution pipeline on **one** already-triaged Gaia issue, selected9by priority (`P0`–`P4`) or assignee. Adapted from `favorchurch/rock-steward`'s10`rock-issue-resolver`; the six-phase shape and the Kill Criteria discipline are its11contribution, the Gaia mechanics below are this repo's.1213Prerequisite: the issue is triaged — it has a priority label, a size, and a stated14problem. If it doesn't, stop and run `/gaia-triage` on it first. This skill resolves; it15does not decide what is worth resolving.1617---1819## 1. Non-negotiables20211. **Zero follow-up debt.** Do not close an issue by filing a trailing "clean up" issue22 that carries its own unfinished work. Everything a reasonable reviewer would call a23 direct consequence of this change belongs in this change. This is `gaia-skill-tree`'s24 sprint-completeness rule applied at issue granularity: genuinely new, out-of-scope work25 discovered along the way may still be filed; the issue's own remainder may not.262. **Kill Criteria before code.** Every acceptance requirement is written as an explicit27 `KC-1 … KC-N` list, posted as a comment on the issue *before* implementation starts,28 and checked off from evidence before closing. An issue with no Kill Criteria has no29 definition of done.303. **Draft PR first, push often.** Branch, then open a **draft** PR as the first git31 operation after the first commit — before the work is finished. Push after each phase.32 Draft PRs stay draft until a human marks them ready.334. **Programmatic-first.** Registry mutations go through `gaia dev` verbs, never hand-edits34 to `registry/nodes/` or `registry/named/` frontmatter. If the right verb does not exist,35 file it as a `CLI` + `tech-debt` issue and say so in the PR — do not work around it.365. **Read-only during audit.** Phase 2 observes and never mutates. No `gaia dev` write37 verb, no `git push`, no site regeneration, until the plan is posted.386. **Class A / Class B dual delivery, where it applies.** If the issue describes a39 recurring drift rather than a one-off defect, ship a detector alongside the fix:40 - **Class A** — a read-only, deterministic check that observes the condition41 (`founder/steward/POLICY.yaml` declares the Class A repairs Gaia Steward runs42 unattended; `scripts/verify_evidence.py` and `scripts/verify_lockstep.py` are the43 shape to copy).44 - **Class B** — an operational routine, `--dry-run` by default with an explicit45 `--apply` gate, living in `founder/steward/routines/`.46 A one-off typo fix does not need either. A fourth recurrence of the same drift does.4748---4950## 2. The six phases5152### Phase 1 — Intake & scope5354```bash55export GAIA_HQ=gaia-research/gaia-skill-tree56gh issue list --repo "$GAIA_HQ" --label P0 --state open # or --assignee @me57gh issue view <n> --repo "$GAIA_HQ" --comments58```5960Read the **whole** thread, not the title. Note which repo the fix lands in — the issue is61in HQ, the code may not be (see `/wayfinder` §1 for the target-repo convention). Confirm62the issue is still real before spending a session on it; a stale issue is a `/gaia-triage`63close, not a resolution.6465### Phase 2 — Baseline audit (read-only)6667Establish what is actually true now, from the artifact, not from the issue text. Pick the68probes that match the domain:6970| Domain | Baseline probe |71|---|---|72| Registry data / evidence | `gaia dev list --generic --named`, `gaia dev audit`, `python3 scripts/verify_evidence.py` |73| Trust Magnitude | `gaia dev calibrate-trust-magnitude --skill <id> --dry-run`, `/trust-appraise` |74| Docs / Class S drift | `python scripts/build_docs.py --check` (must exit 0) |75| CLI behaviour | run the actual command; read `src/gaia_cli/commands/` |76| Versioning | `python scripts/verify_lockstep.py` |77| Site rendering | `/design-gate`, or `node scripts/visual-audit.mjs` in `gaia-research` |78| Nomenclature | `npx tsx scripts/lexicon/check-lexicon.ts` (in `gaia-research`) |7980Capture the baseline output. It is what proves the fix later, and a number you did not81capture before the change cannot be claimed after it.8283### Phase 3 — Plan, Kill Criteria, draft PR8485Write the plan, then formalize it as Kill Criteria covering, as applicable:8687- the defect actually fixed, with the failing probe from Phase 2 named88- Class A detection (if the issue is recurring drift)89- Class B remediation routine, `--dry-run` default (same condition)90- generated-artifact cohesion — Class S committed alongside the source change91- automated tests passing92- idempotency: a second run plans zero actions93- CI green9495Post them:9697```bash98gh issue comment <n> --repo "$GAIA_HQ" --body-file kill-criteria.md99```100101Branch and open the draft PR against the correct base — an integration branch if the102effort spans multiple PRs, `main` otherwise:103104```bash105git checkout -b fix/<topic>-<issue-number> # or feat/<workstream>-<slug>106gh pr create --draft --body-file pr-body.md107```108109Branch prefix must satisfy the target repo's scope rules — in `gaia-skill-tree`,110`.github/workflows/branch-scope.yml` enforces which directories each prefix may touch111(`schema/`, `cli/`, `docs/`, `design/`, `review/meta/`, `infra/`, `dev/`, `claude/`).112113### Phase 4 — Implement & test114115One logical change per commit; push after each. Registry mutations through `gaia dev`.116Tests are surgical during the loop and full once before review — CI runs on every push,117so read results rather than re-running locally.118119When the issue warrants dual delivery:120121- Class A check — deterministic, read-only, structured output, non-zero exit on detection.122- Class B routine in `founder/steward/routines/` — `--dry-run` by default, `--apply` gate,123 a receipt of what it changed.124125Cover in tests: the computation and its edge cases, the CLI flags and exit codes, and an126idempotency proof (second run ⇒ zero planned actions).127128### Phase 5 — Verify against the baseline129130- Re-run the Phase 2 probe. It must now pass, and you must show both readings.131- Run the Class B routine `--dry-run`, inspect the plan, `--apply`, then dry-run again and132 show **0 planned actions**.133- Re-run the Class A check → clean.134- Registry changes: `gaia dev docs`, then commit the **deterministic** Class S set only —135 `docs/graph/*`, `docs/api/v1/**`, `docs/u/<handle>/index.html`, `docs/tree.md`,136 `registry/registry.md`, `docs/graph/ledger/data.json` — and **not** `docs/og/*.svg`,137 `docs/api/v1/trending/`, `layouts_3d.json`, or `docs/okf/`. Confirm with138 `python scripts/build_docs.py --check` exiting 0.139- Skills changed: `python scripts/sync_agent_skill_mirror.py --check` must pass.140141### Phase 6 — Review, ready, closeout1421431. Independent review of the diff — `/code-review`, or a subagent with a fresh context.144 Confirm no secrets, tokens, or PII in the diff.1452. Mark ready **only if the change is not human-gated**. Frontend changes are founder-gated146 in `gaia-skill-tree`: agents may open, iterate, and mark ready, but **may not merge**.147 Attach the evidence page from `/design-gate`.148 ```bash149 gh pr ready <pr>150 ```1513. Post the closeout comment: every Kill Criterion checked off with the evidence that152 satisfied it (a command output, a file path, a commit sha), then close.153 ```bash154 gh issue close <n> --repo "$GAIA_HQ" --reason completed --comment "$(cat closeout.md)"155 ```1564. Merge verb is **per repo, not per project** — check before merging:157 ```bash158 gh api repos/<owner>/<repo> --jq '{squash:.allow_squash_merge,merge:.allow_merge_commit,rebase:.allow_rebase_merge}'159 ```160 `gaia-skill-tree` and `gaia-research` take **merge commits** (squash to `main` is161 disallowed); `gaia-skill-heaven` **squashes** — a merge commit there is blocked by a162 ruleset on `main` regardless of what the API reports. Rulesets can be stricter than repo163 settings; treat the API answer as a floor.1645. Report token spend for the session (`/pi-cost`) as a comment on the PR, or on the issue165 when there is no PR.166167---168169## 3. Priority behaviour170171The `P0`–`P4` ladder is the one `/gaia-triage`, `/gaia-meta-audit`, and `/gaia-meta-sweep`172already use — do not import a second one. What changes per priority is how much pipeline173the issue earns:174175| Priority | Pipeline |176|---|---|177| `P0` | Full six phases. Interrupt other work. Dual delivery expected — a P0 that recurred once will recur again. |178| `P1` | Full six phases. Class A detection expected; Class B if the remediation is repeatable. |179| `P2` | Full six phases, dual delivery optional. |180| `P3` | Phases 1, 3, 4, 6. Baseline probe only where a number is claimed. |181| `P4` | Phases 1, 4, 6. Kill Criteria may be a single line. Do not over-ceremony a typo. |182183---184185## 4. Output186187Close every run with:188189- the issue and PR, by title and number190- each Kill Criterion, checked off with its evidence191- before/after readings of the Phase 2 probe192- what shipped as Class A vs Class B, or an explicit "one-off — neither warranted"193- anything genuinely out of scope that was filed separately, and why it was not this194 issue's remainder195- session token spend and estimated cost