con un clic
auto-pr-merge
// Create PR, wait for checks, fix issues iteratively, and merge with --admin
// Create PR, wait for checks, fix issues iteratively, and merge with --admin
Lightweight review-fix loop (2 rounds, 1 agent each), then create PR and merge
Launch, automate, and validate Electron desktop apps using playwright-cli via Chrome DevTools Protocol. Use this skill to validate UI changes in Orca, test features in the running Electron app, verify code fixes work end-to-end, or automate any Electron app (VS Code, Slack, Discord, etc.). Triggers include "validate in Electron", "test in the app", "verify the fix", "check the UI", "/electron", "automate Slack app", "control VS Code", or any task requiring interaction with a running Electron application.
Use the Orca CLI to orchestrate worktrees and live terminals through a running Orca editor. Use when an agent needs to create, inspect, update, or remove Orca worktrees; inspect repo state known to Orca; or read, send to, wait on, or stop Orca-managed terminals. Coding agents should also keep the current worktree comment updated with the latest meaningful work-in-progress checkpoint whenever useful; this is an expected default behavior, not a special trigger-only action. Triggers include "use orca cli", "manage Orca worktrees", "read Orca terminal", "reply to Claude Code in Orca", "create a worktree in Orca", "update Orca worktree comment", or any task where the agent should operate through Orca instead of talking to git worktrees and terminal processes directly.
Automated iterative code review and fix loop with parallel review agents
This skill should be used when the user asks to "optimize TypeScript performance", "speed up tsc compilation", "configure tsconfig.json", "fix type errors", "improve async patterns", or encounters TS errors (TS2322, TS2339, "is not assignable to"). Also triggers on .ts, .tsx, .d.ts file work involving type definitions, module organization, or memory management. Does NOT cover TypeScript basics, framework-specific patterns, or testing.
End-to-end autonomous pipeline that runs auto-review-fix, then auto-pr-merge
| name | auto-pr-merge |
| description | Create PR, wait for checks, fix issues iteratively, and merge with --admin |
End-to-end autonomous PR workflow: create PR, wait for CI checks to pass, fix any issues (typecheck, code review), update PR, and merge with admin override. Runs fully autonomously without user confirmation.
IMPORTANT: Execute this entire process autonomously without asking the user for confirmation at any step. Just do it.
CREATE PR → WAIT FOR CHECKS → FIX LOOP (max 3) → MERGE --admin
│ │ │ │
/create-pr 1min + 1min polls diagnose CI gh pr merge
(up to ~6min) fix issues --admin
pn typecheck --squash
/review-code --delete-branch
commit & push
wait for checks
Run the /create-pr skill to create or update the pull request.
Use the Skill tool: skill: "create-pr"
After /create-pr completes, extract the PR number and URL:
gh pr view --json number,url --jq '.number, .url'
Store the PR number for later use.
CRITICAL: DO NOT STOP after /create-pr completes. Continue to Step 2.
Use the Check Polling Procedure (defined below) to wait for CI checks. Based on the result:
PASSED → Skip to Step 4 (MERGE)FAILED → Proceed to Step 3 (FIX LOOP)NO_CHECKS → Skip to Step 4 (MERGE) — no CI configured, nothing to wait forRun up to 3 iterations of the diagnose-fix-review-push cycle.
Identify which checks failed and get their logs:
# Get the most recent failed run ID for this branch
FAILED_RUN=$(gh run list --branch $(git branch --show-current) --limit 5 --json databaseId,conclusion,name --jq '[.[] | select(.conclusion == "failure")] | .[0].databaseId')
echo "Failed run: $FAILED_RUN"
# View failed step logs (truncated to last 200 lines to avoid context bloat)
if [ -n "$FAILED_RUN" ] && [ "$FAILED_RUN" != "null" ]; then
gh run view "$FAILED_RUN" --log-failed 2>&1 | tail -200
fi
If gh run view --log-failed returns too much output or doesn't work, fall back to:
gh run view "$FAILED_RUN" --json jobs --jq '.jobs[] | select(.conclusion == "failure") | {name, steps: [.steps[] | select(.conclusion == "failure") | {name, conclusion}]}'
Based on the failure diagnosis:
/fix-lint skill/fix-build skillAfter applying fixes, verify types are clean:
pn typecheck 2>&1
pn typecheckRun only /review-code to catch any issues introduced by the fixes. Do NOT run /review-correctness, /review-via-codex, /review-algorithm-architecture, or any other review skill — only /review-code:
Use the Skill tool: skill: "review-code"
After review completes:
pn typecheck to verify the review fixes don't introduce type errorsCommit and push only if there are actual changes:
# Check if there are changes to commit
if [ -n "$(git status --porcelain)" ]; then
git add -A && git commit -m "fix: address CI failures and review feedback"
git push --force-with-lease
else
echo "NO_CHANGES"
fi
NO_CHANGES: No fixes were needed/possible. Exit the fix loop and proceed to Step 4.Use the Check Polling Procedure (defined below) to wait for CI checks. Based on the result:
PASSED → Exit fix loop, proceed to Step 4FAILED → Next iteration of fix loop (back to 3a)NO_CHECKS → Exit fix loop, proceed to Step 4If max 3 fix iterations reached, proceed to Step 4 anyway.
Merge the PR using admin override with squash merge.
IMPORTANT: Worktree detection. When running from a git worktree, --delete-branch will fail because gh tries to checkout the default branch locally, but it's already checked out in the main worktree. Detect this and handle accordingly:
# Check if we're in a worktree (not the main working tree)
IS_WORKTREE=false
if [ "$(git rev-parse --git-dir)" != "$(git rev-parse --git-common-dir)" ]; then
IS_WORKTREE=true
fi
BRANCH=$(git branch --show-current)
if [ "$IS_WORKTREE" = "true" ]; then
# In a worktree: merge WITHOUT --delete-branch, then delete remote branch separately
gh pr merge --admin --squash
# Delete the remote branch manually (local cleanup happens when worktree is removed)
git push origin --delete "$BRANCH" 2>/dev/null || true
else
# Normal repo: use --delete-branch as usual
gh pr merge --admin --squash --delete-branch
fi
--admin bypasses branch protection rules (required reviews, status checks)--squash squashes all commits into one clean commit--delete-branch cleans up the feature branch after merge (skipped in worktrees to avoid checkout conflict)If merge fails:
'master' is already used by worktree or similar: retry without --delete-branch and delete the remote branch manually with git push origin --delete <branch>skill: "resolve-conflicts", push, then retry merge onceThis is the shared polling logic used by Step 2 and Step 3f. Do NOT run this as a single long bash command — the Bash tool will timeout. Instead, run each poll as a separate Bash call.
IMPORTANT: Minimize token waste. Do NOT add verbose commentary between polls. Just run the wait, run the check, and act on the result. No cheerful status messages, no "patience is key", no filler text.
After a push, CI takes time to run. Wait 1 minute before the first poll:
echo "Waiting 1 minute for CI checks to run..." && sleep 60
IMPORTANT: You MUST actually execute the sleep 60 command and wait for it to complete. Do NOT skip the sleep or claim you waited without running the command. The sleep ensures CI has time to finish.
CRITICAL: When calling the Bash tool for sleep 60, you MUST set timeout: 120000 (2 minutes) on the Bash tool call. Similarly, for sleep 60 poll interval calls, set timeout: 120000 (2 minutes).
For each poll attempt (1 through 5):
CHECKS=$(gh pr checks --json name,state,bucket 2>&1)
echo "$CHECKS"
# Parse results using 'bucket' field (pass, fail, pending, skipping, cancel)
if echo "$CHECKS" | jq -e 'length == 0' >/dev/null 2>&1; then
echo "RESULT:NO_CHECKS"
elif echo "$CHECKS" | jq -e '[.[].bucket] | all(. == "pass" or . == "skipping")' >/dev/null 2>&1; then
echo "RESULT:PASSED"
elif echo "$CHECKS" | jq -e '[.[].bucket] | any(. == "fail" or . == "cancel")' >/dev/null 2>&1; then
echo "RESULT:FAILED"
else
echo "RESULT:PENDING"
fi
RESULT:PASSED → Return PASSED. Stop polling.RESULT:FAILED → Return FAILED. Stop polling.RESULT:PENDING → Wait 1 minute, then poll again (use timeout: 120000 on the Bash tool call):
sleep 60
RESULT:NO_CHECKS → Return NO_CHECKS (no CI configured).If checks are still pending after 5 polls (~6 min total), return FAILED to enter the fix loop for investigation.
After pushing new commits in Step 3e, old check results may linger briefly. To avoid reading stale results:
OLD_SHA=$(git rev-parse HEAD)gh pr checks still shows the old results (check names match but they completed instantly), wait an extra 30s.state: "IN_PROGRESS" or "QUEUED" as a signal that fresh checks have started.Display progress after each major step:
╔════════════════════════════════════════════════════════════╗
║ AUTO PR MERGE ║
╠════════════════════════════════════════════════════════════╣
║ Step 1 - Create PR: ✅ PR #123 created ║
║ Step 2 - Wait for checks: ❌ 2/5 checks failed ║
║ Step 3 - Fix Loop: ║
║ Iteration 1/3: ║
║ Diagnose: ✅ Type errors in 2 files ║
║ Fix: ✅ Fixed type errors ║
║ Typecheck: ✅ Passed ║
║ Review: ✅ No critical issues ║
║ Push: ✅ Updated PR ║
║ Checks: ✅ All passed ║
║ Step 4 - Merge: ✅ Merged with --admin --squash ║
╠════════════════════════════════════════════════════════════╣
║ PR URL: https://github.com/org/repo/pull/123 ║
║ Result: Successfully merged! ║
╚════════════════════════════════════════════════════════════╝
sleep in its own Bash call between polls.git status --porcelain is empty/review-code for quick checks in the fix loop. Codex-based reviews are slow and belong in /auto-review-fix, not here.sleep 60, you MUST run the bash command and wait for it to complete. Do not skip or fabricate the wait.sleep 60 requires timeout: 120000. The default 2-minute Bash timeout is sufficient for 1-minute sleeps but set it explicitly for safety./create-pr fails: Report error and exitgh CLI is not installed or authenticated: Report and exit/resolve-conflicts, push, then retry merge once