commit-pr
1
总安装量
1
周安装量
#76194
全站排名
安装命令
npx skills add https://github.com/sweetretry/skills --skill commit-pr
Agent 安装分布
amp
1
opencode
1
cursor
1
kimi-cli
1
github-copilot
1
Skill 文档
Pre-flight Validation
- Check git repo:
git rev-parse --git-dir 2>/dev/null || echo "Not a git repo" - Check gh CLI:
gh --version 2>/dev/null || echo "gh not installed" - If either fails, exit with error message
Step 1: Commit Changes
- Run
git status -sbto check state - If changes exist:
- View:
git diff --stagedandgit diff - Stage:
git add -A(or ask user for specific files) - Generate Conventional Commit message:
- Format:
<type>(<scope>): <description> - Types:
feat|fix|docs|style|refactor|perf|test|chore
- Format:
- Commit with HEREDOC to preserve formatting
- View:
- If no changes, skip to Step 2
Step 2: Push Branch
- Check upstream:
git rev-parse --abbrev-ref --symbolic-full-name @{u} 2>/dev/null - Push:
git push -u origin $(git branch --show-current)orgit push
Step 3: Create/Update PR
3.1 Gather Context
# Detect base branch
git remote show origin | grep 'HEAD branch' | cut -d: -f2 | xargs
# Check existing PR
gh pr view --json number,title,body 2>/dev/null
# Get commits & diff (run in parallel)
git log origin/<base>..HEAD --oneline
git diff origin/<base>...HEAD --stat
3.2 Determine Language
- Analyze
$ARGUMENTSfor Chinese characters â 䏿 PR - Otherwise â English (default)
3.3 PR Template
Title: <type>(<scope>): <description> (max 72 chars)
Body (English):
## Summary
[2-4 sentences: what changed and why]
## Changes
- Change 1
- Change 2
## Type
- [ ] Bug fix
- [ ] Feature
- [ ] Breaking change
- [ ] Refactor
## Testing
[How to test]
## Checklist
- [ ] Follows style guide
- [ ] Self-reviewed
- [ ] Tests added/updated
Body (䏿):
## æ¦è¿°
[æ¹å¨å
容ååå ï¼2-4å¥è¯]
## æ¹å¨å
容
- æ¹å¨ç¹1
- æ¹å¨ç¹2
## åæ´ç±»å
- [ ] Bugä¿®å¤
- [ ] æ°åè½
- [ ] ç ´åæ§åæ´
- [ ] éæ
## æµè¯æ¹æ³
[å¦ä½æµè¯]
## æ£æ¥æ¸
å
- [ ] éµå¾ªä»£ç è§è
- [ ] å·²èªæå®¡æ¥
- [ ] 已添å /æ´æ°æµè¯
3.4 Execute
# Create PR
gh pr create --title "feat(auth): add OAuth login" --body "$(cat <<'EOF'
## Summary
Added OAuth 2.0 authentication flow using Passport.js.
## Changes
- Implemented OAuth strategy
- Added login/callback routes
- Updated user model
EOF
)"
# Or edit existing PR
gh pr edit <number> --title "..." --body "$(cat <<'EOF' ... EOF)"
Notes
- Analyze ALL commits in branch for description
- NEVER use
--forcepush - Handle pre-commit hook failures gracefully