Agent skill
pr
Create a PR for the current branch. Use when the user asks to create a pull request, submit PR, or says 'pr'.
Install this agent skill to your Project
npx add-skill https://github.com/lobehub/lobehub/tree/canary/.agents/skills/pr
SKILL.md
Create Pull Request
Branch Strategy
- Target branch:
canary(development branch, cloud production) mainis the release branch — never PR directly to main
Steps
1. Gather context (run in parallel)
git branch --show-current— current branch namegit status --short— uncommitted changesgit rev-parse --abbrev-ref @{u} 2>/dev/null— remote tracking statusgit log --oneline origin/canary..HEAD— unpushed commitsgh pr list --head "$(git branch --show-current)" --json number,title,state,url— existing PRgit diff --stat --stat-count=20 origin/canary..HEAD— change summary
2. Handle uncommitted changes on default branch
If current branch is canary (or main) AND there are uncommitted changes:
- Analyze the diff (
git diff) to understand the changes - Infer a branch name from the changes, format:
<type>/<short-description>(e.g.fix/i18n-cjk-spacing) - Create and switch to the new branch:
git checkout -b <branch-name> - Stage relevant files:
git add <files>(prefer explicit file paths overgit add .) - Commit with a proper gitmoji message
- 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. Create PR with gh pr create --base canary
- Title:
<gitmoji> <type>(<scope>): <description> - Body: based on PR template (
.github/PULL_REQUEST_TEMPLATE.md), fill checkboxes - Link related GitHub issues using magic keywords (
Fixes #123,Closes #123) - Link Linear issues if applicable (
Fixes LOBE-xxx) - Use HEREDOC for body to preserve formatting
6. Open in browser
gh pr view --web
PR Template
Use .github/PULL_REQUEST_TEMPLATE.md as the body structure. Key sections:
- Change Type: Check the appropriate gitmoji type
- Related Issue: Link GitHub/Linear issues with magic keywords
- Description of Change: Summarize what and why
- How to Test: Describe test approach, check relevant boxes
Notes
- Language: All PR content must be in English
- If a PR already exists for the branch, inform the user instead of creating a duplicate
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
task
i18n
Internationalization guide using react-i18next. Use when adding translations, creating i18n keys, or working with localized text in React components (.tsx files). Triggers on translation tasks, locale management, or i18n implementation.
data-fetching
Data fetching architecture guide using Service layer + Zustand Store + SWR. Use when implementing data fetching, creating services, working with store hooks, or migrating from useEffect. Triggers on data loading, API calls, service creation, or store data fetching tasks.
recent-data
Guide for using Recent Data (topics, resources, pages). Use when working with recently accessed items, implementing recent lists, or accessing session store recent data. Triggers on recent data usage or implementation tasks.
hotkey
Guide for adding keyboard shortcuts. Use when implementing new hotkeys, registering shortcuts, or working with keyboard interactions. Triggers on hotkey implementation or keyboard shortcut tasks.
debug
Debug package usage guide. Use when adding debug logging, understanding log namespaces, or implementing debugging features. Triggers on debug logging requests or logging implementation.
Didn't find tool you were looking for?