/corgi:storiesfrom corgi
Ships work across a Corgi workspace by implementing tracker tickets or free-text features: creates specs, branches, draft PRs/MRs, runs review loops, and reports progress.
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.
Done when: every story in batch has, per touched repo, pushed branch + draft PR/MR whose checks polled to conclusion and whose review loop ran - or BLOCKED line with its one question; then report. Story corgi tracks (sits in corgi agent watch status) also gets corgi agent watch done <KEY> once work pushed, so inbox rows close on this side; watch comment and watch pr do that on their own.
Work items - tracker issues (Linear/Jira) or free-text feature - → spec each
→ isolated branch(es) → tested + reviewed → draft PR/MR per repo → review
loop until clean (Phase 5.5) → grouped report. Services, dirs, dependency order: all from corgi-compose.yml. Never
hard-code.
Request naming page - /idea/<slug>, slug, "the spec on the page", corgi idea … link - already specified and argued there. Read with
corgi idea show <slug> --json: markdown = spec, tickets = stories
(one branch each; after = order; ticket with ref already board task
or tracker ticket - use that key), comments = decisions, so Phase 2 sign-off already given when no comment is open. Work tickets as stories.
Report progress on page, not only chat:
corgi idea comment <slug> "<what shipped, the PR link>" --as-agent - story changed plan → keep split true with corgi_idea_edit. idea skill has rest.
One blocking gate on adjustment/bug fast path; complex stories add superpowers checkpoints.
corgi agent watch enable --action fix --auto-for tickets (or all); prompt then carries corgi watch · … trail
and "I approve all changes". That = pre-authorized run above + one rule
from ../_shared/conventions.md: never ask - every choice takes recommended
option, named in one line; story that cannot go on ends in corgi agent handoff --ref <key> --blocked "<why>", not question. Run still posts spec
comment, opens draft PRs/MRs, runs review loop, reports; corgi agent today,
inbox, kanban show it same as any run. Turning on = person's
choice per workspace, never this skill's.| Tier | What | Extra rigor |
|---|---|---|
| Adjustment | clear-spec UI/copy/flag/config; unambiguous | test for new behaviour only |
| Bug | broken / regressed | regression test FAILS on base branch before fix, passes after |
| Feature | new behaviour, real design, or new/changed cross-service contract | hand to superpowers if installed, else equivalent inline (below) |
Tier ≠ span. Complexity axis vs single/multi-service (Phase 4). Multi-service change = Feature whatever size: contract crosses boundary, design lives there.
How the tier is picked. --mode bug|feature|adjustment in invocation
wins. Else ticket's own words: type or labels bug, defect, regression,
incident, hotfix → Bug. Everything else Feature until Phase 1
proves adjustment: one service, surface nameable in one
sentence before reading code, no new behaviour, no contract. Proof = investigation, never ticket brevity - one-line ticket for "premium
frequency" can be feature across four repos. Unsure → Feature rigor costs one
plan; adjustment that was feature costs rewrite.
Risk lane - always a plan, whatever the size. Change touching
migrations, auth, sessions, permissions, payments, billing, secrets or
cross-service contract gets Feature rigor even at three lines: interface or schema change written and confirmed first (Phase 2 gate never
collapses for it), spec names rollback. Workspace may extend
list with riskPaths: under its entry in user agent config.
Bug lane - logs first, theories second. Before hypothesis: reproduce
against running stack (corgi run, corgi logs --service <svc> --grep '(?i)error',
corgi_wait_for_log), quote failing line or request, write
regression test that fails on <base>, then smallest fix. No plan file, no
subagent fan-out: bug = straight line from log to test. Quoted
line travels with fix - spec comment, PR body, report each
carry it verbatim, not pointer to where it lives.
Express lane - small-surface adjustment. Only proven adjustment (above) in single service, no cross-service contract, surface nameable up front (one component or few files: asset/copy/flag/style swap, small wiring), takes lighter machinery. Open design question (which variant? what scope?) takes it out of express lane: feature question, feature path. Lighter steps, same guardrails:
Explore subagent - grep + read 2-3 files inline; subagent returns
full report to map one component, orchestrator's own search cheaper. Reserve
Explore for unclear surface or real fan-out.docs/stories/*.md - ## Spec tracker comment IS spec, don't
write both (multi-service/feature still gets file).Still mandatory: gate sign-off, spec comment (QA section folded in), branch, per-story review, draft PR, report. Unsure on scope → full path; express lane for change whose scope never in doubt.
Bug sub-type - logic vs visual. "FAILS on base" assumes unit test can see it. Visual/layout bug (z-index/stacking, overflow, position, breakpoint, CSS specificity/cascade) → jsdom can't catch it; green unit test proves nothing. Don't fake one.
references/expo-verification.md) → red check there,
same FAILS-on-base.references/expo-verification.md, Phase 3's
screenshot bullet).Before/after asked for → run before-after. Any phrasing of "screenshot
comparison", "before and after", "show the visual diff", "prove the UI changed" = request for before-after skill, not second after-only screenshot: builds
base branch too, captures same screen twice, puts both where user
asked - PR body when they said PR, else ticket (§6a). Costs two builds, so
runs only when user asks - never own initiative, however
visual change; gate + repo's harness = default proof. Never satisfy
request by describing old state from diff; diff exactly what does
not show it.
Bigger than adjustment (real design, unclear approach, large surface, new contract)
→ don't force one-shot. superpowers installed, via Skill:
superpowers:brainstorming - settle intent + approach before code.superpowers:writing-plans - becomes spec doc.superpowers:test-driven-development + superpowers:executing-plans - build,
tests first.superpowers:verification-before-completion - prove before draft PR.Not installed → equivalent inline: settle approach with user, plan into spec, tests first, verify before push. Either way flows back here - same spec doc, one gate, per-story review, draft PR, grouped report.
../_shared/conventions.md first (attribution, manualRun, preflight, worktrees).../_shared/conventions.md › Code you write says. No comments, names
carry meaning, smallest change that does job, nothing speculative.Stands alone. Used if present, never required:
superpowers:* (separate plugin) - complex-story engine + nicest review.
Missing → inline. Don't block on missing plugin.expo:* (separate plugin) - Expo/RN service: its skills
(expo:expo-dev-client, expo:building-native-ui, …) deepen simulator
verification in references/expo-verification.md. Missing → reference
alone suffices./code-review) - Phase 3.5 if present; else
review subagent works everywhere.Always available, all flow needs: git, gh/glab, corgi, Explore/Task
agents, tracker MCP.
../_shared/conventions.md). None →
/corgi-new first, or ask which repos; don't guess layout.
Pasted context may not be this workspace. Diff, MR body, ticket or
screenshot in prompt can come from other product entirely - may be example of shape wanted, not target. Never identify
workspace by hunting filesystem for code matching paste: confirm
which one before Phase 1, re-confirm when paste names services
compose file doesn't.services.<name>.{path,cloneFrom,manualRun}, depends_on_services, exports
(schema: skills/corgi/references/yml-schema.md). Don't render whole
project: /corgi-describe too many tokens; corgi --describe dumps JSON then
still runs command. Build:
path: (local) or cloneFrom: (clone target) = repo you branch in. cloneFrom not on disk → corgi init clones first.depends_on_services + exports/
${producer.VAR}. Depended-on service (schema/contract owner) first; consumers
follow. Cycles → flag.<base>: per conventions.md (base used for branch, red
test, PR target).package.json scripts, Makefile,
pyproject/go.mod, service start/beforeStart/scripts. Don't assume
runner. Also find CI gate PR will face - coverage-threshold
script (test:cov:check, check-coverage step, --coverage floor) or CI
workflow (.github/workflows, .gitlab-ci.yml). Note it; Phase 3 runs same
gate before PR, not only scoped test.../_shared/tracker-mcp.md first.Route the intake first - what am I building?
linear.app/<org>/issue/ABC-123/… and
<site>.atlassian.net/browse/ABC-123 both carry key - take from URL,
carry on, never ask which ticket meant. Several links or keys in one
message = one batch, not one run each: specced together.tracker skill's pickup - agent queue (label agent, not In
Progress/Done), drift-skipped - confirm picks, build here. Same selection as
/corgi-queue: selection in tracker, building here.Tracker issue: fetch, view screenshots, read real code paths.
get_issue includeRelations: true; Jira issue
links. duplicateOf / relatedTo / parent epic often already carries or shipped
work - see Already shipped? below.curl the uploads.linear.app URL (signed, expires ~5 min -
re-fetch issue for fresh URL), read.getJiraIssue gives attachment metadata only (filename +
content URL /rest/api/3/attachment/content/<id>), no bytes.
mcp__atlassian__fetch won't get bytes - ARIs only; attachment id
mis-resolves to wrong issue. No MCP tool returns bytes. Jira URL needs
auth header you don't hold. So: 1. Have creds ($JIRA_EMAIL/$JIRA_API_TOKEN)?
curl -u "$JIRA_EMAIL:$JIRA_API_TOKEN" -L -o /tmp/<name> "<content-url>", read.
Usually not in env. 2. No creds / 401 / 403 → stop guessing. Ask user to
download + share path (~/Downloads), ls -t ~/Downloads | head, read.design-screenshots/, Figma export on disk, "see mockup") → read direct,
outranks prose. Build as drawn - exact icon/emoji, colour, copy, spacing,
placement. No near-equivalent.Before speccing from scratch, check three places prior spec may live - human's, past stories run's, decompose ticket's acceptance criteria:
list_comments; Jira via getJiraIssue
/ dev panel). Comment whose first heading is ## Spec = prior run's spec.docs/ - docs/stories/<issue-key>-*.md (this skill's output) + any
hand-written design doc whose name/heading matches.Found one → starting hypothesis, not ground truth. Re-resolve every file:line
against current tree, re-confirm contract - code moves, specs rot. Say what
drifted, rewrite stale parts, keep what holds. Nothing found → spec from scratch.
Bug tier - check for dead prior fix first. git blame / git log -S"<symptom>"
suspect lines. Prior fix present but bug persists → inert (overridden, lost
specificity, runtime style wins, wrong selector, behind flag). Explain why dead, revive/correct - don't stack second half-fix. Note why in root-cause.
Re-opened ticket whose prior fix already merged? Read prior PR/MR state
(gh pr view <n> --json state / glab mr view): MERGED + closed → branch
dead (often deleted), fix already on <base> - branch fresh off
<base>, never reopen/continue merged branch; old ## Spec comment = insufficient fix, so update that comment, don't follow it.
Reuse-spec check (above) finds prior spec; this finds deliverable already
built on <base> - by sibling / related / duplicate ticket, or earlier PR
that bundled it. Re-build wastes batch + opens dup PR. Before speccing actionable story, prove NOT already done:
duplicateOf / relatedTo / parent
epic - description or merged PR often already covers ask.<base> for what story adds - component, copy string, route, flag:
git -C <dir> log --oneline -S"<symbol>" -- <area>, git grep "<copy>" origin/<base>.
Present + wired → shipped.Explore summary. Explore hands
code already satisfying story; "found it" ≠ "needs building."Shipped → do NOT branch. Mark Status: ALREADY DONE, comment lineage
(commit/PR that delivered it) + recommend close as duplicate, report no-op.
Comment ≠ close - ask before changing ticket state. Phase 1 finding → surfaces
at the gate, not after wasted branch.
Description, not links → no fetch, nothing says where code goes. (First check
docs/ for existing design doc - Reuse an existing spec.) Find target
service(s) before speccing:
corgi-compose.yml (names, paths,
depends_on_services) + README next to compose + per-service READMEs.
Don't guess.Explore scoped to candidate service(s) - find real files.superpowers:brainstorming);
don't guess.Described feature = usually Feature tier: superpowers:brainstorming (or inline
Q&A) to settle scope → superpowers:writing-plans for spec. After sign-off
(Phase 2), offer to create tracker issue (Linear mcp__linear-server__save_issue
with title+team and no id / Jira mcp__atlassian__createJiraIssue) for key +
auto-link; declined → spec stays
local + on PR, branch drops key segment (Phase 3). Caller (e.g. suggest)
that already created issue + hands key + spec → use that key, don't re-create.
Batched stories overlap. Re-exploring per story doubles tokens. So:
Explore sweep per area, not per story - all area's questions in
one agent. Never per-story over same files. (Micro adjustment → no subagent at
all; grep inline - Express lane.)debug skill (Step 4 - provider data), fold findings
into note; don't hand off whole flow..corgi/memory/ exists → read first
(corgi memory list --json / index.md, then matching facts; see memory skill):
honor
decision constraint, reuse incident fix for regression, ground
free-text feature in domain facts. Absent → skip.Before spec, run risk skill on story (ticket text + code area it
names): forecast, confidence: low, never auto-approve. Decides two things:
which tier when ticket alone unclear (forecast 7+ never adjustment), and what goes in spec's Before building list - decisions human makes at Phase 2 gate (flag, migration strategy, rollout,
which service owns data). Put forecast line in spec comment so sign-off
made knowing it; real score comes from diff at Phase 5.
docs/stories/<issue-key>-<slug>.md, actionable or not - except single-service
bug (Bug lane) or express adjustment (Express lane): no file, ## Spec
comment is spec. Tracker unreachable → spec goes into report and
PR body, never into repo file standing in for comment:
file:line refs.../_shared/second-reviewer.md that apply, each with
one-line answer (check then write: one transaction, conditional update;
installed apps: still read items[0] - kept).
Name what plan deliberately does not build and what covers it instead (native element, existing helper) - cheapest spec has fewest
new parts. Multi-service: ## Contract + cross-service order.../_shared/conventions.md ›
Team skills), each with its step - e.g. the team's ready-for-qa before QA
hand-off. None fits → no line..md attachment).
Open with ## Spec heading; when change user-testable, end with
short ## What to test section (plain QA: clicks + outcome, no code/file refs, end
Expected:) - folded into same comment, not second. No HTML comment
marker (trackers render <!-- … --> as visible text), no footer badge. Linear
mcp__linear-server__save_comment({ issueId, body }) (omit id to create, pass id
to update); Jira mcp__atlassian__addCommentToJiraIssue. Literal newlines/markdown.
Picture, video or file goes through corgi agent watch comment <KEY> "<text>" --file <file>
(../_shared/conventions.md § Comments people read).
## Spec heading = how later run (new session, no comment id) finds it: list
comments, match one whose first heading is ## Spec, update
(save_comment({ id, body })), don't duplicate. Skip QA section for
non-testable stories.Status: BLOCKED + Decision
needed; surface choice. Hold it; rest of batch proceeds.superpowers:brainstorming / superpowers:systematic-debugging (if installed) to
resolve ambiguity before blocking.
Present all actionable specs in one round; sign-off before any branch -
batch-level, not per-branch. Re-present only changed specs. Blocked held out. Open
questions inside spec use align skill's fork format (❓ Qn + ➡️ pick, ≤5 per
spec); story with more forks not ready to gate.
Superpowers-escalated stories pass here too: writing-plans output = spec.
Fast-path - collapse the approval round to inline diagnosis. Gate confirms intent before branching; collapses (state diagnosis + exact change inline, then go - that is gate, user can still stop you) in exactly two cases:
../_shared/conventions.md - the
corgi watch · trail). That = sign-off for any tier, span, batch size; state
each spec inline and go. Signal = explicit approval + directive, not
impatience.Workspace says wait. corgi_watch_switches (or corgi agent watch) may carry
planReview: always | risk>=N for this workspace (corgi agent watch enable --plan-review).
Matches story's forecast → neither fast-path applies: post spec, ask
sign-off with AskUserQuestion so phone can answer, cut no branch
until it returns. Unset or off (default) changes nothing above.
Either way fast-path drops pause - never thinking, not artifacts: post spec comment (with QA section) even for one-liner. Durable record; visual/QA defect is what human must re-verify.
One at a time by default. Stories run in order on this thread, no subagent dispatch, unless
person asked for parallel work in this conversation. "No agents", "one at a time" stand for
rest of thread. When asked, read load (uptime) before fanning out: more than one full test gate at a time only while
load stays below core count, never more worktrees than stories. Subagent cut
short by usage limit or 429 → resume with same brief once limit over -
re-read clock before calling anything "still rate-limited"; limit message
carries reset time, passed reset = over.
Local side effects are reported, never silent. QA pointing service at other
database, editing .env, stopping container or killing process says so when done, restores after; report lists what changed on machine and
that it was restored.
Branch: feature/<issue-key>/<kebab-slug>, same name in every affected repo.
Write the scope before the first edit. Spec named files or areas that change and what done means; put on record so hooks hold you to it:
corgi agent scope set <issue-key> --path "api/limits/**" --path "web/src/limits/**" \
--lines <diff budget> --tests <new test files> --done "<criterion>" --done "…"
Paths = workspace-relative globs (** crosses directories; directory
covers contents). Scope = tripwire for wandered run, not target to build down to: name every area spec touches, set line
budget at three times spec's guess (adjustment ≈ 200, bug ≈ 400, feature ≈
1200 per service), tests one file per acceptance criterion, core flow first.
Write outside paths refused with way to widen - corgi agent scope add <key> --path … - widening normal the moment
code needs it; say why in one line of PR. Diff over budget reported
once when turn ends: raise budget on record (scope set --lines N)
with one line why. Never trim real work, tests or error handling to
fit number, never widen silently, never disable hook.
Get <issue-key> from the tracker, don't invent it (auto-link token):
get_issue → identifier (ABC-123) + suggested gitBranchName.
Use identifier; Linear links any branch containing it (case-insensitive). (Or
gitBranchName verbatim.)getJiraIssue → key (PROJ-123). Dev panel / Smart Commits link by
that token.feature/<kebab-slug>, no key segment (or key of issue
created in Phase 1).Key also in commit + PR/MR title (Phases 4-5). Same branch name across repos so multi-repo PRs group.
Move the ticket to in-progress + assign when work starts. As each actionable, ticketed story's branch created (post sign-off):
save_issue({ id, state }) to started-type state (state
takes type/name/id; resolve via list_issue_statuses);
Jira transitionJiraIssue to transition targeting In-Progress
(mcp__atlassian__getTransitionsForJiraIssue).save_issue({ id, assignee: "me" })
(assignee accepts user id/name/email/"me"); Jira editJiraIssue assignee = current user (mcp__atlassian__atlassianUserInfo).
Don't steal - assigned to someone else → leave, note who; unassigned → take.Idempotent - skip if already set; skip no-ticket + blocked. In-progress move
also stops looping /corgi-queue re-grabbing story in flight (auto-pick takes
only not-In-Progress). Review transition fires later, at draft PR - Phase 5.
Pick branch vs worktree per repo - check the working tree first:
git -C <dir> status --porcelain --untracked-files=no - empty = clean, any output =
dirty. (Ignore stray untracked; checkout -b doesn't disturb them.)
| Repo state | Stories touching this repo | Mode |
|---|---|---|
| clean | one | branch in place |
| dirty | one | worktree - don't disturb user's uncommitted work, skip destructive base checkout on dirty tree |
| any | several | worktree per story (parallel isolation) |
Count "stories touching this repo" across whole batch up front - two single-repo stories hitting one repo = "several" → both worktree.
Dirty + overlap guard. Worktree gate in ../_shared/conventions.md applies:
edits overlapping story's files → STOP and ask; no overlap → worktree safe.
Must-run producer in a worktree → run it with --service-dir. Producer that
must be running for consumer to verify (Phase 4) can live in worktree:
corgi run --service-dir <producer>="$W" (below).
checkout <base>/pull dance, no local-divergence trap:
git -C <dir> fetch origin && git -C <dir> checkout -b <branch> origin/<base>.corgi worktree add
puts it under .corgi/corgi_services/.worktrees/, inside workspace, so the repo's
CLAUDE.md still loads when you read files there - a /tmp worktree loses it and
you code without the repo's rules. Branches off fetched origin/<base>, never
touches <dir>'s tree, reuses branch that already exists, one dir per repo+branch
so stories never collide:
W=$(corgi worktree add <service> --branch <branch> --base <base>) # prints the dir
# several repos: corgi --json worktree add api web --branch <branch> --base <base>
# repo not in corgi-compose.yml: git -C <dir> worktree add -b <branch> <dir>/../.wt-<branch-slug> origin/<base>,
# then read that worktree's CLAUDE.md / AGENTS.md yourself before editing
# deps dir (node_modules / vendor / target / .venv) gitignored → symlink main
# checkout's for SEQUENTIAL gate runs; real install for CONCURRENT runs and for
# any worktree corgi will run (--service-dir, below).
ln -s "$PWD/<dir>/node_modules" "$W/node_modules"
Use path you got ($W) for every later step of this repo. corgi older
than 2.45.0 has no worktree add → corgi upd.
Worktree corgi will run gets real install, never symlink.
--service-dir (below) runs service's beforeStart in worktree, and
install step rebuilding deps dir (npm ci, clean reinstall) follows
symlink and empties main checkout's deps. Symlink for gate runs you start
yourself; before corgi run --service-dir, unlink it and install for real. Main
checkout's deps dir suddenly empty → that's what happened: reinstall there,
report as local side effect.
Worktree dir now this repo's working dir - implement, gate, review,
commit, push, open PR/MR from it (Phases 3.5-5).
--service-dir (only services in
corgi-compose.yml). corgi resolves service from path: (main <dir>);
to run worktree's code - e.g. producer consumer verifies against
(Phase 4) - pass --service-dir <svc>="$W" (worktree dir); corgi runs
service's env, beforeStart/afterStart, process from worktree, main
checkout untouched. Per-service, repeatable - mix worktree + compose path:
services:
corgi run --detach \
--service-dir api="$W_API" \
--service-dir web="$W_WEB"
# services not named (admin, worker, db_services) run from their compose path:
beforeStart steps run from worktree too, so step leaving
service dir (cd .. && make …, ../scripts/…) lands in worktree's parent, fails.
corgi run --detach still starts process, then exits non-zero with
beforeStart failed for <svc> - stack keeps running without what step
made (seeds, generated files, policies). Treat exit as real failure, not
healthy boot: run failed step from compose dir by hand, name it in
report. corgi status shows service ❌, corgi why <svc> says
setup_failed. Lasting fix in compose file: step needing
compose folder says cd "$CORGI_COMPOSE_DIR" (corgi 2.35.4+), not cd .. -
offer as follow-up, never fold into story's diff.
--service-dir runs exact worktree code. (corgi also has
--service-branch <svc>=<branch> - own reused worktree off branch - and
--service-checkout <svc>=<branch> for in-place checkout; handy for ad-hoc
"run this branch", but for stories point at impl worktree.) Branched repo
not corgi service → no --service-dir; run its runner in
worktree dir.git -C <dir> worktree remove "$W" once
PR up. Failure (Stop rule) → leave it; report its path. Never
worktree remove failed story.Implement to spec, and before each piece, walk ladder in
references/smallest-change.md - not needed → already in repo → language
ships it → platform ships it → installed dependency does it → one clear line →
least code passing check. Stop at first rung that holds. Minimum
diff - no opportunistic refactor, no abstraction nobody asked for, no new dependency
for what installed one covers, no code comments unless file already comments
heavily. Validation at trust boundaries, data-loss error handling, security,
accessibility, tier's test never trimmed. Shortcut with known
ceiling goes in PR body's Deferred list (Phase 5), not comment. Run
per-service gate (tests + typecheck + lint) BEFORE commit. Tests for every change,
matching existing patterns.
corgi-compose.yml - gives
worktree full resolved env, deps, cwd, no guessing runner or
hand-building env:
test script → corgi test --changed --base <base> runs whole test script of
every repo differing from <base> (uncommitted work counts); add
--service-dir <svc>=<worktree-dir> for worktree'd services. Reports nothing
changed → fall back to corgi test --service <svc> (in place, or with same
--service-dir mapping).corgi exec <svc> --service-dir <svc>=<worktree-dir> --ensure-deps -- <cmd>.test script, or no compose → run discovered runner
(Phase 0) in worktree dir. Same --service-dir <svc>="$W"
mapping as corgi run (Phase 3); drop for in-place.complexity skill in gate mode on diff (touched functions vs <base>): function started at or under repo's threshold ends at or under, one
started over does not rise, new function starts under. fail → apply
skill's tactics to function, re-gate. Review loop (Phase 5.5) checks
same rule, so regression caught here = one round saved there.<base>,
unrelated. Don't chase whole-repo green that never existed; don't let baseline
noise hide your breakage. Gate on no NEW errors - filter run to changed
files, or diff base error set. Touched files clean; baseline left as-is, not
"fixed" (scope creep).corgi test --changed --base <base>
runs each changed repo's whole test script in resolved env (--service <svc>
when --changed finds nothing), so suites importing changed module load
too. Then run CI gate Phase 0 found: coverage floor over changed files counts
untested file you merely touched - add test or leave it alone. Green
exit proves nothing unless intended suites ran: check test count above
zero (path filter containing (…) or […] can match nothing and still pass).generate:types, codegen, …; in
package.json / Makefile), commit result, or gate fails on new
key/type.corgi run --services <svc> --with-deps --detach brings up service's
db_services (no full stack needed), then run repo's own migrate command through
corgi - corgi exec <svc> --ensure-deps -- <migrate cmd> (script wrapping
prisma migrate dev / drizzle-kit generate / knex migrate:make / alembic revision --autogenerate). Commit generated migration and regenerated
client. corgi stop when done.mcp__argent__* tools in tool list; argent --version on
PATH) - iOS simulator, Android emulator, or Chromium page over CDP (web
service in browser started with --remote-debugging-port): list-devices,
launch-app / open-url, describe for tap coordinates, gesture-tap,
screenshot. Every action returns screen after it, so no flow file, no
guessed coordinates. Read argent rule/skill it ships before first call.mobile skill; its MCP when connected) - flow file with
takeScreenshot inside flow, --device <udid>.npx playwright screenshot,
chrome --headless --screenshot).xcrun simctl io <udid> screenshot, adb exec-out screencap -p.
Whatever captured: log in as account class story is about, seed
state ticket describes, read each image before attaching or concluding.
Asked-for set (trigger 1) complete: every state spec names (empty /
in progress / done / error) and every rendered side of multi-service story - web or admin console showing same record gets shot too. Verification shot (trigger 2) covers one spot change touches, nothing
more. Name each file <n>-<what>.png. Attaching: ticket through tracker's own
upload, PR per Phase 5 (§6a link form). No driver, no device (host with no
simulator or browser) → repro steps in spec and PR instead; say so in
report when user asked for shots.docs/design/<ticket>/, capture same states
from app, compose labelled design-vs-app images, put deviation table (fixed vs
deliberate divergence) in PR/MR - table = record; composed images
go with it per screenshot bullet above (ticket when user asked for
screenshots, PR when they said PR, else your call). Feature still behind flag or without seeded data
forced on with temporary, clearly-marked local switch - reverted before commit. Full
loop: design-parity skill.references/expo-verification.md). Detect: package.json depends on expo
(or react-native + ios//android/). Jest-green not done: Metro
interop, native modules, permissions/entitlements, visual layout only
fail on device. Native-scoped change (new native dep, app.json
plugins/permissions) → rebuild dev client (prebuild → LANG=en_US.UTF-8 pod install → xcodebuild), re-install; JS-only → existing build + Metro
reload. Drive changed flow with driver screenshot bullet picked -
argent MCP when present, else Maestro (flows in e2e/, committed with
PR) - confirm by reading screen driver returns (screenshot bullet's
trigger 2: verification, not attachment), watch Metro log for runtime
errors. Multi-device features (P2P/LAN): clone simulators - share
host's network/Bonjour, so real radio path testable. Use
expo:* plugin skills for SDK-specific guidance when installed;
same-plugin mobile skill = canonical device-driving loop + build
gotchas (Maestro flow-as-file + --device, non-login LANG pod builds,
--clear redbox, apple-targets extension creds + App Group, stale autolinking,
tee/exit-code masking) - invoke for VERIFY. Never run its
local-build → TestFlight/Play ship from story - shipping separate,
owner-approved step, only when ticket/spec explicitly calls for release.
Non-macOS host (no simulator) → fall back to visual-bug manual-only
path: spec + PR carry repro steps; say so in report.corgi tunnel <svc> for public URL, point provider (or CLI,
e.g. stripe listen --forward-to <url>) at it.corgi status --ready) BEFORE this gate on consumer. Consumer's types
come from introspecting running producer (GraphQL introspection codegen,
OpenAPI client-gen against live server) → MUST start producer with corgi,
run real codegen against it - never hand-edit generated client/types as
shortcut because producer down. Hand-edited generated file drifts from
real schema, not validated, next real codegen silently overwrites.
Producer down → bring up (corgi run --services <producer> --with-deps --detach),
don't fake output.needs attention + failure, rest ships. Never push red.## Contract), re-gate, create producer
branch - don't escalate in place.Review each story as it finishes, scoped to only its diff - incremental, bounded context, NOT one giant end-of-batch review (re-reads everything, burns tokens).
git -C <branch-dir> diff <base>...HEAD - review subagent passed only
that diff + spec (works everywhere), or /code-review /
superpowers:requesting-code-review if present.../_shared/second-reviewer.md with diff, hunts every
kind that applies, from whole tree, each finding a scenario (who does
what, in which order, what breaks). Scenario cheap to run gets probe
spec failing on head commit. "No findings" means each applicable kind
checked - name them in one line.## Assumptions. Decide, don't delegate. Spec
silent → pick reading ticket, repo's conventions, user's
earlier words imply, build it, name pick under ## Assumptions - never
"open decisions" section for reviewer to settle, never stop. Only reading
that builds something materially different = question (Phase 1 gate).
Someone already raised it as product call → theirs (review Mode B step 2).Commit: match repo's git log style (Conventional prefix only if repo
does). Concise subject + issue key; body only if truly needed, never wall.
Attribution and hook rules: ../_shared/conventions.md.
Record a fact when it'll matter later (confirm first). Non-obvious bug root
cause that could recur, or cross-service contract decision, earns memory fact -
draft, show, write on OK via corgi memory add … then corgi memory index (see
memory skill). After fix fact, run recurrence check
(corgi memory list --type fix --json; pattern ≥ 3× → write proposal, stop -
never auto-install). No .corgi/memory/ → offer to create; declined → skip.
Never put secret in fact.
Multi-service (one issue → N repos → N PRs):
corgi run --services <producer> --with-deps --detach # or: corgi run --detach
corgi status --ready --service <producer> # block until healthy
Until up, consumer's generated types stale → won't typecheck. Producer from
depends_on_services/exports graph (Phase 0). corgi stop when done. Producer
in worktree? corgi run serves path: (main checkout) by default - add
--service-dir <producer>="$W" to run worktree's
code (Phase 3).<base>), so schema or contract there to build against; nothing waits for
producer's merge. After producer lands, rebase consumer onto <base>, say
so (../_shared/conventions.md › Gates).Per repo, forge from Phase 0. <dir> = repo's working dir - worktree dir
($W from Phase 3) if worktree'd, else checkout. Push,
create draft, attach spec with commands in ../_shared/forge-commands.md
§6, run from inside <dir>. Title <subject> [<issue-key>]; body = what / how / tests /
issue link.
risk skill in
stamp mode on it (pre-authorised here - run already passed spec gate, so
print card, no prompt). Card lands at end of description between markers,
tells human flipping to ready how much review needed and
whether mergeable on score alone. Re-stamp after every push in
Phase 5.5 loop so score follows diff. Multi-repo → stamp each PR/MR; set's
score = maximum, contract lines go on every side.../_shared/forge-commands.md §6 (GitHub gh pr checks --watch, GitLab
glab ci status).Code Review/In Review state (later started-type or
custom, from list_issue_statuses); Jira transition whose target named
In Review/Code Review (getTransitionsForJiraIssue). No such state → leave
In Progress. Idempotent; skip no-ticket/blocked. Multi-repo → move once all
PRs open, not per-repo. Best-effort: tracker↔forge automation may treat
draft PR as in progress and revert move - review state sticks only once
PR marked ready. Set once; don't fight revert.before-after run with PR as target), or when
verification shot shows reviewer something diff can't. Asked for screenshots
with no place named → ticket, not here. Shot that only served own check
needs no attachment - one line in ## Evidence ("verified on iPhone 16 sim")
enough. When they go in, attach way
../_shared/forge-commands.md §6a says - corgi assets push <files> --key <key> --dir <repo> puts them on repo's pr-assets/<key> branch and prints
 lines to paste (GitLab may use
project upload instead) - paste exactly what it printed. Never raw.githubusercontent.com (empty box on private repo), never local path, never image on PR branch
(gone after merge). Shots go in table, one line naming device, environment,
account, what to look at. Ticket-bound screenshots go into ## Spec
comment through tracker's own upload (§6a) - forge link unreadable there.corgi surface --branch <branch>
(or corgi_diff with surface: true) prints ## Changed surface block.
--branch (here and on docs check below) finds any git worktree on that branch,
corgi worktree add ones included. corgi older than 2.35.4 sees only
worktrees it made itself, fails with no worktrees exist for branch - then
corgi upd, or write block from git -C <worktree> diff <base>...HEAD per
repo. Block lists exported symbols, routes, contracts, migrations,
config PR changed, removals and signature changes marked breaking. Paste first - reviewer reads it before diff; breaking line with no caller updated in
same batch = bug you should've caught here. Re-run after every push
in Phase 5.5 loop.corgi docs check --branch <branch> lists
every Markdown file mentioning symbol or route batch changed, and
every file:line pointer in CLAUDE.md or .claude/rules no longer
landing. Fix ones change made wrong in same PR; list rest under
Deferred with file name. Stale doc = bug reviewer can't see
in diff.## Evidence
section with (1) changed files with reason each - one line per file or
group, why changed, not what; (2) commands run + results -
test, build, check commands verbatim with pass/fail, so reviewer can
re-run exactly; (3) tests → acceptance criteria - each new or changed
test mapped to criterion it protects, core flow first; criterion with no
test says so; (4) known limitations + residual risk - what left out,
what could still go wrong, one line each. Facts only, no adjectives; skip
nothing done, invent nothing not done. Multi-repo → per PR, own
files. Before Deferred list and risk card.## You do in the body - every step only person can do (statement on
hosted database, flag, deployed env value, console click), numbered, with
exact value and when it runs; same block goes on ticket's spec comment,
final report ends with it (../_shared/conventions.md › Steps only a person can
do). None → omit section.corgi run --service-branch <svc>=<branch> … --with-deps (Per-story lines) so
reviewer spins branch up without hunting.Deferred in the body - one line per deliberate shortcut from Phase 3
(<what> · ceiling: <limit> · revisit when: <trigger>), one line per thing
ladder left out with rung that covered it. Omit section when nothing; never pad. risk card reads it, so ceiling below today's load
= Check line, not surprise.Phase 3.5 reviewed each story's raw diff mid-flight; this = closing check on
actual PRs/MRs - run review skill (/corgi-review engine) on
every PR/MR this run opened, don't just hand reviewer hint line. Skip
blocked/failed stories.
0 findings - clean. or
totals line with 0 blocking (declined nits don't keep loop
alive). Cap ~3 rounds; still blocking → stop looping, surface open findings
as needs attention in report (Stop rule).review skipped or
✗ review open - round <n>: stopped by user.Default: PR/MR stays draft, human flips. Workspace opts in with line in CLAUDE.md such as "mark agent PRs ready when done" - no line, no flip. Opted in → flip per PR/MR, only when every one holds:
0 blocking), not stopped or capped.needs attention.Then gh pr ready <url> / glab mr update <iid> --ready, plus follow-up
workspace CLAUDE.md names (manual CI job to play, reviewer to request). One story
failing checks keeps only that story's PRs in draft; rest still flip. Say which
flipped and which stayed in report.
Report = summary skill's shape (Phase 6): one ## [<issue-key>] <title>
block per story, table row per repo with PR/MR as markdown link and state
with nuance. No-ticket → short [<slug>] tag as key. Under each block:
Run line → after link(s), one copy-paste corgi run spinning up every
impacted service on its branch via --service-branch <svc>=<branch> (corgi builds
worktree from pushed branch - reviewer needs nothing else). Same <branch>
across repos. --with-deps so deps/dbs come up. One --service-branch per service.
Skip blocked/failed. Same line for you + reviewer - branch committed now,
no --service-dir variant needed.
(--service-dir at live impl worktree belongs to Phase 3 gate, code still
uncommitted.)
Review hint → after link(s) per actionable (non-blocked) story, one line
per PR/MR: ↳ review it: /corgi-review <pr-or-mr-link> - hands reviewer to
review skill (checks diff against repo standards + ticket, posts inline
suggestions). Skip blocked/failed.
CI line (when watched) → one line per PR/MR after link: ✓ CI green or
✗ CI red - <failing job>. Omit if CI not watched.
Risk line → one line per story after link(s): risk N/10 <tier> · auto-approve: yes|no - <reason> (set's maximum for multi-repo). Exactly
risk skill's gate line, so reader - or autopilot - can sort batch by it.
Review line → one line per PR/MR after link: ✓ review clean (<n> rounds),
✗ review open - round <n>: <short finding or "stopped by user">, or
review skipped when phase skipped up front (Phase 5.5 - one canonical
form, no variants).
Blocked / failed → no link, one line:
[<key>] <Service>: BLOCKED - <decision needed> (or needs attention - <reason>, +
worktree path if partial work parked there).
Review-channel blurb (print it last, every run) - one part leaving terminal, never make user ask → terse. No pitch, no root-cause paragraph, no emoji, no "please review" - link unfurls; channel convention terse.
<Service>: <short title> then bare
PR/MR link.<short title> line for whole change,
then one <repo>: <bare link> line per repo.Profile: phone field + validation localized
api: https://github.com/<org>/api/pull/<n>
web: https://github.com/<org>/web/pull/<n>
api: fix pagination cursor on empty page
https://github.com/<org>/api/pull/<n>
Example (rendered as markdown, not fenced):
## [ABC-200] Add phone field to user
| Repo | PR | State |
|---|---|---|
| api | [#41](https://github.com/<org>/api/pull/41) | OPEN - draft, CI ✓ |
| web | [#37](https://github.com/<org>/web/pull/37) | OPEN - draft, CI ✓ |
risk 7/10 high · auto-approve: no - cross-service contract
✓ review clean (1 round)
↳ review it: /corgi-review https://github.com/<org>/api/pull/41 https://github.com/<org>/web/pull/37
▶ corgi run --with-deps --service-branch api=feature/ABC-200/user-phone --service-branch web=feature/ABC-200/user-phone
## [ABC-125] api - BLOCKED - which auth scope gates the endpoint?
Phase 3's worktrees live under .corgi/corgi_services/.worktrees/. Don't run
corgi worktree prune for this - it also removes clean worktrees other sessions are
still using. Remove only yours, one per story per repo, each carrying
node_modules symlink and checked-out branch.
Clean after report, once every branch pushed - branch lives on remote, removing worktree loses nothing:
git -C <dir> worktree remove "$W" # no --force
git -C <dir> worktree prune # drop the admin entry
Rules:
--force here. Plain remove refuses worktree with uncommitted or
untracked changes; refusal = signal something not committed. Report
path, leave it - don't discard work to tidy up.node_modules symlink, never main
checkout's real directory.git -C <dir> worktree list shows every one still
registered, stale entry whose dir gone clears with worktree prune.Per-story lines above = report's content - render them, never prose write-up around them. Findings essay not hand-back: nothing in it can be pasted anywhere.
Hand batch back in summary skill's shape: one block per ticket, table
row per repo, PR/MR as markdown link, state carrying nuance (MERGED ✓,
OPEN - auto-merge armed, OPEN - 2 unresolved threads). Re-read each PR/MR and ticket
live, don't report what this run did to them - auto-merge fires and pipelines
turn red between push and report, stale row always the one that
matters.
Lead with anything still needing user: blocked story, missing credential, manual job to play, open question. Then tables, then tracker roll-up. Include what Phase 5.5 review caught in this run's own work, one line each - highest-signal part, easiest to quietly drop.
Never wrap in fenced code block: renders monospace, kills every link.
Announce in chat, once, when PRs/MRs were opened (after Phase 5.6, so flipped PR
announced ready): run
corgi agent chat announce "<[KEY] story title>" <pr-url> <pr-url> … with every PR/MR
this run opened (one call per story), bare URLs only. Posts title, then link
alone for one PR or one repo: link line per PR for several, in workspace's review channel, in voice workspace configured; no
review channel configured → prints one line, posts nothing - don't work around
that, never post with chat post yourself. Skip for story that opened
nothing, and for re-run whose PRs announced before.
superpowers:subagent-driven-development /
dispatching-parallel-agents), one per branch, scoped to spec + shared
note. Orchestrator stays gate-keeper, collects reports + reviews. Chunk huge
batch.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
corgi, ticket-management, pr-management, workflow-automation
npx claudepluginhub andriiklymiuk/corgi --plugin corgi33 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).Other plugins' skills for the same job