Create PR

VerifiedCaution

Creates a pull request from the current branch with a structured summary, test results, and change description.

Sby Skills Guide Bot
DevelopmentBeginner
7/22/2026
Claude Code
#git#pull-request#gh-cli#workflow#code-review

Recommended for

Automated summary

Creates a pull request from the current branch, generating a structured summary from commits, diff stats, and test and lint results.

Strengths

  • Refuses to open a PR from main or develop and warns when uncommitted changes are present
  • Automatically gathers commit list, diff stats, test results, and lint output before drafting the description
  • Produces a standardized PR body (Summary, Changes, Test plan) with a title under 70 characters
  • Pushes the branch, creates the PR through gh CLI, then reports the URL and suggests next steps

Limitations

  • Assumes gh CLI is installed and authenticated and that the base branch is named main
  • Test and lint commands are shown as npm examples and must be adapted to the project
  • Failing tests or lint only trigger a warning, so nothing blocks a PR with a bad test plan
When to use it

Use it once a feature is finished on its own branch and ready to be handed off for review.

When not to use it

Avoid it when you are working directly on main or develop, or when no commits exist on the branch yet.

Security analysis

Caution
Quality score85/100

The skill uses legitimate developer tooling for standard PR creation and contains no destructive, exfiltrating, or obfuscated instructions. However, running project test/lint scripts and pushing/creating remote PRs are powerful operations, so it warrants caution rather than being completely risk-free.

Findings
  • •Runs project test/lint commands such as `npm test` and `npm run lint`, which can execute arbitrary project-defined scripts.
  • •Pushes the current branch to origin and creates a PR via `gh`, modifying remote state and requiring authenticated GitHub CLI access.
  • •Does not declare allowed-tools despite relying on git, shell, test runners, and network/gh operations.
How this analysis is made

Examples

Open PR after finishing a feature
/create-pr
Feature branch ready for review
I've finished the dark mode toggle on feature/dark-mode and everything is committed. Create the pull request with a summary of the changes and the test results.
Push and open PR with context
Push my current branch and open a PR against main — include the diff stat, test pass count, and lint status in the description.

name: create-pr description: "Create a pull request from the current branch with structured summary" user-invocable: true workflow: version: 1 steps: - id: verify-branch role: system intent: "Verify not on main/develop, check for uncommitted changes, get commits ahead of main." produces: [branch-name, branch-state, commit-list] - id: gather-context role: system intent: "Collect diff stats, run tests and lint for PR description context." requires: [branch-state] produces: [diff-summary, test-result, lint-result] - id: generate-description role: system intent: "Build structured PR description from commits, diff stats, and test results." requires: [commit-list, diff-summary, test-result, lint-result] produces: [pr-description, pr-title] gate: true - id: create-pr role: system intent: "Push branch to origin and create PR via gh CLI." requires: [pr-description, pr-title, branch-name] produces: [pr-url] - id: post-creation role: system intent: "Display PR URL and suggest next steps." requires: [pr-url] produces: [summary] gate: true

Create PR

Creates a pull request from the current feature branch with a structured summary, test results, and change description. Closes the pipeline loop: init -> build-feature -> create-pr.

When to use

  • After completing a feature with /build-feature
  • When you have changes on a feature branch ready for review
  • To create a well-structured PR without manual formatting

Usage

/create-pr

Process

Step 1 -- Verify branch state

  1. Confirm you are NOT on main or develop -- refuse to create PR from default branches
  2. Run git status to check for uncommitted changes -- if any, warn the user and ask whether to commit first
  3. Run git log main..HEAD --oneline to get the list of commits that will be in the PR
  4. If there are no commits ahead of main, report that there is nothing to PR

Step 2 -- Gather context

Collect the information needed for the PR description:

  1. Commits: git log main..HEAD --oneline -- list of all commits on this branch
  2. Diff summary: git diff main..HEAD --stat -- files changed with line counts
  3. Test results: Run project tests (e.g., npm test) and capture pass/fail
  4. Lint results: Run project lint (e.g., npm run lint) and capture pass/fail
  5. Branch name: Extract feature name from the branch (e.g., feature/dark-mode -> dark-mode)

If tests or lint fail, warn the user but allow them to proceed (some PRs are draft/WIP).

Step 3 -- Generate PR description

Build a structured PR description:

## Summary
[2-4 bullet points describing what this PR does, derived from commit messages]

## Changes
[File-level summary from git diff --stat]

## Test plan
- [x] Tests: [pass/fail] ([count] tests)
- [x] Lint: [pass/fail]
- [ ] [Any manual verification steps if applicable]

Step 4 -- Create the PR

  1. Push the branch to origin: git push -u origin [branch-name]
  2. Create the PR using gh pr create:
    • Title: derived from branch name or first commit message (max 70 chars)
    • Body: the generated description from Step 3
    • Base: main (or the project's default branch)
  3. Report the PR URL to the user

Step 5 -- Post-creation

  1. Display the PR URL
  2. Suggest next steps:
    • "Request review from a teammate"
    • "Run /code-review for an AI code review"
    • "Merge when ready with gh pr merge [number]"

Example Session

User: /create-pr

Checking branch state...
Branch: feature/dark-mode (4 commits ahead of main)
Tests: 82 passed, 0 failed
Lint: 0 errors

Creating PR...
PR #42: "feat: add dark mode toggle to settings"
https://github.com/org/repo/pull/42

Next steps:
- Request review from a teammate
- Run /code-review for AI code review
- Merge when ready

Notes

  • The PR title should be concise (under 70 characters) and follow conventional commits format when the project uses it
  • If the branch has wip: commits from build-feature checkpoints, consider squashing them before creating the PR
  • This skill does NOT merge the PR -- that is a manual step or a separate command

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/create-pr-mrwak9ct/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/create-pr-mrwak9ct' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/create-pr-mrwak9ct/download' --output '.skill-downloads/create-pr-mrwak9ct/SKILL.md.part' && mv '.skill-downloads/create-pr-mrwak9ct/SKILL.md.part' '.skill-downloads/create-pr-mrwak9ct/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/create-pr-mrwak9ct/SKILL.md' && test -s '.skill-downloads/create-pr-mrwak9ct/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/create-pr' && cp -R '.skill-downloads/create-pr-mrwak9ct' '.claude/skills/create-pr'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/create-pr-mrwak9ct'

openskills read 'create-pr-mrwak9ct'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/create-pr-mrwak9ct/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills