Skip to content
AI Skills Central

Type to search Agent Skills, workflows, tutorials, tools and the glossary.

Agent Skill

PR writer (Sentry)

Reads the whole branch diff with gh, then writes a conventional PR title and a short body for reviewers: what changed, why, and where to look. Opens drafts.

name: pr-writerBy SentryChecked
View source on GitHub
Bookmark

Bookmarks are kept in your free account, so you can find this page again on any device.

Sign in to bookmark

Install

Commands are pinned to commit a582c51, the version we read, wherever the install method supports it.

npx skills

Terminal
npx skills add getsentry/skills@a582c51ee29d0f35e6ac321340796f77d43da733 --skill pr-writer -a claude-code

Copies the skill into .claude/skills/ in this project, pinned to the reviewed commit.

Plugin marketplace

Claude Code prompt
/plugin marketplace add getsentry/skills
/plugin install sentry-skills@sentry-skills

Run inside Claude Code. Installs the whole sentry-skills plugin from its default branch, not the pinned commit.

What it does

It treats a pull request body as a cover note for the person reviewing it, not a changelog. The agent first checks the current branch and working tree, asks gh whether a PR already exists, picks the base branch (the PR’s own base, or the repository default), and reads the whole branch with git log and git diff "$BASE"...HEAD, not just the last commit. It then writes a title in <type>(<scope>): <subject> form from a fixed list of types, and the smallest body that fits the change: one paragraph for a small fix, affected surfaces and migration notes for a breaking change, a “start here” note for a broad one.

New PRs go up as drafts with gh pr create --draft --body-file; existing ones are rewritten in place with gh api -X PATCH. The skill also tells the agent to refresh the title and body when later commits change the scope, and to skip typo-only or rename-only follow-ups.

When to use it

Whenever an agent opens or updates a PR for you and you are tired of bodies that list every file, paste test output and repeat the commit log. It is most useful on teams whose reviewers read a lot of agent-written PRs: the rules against template headings, command dumps and invented issue numbers remove most of what reviewers skim past. It also handles the step people forget, rewriting the description after review feedback changes the shape of the PR.

When to skip it

When your repository has a PR template that a bot or compliance check expects: the skill is told to ignore templates and omit default “Summary” and “Test Plan” sections, so it will fight the template. Skip it too if your team does not use Conventional Commits-style titles, or if you are not on GitHub; everything runs through gh.

Try it

Open a PR for this branch. It moves the rate limiter from Redis to the
new token bucket in src/limits/, and the /v2/upload endpoint now
returns 429 instead of 503 when a client is over its limit.

What it can touch

Bundles scripts
No
Pre-approved tools
None declared
Needs
GitHub CLI (gh), authenticated; Push access to the branch
Client-specific fields
None, spec fields only

Its instructions steer what your agent does, and it may have changed since the commit we read. How to check a skill.

  • Shell: git branch, git status, git log and git diff locally, plus gh pr view, gh repo view, gh pr create and gh api -X PATCH against GitHub with your gh login.
  • GitHub: it creates draft PRs and edits the title and body of existing ones. If you are on main or master it creates a feature branch first.
  • Local files: it writes the body to a temporary Markdown file such as /tmp/pr-body.md before passing it to gh.
  • It is told never to include customer names, emails, ticket contents, secrets or other personal data in a PR body. That is an instruction to the model, not a filter, so still read the body before you mark the PR ready.
  • No scripts that run at use time. EVAL.md shows npx @netlify/axis commands, unpinned, for maintainers running evals; the skill itself never calls them.

At commit a582c51 the SKILL.md is 160 lines long. Alongside it:

  • SPEC.md: the design notes behind the skill: who it is for, what should and should not trigger it, the “runtime contract”, and the sources it draws on (Sentry’s code review and commit conventions, Google’s guidance on change descriptions, GitHub’s reviewability advice).
  • EVAL.md: how Sentry tests the skill with the AXIS eval runner.
  • evals/ (3 entries): the AXIS config and one scenario that judges a docs-only PR for a conventional title and the absence of “Summary” and “Test Plan” headings.

Only SKILL.md is loaded when the skill runs.

Alternatives

Git commit writes the commit messages the PR is built from, and iterate on a PR from the same repository handles the loop after you open it: CI failures and review comments. For the reviewing side, Sentry’s code review skill, or our AI code review with Claude Code workflow for a review on every PR.

SKILL.md

The file exactly as published at the reviewed commit, reproduced under its Apache-2.0 licence.

skills/pr-writer/SKILL.md
---
name: pr-writer
description: Create or refresh reviewer-facing PR titles and descriptions. Use when opening a PR, updating its title or body, or preparing branch changes for review.
---

# PR Writer

Write the PR body as a cover note for reviewers, not a changelog, template,
validation log, or file-by-file summary.

## Inspect the Change

Requires authenticated `gh`. Inspect the current branch, working tree, PR,
base branch, commits, and full diff:

```bash
git branch --show-current
git status --porcelain
gh pr view --json number,title,body,url,baseRefName,headRefName
gh repo view --json defaultBranchRef
```

