| name | openup-create-pr |
| description | Create a pull request with proper description linking to roadmap task context |
| model | sonnet |
| fit | {"great":["shipping a finished task","opening a review-ready PR"],"ok":["WIP / draft PRs for early feedback"],"poor":["pre-merge to local-only branches","work not yet committed"]} |
| arguments | [{"name":"task_id","description":"The task ID from roadmap (e.g., T-001). Auto-detected from branch name if not provided.","required":false},{"name":"branch","description":"The branch to create PR from. Uses current branch if not provided.","required":false},{"name":"title","description":"Custom PR title. Auto-generated from task if not provided.","required":false},{"name":"base","description":"Base branch to merge into (e.g., main, develop). Auto-detected if not provided.","required":false}] |
Create Pull Request
Create a PR with a structured description linked to roadmap task context.
Process
1. Detect Current State
- Use
$ARGUMENTS[branch] or git rev-parse --abbrev-ref HEAD.
- Check for unmerged commits:
git log <trunk>..HEAD --oneline. Exit if none.
- Detect platform:
command -v gh (GitHub) or command -v glab (GitLab).
- Verify remote:
git remote get-url origin.
2. Prepare Commits
- Trunk guard: If on trunk (main/master/detected), create and switch to a feature branch (
git checkout -b feature/... or fix/...).
- Check uncommitted changes:
git status --porcelain. If clean, skip to step 3.
- Organize atomic commits: Group changes into logical units. Commit in dependency order (deps/config → types/interfaces → core logic → dependent features). Follow format from
docs-eng-process/conventions.md.
- Apply test strategy: Bundle tests with feature commits. For bug fixes, commit failing test first, then the fix.
- Lint before committing: Run linter/formatter before each commit. Skip if none configured.
- Full rules:
commit-procedure.md in complete-task/.
3. Extract Task Context
- Get task_id from
$ARGUMENTS[task_id] or extract from branch name (regex ([Tt]-?\d+)).
- Read
docs/roadmap.md, find task section, extract description/priority/status.
- Generate title:
[<task_id>] <description> or use $ARGUMENTS[title].
4. Detect Trunk Branch
Use $ARGUMENTS[base] if provided; otherwise follow trunk detection in docs-eng-process/sops/branching.md (Branching SOP). Record detected trunk in run log.
5. Generate PR Description
Use template from docs-eng-process/templates/pr-description.md and populate:
- Summary, Task Context (id, description, priority), Changes Made (git diff/log)
- Testing Performed, Review Checklist, Related Issues, Breaking Changes, Notes
6. Push Branch and Create PR
git push -u origin <branch>
gh pr create --base <base> --title "<title>" --body "<description>" --label "task:<task_id>"
glab mr create --base <base> --title "<title>" --description "<description>" --label "task:<task_id>"
7. Update Documentation (Optional)
docs/roadmap.md: Add PR URL to task entry
docs/project-status.md: Note PR in Active Work Items
Common Errors
| Error | Cause | Solution |
|---|
| No unmerged commits | Branch up to date with trunk | Inform user no PR needed |
| No remote configured | Git remote not set up | git remote add origin <url> |
| CLI not installed | gh/glab not available | brew install gh or brew install glab |
| No task_id found | Branch name has no task ID | Proceed without task context or provide manually |
| Roadmap not found | docs/roadmap.md missing | Proceed without task context, inform user |
| PR already exists | Branch already has open PR | Inform user of existing PR URL |
| On trunk branch | Working directly on main/master | Auto-create feature branch before committing |
References
- Branching SOP:
docs-eng-process/sops/branching.md
- PR Description Template:
docs-eng-process/templates/pr-description.md
- Roadmap:
docs/roadmap.md
See Also