Skip to main content
ClaudeWave
Slash Command828 estrellas del repoactualizado 13d ago

pr-create

The pr-create command automates pull request creation by capturing the current Git branch context, recent commits, and changed files, then generates a PR with auto-detected title and description if not explicitly provided. Use this when you need to quickly create a pull request without manually gathering branch information or writing PR descriptions from scratch.

Instalar en Claude Code
Copiar
mkdir -p ~/.claude/commands && curl -fsSL https://raw.githubusercontent.com/huangjia2019/claude-code-engineering/HEAD/05-Commands/projects/02-advanced-commands/.claude/commands/pr-create.md -o ~/.claude/commands/pr-create.md
Después abre una sesión nueva de Claude Code; el slash command carga automáticamente.

pr-create.md

Create a pull request.

Title: $1
Description: $2

## Current Context (Auto-detected)

Current branch:
!`git branch --show-current`

Recent commits on this branch:
!`git log origin/main..HEAD --oneline 2>/dev/null || echo "No commits ahead of main"`

Files changed:
!`git diff --stat origin/main 2>/dev/null || git diff --stat HEAD~3`

## Steps

1. Ensure we're not on main/master branch
2. Push current branch to remote (if not already)
3. Create PR using `gh pr create`:
   - Title: $1 (or auto-generate from branch name)
   - Body: $2 (or auto-generate from commits)
4. Return the PR URL

## PR Body Template

If $2 is not provided, generate:

```markdown
## Summary
[Auto-generated from commit messages]

## Changes
[List of changed files with brief descriptions]

## Testing
- [ ] Tests pass locally
- [ ] Manual testing completed

---
Created with `/pr-create`
```

## Output

```
✓ PR Created: [URL]

Title: [title]
Branch: [branch] → main
Changes: [n] files
```