| name | open-pr |
| description | Open a pull request for the current feature branch |
Skill: open-pr
Load Context
- Read
$ARGUMENTS for the feature name. If empty, infer from current branch name (feat/<feature>).
- Scan all JSON files in
task-state/<feature>/ and confirm task states
- Run
git log main..HEAD --oneline to get all commits on this branch
- Read
docs/modules/<feature>/TASKS.<feature>.md
- Read
.github/pull_request_template.md
Pre-checks
- If any task state is not
committed → list the unfinished tasks, abort: "The following tasks are not yet committed. Complete all tasks before opening a PR."
- If the current branch is
main or master → abort: "Run this command from a feature branch."
- If there are no new commits compared to
main → abort: "No changes to merge."
Steps
Step 1: Push the branch
git push -u origin feat/<feature>
If the remote branch already exists, use git push (not force-push). If it fails, ask the user to handle it manually.
Step 2: Draft the PR title
Format: feat(<feature>): <one-sentence summary of the PR>
- Under 50 characters
- Distilled from the commit list, not a simple concatenation
Step 3: Draft the PR body
Fill in all sections from pull_request_template.md:
Summary (≤ 3 bullets — describe what changed, not how):
- Distil from the TASKS file
- Focus on user-visible changes, not technical details
Related Issues:
- Extract
Refs: #N or Fixes: #N from commit messages
- If none → write
N/A
Changes (one line per major file or module):
Test Plan (checkable list):
- Unit tests pass
- Integration tests pass
- Manually tested the critical path
- Edge cases considered
Checklist:
- Keep all items from the template — do not remove any
Step 4: Create the PR
gh pr create \
--title "<title>" \
--body "<body>" \
--base main \
--head feat/<feature>
Step 5: Output result
✅ PR created: <PR URL>
Title: <title>
Base: main ← feat/<feature>
Tasks: N committed
Next steps:
- Wait for CI to pass
- Wait for code review
- After merge, run /release staging
Error Handling
| Situation | Action |
|---|
gh is not authenticated | Ask the user to run gh auth login, then abort |
| Push rejected by branch protection rules | Print the error, ask the user to check repository permissions |
| PR already exists for this branch | Print the existing PR URL, ask whether to update the PR description instead |
| Cannot reach GitHub | Print the PR title and body in the conversation for the user to create manually |
Done When