If `gh pr view` reports that no PR exists, continue with first-time PR
creation. For an existing PR, use its `baseRefName`; otherwise use the
repository default branch. Set `BASE`, then inspect:

```bash
git log "$BASE"..HEAD --oneline
git diff "$BASE"...HEAD
```

If on `main` or `master`, create a feature branch first. Ensure intended
changes are committed and review the whole branch diff, not only the latest
commit or existing PR text.

## Core Rules

- Describe concrete changed behavior, affected surfaces, and reviewer impact
  before implementation detail.
- Explain motivation, risk, tradeoffs, migration, or review focus only when
  useful.
- Use the smallest structure that makes the change easier to review.
- Replace internal prompt or process terminology with specific behavior.
- When refreshing a PR, rewrite around the current full diff without narrating
  review history.

## Titles

Use `<type>(<scope>): <subject>` or `<type>: <subject>`.

Allowed types: `feat`, `fix`, `ref`, `perf`, `docs`, `test`, `build`,
`ci`, `chore`, `style`, `meta`, `license`, and `revert`.

- Describe the dominant full-branch change with the narrowest accurate type
  and scope.
- Use `!` only when the change breaks an external contract, and explain the
  affected surface in the body.
- Avoid vague subjects such as `update`, `cleanup`, `misc`, `fix stuff`,
  or `address feedback`. Do not add a trailing period.
- Keep an existing title only when it still describes the whole diff.

## Body Shape

Choose the minimum useful shape:

| Change | Include |
|--------|---------|
| Small or obvious | One concise paragraph without headings. |
| Feature, bug fix, or refactor | Changed behavior and effect; add root cause, unchanged behavior, or non-obvious approach when relevant. |
| Contract or breaking change | Affected API, schema, payload, config, permission, storage, or CLI surface; include compatibility and migration guidance. |
| Operational, visual, or workflow change | User/operator effect, measured impact, failure modes, or flow when useful. |
| Broad, generated, or cross-cutting change | Organizing principle, why the breadth is necessary, and where review should start. |

Default:

```markdown
<What changed and what effect it has.>

<Why the approach, risk, migration, or review focus matters, if not obvious.>
```

For review-feedback updates, describe the resulting PR as a whole rather than
the sequence of revisions.

## Reviewer Aids

Use an aid only when it reduces reviewer reconstruction work:

- A compact before/after or interface example for changed contracts.
- A small Mermaid diagram for async flows or state transitions.
- A screenshot or recording note when visual evidence exists.
- A rollout, compatibility, risk, or review-order note when reviewers or
  adopters need it.

Introduce an artifact with one sentence explaining what reviewers should
notice. Omit it when prose is clearer.

## Boundaries

- Do not add default `Summary`, `Changes`, or `Test Plan` sections.
- Omit routine validation unless it changes risk assessment or explains
  meaningful regression coverage. For docs, skills, copy, or config changes,
  omit it by default.
- Do not paste commands, CI logs, validation dumps, commit logs, placeholders,
  or exhaustive file lists.
- Never include customer or organization names, user emails, support ticket
  contents, secrets, or PII.
- Use issue references only when verified from user input, branch names,
  commits, PR discussion, or tracker output. `Fixes <issue>` closes;
  `Refs <issue>` only links.

## Create or Update

Create new PRs as drafts. Write the body to a temporary Markdown file, then run:

```bash
gh pr create --draft --title '<title>' --body-file /tmp/pr-body.md
```

Update existing PRs with `gh api`:

```bash
gh api -X PATCH repos/{owner}/{repo}/pulls/PR_NUMBER \
  -f title='<title>' \
  -F body=@/tmp/pr-body.md
```

Refresh the title and body when follow-up commits materially change scope,
approach, breaking behavior, risk, migration, or review expectations. Skip
typo-only, formatting-only, and rename-only follow-ups.

## Examples

Small change:

```markdown
The AI Customizations section now starts collapsed so it does not consume
sidebar space before users need it. Expanding it preserves the existing saved
preference behavior.
```

Breaking contract:

````markdown
Run logs now emit chunk-level records instead of one skill-level record.
Consumers that read top-level `findings` must iterate over
`chunk.findings` for each record.

Before:

```json
{"skill": "security-review", "findings": [...]}
```

After:

```json
{"schemaVersion": 1, "chunk": {"index": 1, "findings": [...]}}
```
````
  • Git commit (Conventional Commits)

    Reads the diff, stages related files and writes a Conventional Commits message, splitting unrelated changes into separate commits. Never pushes.

    GitHub (awesome-copilot)Checked at 1683f50

  • Iterate on a PR (Sentry)

    Sentry's skill that loops on a pull request until CI passes and high and medium review feedback is handled, using GitHub CLI and bundled Python scripts.

    Bundles scriptsChecked at a582c51

  • Code review (Sentry)

    Sentry's pull-request review checklist: correctness, design, test coverage and long-term impact, with Python, TypeScript and security patterns to flag.

    Checked at a582c51