PR Creator Skill
Create well-formatted GitHub Pull Requests with intelligent title and description generation.
Prerequisites
- •GitHub CLI (
gh) installed and authenticated - •Changes committed to a feature branch
- •Remote branch pushed
PR Title Generation
Generate concise, descriptive PR titles based on the task:
Rules
- •Start with action verb: "Add", "Fix", "Update", "Refactor", "Remove", "Improve"
- •Keep under 70 characters
- •Be specific about what changed
- •Use imperative mood
Examples
| Task | Generated Title |
|---|---|
| "Fix the login timeout bug" | Fix login timeout by increasing session duration |
| "Add user authentication" | Add JWT-based user authentication |
| "Refactor database queries" | Refactor database layer for better performance |
| "Update the API error handling" | Update API error handling with proper status codes |
| "Remove deprecated functions" | Remove deprecated legacy API functions |
PR Body Template
markdown
## Summary <!-- 1-3 bullet points of key changes --> - <change 1> - <change 2> - <change 3> ## Task > <Original task description> ## Changes ### Files Modified <!-- List of changed files with brief explanation --> - `path/to/file.js` - <what changed> - `path/to/other.js` - <what changed> ### Key Implementation Details <!-- Technical details worth noting --> - <detail 1> - <detail 2> ## Testing ### Automated Tests - [ ] Unit tests pass - [ ] Integration tests pass - [ ] No new warnings ### Manual Testing - [ ] <test case 1> - [ ] <test case 2> ## Codex Review **Status**: ✅ Approved **Summary**: <brief review summary> ## Metadata | Field | Value | |-------|-------| | Implementer | OpenCode (GLM 4.7) / Claude Code (Opus 4.5) | | Reviewer | Codex (GPT-5.2-Codex) | | Iterations | <N> | | Task ID | <task_id> | --- 🦞 Generated by [Clawdbot Intelligent Implementer](https://github.com/clawdbot/clawdbot)
Usage
From Shell Script
bash
# Basic usage ./lib/gh-pr.sh \ --title "Fix login timeout issue" \ --task "Fix the login timeout bug that causes users to be logged out" \ --base main \ --head ai/fix-login-timeout \ --state-file /path/to/state.json # With additional options ./lib/gh-pr.sh \ --title "Add user authentication" \ --task "Implement JWT-based user authentication" \ --base develop \ --head ai/add-user-auth \ --state-file /path/to/state.json \ --draft \ --reviewer username
From Orchestrator
The orchestrator automatically calls the PR creator after successful task completion:
bash
# The orchestrator does this internally: PR_URL=$(./skills/pr-creator/lib/gh-pr.sh \ --title "$GENERATED_TITLE" \ --task "$TASK_DESCRIPTION" \ --base "$BASE_BRANCH" \ --head "$BRANCH_NAME" \ --state-file "$LOG_DIR/state.json")
Commands Reference
Create PR
bash
gh pr create \ --title "$PR_TITLE" \ --body "$PR_BODY" \ --base "$BASE_BRANCH" \ --head "$BRANCH_NAME"
Get PR URL
bash
gh pr view --json url -q '.url'
Add Labels
bash
gh pr edit --add-label "ai-generated,needs-review"
Request Reviewers
bash
gh pr edit --add-reviewer "username1,username2"
Create as Draft
bash
gh pr create --draft \ --title "$PR_TITLE" \ --body "$PR_BODY"
Error Handling
- •Branch not pushed: Auto-push before creating PR
- •PR already exists: Return existing PR URL
- •Auth issues: Prompt to run
gh auth login - •Rate limiting: Wait and retry
Configuration
In ~/.clawdbot-orchestrator.env:
bash
# PR defaults PR_DEFAULT_LABELS=ai-generated PR_AUTO_DRAFT=false PR_AUTO_REVIEWERS= # Template customization PR_TEMPLATE_PATH=.github/PULL_REQUEST_TEMPLATE.md