一键导入
pr-fixup
Automated PR fixup loop — syncs with main, addresses all Copilot review comments, and waits for CI to pass. Run with /pr-fixup or /pr-fixup <PR_NUMBER>.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Automated PR fixup loop — syncs with main, addresses all Copilot review comments, and waits for CI to pass. Run with /pr-fixup or /pr-fixup <PR_NUMBER>.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Spawn the ACP-variant runtimes (claude-code-acp / codex-acp / copilot-acp). claude-code-acp validated; it surfaces real tool failures that native claude-code can't. Run with /test-acp-runtime. Pairs with /launch-grackle.
Spawn and exercise the native `claude-code` runtime against a test server, including the model names that work and the synthetic-tool-result gotcha. Run with /test-claude-runtime. Pairs with /launch-grackle.
Spawn the `codex` runtime against a test server. Use model `gpt-5.5` (requires Codex SDK >= 0.135.0). Run with /test-codex-runtime. Pairs with /launch-grackle.
Spawn and exercise the `copilot` runtime against a test server. CRITICAL: gpt-4o does NOT work — use claude-sonnet-4.5. Run with /test-copilot-runtime. Pairs with /launch-grackle.
Investigates code bugs and files GitHub issues.
Pure coordinator that decomposes work and delegates to subagents.
| name | pr-fixup |
| description | Automated PR fixup loop — syncs with main, addresses all Copilot review comments, and waits for CI to pass. Run with /pr-fixup or /pr-fixup <PR_NUMBER>. |
This skill automates the full PR-readiness workflow: sync with main, address Copilot review comments in a loop, and verify CI passes.
If a PR number was provided as an argument, use it. Otherwise detect from the current branch:
gh pr view --json number --jq '.number'
If this fails, the current branch has no open PR — tell the user and stop.
Store the PR number, repo owner, and repo name for all subsequent commands:
PR_NUMBER=<detected or provided PR number>
OWNER=$(gh repo view --json owner --jq '.owner.login')
REPO=$(gh repo view --json name --jq '.name')
All commands below use $PR_NUMBER, $OWNER, and $REPO.
git fetch origin
git merge origin/main
If merge conflicts arise:
git diff --name-only --diff-filter=UIf no conflicts, and the merge brought in new commits, the merge commit is created automatically.
Run the build to catch compile errors before pushing:
rush build
If the build fails, fix the errors, commit the fixes, and re-run the build. Only proceed to push once the build succeeds.
Before pushing, manually test the PR's changes to catch issues early (see Step 4g for testing instructions). If the PR only touches config/docs or codespace-only code, note why testing is skipped.
git push
This triggers both CI and a Copilot review on the PR.
Repeat the following cycle until stable (zero new unresolved Copilot comments on two consecutive checks).
Wait 30 seconds for the Copilot review to arrive:
sleep 30
Use the GraphQL API to fetch all review threads, filtering for unresolved ones with Copilot comments.
Important: On Windows (MSYS2/Git Bash), $ characters in gh api graphql -f query='...' are unreliably handled by the shell. Always use Node.js with gh api -X POST /graphql --input - to pipe the GraphQL query via stdin, avoiding all shell quoting issues:
node -e "
const {execSync} = require('child_process');
const body = JSON.stringify({
query: 'query(\x24owner: String!, \x24repo: String!, \x24pr: Int!) { repository(owner: \x24owner, name: \x24repo) { pullRequest(number: \x24pr) { reviewThreads(first: 100) { nodes { id isResolved isOutdated path line startLine comments(last: 1) { nodes { id author { login } body createdAt } } } } } } }',
variables: {owner: '$OWNER', repo: '$REPO', pr: $PR_NUMBER}
});
console.log(execSync('gh api -X POST /graphql --input -', {input: body, encoding: 'utf-8'}));
"
From the response, select threads where ALL of:
isResolved is false (do NOT filter on isOutdated — outdated but unresolved threads still block the merge button)comments(last: 1) query) has author.login equal to "copilot-pull-request-reviewer"If no threads match, the loop may be done — skip to step 4f.
For each actionable Copilot thread:
path, focusing on the lines around line (and startLine if present)gh api "repos/$OWNER/$REPO/pulls/$PR_NUMBER/comments/$COMMENT_ID/replies" -f body="MESSAGE"
Where COMMENT_ID is the numeric REST ID of the Copilot comment, and MESSAGE explains what was done.
Important: The REST API needs numeric comment IDs, not GraphQL node IDs. Fetch them with:
gh api "repos/$OWNER/$REPO/pulls/$PR_NUMBER/comments" --jq '.[] | select(.user.login == "Copilot") | {id, node_id, path, line, body}'
To map a GraphQL thread to its REST comment ID, match the GraphQL comment's node ID (comments.nodes[0].id) to the node_id field in the REST output, then use that entry's numeric id as COMMENT_ID.$ escaping issues:
node -e "
const {execSync} = require('child_process');
const body = JSON.stringify({
query: 'mutation(\x24threadId: ID!) { resolveReviewThread(input: {threadId: \x24threadId}) { thread { isResolved } } }',
variables: {threadId: 'THREAD_NODE_ID'}
});
console.log(execSync('gh api -X POST /graphql --input -', {input: body, encoding: 'utf-8'}));
"
If any code changes were made in this round:
git add -A)Address Copilot review round N: <brief summary of fixes>git push
If no code changes were made (all comments were dismissed), go to step 4f.
After making code changes (whether from Copilot fixes or CI fixes), manually test the affected functionality before pushing. This catches real-world issues that unit tests miss.
Preferred: Web UI via Playwright MCP
mcp__playwright__browser_navigate to open the web UIFallback: CLI
grackle CLI commands to exercise the changed functionalitySkip conditions (state explicitly if skipping):
After a round with zero new actionable comments, wait 30 more seconds and check again:
sleep 30
Re-run the GraphQL query from step 4b. If still zero unresolved Copilot threads, the review loop is complete. If new comments appeared, go back to step 4d.
Poll CI status with a 15-minute timeout. Use --watch with a timeout wrapper:
timeout 900 gh pr checks "$PR_NUMBER" --watch --fail-fast
Note: timeout returns exit code 124 on timeout, while gh pr checks --fail-fast returns a non-zero code on check failure. Distinguish between them — a timeout means CI is still running (report it as a timeout), while a non-124 failure means a check actually failed.
If --watch or timeout is not available, poll manually — run gh pr checks "$PR_NUMBER" every 30 seconds, tracking elapsed time. Stop after 15 minutes (30 iterations) and report a timeout.
CI is done when all required checks show a conclusion (pass or fail). If any check fails:
gh run view RUN_ID --log-failed
When everything is green, summarize:
gh repo view to get the owner/repo dynamically — do not hardcodeid / REST node_id join as the source of truth when correlating comments across APIs. For filtering, GraphQL uses author.login == "copilot-pull-request-reviewer" and REST uses user.login == "Copilot"rush change --verify, run the /rush-change skill to generate the correct change file (it handles merge-commit false positives automatically)