Create a PR with proper formatting, auto-generated description, and issue links
Creates pull requests with auto-generated descriptions, conventional formatting, and issue linking.
/plugin marketplace add C0ntr0lledCha0s/claude-code-plugin-automations/plugin install github-workflows@claude-code-plugin-automations[--title TITLE] [--draft]Create a pull request with automatically generated description from commits and proper formatting.
/pr-create # Auto-detect title and generate description
/pr-create --title "Add auth" # Custom title
/pr-create --draft # Create as draft PR
/pr-create --title "Fix bug" --draft
--title TITLE (optional): PR title
--draft (optional): Create as draft PR
When this command is invoked:
# Get current branch
BRANCH=$(git branch --show-current)
# Get base branch (main or develop)
BASE=$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@' || echo "main")
# Get commits on this branch
COMMITS=$(git log $BASE..$BRANCH --pretty=format:"%s" --reverse)
# Get files changed
FILES=$(git diff --name-only $BASE...$BRANCH)
If title not provided:
# From branch name: feature/issue-42-auth → Add authentication (Closes #42)
# From first commit: feat(auth): add login → Add login
# Parse branch for issue number
ISSUE=$(echo "$BRANCH" | grep -oE '[0-9]+' | head -1)
# Use first commit subject
TITLE=$(git log $BASE..$BRANCH --pretty=format:"%s" --reverse | head -1)
Generate PR body with:
## Summary
[Auto-generated from commits]
## Changes
- List of commits grouped by type
- Files changed
## Testing
- [ ] Tests added/updated
- [ ] Manual testing completed
- [ ] No regressions
## Related Issues
Closes #N (if detected from branch name or commits)
---
🤖 Generated with [Claude Code](https://claude.com/claude-code)
# From commit types
feat: → feature
fix: → bug
docs: → documentation
# From file paths
frontend/* → scope:frontend
backend/* → scope:backend
*.test.* → has-tests
# Get any linked issues
ISSUES=$(echo "$COMMITS" | grep -oE '#[0-9]+' | sort -u | tr '\n' ' ')
# Create the PR
gh pr create \
--title "$TITLE" \
--body "$BODY" \
--base "$BASE" \
${DRAFT:+--draft} \
${LABELS:+--label "$LABELS"}
After PR is created:
Creating PR for branch: feature/issue-42-auth
Branch Analysis:
- Base: main
- Commits: 3
- Files changed: 8
Generated Title: feat(auth): add user authentication
Generated Description:
## Summary
Add user authentication with JWT tokens...
Detected Labels: feature, scope:backend
Creating PR...
✓ PR created: https://github.com/owner/repo/pull/123
Suggested reviewers based on CODEOWNERS:
- @backend-team (src/api/*)
- @security-team (src/auth/*)
Add to project board?
Works with:
/pr-create> 不再推荐:请优先使用 `/pr-create-smart` 生成高质量的 PR 描述草稿,然后使用 gh/GUI 创建 PR。本命令属于“端到端自动创建 PR(保留模板、自动打标签、创建 Draft)”的旧方案,仅为兼容保留。
/pr-createCreates Pull Requests automatically by analyzing your Git changes for a smoother workflow.
/pr-create> 不再推薦:請優先使用 `/pr-create-smart` 生成高質量的 PR 描述草稿,然後使用 gh/GUI 創建 PR。本命令属于“端到端自動創建 PR(保留模板、自動打標簽、創建 Draft)”的旧方案,仅為兼容保留。