Agent skill · software engineering · lobehub

pr

Create a PR for the current branch (targets `canary` by default), including splitting one cross-layer branch into ordered stacked PRs so a lower layer (db / shared package / server TRPC) merges before its callers (desktop / CLI / UI). Use when the user asks to create / submit a PR, or to split a branch because clients call a server contract that isn't on the trunk yet. Triggers on 'pr', 'create pr', 'submit pr', 'open a PR', 'pull request', 'split this PR', 'stacked PR', 'backend should merge first', '提 PR', '提个 PR', '新建 PR', '拆 PR', '后端先合', '分层合并'.

Why this skill is useful

Adds a comprehensive automation script for creating and managing PRs with specific branching strategies and handling stacked PRs that the AI cannot generate on its own.

What it needs

Requires gh, git installed locally. About 8k tokens when loaded. Last updated 2026-08-07. 81,352 stars on the source repository.

What this skill does

Create Pull Request Branch Strategy Target branch: canary (development branch, cloud production) main is the release branch — never PR directly to main Steps 1. Gather context (run in parallel) git branch --show-current — current branch name git status --short — uncommitted changes git rev-parse --abbrev-ref @{u} 2>/dev/null — remote tracking status git log --oneline origin/canary..HEAD — unpushed commits gh pr list --head "$(git branch --show-current)" --json number,title,state,url — existing PR git diff --stat --stat-count=20 origin/canary..HEAD — change summary Reuse an existing acceptance link from the task when it covers the delivered behavior. If a lookup is needed, first follow Publish auth preflight, then run publishlh acceptance run list --json and match on branch. Do not blindly unset API keys: the production credential may exist only in the environment. A lookup never requires creating a new round. 2. Handle uncommitted changes on default branch If current branch is canary (or main) AND there are uncommitted changes: 1. Analyze the diff (git diff) to understand the changes 2. Infer a branch name from the changes, format: <type>/<short-description> (e.g. fix/i18n-cjk-spacing) 3. Create and switch to the new branch: git checkout -b <branch-name> 4. Stage relevant files: git add <files> (prefer explicit file paths over git add .) 5. Commit with a proper gitmoji message 6. Continue to step 3 If current branch is canary/main but there are NO uncommitted changes and no unpushed commits, abort — nothing to create a PR for. 3. Push if needed No upstream: git push -u origin $(git branch --show-current) Has upstream: git push origin $(git branch --show-current) 4. Search related GitHub issues gh issue list --search "<keywords>" --state all --limit 10 Only link issues with matching scope (avoid large umbrella issues) Skip if no matching issue found 5. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills lobehub/pr

View the source on GitHub

Browse the @skills marketplace