prepare-pr
Script-first PR preparation with structured findings resolution, deterministic push safety, and explicit gate execution.
Best use case
prepare-pr is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Script-first PR preparation with structured findings resolution, deterministic push safety, and explicit gate execution.
Teams using prepare-pr should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/prepare-pr/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How prepare-pr Compares
| Feature / Agent | prepare-pr | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Script-first PR preparation with structured findings resolution, deterministic push safety, and explicit gate execution.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Prepare PR ## Overview Prepare the PR head branch for merge after `/review-pr`. ## Inputs - Ask for PR number or URL. - If missing, use `.local/pr-meta.env` if present in the PR worktree. ## Safety - Never push to `main`. - Only push to PR head with explicit `--force-with-lease` against known head SHA. - Do not run `git clean -fdx`. - Wrappers are cwd-agnostic; run from repo root or PR worktree. ## Execution Contract 1. Run setup: ```sh scripts/pr-prepare init <PR> ``` 2. Resolve findings from structured review: - `.local/review.json` is mandatory. - Resolve all `BLOCKER` and `IMPORTANT` items. 3. Commit scoped changes with concise subjects (no PR number/thanks; those belong on the final merge/squash commit). 4. Run gates via wrapper. 5. Push via wrapper (includes pre-push remote verification, one automatic lease-retry path, and post-push API propagation retry). Optional one-shot path: ```sh scripts/pr-prepare run <PR> ``` ## Steps 1. Setup and artifacts ```sh scripts/pr-prepare init <PR> ls -la .local/review.md .local/review.json .local/pr-meta.env .local/prep-context.env jq . .local/review.json >/dev/null ``` 2. Resolve required findings List required items: ```sh jq -r '.findings[] | select(.severity=="BLOCKER" or .severity=="IMPORTANT") | "- [\(.severity)] \(.id): \(.title) => \(.fix)"' .local/review.json ``` Fix all required findings. Keep scope tight. 3. Update changelog/docs (changelog is mandatory in this workflow) ```sh jq -r '.changelog' .local/review.json jq -r '.docs' .local/review.json ``` Changelog gate requirement: - `CHANGELOG.md` must include a newly added changelog entry line. - When PR author metadata is available, that same changelog entry line must include `(#<PR>) thanks @<pr-author>`. 4. Commit scoped changes Use concise, action-oriented subject lines without PR numbers/thanks. The final merge/squash commit is the only place we include PR numbers and contributor thanks. Use explicit file list: ```sh scripts/committer "fix: <summary>" <file1> <file2> ... ``` 5. Run gates ```sh scripts/pr-prepare gates <PR> ``` 6. Push safely to PR head ```sh scripts/pr-prepare push <PR> ``` This push step includes: - robust fork remote resolution from owner/name, - pre-push remote SHA verification, - one automatic rebase + gate rerun + retry if lease push fails, - post-push PR-head propagation retry, - idempotent behavior when local prep HEAD is already on the PR head, - post-push SHA verification and `.local/prep.env` generation. 7. Verify handoff artifacts ```sh ls -la .local/prep.md .local/prep.env ``` 8. Output - Summarize resolved findings and gate results. - Print exactly: `PR is ready for /merge-pr`. ## Guardrails - Do not run `gh pr merge` in this skill. - Do not delete worktree.
Related Skills
opentwitter
Twitter/X data via the 6551 API. Supports user profiles, tweet search, user tweets, follower events, deleted tweets, and KOL followers.
opennews
Crypto news search, AI ratings, trading signals, and real-time updates via the OpenNews 6551 API. Supports keyword search, coin filtering, source filtering, AI score ranking, and WebSocket live feeds.
agent-reach
Give your AI agent eyes to see the entire internet. Read and search across Twitter/X, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu, Instagram, LinkedIn, Boss直聘, RSS, and any web page — all from a single CLI. Use when: (1) reading content from URLs (tweets, Reddit posts, articles, videos), (2) searching across platforms (web, Twitter, Reddit, GitHub, YouTube, Bilibili, XiaoHongShu, Instagram, LinkedIn, Boss直聘), (3) user asks to configure/enable a platform channel, (4) checking channel health or updating Agent Reach. Triggers: "search Twitter/Reddit/YouTube", "read this URL", "find posts about", "搜索", "读取", "查一下", "看看这个链接", "帮我配", "帮我添加", "帮我安装".
searxng-search
使用自建SearXNG搜索引擎搜索互联网内容。触发词:搜索、查一下、帮我查、查找、搜一下、帮我搜索。
multi-search-engine
Multi search engine integration with 17 engines (8 CN + 9 Global). Supports advanced search operators, time filters, site search, privacy engines, and WolframAlpha knowledge queries. No API keys required.
weather
Get current weather and forecasts via wttr.in or Open-Meteo. Use when: user asks about weather, temperature, or forecasts for any location. NOT for: historical weather data, severe weather alerts, or detailed meteorological analysis. No API key needed.
wacli
Send WhatsApp messages to other people or search/sync WhatsApp history via the wacli CLI (not for normal user chats).
voice-call
Start voice calls via the OpenClaw voice-call plugin.
video-frames
Extract frames or short clips from videos using ffmpeg.
trello
Manage Trello boards, lists, and cards via the Trello REST API.
tmux
Remote-control tmux sessions for interactive CLIs by sending keystrokes and scraping pane output.
things-mac
Manage Things 3 via the `things` CLI on macOS (add/update projects+todos via URL scheme; read/search/list from the local Things database). Use when a user asks OpenClaw to add a task to Things, list inbox/today/upcoming, search tasks, or inspect projects/areas/tags.