ALWAYS use this skill when creating pull requests — never create a PR directly without it. Follows Sentry conventions for PR titles, descriptions, and issue references. Trigger on any create PR, open PR, submit PR, make PR, push and create PR, or prepare changes for review task.
Add this skill
npx mdskills install getsentry/create-prWell-structured PR creation workflow with clear steps, Sentry conventions, and practical examples
1---2name: create-pr3description: ALWAYS use this skill when creating pull requests — never create a PR directly without it. Follows Sentry conventions for PR titles, descriptions, and issue references. Trigger on any create PR, open PR, submit PR, make PR, push and create PR, or prepare changes for review task.4---56# Create Pull Request78Create pull requests following Sentry's engineering practices.910**Requires**: GitHub CLI (`gh`) authenticated and available.1112## Prerequisites1314Before creating a PR, ensure all changes are committed. If there are uncommitted changes, run the `sentry-skills:commit` skill first to commit them properly.1516```bash17# Check for uncommitted changes18git status --porcelain19```2021If the output shows any uncommitted changes (modified, added, or untracked files that should be included), invoke the `sentry-skills:commit` skill before proceeding.2223## Process2425### Step 1: Verify Branch State2627```bash28# Detect the default branch — note the output for use in subsequent commands29gh repo view --json defaultBranchRef --jq '.defaultBranchRef.name'30```3132```bash33# Check current branch and status (substitute the detected branch name above for BASE)34git status35git log BASE..HEAD --oneline36```3738Ensure:39- All changes are committed40- Branch is up to date with remote41- Changes are rebased on the base branch if needed4243### Step 2: Analyze Changes4445Review what will be included in the PR:4647```bash48# See all commits that will be in the PR (substitute detected branch name for BASE)49git log BASE..HEAD5051# See the full diff52git diff BASE...HEAD53```5455Understand the scope and purpose of all changes before writing the description.5657### Step 3: Write the PR Description5859Use this structure for PR descriptions (ignoring any repository PR templates):6061```markdown62<brief description of what the PR does>6364<why these changes are being made - the motivation>6566<alternative approaches considered, if any>6768<any additional context reviewers need>69```7071**Do NOT include:**72- "Test plan" sections73- Checkbox lists of testing steps74- Redundant summaries of the diff7576**Do include:**77- Clear explanation of what and why78- Links to relevant issues or tickets79- Context that isn't obvious from the code80- Notes on specific areas that need careful review8182### Step 4: Create the PR8384```bash85gh pr create --draft --title "<type>(<scope>): <description>" --body "$(cat <<'EOF'86<description body here>87EOF88)"89```9091**Title format** follows commit conventions:92- `feat(scope): Add new feature`93- `fix(scope): Fix the bug`94- `ref: Refactor something`9596## PR Description Examples9798### Feature PR99100```markdown101Add Slack thread replies for alert notifications102103When an alert is updated or resolved, we now post a reply to the original104Slack thread instead of creating a new message. This keeps related105notifications grouped and reduces channel noise.106107Previously considered posting edits to the original message, but threading108better preserves the timeline of events and works when the original message109is older than Slack's edit window.110111Refs SENTRY-1234112```113114### Bug Fix PR115116```markdown117Handle null response in user API endpoint118119The user endpoint could return null for soft-deleted accounts, causing120dashboard crashes when accessing user properties. This adds a null check121and returns a proper 404 response.122123Found while investigating SENTRY-5678.124125Fixes SENTRY-5678126```127128### Refactor PR129130```markdown131Extract validation logic to shared module132133Moves duplicate validation code from the alerts, issues, and projects134endpoints into a shared validator class. No behavior change.135136This prepares for adding new validation rules in SENTRY-9999 without137duplicating logic across endpoints.138```139140## Issue References141142Reference issues in the PR body:143144| Syntax | Effect |145|--------|--------|146| `Fixes #1234` | Closes GitHub issue on merge |147| `Fixes SENTRY-1234` | Closes Sentry issue |148| `Refs GH-1234` | Links without closing |149| `Refs LINEAR-ABC-123` | Links Linear issue |150151## Guidelines152153- **One PR per feature/fix** - Don't bundle unrelated changes154- **Keep PRs reviewable** - Smaller PRs get faster, better reviews155- **Explain the why** - Code shows what; description explains why156- **Mark WIP early** - Use draft PRs for early feedback157158## Editing Existing PRs159160If you need to update a PR after creation, use `gh api` instead of `gh pr edit`:161162```bash163# Update PR description164gh api -X PATCH repos/{owner}/{repo}/pulls/PR_NUMBER -f body="$(cat <<'EOF'165Updated description here166EOF167)"168169# Update PR title170gh api -X PATCH repos/{owner}/{repo}/pulls/PR_NUMBER -f title='new: Title here'171172# Update both173gh api -X PATCH repos/{owner}/{repo}/pulls/PR_NUMBER \174 -f title='new: Title' \175 -f body='New description'176```177178Note: `gh pr edit` is currently broken due to GitHub's Projects (classic) deprecation.179180## References181182- [Sentry Code Review Guidelines](https://develop.sentry.dev/engineering-practices/code-review/)183- [Sentry Commit Messages](https://develop.sentry.dev/engineering-practices/commit-messages/)184
Full transparency — inspect the skill content before installing.