Create Pull Request
Commit changes, push to remote, and create a pull request with a conventional commit-style title and comprehensive description: $ARGUMENTS
Current Repository State
- Git status: !
git status --porcelain
- Current branch: !
git branch --show-current
- Default branch: !
git rev-parse --abbrev-ref origin/HEAD 2>/dev/null | sed 's|origin/||' || echo main
- Staged changes: !
git diff --cached --stat
- Unstaged changes: !
git diff --stat
- Recent commits on this branch: !
git log --oneline -10
- Existing PR for branch: !
gh pr view --json number,title,body 2>/dev/null || echo "No existing PR"
What This Command Does
- Stage and commit changes using conventional commit format (follow the gh-commit skill conventions)
- If there are unstaged changes, stage and commit them with appropriate conventional commit messages
- If multiple distinct logical changes exist, create separate commits for each
- ALWAYS attribute AI-assisted code authorship in commits
- Push the branch to the remote repository
- If the current branch is the default branch (main/master), create a new feature branch first
- Use
git push -u origin <branch> to set upstream tracking
- Analyze all changes in the branch relative to the base branch
- Run
git diff origin/<default-branch>...HEAD to review the full scope of changes
- Read relevant modified files to understand the context and impact of changes
- Generate a PR title following Conventional Commits format:
- Format:
<type>[optional scope]: <description>
- Types:
feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert
- Use
! after type/scope for breaking changes: feat(api)!: change response format
- Keep the title concise (under 72 characters)
- For multi-commit PRs, synthesize a higher-level title that captures the overall theme
- Generate a PR description with the structure defined in the PR Description Template below
- Create or update the pull request
- If no PR exists for this branch:
gh pr create --title "TITLE" --body "DESCRIPTION"
- If a PR already exists:
gh pr edit <number> --title "TITLE" --body "DESCRIPTION"
PR Title Examples
feat(auth): add JWT token refresh endpoint
fix(ui): resolve layout shift on mobile navigation
docs: update API reference for v2 endpoints
refactor(db): migrate from raw SQL to query builder
feat(api)!: change pagination response format
chore(deps): bump TypeScript to 5.x
PR Description Template
Use this structure for the PR body. Omit sections that are not applicable.
## Summary
[1-2 sentence overview of what this PR does and why]
## Changes
- [Key change 1]
- [Key change 2]
- [Key change 3]
## Breaking Changes
[Describe what breaks and required migration steps]
## Notes
[Additional context, testing instructions, or deployment considerations]
Guidelines
- Respect existing content: If the PR title already follows conventional commit format, keep it unless it's inaccurate. If a PR already has a meaningful description, enhance it rather than replace it entirely.
- Issue references: If the branch name contains an issue number (e.g.,
feat/123-add-auth), reference it in the description with Closes #123 or Refs #123.
- Holistic analysis: The PR title should capture the overall intent of the changes, not just list individual commits.
- Single-commit PRs: The PR title can mirror the commit message.
- Multi-commit PRs: Synthesize a higher-level title that captures the full scope.
- Use markdown formatting in the description for readability.
Important Notes
- By default, pre-commit checks (defined in
prek.toml) will run to ensure code quality
- IMPORTANT: DO NOT SKIP pre-commit checks
- ALWAYS attribute AI-Assisted Code Authorship in commit messages
- Always review the diff before generating the title and description to ensure accuracy
- If
gh CLI is not authenticated, prompt the user to run gh auth login first
1---2name: gh-create-pr3description: Commit unstaged changes, push changes, submit a pull request.4---56# Create Pull Request78Commit changes, push to remote, and create a pull request with a conventional commit-style title and comprehensive description: $ARGUMENTS910## Current Repository State1112- Git status: !`git status --porcelain`13- Current branch: !`git branch --show-current`14- Default branch: !`git rev-parse --abbrev-ref origin/HEAD 2>/dev/null | sed 's|origin/||' || echo main`15- Staged changes: !`git diff --cached --stat`16- Unstaged changes: !`git diff --stat`17- Recent commits on this branch: !`git log --oneline -10`18- Existing PR for branch: !`gh pr view --json number,title,body 2>/dev/null || echo "No existing PR"`1920## What This Command Does21221. **Stage and commit changes** using conventional commit format (follow the gh-commit skill conventions)23 - If there are unstaged changes, stage and commit them with appropriate conventional commit messages24 - If multiple distinct logical changes exist, create separate commits for each25 - ALWAYS attribute AI-assisted code authorship in commits262. **Push the branch** to the remote repository27 - If the current branch is the default branch (main/master), create a new feature branch first28 - Use `git push -u origin <branch>` to set upstream tracking293. **Analyze all changes** in the branch relative to the base branch30 - Run `git diff origin/<default-branch>...HEAD` to review the full scope of changes31 - Read relevant modified files to understand the context and impact of changes324. **Generate a PR title** following Conventional Commits format:33 - Format: `<type>[optional scope]: <description>`34 - Types: `feat`, `fix`, `docs`, `style`, `refactor`, `perf`, `test`, `build`, `ci`, `chore`, `revert`35 - Use `!` after type/scope for breaking changes: `feat(api)!: change response format`36 - Keep the title concise (under 72 characters)37 - For multi-commit PRs, synthesize a higher-level title that captures the overall theme385. **Generate a PR description** with the structure defined in the PR Description Template below396. **Create or update the pull request**40 - If no PR exists for this branch: `gh pr create --title "TITLE" --body "DESCRIPTION"`41 - If a PR already exists: `gh pr edit <number> --title "TITLE" --body "DESCRIPTION"`4243## PR Title Examples4445```46feat(auth): add JWT token refresh endpoint47fix(ui): resolve layout shift on mobile navigation48docs: update API reference for v2 endpoints49refactor(db): migrate from raw SQL to query builder50feat(api)!: change pagination response format51chore(deps): bump TypeScript to 5.x52```5354## PR Description Template5556Use this structure for the PR body. Omit sections that are not applicable.5758```markdown59## Summary6061[1-2 sentence overview of what this PR does and why]6263## Changes6465- [Key change 1]66- [Key change 2]67- [Key change 3]6869## Breaking Changes7071[Describe what breaks and required migration steps]7273## Notes7475[Additional context, testing instructions, or deployment considerations]76```7778## Guidelines7980- **Respect existing content**: If the PR title already follows conventional commit format, keep it unless it's inaccurate. If a PR already has a meaningful description, enhance it rather than replace it entirely.81- **Issue references**: If the branch name contains an issue number (e.g., `feat/123-add-auth`), reference it in the description with `Closes #123` or `Refs #123`.82- **Holistic analysis**: The PR title should capture the overall intent of the changes, not just list individual commits.83- **Single-commit PRs**: The PR title can mirror the commit message.84- **Multi-commit PRs**: Synthesize a higher-level title that captures the full scope.85- Use markdown formatting in the description for readability.8687## Important Notes8889- By default, pre-commit checks (defined in `prek.toml`) will run to ensure code quality90 - IMPORTANT: DO NOT SKIP pre-commit checks91- ALWAYS attribute AI-Assisted Code Authorship in commit messages92- Always review the diff before generating the title and description to ensure accuracy93- If `gh` CLI is not authenticated, prompt the user to run `gh auth login` first