Agent skill
open-pull-request
Commits current changes and opens a pull request via GitHub CLI (gh). Use only when the user explicitly says "open a pull request", "open an pull request", or "create a pull request". Do not run this workflow for other requests.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/open-pull-request
SKILL.md
Open a Pull Request
When to Use
Use this skill only when the user explicitly requests to open a pull request (e.g. "open a pull request", "open an pull request", "create a pull request"). Do not run git commit, push, or gh pr create for any other request.
Preconditions
- Working tree: Confirm that current changes (staged or unstaged) are what the user wants to commit. If the state is unclear or already on a feature branch with unpushed commits, ask before proceeding.
- GitHub CLI: Require
ghinstalled and authenticated. Rungh auth status; if not OK, instruct the user to install GitHub CLI and rungh auth login, then stop.
Workflow
1. Create a new branch
- Create a new branch from current HEAD:
git checkout -b <branch-name>. - Branch name: Use user-provided name if given. Otherwise derive from the commit message: e.g.
feat/scope-short-desc,fix/short-desc,enhance/improve-x,ci/update-workflow, or(deps)/go-mod(slug from the first line of the conventional commit). These patterns align with .github/labeler.yml so the labeler auto-applies PR labels (feature, bug, enhancement, github-actions, dependencies). For breaking changes, include!in the branch name to get thebreaking-changelabel. Prefer lowercase, hyphens; avoid spaces.
2. Stage and commit
- Run
git add . - Commit message: Use conventional style per project (e.g.
feat(scope): description,fix(scope): description). If the user provided a message, use it; otherwise generate fromgit statusandgit diff(orgit diff --stagedafter add). - Run
git commit -s -m "<message>"so the commit includes a Signed-off-by line (DCO). Do not add aMade-with: Cursoror similar trailer to the commit message. The repo has the DCO bot enabled; PRs must have all commits signed off.
3. Push and create PR
- Push:
git push -u origin <branch-name> - Create PR:
gh pr createusing the repository’s pull request template. Populate all sections (see PR body below). Theneptunelabel is applied automatically; do not add it manually.
4. Safety
- Do not run
git push,git commit, orgh pr createunless the user has explicitly requested to open a pull request. - If the repo is in an unexpected state (e.g. already on a feature branch with unpushed commits, or detached HEAD), ask the user before creating a new branch or pushing.
PR body (repo template)
The repo uses .github/pull_request_template.md. When creating the PR (e.g. gh pr create --body-file - or by filling the template), populate:
- What is this feature? – Short description; correlates with issues.
- Why do we need this feature? – Problem or context (from commit/conversation).
- Who is this feature for? – Target user or use case.
- Related issues – e.g.
Fixes #123orRelates to #456if applicable. - Notes for reviewers – Optional; call out design decisions or areas to focus on.
- Checklist – Mark as appropriate: breaking changes (Yes/No/N/A), docs updated, tests added/updated.
- AI Summary – For AI reviewers; fill from changed files and context:
- Scope: e.g.
lambda (config, webhooks, main),docs,AGENTS.md - Type:
feat|fix|docs|refactor - Key files/areas: paths from
git diff --name-onlyor conversation (e.g.lambda/pkg/config/config.go,docs/github-app-and-lambda.md)
- Scope: e.g.
Generate the body from the commit message and git diff --name-only (or equivalent) so the template sections are filled accurately.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?