with one click
mark-pr-ready
// Promote a draft PR to ready-for-review after CI passes and self-review is clean. Assigns reviewers and adds labels.
// Promote a draft PR to ready-for-review after CI passes and self-review is clean. Assigns reviewers and adds labels.
Auto-merge a PR after it is marked ready-for-review, if the change is small, non-disruptive, and all checks pass.
Diagnose and fix failing CI on a PR. Capped at 3 attempts. Load repo-setup first.
Clone or refresh a GitHub repo and prepare the working tree. Load this before any situation skill.
Resolve a GitHub issue end-to-end — explore, plan, implement, clean up, and open a draft PR.
Triage and respond to comments on a PR. Fix if actionable, reply either way. Load repo-setup first.
Review a pull request. Self-fix on own PRs, post a review on others'. Load repo-setup first.
| name | mark-pr-ready |
| description | Promote a draft PR to ready-for-review after CI passes and self-review is clean. Assigns reviewers and adds labels. |
| license | Apache-2.0 |
| metadata | {"audience":"autonomous-agents"} |
Promote a draft PR out of draft status. Only do this when CI is green and self-review found no remaining issues.
gh pr checks <N> --required).Verify CI status:
FAILING=$(gh pr checks <N> --json name,state \
--jq '[.[] | select(.state != "SUCCESS" and .state != "SKIPPED" and .state != "NEUTRAL")]')
If the output is not an empty array [], stop — CI isn't green yet.
Mark ready for review:
gh pr ready <N>
Request reviewers. GitHub auto-assigns from CODEOWNERS when a draft PR is marked ready (if branch protection requires reviews), so explicit assignment is often unnecessary. If the repo doesn't use branch protection, try to find an owner:
CODEOWNERS_FILE=""
for f in .github/CODEOWNERS CODEOWNERS docs/CODEOWNERS; do
[ -f "$f" ] && CODEOWNERS_FILE="$f" && break
done
if [ -n "$CODEOWNERS_FILE" ]; then
OWNERS=$(grep -v '^#' "$CODEOWNERS_FILE" | awk '{for(i=2;i<=NF;i++) print $i}' | sort -u | head -3)
for owner in $OWNERS; do
owner="${owner#@}"
gh pr edit <N> --add-reviewer "$owner" 2>/dev/null || true
done
fi
If reviewer assignment fails, skip silently.
Add labels:
gh pr edit <N> --add-label "bot-generated"
If the original issue had priority labels, propagate them:
ISSUE_LABELS=$(gh issue view <issue-N> --json labels --jq '.labels[].name' 2>/dev/null)
for label in $ISSUE_LABELS; do
case "$label" in priority*|P0|P1|P2|P3|critical|high|medium|low)
gh pr edit <N> --add-label "$label" 2>/dev/null || true
;;
esac
done
Post a short comment noting the PR is ready. Mention what CI checks passed and that self-review found no issues. Write it naturally — vary the wording, don't use a canned phrase.
check_suite or workflow_run event with conclusion success.