rig-doctor — is this project set up for rig?
Inspect the environment, the tracker/board, the repo's gates, and .rig/config.json,
then report what would make rig run worse or fail — each finding with the exact
fix. Read-only by default. With --fix, apply the safe fixes after showing
them and getting a yes; leave sensitive changes (auth, branch protection) as
printed commands.
Pairs with /rig-onboard: onboard installs, doctor verifies.
Output
Group findings by severity and print the fix under each:
rig-doctor — <project> on <branch>
BLOCKERS (n) … rig won't work right until these are fixed
WARNINGS (n) … rig runs, but ungated or degraded
NITS (n) … advisories
✓ when a section is clean.
Read .rig/config.json first (if absent → the only blocker is "not onboarded;
run /rig-onboard"). Everything below is gated on what the config actually uses
(e.g. skip board checks when tracker.provider ≠ github or no tracker.board).
Checks
Blockers
- gh present + authed —
gh --version, gh auth status. Fix: install
https://cli.github.com / gh auth login. (manual — interactive)
project scope — when tracker.board is set, gh auth status must list
project. Fix: gh auth refresh -s project --hostname github.com. (manual)
- board reachable —
gh project view <n> --owner <owner> succeeds, and the
adapter returns: run the resolved tracker adapter's select --limit 1
(.rig/rig-tracker if executable, else <RIG_DIR>/scripts/rig-tracker.sh).
Fix: correct tracker.board.owner/projectNumber.
- config valid —
.rig/config.json parses and matches rig.schema.json
(.rig/schema.json). vcs.baseRef and vcs.defaultBranch exist on the remote
(git ls-remote --heads origin <branch>). Fix: correct the fields.
- test command runs — the runtime behind
test.command is installed
(cargo / bun / node per runtime.packageManager). Fix: install it.
Warnings
- CI gates — the default branch has required status checks (
gh api repos/<repo>/branches/<default>/protection → required_status_checks.contexts
non-empty), and .github/workflows/ has a test gate. Empty/absent → "merges
aren't gated." Fix: add a test-gate workflow (see rig's ci/), then mark its
check required. (manual — protection is sensitive)
- shape labels exist — on
tracker: github, the tracker.shapeLabels
values exist as repo labels (gh label list). (--fix: gh label create.)
- board columns match —
tracker.board.statusOptions values exist as
columns on the board (gh project field-list). Fix: add the columns, or
correct the config. (--fix: add via gh if missing.)
- review catalog —
review.patternsFile (default .claude/REVIEWER.md)
exists. Fix: copy the template from rig templates/. (--fix: copy it in.)
- writing-style guide —
style.guideFile (default .claude/STYLE.md)
exists, so every agent writes PR bodies, tickets, and findings to one
standard. Absent → "agent prose is unconstrained." Fix: copy the template from
rig templates/. (--fix: copy it in.)
- review bot reachable — if
review.bot ≠ none, the bot is installed on
the repo. Fix: install it or set review.bot: none.
Nits / advisories
- auto-accept — a skill cannot read the harness's mode, so this is
advice, not a check: if you're not in auto-accept, epics and
rig-loop
pause on every edit. In Claude Code, shift+tab toggles it.
.rig/epics/ gitignored — it's throwaway coordination state and must not
be committed. (--fix: add .rig/epics/ to .gitignore.)
- sourceScope paths exist — each
sourceScope[i] resolves. Fix: correct it.
- stale epics —
.rig/epics/*.json whose branches are already merged/gone.
--fix (opt-in)
Only when --fix is passed. Show the exact change and get a yes before each,
then apply only the safe set:
- create missing
shapeLabels repo labels (gh label create … --force);
- add
.rig/epics/ to .gitignore;
- copy
REVIEWER.md from the kit template if absent;
- copy
STYLE.md from the kit template if absent;
- add missing board columns.
Never auto-apply (print the command instead): gh auth … (interactive),
branch-protection changes, creating/editing CI workflows, anything that writes
to a branch or changes permissions. Re-run diagnose after fixing.
Notes
- Purely diagnostic without
--fix; it reads, it doesn't change.
- Degrades: skip tracker/board checks on
tracker.provider: none; skip GitHub
checks on linear.
- Fast to re-run — good as a preflight before
/rig-plan, /rig-epic run, or a
live demo.
1---2name: rig-doctor3description: Preflight health check for a rig project: detect things that make rig degrade or fail — missing gh auth or the project scope, an unreachable board, an invalid config, no CI gates, missing review catalog — and report each with the exact fix. Diagnose-only by default; `--fix` applies the safe fixes with confirmation. Triggers on: 'doctor', 'rig doctor', 'check my setup', 'health check', 'why isn't rig working', 'diagnose rig', 'preflight'.4---56# rig-doctor — is this project set up for rig?78Inspect the environment, the tracker/board, the repo's gates, and `.rig/config.json`,9then report what would make rig run worse or fail — each finding with the exact10fix. **Read-only by default.** With `--fix`, apply the *safe* fixes after showing11them and getting a yes; leave sensitive changes (auth, branch protection) as12printed commands.1314Pairs with `/rig-onboard`: onboard installs, doctor verifies.1516## Output1718Group findings by severity and print the fix under each:1920```21rig-doctor — <project> on <branch>22 BLOCKERS (n) … rig won't work right until these are fixed23 WARNINGS (n) … rig runs, but ungated or degraded24 NITS (n) … advisories25✓ when a section is clean.26```2728Read `.rig/config.json` first (if absent → the only blocker is "not onboarded;29run /rig-onboard"). Everything below is gated on what the config actually uses30(e.g. skip board checks when `tracker.provider` ≠ `github` or no `tracker.board`).3132## Checks3334### Blockers35- **gh present + authed** — `gh --version`, `gh auth status`. Fix: install36 <https://cli.github.com> / `gh auth login`. (manual — interactive)37- **`project` scope** — when `tracker.board` is set, `gh auth status` must list38 `project`. Fix: `gh auth refresh -s project --hostname github.com`. (manual)39- **board reachable** — `gh project view <n> --owner <owner>` succeeds, and the40 adapter returns: run the resolved tracker adapter's `select --limit 1`41 (`.rig/rig-tracker` if executable, else `<RIG_DIR>/scripts/rig-tracker.sh`).42 Fix: correct `tracker.board.owner`/`projectNumber`.43- **config valid** — `.rig/config.json` parses and matches `rig.schema.json`44 (`.rig/schema.json`). `vcs.baseRef` and `vcs.defaultBranch` exist on the remote45 (`git ls-remote --heads origin <branch>`). Fix: correct the fields.46- **test command runs** — the runtime behind `test.command` is installed47 (`cargo` / `bun` / `node` per `runtime.packageManager`). Fix: install it.4849### Warnings50- **CI gates** — the default branch has **required status checks** (`gh api51 repos/<repo>/branches/<default>/protection` → `required_status_checks.contexts`52 non-empty), and `.github/workflows/` has a test gate. Empty/absent → "merges53 aren't gated." Fix: add a test-gate workflow (see rig's `ci/`), then mark its54 check required. (manual — protection is sensitive)55- **shape labels exist** — on `tracker: github`, the `tracker.shapeLabels`56 values exist as repo labels (`gh label list`). *(--fix: `gh label create`.)*57- **board columns match** — `tracker.board.statusOptions` values exist as58 columns on the board (`gh project field-list`). Fix: add the columns, or59 correct the config. *(--fix: add via `gh` if missing.)*60- **review catalog** — `review.patternsFile` (default `.claude/REVIEWER.md`)61 exists. Fix: copy the template from rig `templates/`. *(--fix: copy it in.)*62- **writing-style guide** — `style.guideFile` (default `.claude/STYLE.md`)63 exists, so every agent writes PR bodies, tickets, and findings to one64 standard. Absent → "agent prose is unconstrained." Fix: copy the template from65 rig `templates/`. *(--fix: copy it in.)*66- **review bot reachable** — if `review.bot` ≠ `none`, the bot is installed on67 the repo. Fix: install it or set `review.bot: none`.6869### Nits / advisories70- **auto-accept** — a skill **cannot** read the harness's mode, so this is71 advice, not a check: if you're *not* in auto-accept, epics and `rig-loop`72 pause on every edit. In Claude Code, `shift+tab` toggles it.73- **`.rig/epics/` gitignored** — it's throwaway coordination state and must not74 be committed. *(--fix: add `.rig/epics/` to `.gitignore`.)*75- **sourceScope paths exist** — each `sourceScope[i]` resolves. Fix: correct it.76- **stale epics** — `.rig/epics/*.json` whose branches are already merged/gone.7778## `--fix` (opt-in)7980Only when `--fix` is passed. Show the exact change and get a yes before each,81then apply **only the safe set**:82- create missing `shapeLabels` repo labels (`gh label create … --force`);83- add `.rig/epics/` to `.gitignore`;84- copy `REVIEWER.md` from the kit template if absent;85- copy `STYLE.md` from the kit template if absent;86- add missing board columns.8788**Never auto-apply** (print the command instead): `gh auth …` (interactive),89branch-protection changes, creating/editing CI workflows, anything that writes90to a branch or changes permissions. Re-run diagnose after fixing.9192## Notes9394- Purely diagnostic without `--fix`; it reads, it doesn't change.95- Degrades: skip tracker/board checks on `tracker.provider: none`; skip GitHub96 checks on `linear`.97- Fast to re-run — good as a preflight before `/rig-plan`, `/rig-epic run`, or a98 live demo.