| name | pr |
| description | This skill should be used when the user asks to "create a PR", "open a pull request", "submit for review", or wants to push and open a PR with an AI-generated summary and checklist. |
| category | operations |
| argument-hint | ["base-branch"] |
Create a pull request with an AI-generated summary and AI usage checklist.
Pre-flight
-
Check for uncommitted changes. Run git status. If there are unstaged or staged changes that haven't been committed, suggest running /commit first. Do not proceed with uncommitted changes.
-
Determine the base branch. If $ARGUMENTS provides a branch name, use it. Otherwise, detect the default branch: try git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@', then fall back to main, then master. Verify the base branch exists.
-
Determine the current branch. Run git branch --show-current. If on the base branch, tell the user to create a feature branch first.
-
Check for existing PR. Run gh pr view --json number,state,url 2>/dev/null. If an open PR already exists for this branch, show its URL and ask if the user wants to update it or create a new one.
Gather Context
-
Get the full diff. Run git diff $BASE...HEAD to see all changes that will be in the PR.
-
Get the commit history. Run git log $BASE..HEAD --oneline to understand the logical progression of changes.
-
Read project guidelines. Check for ember.md, CONTRIBUTING.md, or PR template at .github/pull_request_template.md. If a template exists, follow its structure.
Generate PR Content
-
Write the PR title. Under 70 characters, imperative mood. Summarize the high-level intent, not the implementation details.
-
Write the PR body with these sections:
## Summary
<!-- 1-3 sentences: what changed and why -->
## Changes
<!-- Bullet list of logical changes, grouped by area -->
## AI Usage
- [ ] AI-generated code has been reviewed by a human
- [ ] Tests cover AI-generated logic
- [ ] No hallucinated imports or dependencies
- [ ] Security-sensitive code manually verified
<!-- Check all that apply: -->
- [ ] AI was used for implementation
- [ ] AI was used for test generation
- [ ] AI was used for code review
- [ ] AI was used for documentation
## Test Plan
<!-- How was this tested? What commands to run? -->
- Infer the test plan from the changes. If test files were modified, reference them. If not, note what should be tested.
Create the PR
-
Check for gh CLI. Run which gh. If not installed:
- Output the complete PR title and body as markdown
- Tell the user to create the PR manually with this content
- Stop here
-
Push the branch. Run git push -u origin HEAD.
-
Create the PR. Run:
gh pr create --title "<title>" --body "<body>" --base <base-branch>
Use a HEREDOC for the body to preserve formatting.
-
Show the result. Display the PR URL.
Edge Cases
- No commits on branch: Tell the user there are no changes to submit.
- Branch already up on remote with open PR: Ask whether to update the existing PR description or create a new one.
- Very large diff (>50 files): Focus the summary on the most impactful changes. Note the PR is large and recommend splitting if feasible.
- Draft PR: If the user says "draft" in arguments, add
--draft flag.
- No
gh CLI: Degrade gracefully — output the PR content as markdown for manual creation.