.claude/skills/prepare-pr
code:SKILL.md
---
name: prepare-pr
description: Use after implementation and tests pass - creates DRAFT PR with branch management, atomic commits, and mandatory check-pr-template verification for project-specific requirements
user-invocable: true
---
# Prepare PR
## Overview
Systematic workflow for preparing a draft pull request with proper branch management, commit strategy, and requirements verification.
**Purpose**: Ensure consistent, high-quality PR creation with proper checks and always-draft status.
**When to use**: After implementation and tests are complete, ready to submit for review.
## Execution Protocol
### 1. Branch State Verification
- Check current branch
- If on main or master, create descriptive feature branch
- Branch naming: feature/, fix/, refactor/, docs/ + description
### 2. Commit Strategy
Analyze changes to determine strategy:
- **Single logical change**: One commit
- **Multiple independent changes**: Split into atomic commits
For each commit:
- Check repository commit rules (CONTRIBUTING.md, .gitmessage)
- Follow Conventional Commits **with scope**: type(scope): description
- Keep first line under 72 characters
- Use imperative mood
- **NEVER** include AI tool references
### 3. Push Branch
Push with upstream tracking: git push -u origin <branch>
### 4. Verify PR Requirements (MANDATORY)
**ALWAYS** invoke check-pr-template skill first:
`
/check-pr-template
`
This provides:
- PR template structure
- Recent PR title format analysis
- Scope usage patterns
### 5. Create Draft Pull Request
**CRITICAL**: Always use --draft flag
`bash
gh pr create --draft --base main --title "<format>" --body "<template>"
`
Requirements:
- Follow title format from check-pr-template analysis
- Respect PULL_REQUEST_TEMPLATE structure
- **NEVER** include AI tool references
### 6. Verify Creation
Confirm draft status and get PR URL for user.
## Responsibility Scope
**This skill guides**:
- Branch management decisions
- Commit strategy analysis
- PR requirements verification workflow
- Draft PR creation with proper format
**This skill does NOT**:
- Automatically run tests (user must verify first)
- Enforce template compliance (guidance only)
- Modify code or resolve conflicts
- Auto-merge or auto-approve PRs
## Integration
Coordinates with:
- check-pr-template: Verifies template and title format requirements
## Key Principles
1. **Draft First**: All PRs start as draft for iterative improvement
2. **Atomic Commits**: Each commit independently reviewable
3. **Scope Required**: Title format must include scope: feat(auth): not feat:
4. **Template Respect**: Follow project PR template exactly
5. **No AI Credits**: Never reference Claude Code or AI tools