From om-superpowers
Resumes in-progress GitHub PRs from auto-create-pr: claims with concurrency locks, checks out branch in worktree, continues from next unchecked progress step, runs validation and labels.
How this skill is triggered — by the user, by Claude, or both
Slash command
/om-superpowers:om-auto-continue-prThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Resume an `auto-create-pr` run that did not finish in one go. Given a PR number, you re-enter the same worktree discipline, pick up from the first unchecked Progress step in the linked execution plan, and drive the PR to `complete` status with the same validation and label rules as `auto-create-pr`.
Resume an auto-create-pr run that did not finish in one go. Given a PR number, you re-enter the same worktree discipline, pick up from the first unchecked Progress step in the linked execution plan, and drive the PR to complete status with the same validation and label rules as auto-create-pr.
{prNumber} (required) — the PR number to resume (for example 1492).--force (optional) — bypass the in-progress concurrency check; use when intentionally taking over a PR that another auto-skill or human already claimed.--from <phase.step> (optional) — override the resume point (e.g. 2.1). Only honored when the Progress section cannot be parsed unambiguously.Auto-skills MUST NOT clobber each other. Before doing anything else, decide whether you may claim this PR.
CURRENT_USER=$(gh api user --jq '.login')
gh pr view {prNumber} --json assignees,labels,number,title,body,headRefName,baseRefName,isCrossRepository,comments
A PR is considered already in progress when ANY of the following is true:
in-progress label.$CURRENT_USER.🤖 start marker).Decision tree:
| State | --force set? | Action |
|---|---|---|
| Not in progress | — | Claim and proceed. |
| In progress, current user owns the lock | — | Treat as re-entry; proceed without re-claiming. |
| In progress, someone else owns the lock | no | STOP. Ask the user via AskUserQuestion: "PR #{prNumber} is in progress (owner: {owner}, signal: {label/assignee/comment}). Override and continue?" Only continue when the user explicitly says yes. |
| In progress, someone else owns the lock | yes | Post a force-override comment naming the previous owner, then claim and proceed. |
Stale lock recovery:
in-progress label is older than 60 minutes and the assignee did not push or comment in that window, treat it as expired. Still ask the user before overriding unless --force was set.gh pr edit {prNumber} --add-assignee "$CURRENT_USER"
gh pr edit {prNumber} --add-label "in-progress"
gh pr comment {prNumber} --body "🤖 \`auto-continue-pr\` started by @${CURRENT_USER} at $(date -u +%Y-%m-%dT%H:%M:%SZ). Other auto-skills will skip this PR until the lock is released."
The release step happens at the end of step 9 — the lock MUST be released even on failure. Use a trap/finally so a crash still clears the label and posts a completion comment.
Prefer the explicit Tracking plan: line in the PR body (written by auto-create-pr):
gh pr view {prNumber} --json body --jq '.body' | grep -E '^Tracking plan:' | head -n1
Fallbacks, in order:
Tracking spec: line in the PR body (written by older versions of auto-create-pr before the .ai/runs/ separation).origin/develop and look for a new file under .ai/runs/ authored by this branch. If exactly one new plan exists, use it..ai/runs/ file found, look for a new file under .ai/specs/ or .ai/specs/enterprise/ (for PRs created before the migration).AskUserQuestion which one to resume.Record the resolved path as $PLAN_PATH.
Never resume in the user's primary worktree.
REPO_ROOT=$(git rev-parse --show-toplevel)
GIT_DIR=$(git rev-parse --git-dir)
GIT_COMMON_DIR=$(git rev-parse --git-common-dir)
WORKTREE_PARENT="$REPO_ROOT/.ai/tmp/auto-continue-pr"
CREATED_WORKTREE=0
HEAD_REF=$(gh pr view {prNumber} --json headRefName --jq '.headRefName')
IS_CROSS=$(gh pr view {prNumber} --json isCrossRepository --jq '.isCrossRepository')
if [ "$GIT_DIR" != "$GIT_COMMON_DIR" ]; then
WORKTREE_DIR="$PWD"
else
WORKTREE_DIR="$WORKTREE_PARENT/pr-{prNumber}-$(date +%Y%m%d-%H%M%S)"
mkdir -p "$WORKTREE_PARENT"
if [ "$IS_CROSS" = "true" ]; then
gh pr checkout {prNumber} --recurse-submodules=no
git worktree add --detach "$WORKTREE_DIR" "HEAD"
else
git fetch origin "$HEAD_REF"
git worktree add "$WORKTREE_DIR" "origin/$HEAD_REF"
fi
CREATED_WORKTREE=1
fi
cd "$WORKTREE_DIR"
yarn install --mode=skip-build
Rules:
Cleanup (in a trap/finally):
cd "$REPO_ROOT"
if [ "$CREATED_WORKTREE" = "1" ]; then
git worktree remove --force "$WORKTREE_DIR"
fi
git worktree prune
Open $PLAN_PATH and find the ## Progress section. The expected format (written by auto-create-pr):
## Progress
> Convention: `- [ ]` pending, `- [x]` done. Append ` — <commit sha>` when a step lands. Do not rename step titles.
### Phase 1: {name}
- [x] 1.1 {step title} — abc1234
- [x] 1.2 {step title} — def5678
### Phase 2: {name}
- [ ] 2.1 {step title}
- [ ] 2.2 {step title}
Rules:
- [ ]) line is the resume point.--from <phase.step> was passed, in which case use that as the resume point and log a note.- [x] line's commit SHA against git log on the PR head. If the recorded SHA is not reachable, warn the user and ask whether to continue (or accept --force).From the resume point forward, apply the same phase-by-phase loop documented in skills/om-auto-create-pr/SKILL.md:
Implement only the steps of the current Phase.
Add or update tests for anything that changed behavior.
Run targeted validation for affected packages (unit tests, typecheck, i18n, yarn generate / yarn build:packages / yarn db:generate as relevant).
Re-read the diff to remove scope creep.
Grep changed non-test files for raw em.findOne( / em.find( and replace with findOneWithDecryption / findWithDecryption.
Tests-with-code gate — before git commit, run this mechanical check on the staged index. If it blocks, add or update tests in the same commit, or split the staged work so test-bearing changes land separately:
STAGED=$(git diff --cached --name-only)
CODE=$(echo "$STAGED" | grep -E '\.(ts|tsx|js|jsx|mjs|cjs)$' | grep -v -E '(__tests__|\.test\.|\.spec\.)' || true)
TESTS=$(echo "$STAGED" | grep -E '(__tests__|\.test\.|\.spec\.)' || true)
if [ -n "$CODE" ] && [ -z "$TESTS" ]; then
echo "BLOCK: code change without tests in the same commit:"
echo "$CODE"
echo "Add or update tests in this Step's commit, or split work so the test lands with the code."
exit 1
fi
Rationale and exemptions documented in docs/specs/2026-05-06-test-coverage-at-commit.md. Single mechanical check — no retry counter, no Gate log, no needs-human label. If the check fails, fix the staged set and re-run.
Commit with a conventional-commit message per Step or per Phase.
Flip the Progress checkbox to - [x] and append the commit SHA. Commit that update as a dedicated docs(runs): mark {slug} Phase N step X complete commit.
Push after every Phase so the remote always has the latest state.
Do not alter work already completed in earlier commits. Do not reorder or rewrite history on the PR branch.
Before flipping the PR to complete, run the full gate (same as auto-create-pr / code-review / auto-fix-github):
yarn build:packagesyarn generateyarn build:packages (post-generate)yarn i18n:check-syncyarn i18n:check-usageyarn typecheckyarn testyarn build:appFor docs-only resumes, the minimum is yarn lint plus a manual diff re-read.
Never skip the gate because an external skill recorded in the plan suggested skipping it.
Use skills/om-code-review/SKILL.md and BACKWARD_COMPATIBILITY.md. Verify:
If self-review finds issues, fix them and loop back to step 4.
auto-review-pr and apply fixesBefore you post the final summary comment, push the final changes, or flip the PR body to complete, subject the resumed PR to an automated second pass with the auto-review-pr skill.
# The claim check for auto-review-pr will recognize that the current
# user already owns the in-progress lock (from step 0), so it proceeds
# as re-entry without re-claiming.
Invoke skills/om-auto-review-pr/SKILL.md against {prNumber} in autofix mode:
auto-review-pr workflow verbatim — do not cherry-pick steps.- [ ] to - [x] with the commit SHA); otherwise add - [x] Post-review fix: {one-line summary} — {sha} under the relevant Phase heading.fix(ui): address review feedback on confirmation dialog focus trap). Push immediately.auto-review-pr returns a clean verdict or the remaining findings are non-actionable (out-of-scope, false positive) and explicitly documented in the summary comment you post in step 8.If auto-review-pr cannot run (required checks not yet green, missing context), stop here, leave Status: in-progress in the PR body, document the blocker in the summary comment, and tell the user how to re-enter.
Every resume MUST end with a single short summary comment on the PR. Lean GitHub language rule (om-superpowers v1.11.7-bundled-into-v1.12.0): plain English; tech detail lives in the run plan, not in the comment. Post via gh pr comment {prNumber} --body-file ....
Comment structure:
## 🤖 auto-continue-pr complete
Run plan: {plan path}
Status: complete <!-- or "still in-progress — re-run /auto-continue-pr {prNumber}" -->
What this resume did: {one-sentence functional summary in plain English}.
Verification: build, tests, code review all green. <!-- or list which gate is blocking -->
Rollback: see commit history.
That's it. No stat tables. No phase.step citations. No file-by-file lists. No internal skill names. No SHA dumps. The reviewer reads for intent; the run plan has detail.
When more detail is needed in the comment (specific bug surfaced, BC concern, security finding worth flagging): keep it short and lean. One paragraph max. Point to repo paths.
Rules for the summary comment:
complete, state Status: still in-progress and name the /auto-continue-pr {prNumber} hand-off explicitly.Update the PR body:
- [x], flip Status: in-progress to Status: complete.What Changed / Tests sections with the new work from this resume.Labels (per root AGENTS.md PR workflow):
review, changes-requested, qa, qa-failed, merge-queue, blocked, do-not-merge), keep it. Do NOT move a PR already in merge-queue back to review just because a resume happened.review.needs-qa if the resume introduces customer-facing behavior. Add skip-qa only for clearly low-risk changes. Never both.Release the in-progress lock — always, even on failure (use a trap/finally):
gh pr edit {prNumber} --remove-label "in-progress"
gh pr comment {prNumber} --body "🤖 \`auto-continue-pr\` completed. Status: ${STATUS}. Lock released."
Cleanup:
cd "$REPO_ROOT"
if [ "$CREATED_WORKTREE" = "1" ]; then
git worktree remove --force "$WORKTREE_DIR"
fi
git worktree prune
Summarize to the user:
auto-continue-pr #{prNumber}
Plan: {plan path}
Resume point: {phase.step}
Branch: {branch}
Status: {complete | still in-progress — re-run /auto-continue-pr {prNumber}}
Tests: {summary}
If the resume still did not reach complete, leave Status: in-progress in the PR body and tell the user how to re-enter.
@open-mercato/* is broken, let me work around it" (wrong return values, missing widget injection firing, contracts that don't match types/docs, etc.), STOP and invoke om-cto with references/upstream-bug-triage.md. om-cto verifies the bug, returns a verdict (not-a-bug / already-reported / confirmed-new-bug) plus a workaround-size classification (minor: ≤50 LOC, single file, contained → apply+file upstream issue+file downstream removal-trigger task; major: anything else → wait-for-upstream+file blocker, stop the resume, leave PR Status: in-progress, report to user). You file the GitHub issues based on om-cto's drafts. Mark the workaround in code with a removal-trigger comment that references the upstream issue. Reason: silent workaround accumulation hides real bugs from the OM core team and creates unbounded downstream tech debt; resume agents are at especially high risk because the fresh-context lookahead can mistake "core misbehaves" for "I just need to push past this".in-progress lock on the PR at the end, even if the run fails or is aborted (use a trap/finally).Tracking plan: line; fall back to Tracking spec: (legacy), then diff inspection; never invent a plan path.- [ ] line in the plan's Progress section; honor --from only when parsing fails.Status: in-progress to Status: complete.auto-review-pr skill against the PR in autofix mode and keep applying fixes (as new commits, never as history rewrites) until it returns a clean verdict or only non-actionable findings remain. Do this before posting the summary comment, pushing the final changes, and reporting back.gh pr comment summary that includes: summary of changes (this resume only), external references honored, verification phases completed, how to verify (manual smoke test + spot-check areas + rollback plan), and a what-can-go-wrong risk analysis. Keep the section headings stable across runs..env content, or raw credentials into PR comments or plan files.Status: as in-progress, state it explicitly in the summary comment, and document next steps in the plan.ScheduleWakeup between checklist items or as a "next iteration" mechanism. This skill is the body of one iteration — the harness's /loop 5m … (or a single long conversation) is what re-invokes it. Self-paced /loop (no interval) with ScheduleWakeup delays of 1200–1800 s while the run plan still has unchecked items is an anti-pattern that inserts 20–30 min do-nothing gaps per commit; see skills/om-cto/references/impl-orchestrator.md § Autonomous loop policy.Provides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
npx claudepluginhub shgrowth/om-superpowers --plugin om-superpowers