一键导入
create-pr
Create or update a PR from current branch to main, watch CI, and address feedback
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Create or update a PR from current branch to main, watch CI, and address feedback
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Diagnose and fix implementation errors from stack traces, identify root cause, apply minimum effective fixes, and validate with lint/format/build/test loops until green. Use for debugging and defect resolution tasks.
AI-powered code review using CodeRabbit. Default code-review skill. Trigger for any explicit review request AND autonomously when the agent thinks a review is needed (code/PR/quality/security).
Run final quality gates (lint, format, typecheck), fix root causes with minimal changes, and repeat until no errors or warnings remain. Use before completion or handoff.
Use when implementing any feature or bugfix, before writing implementation code
Update an existing pull request with new changes or respond to review feedback. Use when addressing PR comments, making requested changes, or updating a PR after review.
| name | create-pr |
| description | Create or update a PR from current branch to main, watch CI, and address feedback |
The user likes the state of the code.
There are $git status --porcelain | wc -l | tr -d ' ' uncommitted changes.
The current branch is $git branch --show-current.
The target branch is origin/main.
$git rev-parse --abbrev-ref @{upstream} 2>/dev/null && echo "Upstream branch exists." || echo "There is no upstream branch yet."
Existing PR: $gh pr view --json number,title,url --jq '"#\(.number): \(.title) - \(.url)"' 2>/dev/null || echo "None"
The user requested a PR.
Follow these exact steps:
git diff to review uncommitted changesgit diff origin/main... to review the full PR diff/tmp/pr-body.txt)../.agents/skills/create-pr/scripts/pr-body-update.sh --file /tmp/pr-body.txtgh pr view --json body --jq .body to confirm it changed.gh pr create --base main to create a new PR. Keep the title under 80 characters and the description under five sentences.The PR description should summarize ALL commits in the PR, not just the latest changes.
Note: Keep commands CI-safe and avoid interactive gh prompts. Ensure GH_TOKEN or GITHUB_TOKEN is set in CI.
gh in a loop):./.agents/skills/create-pr/scripts/poll-pr.sh --triage-on-change --exit-when-green (polls every 15s for 10 mins).gh pr checks or gh run list to find the failing run id, then:
gh run view <run-id> --log-failedgit fetch origin main && git merge origin/maingh):./.agents/skills/create-pr/scripts/triage-pr.sh once.gh pr view --comments or gh api ....Once CI passes and the PR is approved, ask the user if they want to merge the PR.
If the user confirms, merge the PR:
gh pr merge --squash --delete-branch to squash-merge and delete the remote branchAfter successful merge, check if we're in a git worktree:
[ "$(git rev-parse --git-common-dir)" != "$(git rev-parse --git-dir)" ]request_user_input) to ask if they want to clean up the worktree. If yes, run wt remove --yes --force to remove the worktree and local branch, then switch back to the main worktree.git checkout main && git pullReport the final PR status to the user, including:
If any step fails in a way you cannot resolve, ask the user for help.