om-pr-autopilot
Repo-local extension of om-pr-autopilot - the PR state is re-read before every push, because a human may merge or close the PR mid-run, and the limits of an unattended run.
SKILL.md.ai/skills/om-pr-autopilot/SKILL.md
GitHubom-pr-autopilot (money-tracker.online)
This file extends the shared om-pr-autopilot skill installed at
.claude/skills/om-pr-autopilot/SKILL.md. Follow its full workflow with the additions below.
Re-read the PR state before every push
Diagnosis reads the PR state once, at the start, but a human may merge or close the PR while the
run works. This rule covers every push the run makes, including those of the skills it chains
that push to the PR head (om-auto-continue-pr, om-auto-continue-pr-loop, om-auto-fix-pr,
om-auto-review-pr --autofix), whether or not their own overrides were read:
- Immediately before each
git pushto the PR head, run get-pr and readstate. Keep the check and the push in one command so nothing runs between them. - Anything other than
OPENstops the run: do not push, release the claim, post one comment saying why the run stopped, and report the commits that were not pushed.
GitHub deletes a merged PR's head branch, and a push to it recreates that branch on the remote.
It happened on #447 (2026-09-24): the PR was merged while the base-merge gate ran, and the push
that followed brought ci/vps-only-runners back.
"Approvable" follows the ruleset
A PR is approvable (state matrix row 9) when no review requests changes, no review thread is
unresolved, and the base branch's ruleset requirements for approvals and code-owner review are met.
With required_approving_review_count: 0 and no code-owner review, that holds without any
approving review: read the ruleset as .ai/skills/om-approve-merge-pr/SKILL.md § Rules says. A
missing approval this run cannot give itself (its own account authored the PR) is not a reason to
stop at merge-ready under --allow-merge when the ruleset requires none.
--allow-merge means a merge into develop only. A PR whose base is not develop, or that
carries do-not-merge, ends at merge-ready under --allow-merge too: the develop -> main
promotion deploys production and is the owner's to merge.
Nothing into develop waits for a person
Owner decision 2026-10-06 (ADR 0031): QA, risk-high and security are judged by specialist
sub-agents, and a rejection goes back to the agents. These rules cover the run and every skill it
chains:
QA runs through the unattended sign-off. Where the chain reaches the QA stage (state matrix rows 7 and 10) of a PR that touches a user-facing surface, run
om-auto-qa-pr {pr} --self-qa-signoff(the repo override ofom-auto-qa-prsays how its panel decides). Row 10 never stops to request a person's sign-off: it runs that QA stage. After a successful sign-off, re-read the QA labels and continue with row 9 under--allow-mergein the same run.A
risk-highorsecurityPR merges on a security verdict. Before row 9 merges one (the label, or the riskSDLC.mdinfers from the diff: a label the author left off does not skip it), whether or not it touches a user-facing surface, asksecurity-tenancy-reviewerthrough.ai/skills/afk-decide/SKILL.mdto judge the diff at the current head, and merge only on its approving verdict, recorded in the PR body's Resolved assumptions table with the head it judged. A refusal is a failed round of the loop below, its findings the fix list. A verdict on an older head does not count: merge withgh pr merge --match-head-commit <the judged head>, so a push after the verdict makes the merge fail instead of landing unjudged code.Every rejection goes back to the agents, three rounds at most. A failed check,
changes-requested, aqa-failedthe QA panel set and a refused security verdict all route toom-auto-fix-pr {pr}with the findings, and then to review, QA and the security verdict again on the new head - never to a stop that asks for a person. Judge the round and the panel label with one command, never by listing comments yourself:node .ai/scripts/qa-panel-failed.mjs --repo {owner}/{repo} --pr {n}That script is the only definition of the predicate.
nextRoundis max(count of survivingAutopilot roundcomments, count oflabeledtimeline events forqa-failedandchanges-requested) plus one — a CI or refused-security round leaves noqa-failedevent, so comments still count; deleting the 🤖 comments cannot reset the cap because the labeled events remain.isPanelQaFailedis true only when the latestlabeled qa-failedevent is followed by a🤖 QA-PANEL-FAILED head:<sha>marker. Row 0c's failed-QA stop applies only whenqa-failedis present andisPanelQaFailedis false; a panelqa-failedroutes toom-auto-fix-pr, which removes that label once its fix is pushed. Each round opens with a 🤖 commentAutopilot round <n>/3: <what failed>usingnextRound. Whenexhaustedis true (the next round would be 4), addblockedand post one comment that starts🤖 HUMAN-ONLY:and lists what each round tried and what still fails: that is one of two ways this loop hands a PR to a person (the other is a gate PR at the merge row). Residual risk: label and timeline events come from the shared account, so the timeline helps against deleted comments, not against a rogue agent.
Gate-path PRs are Rafał's merge
Owner decision 2026-11-02 (ADR 0031 addendum, signed by Rafał): a PR whose file list matches a
gate-path glob is never merged by this skill or by om-approve-merge-pr. The globs and the
detect / fail-closed / hold procedure live in .ai/skills/afk-decide/SKILL.md § 5; this file
does not copy the list. Unattended runs still fix, review, QA, and record a security verdict.
Immediately before state-matrix row 9 under --allow-merge (after those steps), run that
procedure against get-pr-files and the origin/develop copy of afk-decide. On a gate PR
(or fail-closed): apply blocked, post the § 5 🤖 HUMAN-ONLY: comment if a trusted agent has
not already, do not invoke om-approve-merge-pr, stop at merge-ready, and report that
Rafał merges it. Do not apply blocked earlier in the chain. Detection never uses labels,
the author's risk claim, or gh pr view --json files.
A spec PR the plan-to-spec run opened merges
The installed skill treats a spec-only design PR as draft-by-intent
(.claude/skills/om-pr-autopilot/references/state-matrix.md, .claude/skills/om-auto-fix-pr/references/pr-finalize.md),
and om-approve-merge-pr refuses a draft, so a spec-only PR ends at merge-ready and a person merges
it. One kind is the exception, because a specialist panel has approved it before the PR exists, or a
second specialist has settled the one disagreement it left and the PR body says so
(ADR 0030, which amends ADR 0027 and is itself amended 2026-10-11): a spec-only PR that all of these describe merges under
--allow-merge like any other PR into develop:
- its branch is
spec/<slug>and theplan-to-specworkflow orafk-plan-to-specopened it: the panel's verdicts and a Resolved assumptions table are in its body, and its spec's metadata table has aPlanrow where anIssuerow would be; - it is ready for review (a draft is the not-approved path of
afk-plan-to-specstep 5, which also putsblockedon it); - it does not carry
blocked,do-not-mergeor any other hold.
Every other spec-only PR keeps the person's merge, the spec workflow's and a spec task's
(implement-ticket; an Issue row and no Plan row) among them. A docs-only PR on a docs/plan-delivered-<slug> branch (afk-plan-to-spec marking
stages the code already delivers) is not a spec-only PR: no draft-by-intent applies, and it merges
under --allow-merge like any docs-only PR.
Unattended-run limits
These hold for every skill this run chains, whether or not its own override was read:
- A lesson goes into the PR, never outside the worktree. Write it in a
## Lessonssection of the PR body, or of the run handoff when no PR exists, whereafk-lessonscollects it. Never edit~/.claude/CLAUDE.mdor any other file outside the worktree, and never end a run asking a human to move a lesson there: a cezar run is refused that write, and two runs failed trying. - A fix that needs a protected file ends with the patch, not a workaround. Claude Code refuses
writes to
.husky/*,.claude/settings.json,.claude/hooks/*andworker-configuration.d.tsunderdontAsk(ADR 0025). When the fix needs one, do the rest of the work, then put the exact patch for that file in the PR body and the report, together with a configuration guardian verdict from.ai/skills/afk-decide/SKILL.md, so applying it is one step for a human. Never retry the write throughcp,sed, a heredoc or another path, and never route the whole ticket to a human in advance because one file is protected: #480-#482 went to a human only forworker-configuration.d.ts(run ee7c7d1a). - A denied command ends the run, so never try one.
permissions.denyin.claude/settings.jsonrefuses it anddontAskturns the refusal into a failed run: run d232173a (#499) died ongit reset --hard origin/<head>. Use the allowed equivalent (AGENTS.md): move a worktree to a PR head withgit status,git fetch origin <head>, thengit checkout -B <head> origin/<head>(when another worktree holds<head>, a clean task branch takesgit merge --ff-only origin/<head>); after a rebase, merge the base or push a new branch instead of force-pushing (--force-with-leaseincluded); fix what a hook reports instead of using--no-verify. - Never open a file
permissions.denyrefuses to read, not even redacted throughcatorsed: it ends the run the same way (planned.travel run b6eb30ef died oncat .ai/qa/test-env.env). The login'spasswordEnvname is in.ai/qa/test-env.json; load the values withset -a; . "$(jq -r .credentialsFile .ai/qa/test-env.json)"; set +aand use"$TEST_OWNER_PASSWORD"in the command (AGENTS.md). - The dev server URL is
baseUrlin.ai/qa/test-env.json(om-prepare-test-envwrites it). Never derive it from.dev.vars, which the agent never reads. - Required checks stuck at
queued: read the runner pool before waiting. Whengh api repos/<owner>/<repo>/actions/runners --jq .total_countis 0, nothing can pick the jobs up and the wait budget is wasted: apply theci.maxWaitMinutesexpiry procedure at once, and do not push again, becauseci.ymlcancels the queued run of the previous head on every push. #596, #598, #604, #608, #609 and #610 waited on an empty or idle self-hosted pool.