/claude-engineering-skills:cyclefrom Claude Engineering Skills
End-to-end feature cycle orchestrator. Runs the full skill chain in sequence: /plan → /audit-plan → (wait for human implementation) → /audit-code → /persona-test (if frontend/full-stack) → /ux-lock (if fixes shipped) → /ship-checked. Use when starting a new feature or non-trivial fix and you want the whole workflow on autopilot. Supports resuming from an existing plan or straight to code-audit, per-step skips, max-round pass-through, an opt-in autonomous mode that implements + audits each plan cluster (the default still pauses for the human), and a remediate mode that fixes triaged persona-test/audit findings against an accepted plan with a focused audit and a rerun of only the affected journeys. Triggers on: "run the full cycle", "do the whole flow", "plan + audit + ship", "feature cycle", "remediate the persona findings", "/cycle". Full command syntax: see the Usage section in this skill.
Ships in Claude Engineering 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.
Read when SKILL.md points to them.
Worktree preflight — in a linked git worktree the gitignored tooling tree
scripts/.claude-skills/is absent (git worktree adddoes not populate it), so every command below that uses it dies onMODULE_NOT_FOUND. Runnpm run skills:hydratefirst; if no such script exists,references/worktree-preflight.mdholds the entry to add (ask the user first: it editspackage.json). Keys are not copied: put them in~/.audit-loop.env, which every worktree reads.
Usage: /cycle <task-description> — Full chain from scratch
Usage: /cycle plan <plan-file> — Skip /plan only; still audits the plan, then the implementation gate
Usage: /cycle code <plan-file> — Skip to code-audit-then-ship (plan accepted, code written)
Usage: /cycle remediate <plan-file> --from persona-test <report.md> [--persona-url <url>] — Fix triaged P0/P1s against an accepted plan; focused audit; rerun affected journeys only
Usage: /cycle remediate <plan-file> --from audit <result.json> — Same, sourcing HIGH findings from an audit result
Usage: /cycle <plan-file> --no-persona — Skip persona-test step
Usage: /cycle <plan-file> --persona-url <url> — Explicit persona-test target (local dev server, no PERSONA_TEST_APP_URL needed)
Usage: /cycle <plan-file> --no-uxlock — Skip ux-lock step (no UI changes)
Usage: /cycle <plan-file> --no-ship — Stop after audit; don't commit or push
Usage: /cycle <plan-file> --max-rounds N — Pass through to /audit-plan and /audit-code
Usage: /cycle --autonomous <plan-file> — Opt-in: implement + audit each §11 cluster; stops before ship: no push, PR or side session (Step 7)
Usage: /cycle --autonomous <plan-file> --ship — Also push the branch + open ONE PR (never merge)
Usage: /cycle code <plan-file> --cluster <ID> [--baseline-ref <sha>] — Resume one declared cluster (human clustered path)
Usage: /cycle --autonomous <plan-file> --authorize-stale-reaudit — Resume a halted autonomous run; re-process stale clusters
This skill's last line is an end marker naming the skill between em-dashes, after the Reference files table. If that last line is not in your context (context compaction keeps only the start of a skill), re-read
.claude/skills/cycle/SKILL.mdin full before continuing — the later steps still apply.
Chains the existing atomic skills into one workflow so you don't have to remember which to invoke when. Each step is a delegation to the underlying skill — this orchestrator just sequences + waits.
This skill does NOT duplicate logic from the atomic skills. If you
want fine control over a single step, invoke that step's skill directly
(/audit-code, /audit-plan, etc.). Use /cycle when you want the
golden-path workflow without thinking about it.
On a host with no skill-to-skill dispatch, delegate INLINE. Claude Code can invoke
/audit-codeas a command; VS Code Copilot reads the same.claude/skills/tree but has no documented mechanism for one skill to invoke another. Where a step below says "invoke/x", such a host instead opens.claude/skills/x/SKILL.mdand follows it in place, then returns here and continues with the next step.Pass the delegated skill its arguments explicitly — the plan path, the sub-command, the flags.
/cyclealready holds those values, so this is orchestrator-supplied input (rule 0 ofreferences/input-acquisition.md), not inference — omitting them deadlocks an inline cycle (→references/orchestration-rationale.md§No-dispatch — read when the reason is questioned).Four invariants survive the fallback, and a run that breaks one is not a
/cyclerun:
- Step order — the sequence below is unchanged; inlining is a change of mechanism, never of order.
- The Step 3 pause — a default (non-
--autonomous) cycle still stops at the implementation gate. Inlining must not silently turn a paused cycle into an autonomous one.- Skip flags —
--no-persona,--no-uxlock,--no-shipare honoured identically.- Blocked propagation — a
[BLOCKED],AUDIT_NOT_RUNor non-converged result from an inlined skill reaches the Step 8 summary. It must not be swallowed by the skill that ran inline.What inlining is NOT: it is not a subagent and gets no fresh context, so a long inlined skill consumes the parent conversation's budget. Say which steps ran inline in the Step 8 summary, so a reader can tell a dispatched run from an inlined one rather than assuming.
A prerequisite that does not resolve is a stop, not a mid-flow death. /cycle pays for /plan before any audit, so resolve the audit prerequisites HERE: hydrate the helper scripts, then run
node scripts/check-setup.mjsand readaudit route:anddegraded audits:. A fresh worktree has no keys — the route comes from~/.audit-loop.env. If one is absent,references/prerequisite-ladder.mddecides: hydrate and retry, the labelled substitute (not whendegraded audits: forbidden), orAUDIT_NOT_RUNand stop. Say so before generating the plan, and carry theAUDIT_DEGRADED/AUDIT_NOT_RUNlabel into Step 6's ship handoff.
| Input shape | Mode |
|---|---|
/cycle <task description> (no file path) | FULL — generate plan, audit it, wait for impl, audit code, ship |
/cycle plan <plan-file> | SKIP_PLAN — plan exists; skip Step 1 only. Audit it (Step 2), then the Step 3 implementation gate (pause, or implement under --autonomous), audit code, ship |
/cycle code <plan-file> | SKIP_TO_CODE — plan accepted + impl exist; skip Steps 1–3; audit code, validate UX, ship |
/cycle remediate <plan-file> --from <persona-test|audit> <report> | REMEDIATE — plan accepted; skip Steps 1–2; triage the report, focused fixes, focused audit, rerun affected journeys, ship — see Step R |
/cycle <plan-file> (no plan/code keyword) | AUTO — detect by checking if any new code exists since plan was written |
/audit-plan is never skipped by inference. Only the explicit code or
remediate keyword skips it — typing it is the operator's declaration that the
plan is accepted. /cycle does not auto-detect "already accepted and unchanged"
(no record identifies the approved plan content) → references/remediate-mode.md
§"The accepted-plan skip" — read when asked to skip /audit-plan by inference.
Optional flags:
--no-persona — skip /persona-test (use when no live URL or backend-only)--persona-url <url> — explicit persona-test target. Use this for a repo that
only sets PERSONA_TEST_APP_URL for CI/PR-preview but runs a normal local dev
server otherwise (Step 5 would silently skip without it — see Step 5).--no-uxlock — skip /ux-lock (use when no UI changes shipped)--no-ship — stop after audit; don't commit or push--max-rounds N — pass through to /audit-plan and /audit-code--autonomous (alias --implement) — opt-in: autonomously implement + audit each §11 cluster, or the whole plan as one unit when it has no §11 block (Step 3 table). Step 7 stays the human's /ship-checked.--ship — with --autonomous: Step 7 may push + open ONE PR, never merge. Absent, nothing is pushed or published.--cluster <ID> — implement/audit a single declared cluster (human resume path).--baseline-ref <sha> — audit baseline for a resume where no clusterStartRef was captured (work already committed).--authorize-stale-reaudit — resume a halted autonomous run by re-processing exactly the stale clusters.--no-cluster — ignore any §11 block; fall back to the single-audit path.--from persona-test <report.md> | --from audit <result.json> — REMEDIATE only, required: the findings source. --include-p2 widens the persona triage to P2.§11 detection: parse the target plan for an ## 11. Execution Clustering
block. If present (and not --no-cluster), set hasClustering and parse
the clusters + each cluster's derived file scope. This activates the
clustered-execution path (Step 0.7 preflight + Step 3 branch). Absent → the
classic linear flow below, unchanged.
Show kickoff card:
═══════════════════════════════════════
/cycle — [MODE]
Steps: plan → audit-plan → audit-code → persona-test → ux-lock → ship
Skipped: --no-persona, --no-uxlock
═══════════════════════════════════════
(REMEDIATE's card reads Steps: triage → fix → focused audit-code → rerun journeys → ux-lock → ship
and Skipped: plan, audit-plan (plan declared accepted by the remediate keyword).)
Whenever a target plan file already exists (SKIP_PLAN/SKIP_TO_CODE/REMEDIATE/AUTO
modes — anything but a fresh FULL run, where the plan doesn't exist yet), run
it before implementation or shipping proceeds:
node scripts/check-plan-status.mjs --check-deps "$PLAN"
This reads the plan's own - **Depends on**: <path> lines (plan/SKILL.md
Phase 7) — the structured form of a "wait for Cluster X to land first"
coordination note — against each referenced plan's current Status: line.
Exit is always 0 and the output goes to stderr only, so it never blocks the
run; a printed unmet line means a declared ordering dependency has not
landed yet. Read it and decide by hand whether to proceed, hold, or
sequence with whoever owns the other plan — this only makes the note visible,
it cannot know whether proceeding anyway is actually safe.
→ references/orchestration-rationale.md §Step 0.5 — read when the check's purpose is questioned.
hasClustering; fail-closed)Validate the §11 block before any execution — /cycle code <plan>
reaches here without having passed /audit-plan, so this is the
execution-time safety net (the second of two validation layers). Check:
fix-gate value in {yes, final, none}; Coupling: present on each cluster;Final gate line present;Files: + tagged Additional files:) is non-empty and fully intent-tagged, validated per cluster against that cluster's gateStatus in the state record, NOT the global /cycle mode: a pending/absent cluster uses pre-implementation expectations ((modify)/(delete) resolve on disk; (create) has a resolvable parent dir, no collision, no sensitive-path); an audited/gate-clear/stale cluster uses post-implementation expectations ((create)/(delete) already done — no false collision on resume).On any failure: stop, present the defect, offer (1) correct the plan or
(2) --no-cluster fallback to the single-audit path. Never silently
proceed with a malformed block.
Invoke /plan <task description>. The unified /plan skill auto-detects
scope (backend / frontend / full-stack) and produces one consolidated
plan document at docs/plans/<descriptive-name>.md.
On failure: surface the error and abort. Don't proceed to audit.
Invoke /audit-plan <plan-file>. Iteratively refines the plan with
GPT + Gemini final gate. Max 3 rounds; rigor-pressure stop.
On verdict:
APPROVE (Gemini) → proceed to Step 3CONCERNS after Gemini round 2 (cap) → present to user, ask: "Plan has remaining concerns from final review. Proceed to implementation anyway, fix the plan first, or stop?"REJECT → present to user, recommend stopping the cycle to reviseDecision table (one source of truth — the bullets below elaborate). The gate is a
pure function of three inputs: the parsed mode, whether the plan carries a §11 block
(hasClustering), and the --autonomous flag. Only SKIP_TO_CODE means the human
already implemented, so only it bypasses the gate (straight to Step 4 audit).
SKIP_PLAN skips Step 1 alone — its plan has been audited in Step 2 but not
implemented, so it meets this gate exactly like FULL. REMEDIATE never reaches
this step; its own remediation gate is Step R.
| Mode | hasClustering | --autonomous | Action |
|---|---|---|---|
| FULL / SKIP_PLAN (plan generated/audited, not yet implemented) | no | no | Pause for the human (card below) |
| FULL / SKIP_PLAN | no | yes | Degenerate single-cluster autonomous (whole plan as one unit) |
| FULL / SKIP_PLAN | yes | no | Pause + print cluster guidance; resume --cluster <ID> |
| FULL / SKIP_PLAN | yes | yes | Step 3C clustered autonomous loop |
| SKIP_TO_CODE (already implemented) | any | any | Empty-diff guard first (below); then no gate — go to Step 4 audit (per-cluster if --cluster, else union diff) |
--autonomous) → /cycle pauses here for
the human to implement; output the "paused at implementation gate" card below.--autonomous → degenerate single-cluster autonomous path
(do NOT silently fall back to the pause — that contradicts the explicit
--autonomous). A plan below the §7b Gate-1 / §11 threshold is small + cohesive by
construction, so treat its entire implementation as ONE implicit cluster and run
the Step 3C loop over it: implement → /audit-code over the union diff →
fix-gate to convergence → the mandatory consolidated Gemini gate (Step 3C.2) →
close-out → ship. Print one line up front so it's never silent:
plan below the §11 threshold — implementing inline as a single unit (no clustering).
The same within-cluster auto-fix authorization applies; a fix needing files outside
the plan's declared §7/§7b scope still stops for confirmation.--autonomous) → still pauses, but prints the
cluster plan as implementation guidance and instructs the operator to
implement only the next cluster, then resume with /cycle code <plan> --cluster <ID> (the --cluster arg is required on every human resume
— /cycle does not auto-divine the next cluster). On resume, Step 4 runs
the per-cluster audit (see Step 3C). If the operator implemented
several clusters at once (per-cluster isolation impossible), /cycle says
so and falls back to a single union-diff audit.--autonomous → enter Step 3C (the implement-and-audit
cluster loop). This is the explicit authorization that relaxes the
"never auto-fix" hard rule, scoped to within-cluster fixes.code assumes the human already implemented — but an approved-but-unimplemented
plan (e.g. resumed straight after /audit-plan, zero commits since) yields an
empty implementation diff, and auditing nothing returns a misleading green.
So before Step 4, compute the diff base (the plan's commit, or --baseline-ref,
else the dirty-aware base /audit-code uses) and check it's non-empty.
POSIX shell only (Git Bash on Windows), not PowerShell:
BASE=$([ -n "$(git status --porcelain)" ] && echo HEAD || echo HEAD~1) # or the plan commit / --baseline-ref
[ -z "$(git diff "$BASE" --name-only)$(git ls-files --others --exclude-standard)" ] && echo EMPTY
If empty → do NOT audit a no-op. Tell the operator the plan looks
unimplemented and offer the fork, naming the EXACT command for each side
(adding --autonomous to a code run does nothing): (1) re-run as
/cycle plan <plan-file> --autonomous (let /cycle implement it), or
(2) implement manually then re-run /cycle code <plan-file> unchanged.
→ references/orchestration-rationale.md §Step 3 — read when the guard or the fork is questioned.═══════════════════════════════════════
/cycle paused at implementation gate
Plan: docs/plans/<name>.md
Resume with: /cycle code docs/plans/<name>.md
═══════════════════════════════════════
hasClustering).audit/cycle-cluster-state.jsonDurable, gitignored, lock-guarded (lock-acquire failure → stop, no racy
overwrite); one record per cluster with gateStatus: pending|audited|gate-clear|stale.
A gate-clear cluster flips to stale if any derivedScope file hash or its
scopeHash changes. → references/clustered-execution.md §Cluster execution
state — read before the first read or write of this file in a session.
State-driven + resumable: read state first, skip gate-clear clusters.
For each remaining cluster in declared order:
Implement the cluster's member-file phases.
Budget: no runtime splitting in v1 — /audit-code on the derived scope handles large diffs itself. /cycle only enforces never merge across a declared boundary.
references/clustered-execution.md §Optional author-tier — read when a cluster has author-tier:.Audit envelope: capture clusterStartRef (vcs.gitCommitSha) when implementation begins, write the cluster's derived scope one-path-per-line to a scope file, then run the two commands below. On a resume with no recorded clusterStartRef, require --baseline-ref <sha> or fall back to union-diff — never default the base to HEAD (empty diff = silent skip). Round policy is /audit-code's cap; on exit 4 META_* run its printed debt command (references/meta-review.md).
--filesis the ONLY flag that scopes the audit (--changed/--diffnever bound what the model reads), and it is the declared scope ∩ what CHANGED — never compute it by hand (→references/clustered-execution.md§Why--files— read when the scope flags are questioned).
# 1. Base, reconciliation set, allowlist (declared ∩ changed, on disk), admission, patch, audit argv.
# EXITS NON-ZERO on an out-of-scope edit or an unadmittable/comma-unsafe path: STOP, show stderr.
node scripts/cycle-cluster-scope.mjs --base "$CLUSTER_START" --scope-file "$SCOPE_FILE" --plan "$PLAN" --out-dir .audit --cluster "$ID" --json > "$SCOPE_JSON"
# 2. Same call + --audit: recomputes the scope and runs the WHOLE argv it built; never hand-build
# audit flags (a hand copy dropped --base). Audit's exit code. R=1; rounds 2+ also pass --round $R --ledger ….
node scripts/cycle-cluster-scope.mjs --base "$CLUSTER_START" --scope-file "$SCOPE_FILE" --plan "$PLAN" --out-dir .audit --cluster "$ID" --audit -- --out ".audit/$SID-r$R-result.json"
# --files: THE scoping allowlist · --changed: R2+ reopen detection, does NOT scope
# --diff: hunk evidence, does NOT scope · --base: stamps _diffBase for the final reviewer
Use the returned sets as returned. emptyAllowlist: true → the consolidated gate, never a vacuous pass. Each
unchangedDeclared path: over-declared or a MISSED edit? Settle it before the cluster is done → references/clustered-execution.md §Two sets.
4. Fix-gate: fix-gate: yes → reach /audit-code convergence (HIGH==0 && MEDIUM<=2 && quickFix==0) over this cluster's IN-CLUSTER findings (see 4a) before the next cluster; none skips; final defers to the consolidated gate. Within-cluster fixing is authorized; a fix needing files outside the cluster's scope → stop for confirmation (mark any touched gate-clear cluster stale). Persistent non-convergence → hand back with a summary.
3a. clusterStartRef is validated ON USE. Run
git merge-base --is-ancestor <clusterStartRef> HEAD before it becomes a
diff base. On a non-ancestor (a concurrent session moved HEAD), halt and
report; never demote to the dirty-aware default (it widens the range).
→ references/clustered-execution.md §3a — read when the base check is questioned.
4a. The gate scores IN-CLUSTER findings only — otherwise no cluster but the last can ever pass (→ references/clustered-execution.md §4a — read when in-cluster scoring is challenged). Classify every finding by the cluster owning its cited file — mechanical, from the derived scopes:
| Cited file is in… | Class | Effect on THIS gate |
|---|---|---|
| this cluster's derived scope | in-cluster | gates — fix it, pre-existing or not |
| a later cluster's derived scope | deferred-declared | does not gate; must be zero at the final gate |
| an earlier cluster's derived scope | regression | gates — that cluster is now stale; go to step 5 |
| no cluster's derived scope | out-of-scope | unchanged: fail closed per step 3 |
Three properties stop this becoming an escape hatch, and all three are load-bearing: (1) deferral is bounded — deferred-declared means "owned by a LATER cluster", and the final cluster has none, so the bucket is empty there by construction and every deferred completeness finding must be satisfied before Step 3C.2; (2) "pre-existing" is still not a defer reason — these buckets are about plan SCHEDULE, never authorship, so AGENTS.md's impact test applies unchanged to anything in-cluster; (3) the classification is derived, never argued — a finding cannot be talked into a friendlier bucket. Every deferred-declared finding is listed in the cluster's hand-back summary with the cluster that owns it — a deferral nobody can see is indistinguishable from a dismissal.
Convergence test scope — run the BROADEST suite, not unit-only (load-bearing for destructive clusters). When "iterate to green" runs the project's tests at the cluster boundary, use the widest command the repo defines (test:all / test:integration / test:e2e — fall back to plain test / the full node --test), never test:unit alone (→ references/clustered-execution.md §Why the broadest test suite — read when a unit-only green is proposed). A cluster is "green" only when the integration tier passes; a test:unit-only green on a destructive cluster is a false-green and does not clear the fix-gate.
4.5. Finalize outcomes (deterministic capture — WS1): once the cluster's audit has converged AND its findings are triaged (the adjudication ledger carries terminal accepted/dismissed/severity_adjusted outcomes), call once per converged audit:
node scripts/cross-skill.mjs finalize-outcomes --run-id "$CLOUD_RUN_ID" --ledger "$FINAL_LEDGER_JSON" --result "$FINAL_ROUND_RESULT_JSON"
The run-id is the audit's _cloudRunId (on the --out JSON); → references/clustered-execution.md §4.5 — read when asked what it captures. Cloud-off → it no-ops with a hint; an unknown run-id is a hard error. Skip only when the audit produced no cloud run (cloud off).
5. After the loop: if any gate-clear cluster went stale, halt + summarize; resume only with --authorize-stale-reaudit, which re-processes exactly the stale clusters (their out-of-scope reconciliation ignores files owned by other clusters, since later clusters legitimately committed since the old baseline). No autonomous loop-back.
The loop only iterates §7b phases, so the plan's unclustered close-out
(e.g. npm run skills:regenerate + npm run skills:check, build/codegen)
would never run. After the last cluster clears and before the
consolidated gate, parse and execute the plan's close-out step(s),
surfacing failures. (Human path leaves close-out to the operator.)
First, the deferrals come due. Step 4a lets a cluster defer a finding that
belongs to a later cluster; this is where that debt is settled, because there
is no later cluster left. Before invoking the reviewer, re-check every
deferred-declared finding accumulated across the run: each must now be
satisfied (the file exists, the migration ran, the phase landed). Any that
remain are the plan's own §7b work, unimplemented — halt and summarize rather
than asking Gemini to bless an incomplete change set. This check is what makes
4a a deferral instead of a dismissal, so it is not optional and not
Gemini's job.
After all clusters (+ close-out), run one Gemini review over the
union diff — mandatory regardless of per-cluster GPT convergence, and a
closed loop driven by the result's code-computed gateDisposition (not the
verdict word): approve → done; approve_with_debt → done, capture the
non-blocking findings with node scripts/debt-auto-capture.mjs --final-review .audit/$SID-gemini-result.json;
blocked → deliberate, apply fixes scoped to the union diff (the per-cluster
out-of-scope stop does NOT apply here — no active cluster; touched gate-clear
clusters are flagged stale for the next run), re-run as round 2 with
--round 2 --prior .audit/$SID-gemini-result.json (the round-1 --out).
Max 2 consolidated rounds — a hard cap enforced by gemini-review.mjs,
which refuses --round 3. A round-2
blocked is handed back to the user with its named blocking items (a concrete
design/correctness defect: fix it, then escalate — see gemini-gate.md);
implementation-completeness nits ("specify the store step", parameter
placement) are non-blocking by definition and close as debt, since the classic
/audit-code path (Step 4) already verified the code against the real
implementation. Exit on approve/approve_with_debt, the capped stop, or
explicit handback. Never replaced by GPT rebuttal.
Between consolidated rounds, apply gemini-gate.md's Step 7.1 deliberation
protocol exactly — this closed loop is the SAME one, not a second one. For
each CONCERNS/REJECT finding decide ACCEPT / PARTIAL / CHALLENGE (a
CHALLENGE must cite evidence); fix the accepted findings; then rebuild the
transcript before re-running Gemini, passing --summary describing what
round 1 decided per finding — fixed, or challenged-and-why; without it round 2
re-raises the same findings. → references/clustered-execution.md §3C.2 round 2 — read when round 2 repeats round 1.
Invocation: build the
transcript the way /audit-code does (changed_files=union file set,
accumulated per-cluster findings as the rounds[] trail), then
node scripts/gemini-review.mjs review <target> <transcript.json> --batch --out … (--batch: a union diff too big for one envelope) —
reuse /audit-code's transcript path, no new gate machinery. Pass one
--ledger <path> per cluster (.audit/$CLUSTER_SID-ledger.json each) —
build-audit-transcript.mjs's --ledger flag is repeatable (mirroring
--result); one ledger alone drops the other clusters' resolutions
(→ references/clustered-execution.md §3C.2 one --ledger — read when a cluster's resolutions are missing). Concrete transcript
shape + the no-GEMINI_API_KEY degradation ladder (Opus fallback → independent
adversarial agent over the union diff → only-then skip) are in
references/gemini-gate.md (the same contract /audit-code's Step 7 follows) — when no provider key is present, run the
independent-agent substitute rather than skipping the mandatory gate. Generated
.claude/skills/** copies are byte-verified by skills:check, not
re-reviewed. Then continue to Step 5 (Step 7 still ends even a fully autonomous run in the blocked handoff).
For narrow defects found after a ship, against a plan already accepted: replaying the whole chain re-plans, re-audits the plan and audits the whole dirty tree. REMEDIATE runs instead, in order, and nothing else:
/plan, no /audit-plan; Step 0.5 still runs.--from report into a fix list (persona P0/P1, or audit
HIGH, by default) and record it in the plan's ## Implementation Log.--autonomous. Capture the base before the first edit./audit-code — --files pinned to the fix files + the plan
via scripts/cycle-cluster-scope.mjs, which exits non-zero on any edit outside
that set. Never a whole-dirty-tree diff. Caps unchanged: 6 audit rounds,
2 final-review rounds./ux-lock,
then Step 7's blocked ship handoff — never autonomous.The commands, triage table, resume card, rerun verdicts and summary card are in
references/remediate-mode.md — read it before R2.
Invoke /audit-code <plan-file> (default --scope=diff). Multi-pass
parallel GPT audit with R2+ ledger suppression and Gemini final
review. Max 6 rounds; quality threshold HIGH==0 && MEDIUM<=2 && quickFix==0.
On verdict:
CONVERGED → proceed to Step 5INCOMPLETE (passes timed out) → present to user, offer: continue with partial / re-run with higher timeout / stopSolo author-model control needs no /cycle action → references/orchestration-rationale.md
§Step 4 — read when asked whether /cycle triggers it.
Detect whether persona-test is applicable:
backend only--no-persona flag passed/persona-test itself uses
(Phase 0b): --persona-url flag → PERSONA_TEST_APP_URL env → (in
--autonomous mode, where there's no human to ask) a running local dev
server if one is detectable, else skip (→ references/orchestration-rationale.md
§Step 5 — read when tempted to resolve from the env var alone). If no
target resolves by any of these, do not skip silently — print
Step 5 skipped — persona-test has no target (PERSONA_TEST_APP_URL unset; pass --persona-url <url> to run it) in the Step 8 summary so the gap is
visible rather than assumed-away.Before driving the browser, resolve whether persona-test can actually GATE here — call the seam, don't re-decide in prose (the decision is a tested function):
node scripts/cross-skill.mjs preview-gate --format human
Act on the directive:
[HALT] (previewGateMode: pre_merge_required) — a preview env exists and MUST gate.
Run persona-test against the preview --url and halt before merge/ship until it passes;
do not let Step 7 ship on a failed/again-skipped persona run.[WARN] (post_merge_warning — deploy-from-main / no preview) — surface the warning
prominently: persona-test here is POST-HOC and cannot prevent prod exposure; its P0/P1
findings are fast-follow, NOT a gate. Proceed, but say so in the Step 8 summary.[OK] (not_applicable, default) — silent; proceed normally.Invoke /persona-test <persona> <url> — drives a browser as a registered
persona, collects P0–P3 findings.
On verdict:
Ready for users → proceed to Step 6Needs work because of authWallUntested
(persona-test hit a login wall with no auth bootstrap configured — the
remedy is /persona-test's auth-bootstrap setup, not a /cycle step) → this is not a
clean pass; it means the run never reached the app's primary
authenticated surfaces. Surface this explicitly in the Step 8 summary
(don't silently read "0 P0" as "proceed") and proceed only as a WARN,
same posture as the [WARN] deploy-topology case above./audit-code round (under [HALT], a P0 blocks ship until fixed)For each HIGH finding fixed in Step 4, AND each P0/P1 fixed in Step 5,
invoke /ux-lock to generate a Playwright spec that locks the fix.
Skip if no fixes were applied OR --no-uxlock flag passed OR backend-only
scope.
/ship-checkedcannot actually be invoked from here — by design, every time. Its frontmatter carriesdisable-model-invocation: true, which refuses ANY programmatic call, even from inside/cycle's own orchestration;--autonomousdoes NOT authorize shipping (references/orchestration-rationale.md§Step 7).Without
--ship, nothing is pushed or published: nogit push,gh pr createor side session, whatever a brief or plan step says; commits stay local. With--ship: push the branch, open ONE PR, never merge, thennode scripts/ci-merge.mjs --pr <n> --wait-onlyinto the done report (references/ci-wait.md).So Step 7 always ends in a blocked handoff (after the push + PR when
--ship), never "Invoke it." Show this card and stop — name the plan path so the human never has to go hunting for it (a bare run with no argument is a second manual step, not a resume command):═══════════════════════════════════════ /cycle blocked at Step 7 (ship) /ship-checked requires explicit user invocation — it cannot be called programmatically, even from /cycle's own orchestration. Resume with: /ship-checked docs/plans/<name>.md ═══════════════════════════════════════
═══════════════════════════════════════
/cycle complete — <PLAN-NAME>
Plan: docs/plans/<name>.md
Audit-plan: 3 rounds, APPROVE
Clusters: A in-cluster H:0 (2 deferred→C); B in-cluster H:0 (autonomous) ← only if hasClustering
Audit-code: 4 rounds, CONVERGED, H:0 M:1 L:2 ← classic path (no §11)
Final review: APPROVE (<provider> / <model>) over union diff ← only if hasClustering
Persona: 0 P0, 1 P1 (deferred)
UX-lock: 2 specs generated
Ship: BLOCKED — run: /ship-checked docs/plans/<name>.md
Total time: 18m
Total cost: ~$1.40
═══════════════════════════════════════
The Ship: line is BLOCKED unless the user already ran /ship-checked themselves in
this same turn — Step 7 can never invoke it (see Step 7's note), so
"commit abc1234 pushed to main" is only correct after the human has actually
typed /ship-checked docs/plans/<name>.md and it completed. Never print a commit sha
here on the assumption that Step 7 "ran" — it didn't.
If any step was skipped, note why. If any step exited non-success, surface as a warning at the top. For clustered runs, show the per-cluster gate result and the preflight outcome.
--autonomous mode, where the opt-in flag authorizes within-cluster fixes
scoped to the active cluster's derived file set (summaries still surfaced;
cross-cluster fixes and persistent non-convergence still hand back)./audit-plan unless explicitly in SKIP_TO_CODE or REMEDIATE mode. SKIP_PLAN skips /plan, not /audit-plan. Never infer "already accepted" — there is no mechanical record of which plan content was approved (Step 0)./audit-code unless explicitly in SKIP_TO_SHIP mode (not currently exposed; reserved). REMEDIATE focuses it; it never skips it./cycle pauses at the implementation gate (Step 3); only the opt-in --autonomous flag implements code, and it never activates silently.--autonomous never pushes or publishes without --ship — no push, PR or side session (Step 7)./cycle reads the §11 block; it never authors or merges clusters — it may split-equivalent (defer oversized diffs to /audit-code's map-reduce) but never merges across a declared boundary. Clustering is the plan's job.deferred-declared finding survives the run.This skill's canonical flow is above. The files below cover specialised situations — read them only when the trigger applies.
| File | Summary | Read when |
|---|---|---|
references/input-acquisition.md | Where a skill's arguments come from on any host, and what to do when there are none. | The no-dispatch fallback — passing an inlined skill its plan path, sub-command and flags as orchestrator-supplied input (rule 0). |
references/prerequisite-ladder.md | Step 0 prerequisite ladder — absent helper bundle or auditor route, and reporting a run that did not happen. | Step 0 — an audit prerequisite did not resolve (helper scripts missing, no GPT route), OR about to report a run that degraded or did not happen. |
references/verification-discipline.md | Verification discipline — pinned citations, figure provenance, two-direction proof, attribution, consumer-side checks. | Reporting a degraded or substituted run — §7's coverage rule, which the prerequisite ladder's census rows cite. |
references/gemini-gate.md | Step 7 Gemini independent review protocol — transcript, verdict handling, re-review loop. | Autonomous mode's consolidated Gemini gate, OR no GEMINI_API_KEY (the ladder picks the substitute). |
references/meta-review.md | Automatic meta-review at the round cap: triggers, guard, records, overrides, opt-out. | Exit 4 META_*, or a round admitted. |
references/remediate-mode.md | REMEDIATE mode — fix triaged post-ship findings against an accepted plan without replaying the full cycle. | The mode is REMEDIATE (Step R), OR the user asks to skip /audit-plan because the plan is already accepted. |
references/clustered-execution.md | Step 3C detail — cluster-state schema, author-tier hint, scope-flag incident, 4a measurement, round-2 rationale. | Step 3C — first read/write of .audit/cycle-cluster-state.json, an author-tier: hint, OR a cluster's scope, class or gate is contested. |
references/orchestration-rationale.md | Why /cycle's linear steps are shaped as they are — inline dispatch, plan deps, empty-diff guard, persona URL, ship. | A linear step's rule (Steps 0–7, outside 3C) is questioned or looks safe to skip. |
references/ci-wait.md | Step 7 CI wait - every check on the pushed head, into the done report; no merging. | Step 7 - a PR was pushed; before the done report. |
references/worktree-preflight.md | Worktree preflight remedy — the skills:hydrate npm script to add when a linked worktree lacks the tooling tree. | A command dies with MODULE_NOT_FOUND in a linked worktree AND this repo has no skills:hydrate script. |
— end of /cycle —
gate-contract.json (opens in a new tab)references/ci-wait.md (opens in a new tab)references/clustered-execution.md (opens in a new tab)references/gemini-gate.md (opens in a new tab)references/input-acquisition.md (opens in a new tab)references/meta-review.md (opens in a new tab)references/orchestration-rationale.md (opens in a new tab)references/prerequisite-ladder.md (opens in a new tab)references/remediate-mode.md (opens in a new tab)references/verification-discipline.md (opens in a new tab)references/worktree-preflight.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
Generated from the plugin's indexed repository (lbstrydom/claude-engineering-skills) — no native marketplace selected
npx claudepluginhub p/lbstrydom-claude-engineering-skills18 skills in this plugin
/ai-context-managementManage AGENTS.md and CLAUDE.md alignment across a repo so Claude, Copilot,
Cursor, Windsurf, and other AI agents share the same project context.
Detects drift, reconciles manually-introduced divergence, and migrates legacy
CLAUDE.md-canonical repos to AGENTS.md-canonical.
Triggers on: "audit AGENTS.md", "check context drift", "AGENTS.md vs CLAUDE.md",
"fix context drift", "migrate to AGENTS.md",
"context sync", "what tools read which file", "ai-context-management".
Usage: /ai-context-management audit — Score drift + report findings
Usage: /ai-context-management reconcile — Apply patches to fix drift
Usage: /ai-context-management migrate — Flip legacy repo to AGENTS.md canonical
/audit-codeIteratively audit code against a plan with GPT + an independent final gate (Gemini, else Claude).
5-pass parallel static analysis (structure, wiring, backend, frontend,
sustainability), R2+ ledger-driven suppression, debt capture for
out-of-scope findings, max 6 rounds with 2-stable-rounds convergence.
Invoke this for ANY code-correctness review, even a small pasted snippet
or diff — don't just review it yourself directly; a single read-through
is not a substitute for the multi-pass GPT + final-gate adjudication this skill
performs, and skipping it means the review didn't actually happen.
Triggers on: "audit my code", "audit my changes", "audit my PR",
"check the implementation", "review my code", "audit code", "/audit-code",
"audit this", "verify the implementation".
Usage: /audit-code <plan-file> — Audit code against plan (--scope diff default)
Usage: /audit-code <plan-file> --scope plan — Audit only files mentioned in the plan
Usage: /audit-code <plan-file> --scope full — Full repo audit