commit-pr
SKILL.md
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
Weekly Installs
1
Repository
sweetretry/skillsFirst Seen
Feb 7, 2026
Installed on
amp1
opencode1
cursor1
kimi-cli1
codex1
github-copilot1