ワンクリックで
publish
Refactor recent changes, ship as a PR with auto-merge, then monitor CI and auto-fix failures until merged.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Refactor recent changes, ship as a PR with auto-merge, then monitor CI and auto-fix failures until merged.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
| name | publish |
| description | Refactor recent changes, ship as a PR with auto-merge, then monitor CI and auto-fix failures until merged. |
| user-invocable | true |
| allowed-tools | Read, Edit, Write, Bash, Glob, Grep, Agent, WebFetch |
Sync, refactor recent changes, sync again, then ship the current branch as a PR with auto-merge enabled. After shipping, monitor CI checks and proactively fix any failures until the PR merges. Be thorough on refactoring but efficient on shipping.
Input: $ARGUMENTS optionally describes what was done
(used for the commit message and PR description).
Sync the branch with the remote default branch before refactoring to avoid working on stale code.
Run in parallel:
git fetch origingit remote show origin | grep 'HEAD branch' | awk '{print $NF}'git branch --show-currentDetermine DEFAULT_BRANCH and CURRENT_BRANCH. If on default branch, STOP: "Create a feature branch first."
Then rebase:
git rebase origin/<DEFAULT_BRANCH>
If conflicts, STOP and show files.
Identify recent changes: use git diff and git log to
find newly implemented or modified code. Establish the list
of files to review.
Re-read all identified files from disk, then:
Apply fixes, then summarize Pass 1 changes.
Re-read ALL the same files again from disk (fresh read), then:
Apply fixes, then summarize Pass 2 changes.
Execute the shipping process efficiently. Batch commands and do NOT deliberate.
Run git status --porcelain and
git diff --stat && git diff --cached --stat in parallel
to check for uncommitted changes.
If there are changes:
.env, credentials, large
binaries). In parallel, check merge-base:
git merge-base --is-ancestor HEAD origin/<DEFAULT_BRANCH>git commit --amend.$ARGUMENTS was
provided, use it to inform the commit message. Infer type
and scope from the diff.Sync again to pick up any changes that landed during refactoring:
git fetch origin && git rebase origin/<DEFAULT_BRANCH>
If conflicts, STOP and show files. Otherwise, in parallel:
git push --force-with-lease origin HEADgh pr view --json url,title,state 2>/dev/nullgh pr merge --auto --rebase, print URL.gh pr create with concise title (<70 chars),
body with ## Summary (bullets) and ## Test plan. If
$ARGUMENTS provided, use it for the summary. Then run
gh pr merge --auto --rebase.After shipping, monitor the PR until it merges or a hard-stop condition is reached. Be proactive: if CI fails, diagnose and fix the issue, then push again.
This phase adapts to the project: not all repos have CI checks, deployments, or auto-merge. Detect what applies and skip what doesn't.
Run in parallel:
- gh pr checks --json name,state → HAS_CHECKS (non-empty list)
- gh pr view --json autoMergeRequest → HAS_AUTO_MERGE (non-null)
If no checks and no auto-merge:
Skip monitoring entirely → go to Final Output
If no checks but auto-merge is set:
Wait for merge only (skip Fix step entirely)
fix_count = 0
wait = 30 # seconds
round = 0
while round < 10:
round += 1
sleep <wait> seconds
wait = min(wait * 1.5, 120)
Run in parallel:
- gh pr view --json state,mergeStateStatus,mergeable
- gh pr checks --json name,state,conclusion,detailsUrl
Evaluate:
A) PR state == MERGED → go to Validate step
B) All checks passing, merge pending → continue loop
C) One or more checks failed → go to Fix step
D) PR closed (not merged) → STOP: "PR was closed"
E) Merge conflicts → STOP: "Merge conflicts — rebase manually"
if fix_count >= 3:
STOP: "CI still failing after 3 fix attempts.
Failing checks: <list>. Manual intervention required."
fix_count += 1
1. Identify failed check(s) from gh pr checks output
2. For each failed check:
a. Extract run-id from the details URL
b. Get log: gh run view <run-id> --log-failed
c. Read error output and diagnose root cause
3. Apply fixes to the codebase
4. Stage and commit:
fix: resolve CI failure in <check-name>
5. Fetch + rebase:
git fetch origin && git rebase origin/<DEFAULT_BRANCH>
6. Push: git push --force-with-lease origin HEAD
7. Reset wait = 30
8. Continue monitor loop
After the PR merges:
gh pr view --json state → assert MERGEDgh run list --branch <DEFAULT_BRANCH> --limit 5 --json name,status,conclusionPrint a summary (max 8 lines):