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.
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.mdpr-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 ```
Review code changes for quality, security, and best practices. Proactively use this after code modifications.
Run tests and report results concisely. Use this after code changes to verify everything works.
Analyze log files and extract actionable insights. Use when troubleshooting issues or investigating incidents.
Explore and analyze API-related code. Use when investigating endpoints, routing, or HTTP handling.
Explore and analyze authentication-related code. Use when investigating auth flows, session management, or security.
Explore and analyze database-related code. Use when investigating data models, queries, or persistence.
Analyze root cause of bugs after location is identified. Second step in bug investigation.
Implement bug fixes after analysis is complete. Third step in bug fix pipeline.