Create a GitHub Pull Request

VerifiedSafe

Complete workflow for creating a GitHub PR: branching, implementation, testing, formatting, and submission.

Sby Skills Guide Bot
DevOpsIntermediate
7/22/2026
Claude CodeCursorCodex
#git#github#pull-request#workflow#code-review

Recommended for

Automated summary

Walks through creating a GitHub pull request step by step, from the working branch to opening the PR, including tests, formatting, and commits.

Strengths

  • Chains nine explicit steps from branch creation to opening the PR.
  • Requires tests with coverage and explains how to read the annotated `,cover` files (>, !, -).
  • Adds a format/lint gate right before committing to catch style drift.
  • Ships concrete templates for conventional commit messages and the PR body.

Limitations

  • Commands are tied to one project (sleap, uv, ruff, pytest) and must be adapted elsewhere.
  • Assumes a `develop` base branch and an already-authenticated `gh` CLI.
  • Does not cover rebase conflicts or responding to review feedback after the PR is open.
When to use it

Use it when a change needs to become a reviewed pull request with tests and formatting included.

When not to use it

Avoid it for a quick local commit or on a repo that uses neither GitHub nor this Python toolchain.

Security analysis

Safe
Quality score78/100

The skill is a conventional Git/GitHub PR workflow: branch creation, ruff formatting, pytest with coverage, commits, push, and `gh pr create`. All commands are standard developer tooling used for their stated purpose, with no obfuscation, no piping remote content to a shell, no credential/secret handling, and no destructive operations beyond a narrowly scoped `rm -f .coverage.*` cleanup and a `--fix` lint pass on the project's own source tree. It does push to a remote and open PRs, but only under the user's normal authenticated workflow.

No concerns found

How this analysis is made

Examples

Feature PR
Create a PR for the new tracking filter: branch off develop, add tests under tests/, run ruff and the coverage suite, then open the PR against develop.
Bug fix PR
Open a pull request fixing issue #214, the edge case in the centroid tracker. Follow the PR workflow with tests and formatting.
Refactor PR
Make a PR that refactors the config loader into smaller functions, updates the tests, and summarizes the changes in the PR body.

name: pr description: > Create a well-structured GitHub PR with proper branching, testing, formatting, and documentation. Use when the user says "create a PR", "make a PR", "open a pull request", or wants to submit changes for review. Handles the full workflow: branch creation, implementation, testing, formatting, committing, and PR creation with comprehensive descriptions.

Create a GitHub Pull Request

Overview

This skill guides the complete PR workflow from branch creation to PR submission. Follow all steps in order to ensure high-quality, well-documented contributions.

Step 1: Branch Setup

Pull latest develop

git checkout develop
git pull origin develop

Create feature branch

Use a descriptive branch name following the pattern: {type}/{description}

Types:

  • feature/ - New functionality
  • fix/ - Bug fixes
  • refactor/ - Code restructuring
  • docs/ - Documentation updates
  • test/ - Test additions/improvements
git checkout -b feature/descriptive-name

Step 2: Understand the Problem

Before coding, clearly identify:

  1. Core problem: What issue are we solving?
  2. Scope: What files/modules will be affected?
  3. Approach: What's the implementation strategy?
  4. Edge cases: What scenarios need special handling?

If there's an associated GitHub issue, fetch it for context:

gh issue view <issue-number>

Step 3: Implement Changes

  • Make focused, incremental changes
  • Follow existing code patterns and style
  • Add docstrings and comments for complex logic
  • Consider backwards compatibility

Step 4: Write Tests

Location

Tests go in the tests/ directory, mirroring the source structure.

Requirements

  • Cover all new functionality
  • Test edge cases and error conditions
  • Test both success and failure paths
  • Aim for high coverage of changed code

Test file naming

  • test_{module_name}.py for module tests
  • Place in corresponding tests/ subdirectory

Step 5: Format Code

Run formatting and linting:

# Format code
uv run ruff format sleap tests

# Fix auto-fixable lint issues
uv run ruff check --fix sleap tests

Then manually fix any remaining errors which cannot be automatically fixed by ruff.

Step 6: Run Tests with Coverage

Run the full test suite with coverage:

uv run pytest -q --maxfail=1 --cov --cov-branch && rm -f .coverage.* && uv run coverage annotate

Check coverage for changed files

The coverage annotate command creates {module_name.py},cover files next to each module.

To find which files changed:

git diff --name-only $(git merge-base origin/develop HEAD)

Review the ,cover files for your changed modules to ensure adequate coverage.

Coverage markers in annotated files

  • > means line was executed
  • ! means line was NOT executed (needs test coverage)
  • - means line is not executable (comments, blank lines)

Step 7: Commit Changes

Pre-commit format+lint gate

Always re-run format and lint on changed files immediately before committing. This catches formatting drift from edits made after the initial Step 5 pass:

