Agent skill
pull-request
Analyzes branch diffs, drafts PR titles and bodies following Conventional Commits, and creates or updates pull requests via GitHub CLI. Use when user asks to "create a PR", "open a pull request", "update PR description", "draft a PR", or "submit changes for review".
Install this agent skill to your Project
npx add-skill https://github.com/jiyeol-lee/dotfiles/tree/main/.opencode/skills/pull-request
SKILL.md
Workflow
- Preflight
- Confirm git repo, branch, and commits exist
- Ensure current branch is NOT
mainormaster— abort if so - Check for unpushed commits
- Analyze
- Use
tool__git--retrieve-current-branch-diffto analyze commits since diverging from target branch - Scan commit messages for issue references (e.g.,
LINEAR-123,JIRA-456,#123) - Check for PR template: try to read
.github/pull_request_template.mdorpull_request_template.md
- Use
- Draft
- If existing PR:
- Fetch context (reviews, comments) using
tool__gh--retrieve-pull-request-info - If a template was found, validate the existing body against it and draft updates conforming to the template
- Draft content updates based on reviews/comments
- Fetch context (reviews, comments) using
- If new PR:
- If template found: fill it out with the summary of changes (do not change template structure or headers)
- If no template: draft a standard title and body
- Use
tool__gh--retrieve-repository-collaboratorsto list available reviewers - Ask the user: "Who should be the reviewer?"
- Present the draft (title, body) and wait for approval
- If existing PR:
- Publish (only after explicit approval)
- Push commits if needed: use
tool__git--push - Use
tool__gh--create-pull-request(new) ortool__gh--edit-pull-request(existing) - Use user-provided reviewers
- Report the final PR URL
- Push commits if needed: use
PR Title Format
Follow Conventional Commits for the PR title:
| Prefix | When to Use |
|---|---|
feat: |
New feature |
fix: |
Bug fix |
refactor: |
Code refactoring |
docs: |
Documentation only |
chore: |
Maintenance, deps, CI |
test: |
Adding or updating tests |
PR Body Guidelines
- If a PR template exists, conform to its structure and headers exactly
- Summarize changes clearly — explain why, not just what or how
- Use markdown formatting for readability
- Include issue references if found in commits
Example Output
For a branch with 3 commits adding a new caching layer:
Title: feat: add Redis caching for user session lookups
Body:
## Summary
- Add Redis-based caching for user session lookups to reduce DB load
- Cache TTL is 15 minutes with automatic invalidation on session update
- Add `RedisCacheService` with connection pooling and retry logic
Constraints
- NEVER create or update a PR without explicit user approval
- NEVER auto-select or recommend reviewers — list collaborators and let the user choose
- NEVER push without explicit approval
- NEVER force-push to main/master
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
commit
Analyzes repository state, proposes commit messages following Conventional Commits, and applies commits after user approval. Use when asked to "commit", "commit changes", "save my work", "create a commit", or "stage and commit".
review
Performs code review analysis across Quality, Regression, Documentation, and Performance focus areas with severity-classified findings. Use when user asks to "review code", "review this PR", "check code quality", "review changes", or "do a code review".
check
Verifies code quality through linting, type-checking, formatting, and testing. Use when asked to "run checks", "validate code", "lint this", "check for errors", "run tests", or "verify code quality" before or after changes.
task-breakdown
Decomposes complex goals into atomic, dependency-aware work items with execution plans. Use when asked to "break down this task", "create a task plan", "decompose this goal", "split this work", "plan the implementation", "what are the steps", or "create an execution plan".
code
Implements features, fixes bugs, refactors code, and writes unit and integration tests. Use when asked to "implement", "fix a bug", "refactor", "add a feature", "write tests", "add test coverage", or "update code".
grill-me
Conducts thorough interviews to deeply understand user needs, requirements, and context before any implementation begins. Use when requirements are unclear, assumptions need validation, edge cases need exploration, when the user says "grill me", "ask me questions", "help me think through this", or when the underlying problem isn't fully understood.
Didn't find tool you were looking for?