/corgi:riskfrom corgi
Scores changes (PRs, branches, local diffs) or stories on a 1-10 risk scale and writes a risk card with evidence. Helps decide auto-approval, review depth, and reviewer assignment.
Ships in corgi. 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.
Read when SKILL.md points to them.
Read ../_shared/conventions.md first (finish what you start, attribution, unattended runs).
Done when: the card (or the gate line) is printed; in stamp mode it is also in the PR/MR description.
Agents open more pull requests than a team can read line by line. The question a reviewer needs answered before they open one is not "is it correct" but "how much of my attention does this deserve, and where". This skill answers that with one number, one sentence of review guidance, and a card that names the exact places to look.
Three modes:
/corgi-risk.stories does when it opens a draft and what review offers
on an existing one.risk N/10 <tier> · auto-approve: yes|no - <reason>. What a caller that wants only
the verdict prints - stories under each PR link, tracker beside each pickup.Two targets:
confidence: low and re-scored
from the diff once it exists. Use it to decide before building whether the story
is one an agent may take alone or one that needs a human in the loop.yes needs every
condition in Auto-approval met and visible; one missing → no with the missing
item named. Never yes on a story target.<!-- corgi-risk --> markers; re-stamping replaces that block and touches nothing
else in the body. Never rewrite the author's text, never post as a comment when the
description was asked for.stamp mode print the card and the exact
description diff, confirm, then write - the same gate review uses for comments.
Pre-authorised autonomous runs (stories, autopilot) skip the prompt, not the
print.corgi-compose.yml (review
Phase 0 rules). Fetch title, body, base, head SHA, diff, changed files, check
status, linked ticket. No checkout.git -C <dir> diff <base>...<branch>, and --numstat for the sizes.git diff <base>...HEAD in the current service dir; uncommitted
work included only when asked.tracker skill's read path, or the
text given) and a grep of the areas it names. Say up front that the score is a
forecast.Read the repo's standards note if review already built one (CLAUDE.md / AGENTS.md /
lint config) - a repo that declares a hot path or a protected directory has told you
where its risk lives. .corgi/memory/ decision facts count too.
Collect, per change, without judging yet:
| Fact | How |
|---|---|
| files, lines added/removed, services touched | --numstat, map paths to compose services |
| shared or hot code touched | paths in shared/, lib/, core/, middleware, auth, payment, migration dirs; the standards note's hot-path list |
| schema / contract shapes | migrations, *.proto, OpenAPI, GraphQL SDL, TS types exported across packages, API handlers' request/response types |
| config / infra | CI files, Dockerfiles, corgi-compose.yml, env templates, IaC, feature-flag definitions, app config (app.json, eas.json, Info.plist, AndroidManifest.xml, entitlements) |
| dependencies | lockfile diff, native modules, major-version bumps |
| tests | test files in the diff, tests deleted or skipped, whether changed non-test lines have a test touching them (name-match or coverage report if CI publishes one) |
| CI | check status on head; which checks exist at all |
| ticket | acceptance criteria present, scope of the diff vs the ticket's words |
| proof of behaviour | screenshots / recordings in the body, a FAILS-on-base regression test, a manual test plan |
| history | git log --oneline -20 -- <touched dirs>: how often this area changes, whether the last change here was reverted |
Eight dimensions; each carries points per references/rubric.md. Score = the
highest single dimension, plus one for every other dimension at 2 or more, capped at
10, then raised to any floor that applies. Highest-dimension-first because risks do
not average: a tiny, well-tested change to the auth middleware is still an auth change.
| Dimension | What raises it |
|---|---|
| Blast radius | many files/services, shared modules, public API, anything every request passes through |
| Reversibility | data migrations, deletes, irreversible side effects (payments, emails, push, store submission), no flag to turn it off, a binary release rather than an OTA/deploy |
| Data & access | auth, permissions, session, PII, secrets, crypto, input validation, new third-party data flows |
| Verification | no tests for changed lines, tests deleted or skipped, CI red or absent, bug fix with no FAILS-on-base proof |
| Contract | request/response or event shape changes, schema, shared types, merge-order dependency between repos |
| Operations | CI/build/infra/env changes, background jobs, retries, concurrency, caching, timeouts, hot-path performance |
| Mobile & native | native modules, ABI/SDK bumps, permissions (push, ATT, location), deep links, offline persistence, navigation stack, store metadata / IAP, app config, platform-specific code - see references/checklists.md |
| Novelty | new dependency, new pattern for this repo, first change in an area, large generated diff, dependency upgrades with changelog-worthy breaks |
Two rules on top of the sum:
| Condition (evidence in the diff) | Minimum |
|---|---|
| touches auth / permissions / session handling | 7 |
| touches payment, billing, IAP, or store submission | 8 |
| destructive or non-reversible data migration (drop, rename, type change, backfill without a down path) | 8 |
| secret, token, or credential handling changed | 8 |
| CI/CD or release pipeline changed | 6 |
| native module added or native SDK bumped (mobile) | 6 |
| changed lines have no test and CI has no coverage signal | 5 |
| cross-service contract changed | 5 |
| a story target (no diff yet) | never below 3, never auto-approve |
| Score | Tier | What the reviewer does |
|---|---|---|
| 1-2 | trivial | one reviewer glances; the only band where auto-approve can be yes |
| 3-4 | low | one reviewer reads the diff; ~10 min |
| 5-6 | moderate | one reviewer reads carefully and runs it (the corgi run --service-branch line); ~30 min |
| 7-8 | high | two reviewers, one owning the touched area; manual check on the real environment or device; ship behind a flag or in a staged rollout |
| 9-10 | critical | two reviewers including the owner, the test plan executed and recorded, a written rollback, a deploy window; never merged the same day it opened |
auto-approve: yes only when all hold and are visible in the evidence:
Otherwise no - <first failing condition>. "Auto-approve" here means a human may
merge on the score alone; it never means the skill merges (nothing in corgi does).
Absent author evidence never decides a no on its own. Screenshots, recordings
and manual test plans are welcome proof when they are there, and are not owed when
they are not - judge verification by the tests, the CI and the diff. A card whose
only failing condition would be "no screenshot" is a yes.
Short, evidence-first, phone-readable. Exact shape:
<!-- corgi-risk score=7 tier=high -->
## Risk 7/10 - high · two reviewers, one owning api; run it before merging
**Why**
- blast radius: two services - `api/handlers/user.go` and `web/src/user.ts` both change
- contract: `api` adds `address` to the user response; `web` reads it (`web/src/user.ts:41`)
- data: a new user field is stored and returned (`api/migrations/0042_address.sql`)
- verification: 3 tests added for the handler; no test touches the `web` reader
- reversibility: additive column, migration has a down path
**Check**
- `web/src/user.ts:41` - null guard on `address` before `api` deploys
- merge order: api first, then web
- run: `corgi run --with-deps --service-branch api=feature/ABC-200 --service-branch web=feature/ABC-200`
**Skip** - the renamed test helpers (`api/handlers/user_test.go`) are mechanical.
auto-approve: no - cross-service contract
<!-- /corgi-risk -->
Rules for the card:
confidence: low - scored from the ticket; re-run on the diff and
a Before building list: the decisions a human must make first (which flag, which
migration strategy, which rollout).<!-- corgi-risk … --> …
<!-- /corgi-risk --> block.gh pr edit <n> --body-file <tmp>; GitLab glab mr update <iid> --description "$(cat <tmp>)". Read the body back and confirm the marker is present
exactly once.risk:<tier> so the list view carries the score. Never create a label scheme the
repo does not have.No write permission → print the card and say it was not stamped; never fall back to a comment silently.
assess and stamp end with the card, then one line per target for a set, then the
summary line - one form everywhere, so a caller can match it as a prefix:
risk 7/10 high · auto-approve: no - cross-service contract
stamp appends · stamped: yes (api#42, web#37) (or stamped: no - <why>) to that
line; gate prints the line alone. The review skill folds the card's first line
into its summary headline and prints this line in its report; stories prints it
under each PR link and tracker beside each pickup; autopilot names over-ceiling
stories in its heartbeat note with it. Keep the form exact.
yes on a story, a red CI, or a set with a merge order → wrong by
definition.references/rubric.md - the point scale per dimension and worked examples.references/checklists.md - what to check per area (backend, web, mobile, data,
infra) so Check lines are specific, not generic.review - runs assess on every PR it reviews and offers stamp.stories - runs stamp when it opens a draft PR/MR; prints the score in its report.autopilot - compares the line against its maxRisk; an over-ceiling story is left for a human.complexity - a complexity-gate fail is verification evidence here, not a score of its own.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
33 skills in this plugin
/agentUse for corgi agent mode: Remote Control from a phone, the session board ("who is waiting on me"), watching trackers and PRs ("tell me when someone comments"), why a watch fired, and handoffs ("leave a handoff for ABC-7"). NOT compose authoring (corgi), starting a stack (run), debugging (debug)./alignUse when the user says "align", "let's agree first", or a request can be read two ways before any code. Reaches a shared understanding cheaply, then codes. NOT a plan gate or a long interview./autopilotUse for a SUPERVISED loop that drains the ticket queue into draft PRs: "autopilot", "keep shipping the queue", "drain the backlog overnight". One spec gate per batch, never merges. NOT a single batch (/corgi-queue)./before-afterUse to prove a visual change against what it replaced: "before and after", "screenshot comparison", "attach screenshots to the PR". Captures the same screen on the base branch and yours. NOT a design match (design-parity) or store shots (mobile-screenshots)./budgetUse for "how much budget do I have", "can I start another task", "when does the limit reset". Reads `corgi agent usage --json`, answers in numbers, suggests `corgi agent carry` near a limit./ciUse to put a corgi stack in CI or run e2e across repos: "set up CI for this workspace", "wire this to GitHub Actions/GitLab CI", "full-stack e2e on the PR". NOT compose authoring, local runs, broken stacks or PR review.npx claudepluginhub andriiklymiuk/corgi --plugin corgiOther plugins' skills for the same job