uv run ruff format sleap tests
uv run ruff check --fix sleap tests

If either command modifies files, stage the changes before committing.

Commit structure

Make well-structured, atomic commits:

  • Each commit should be a logical unit of work
  • Write clear, descriptive commit messages
  • Use conventional commit format when appropriate

Commit message format

<type>: <short description>

<optional longer description>

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Types: feat, fix, refactor, test, docs, chore

Step 8: Push to GitHub

git push -u origin <branch-name>

Step 9: Create Pull Request

Create the PR

gh pr create --base develop --title "<descriptive title>" --body "$(cat <<'EOF'
## Summary
<1-3 bullet points describing the changes>

## Changes Made
- <detailed list of changes>

## Example Usage
```python
# For enhancements, show how to use the new functionality

API Changes

  • <list any API changes, new parameters, removed functionality>

Testing

  • <describe test coverage>
  • <note any manual testing done>

Design Decisions

  • <explain key architectural choices>
  • <note trade-offs considered>

Future Considerations

  • <potential improvements not in scope>
  • <known limitations>

Related Issues

Closes #<issue-number> (if applicable)


🤖 Generated with Claude Code EOF )"


### If updating an existing PR

Fetch current PR description:
```bash
gh pr view <pr-number> --json body -q '.body'

Update PR description:

gh pr edit <pr-number> --body "<new body>"

Fetch associated issue for context

If an issue is linked:

gh issue view <issue-number>

Use issue context to ensure PR description addresses all requirements.

PR Description Checklist

  • [ ] Summary clearly explains the "what" and "why"
  • [ ] All significant changes are documented
  • [ ] Example usage provided for new features
  • [ ] API changes explicitly listed
  • [ ] Breaking changes highlighted
  • [ ] Test coverage described
  • [ ] Design decisions explained with reasoning
  • [ ] Related issues linked

Docs Preview

PRs that modify docs/, sleap/, or mkdocs.yml will automatically get a docs preview deployed at:

https://docs.sleap.ai/pr/<pr-number>/

A comment will be posted on the PR with the preview link.

Quick Reference Commands

# Branch setup
git checkout develop && git pull origin develop
git checkout -b feature/my-feature

# Format and lint
uv run ruff format sleap tests
uv run ruff check --fix sleap tests

# Test with coverage
uv run pytest -q --maxfail=1 --cov --cov-branch && rm -f .coverage.* && uv run coverage annotate

# Find changed files
git diff --name-only $(git merge-base origin/develop HEAD)

# Pre-commit format+lint gate (always run before committing)
uv run ruff format sleap tests
uv run ruff check --fix sleap tests

# Commit
git add <files>
git commit -m "feat: description"

# Push and create PR
git push -u origin <branch>
gh pr create --base develop --title "Title" --body "Description"

# View/edit existing PR
gh pr view <number>
gh pr edit <number> --body "New description"

# View linked issue
gh issue view <number>

CI Checks

PRs trigger the following CI checks:

  • Lint: uv run ruff check sleap tests and uv run ruff format --check sleap tests
  • Tests: uv run pytest --cov=sleap on Ubuntu, Windows, and macOS
  • Docs Preview: Auto-deployed for changes to docs/, sleap/, or mkdocs.yml

Ensure all checks pass before requesting review.

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-a-github-pull-request-mrwak8fn/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-a-github-pull-request-mrwak8fn' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/create-a-github-pull-request-mrwak8fn/download' --output '.skill-downloads/create-a-github-pull-request-mrwak8fn/SKILL.md.part' && mv '.skill-downloads/create-a-github-pull-request-mrwak8fn/SKILL.md.part' '.skill-downloads/create-a-github-pull-request-mrwak8fn/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.

Original excerpt: Requirements
  • Cover all new functionality
  • Test edge cases and error conditions
  • Test both success and failure paths
  • Aim for high coverage of changed code

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-a-github-pull-request-mrwak8fn/SKILL.md' && test -s '.skill-downloads/create-a-github-pull-request-mrwak8fn/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/pr' && cp -R '.skill-downloads/create-a-github-pull-request-mrwak8fn' '.claude/skills/pr'

Cursor
test -f '.skill-downloads/create-a-github-pull-request-mrwak8fn/SKILL.md' && test -s '.skill-downloads/create-a-github-pull-request-mrwak8fn/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/pr' && cp -R '.skill-downloads/create-a-github-pull-request-mrwak8fn' '.cursor/skills/pr'

Codex
test -f '.skill-downloads/create-a-github-pull-request-mrwak8fn/SKILL.md' && test -s '.skill-downloads/create-a-github-pull-request-mrwak8fn/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/pr' && cp -R '.skill-downloads/create-a-github-pull-request-mrwak8fn' '.agents/skills/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-a-github-pull-request-mrwak8fn'

openskills read 'create-a-github-pull-request-mrwak8fn'

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-a-github-pull-request-mrwak8fn/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