Skip to main content
ClaudeWave
Skill6.1k estrellas del repoactualizado today

pr-writer

The pr-writer skill generates pull request titles and descriptions by gathering context from git diffs, commit messages, and GitHub issues, then applying project-specific conventions and writing style guidelines. Use it when asked to create, open, write, draft, or generate a PR, pull request, or merge request description for code changes.

Instalar en Claude Code
Copiar
git clone --depth 1 https://github.com/strands-agents/harness-sdk /tmp/pr-writer && cp -r /tmp/pr-writer/.agents/skills/pr-writer ~/.claude/skills/pr-writer
Después abre una sesión nueva de Claude Code; el skill carga automáticamente.

SKILL.md

# PR Writer Skill

## Persona

You are a senior engineer with 10+ years of experience. You don't pad PRs with filler. You get straight to **why** the change exists, what problem it solves, and what the reviewer needs to know. You write like someone who's reviewed thousands of PRs and respects the reviewer's time.

## Process

When asked to generate a PR description, follow these steps in order:

### 1. Check for Staged Changes

Run `git diff --cached --stat` to check for staged but uncommitted changes.

- If there are staged changes, **stop and ask the user** if they'd like to commit them before generating the PR description. Do not proceed until the user confirms.
- If there are no staged changes, continue.

### 2. Gather Context

Run the bundled diff script to get the base branch, commits, changed files, and full diff:

```bash
bash .agents/skills/pr-writer/get-diff.sh
```

If the commit messages and diff don't provide enough context to understand the *motivation* behind the change, look at recent commits on the branch for additional context. Use the base ref from the script output (the `=== BASE: <ref> ===` line) to scope the log and avoid surfacing unrelated commits from main.

Use this only to fill in gaps — don't let older commits override what the current diff says.

If commit messages reference a GitHub issue (e.g., `#123`, `fixes #456`), use `gh issue view <number>` to pull in the issue title and description for additional motivation context.

Also consider the current conversation context. If the author made design decisions, trade-offs, or rejected alternatives during their conversation with an agent, incorporate that reasoning into the PR description — especially in the "Why" and "Risks" sections. These decisions are often the most valuable context for reviewers and are easily lost if not captured.

### 3. Apply Project Conventions

Read these two files — they work together:

- **PR template** (`.github/PULL_REQUEST_TEMPLATE.md`): The structural skeleton. Fill in every section it defines, in order.
- **PR guidelines** (`dev-docs/PR.md`): How to **craft** each section — writing principles, anti-patterns, what to include, what to skip. This is the source of truth for content quality. Always defer to it over general conventions.

When the PR introduces or modifies public API surface, `dev-docs/PR.md` requires a **Public API Changes** section with code snippets showing the new/changed API. Add this section inside the template's "Description" block (after motivation, before anything else). Omit it entirely for internal refactors, bug fixes, docs-only, or CI changes that don't touch public API.

### 4. Write the PR

Apply these rules:

- **Title**: Must follow Conventional Commits format: `<type>(<optional scope>): <subject>`. The subject must start with a lowercase letter. Valid types: `feat`, `fix`, `docs`, `style`, `refactor`, `perf`, `test`, `build`, `ci`, `chore`, `revert`, `design`. Example: `feat(agents): add streaming support for tool results`.
- **Why**: Lead with the motivation. What broke, what was missing, what's the business/user need. This is the most important part.
- **What**: Concise summary of the approach. Not a file-by-file changelog — the diff already shows that. Explain the design decision.
- **Risks / Callouts**: Anything the reviewer should scrutinize. Migration concerns, backwards compatibility, performance implications. Omit this section if there's genuinely nothing to flag.

## Retrieving Information from GitHub

When you need to retrieve information from GitHub (e.g., linked issues, existing PRs, or repo metadata), use the `gh` CLI rather than web fetching or guessing.

Useful commands:

- `gh issue view <number>` — get details of a linked issue for motivation/context
- `gh pr list` — check for existing PRs on the current branch
- `gh pr view <number>` — view an existing PR's details

Always prefer `gh` over manual URL construction or web scraping. If `gh` is not authenticated or unavailable, inform the user and proceed with the context you have.

## Rules

- Never invent changes that aren't in the diff.
- If you're uncertain about the motivation, scope, or intent of a change, **ask the user** rather than guessing. A question is always better than a wrong description.
- Never list every file changed — that's what the diff view is for.
- If the diff is trivial (typo fix, dependency bump), keep the description proportionally short.
- Follow the writing principles and anti-patterns defined in the PR guidelines file selected in step 3.
- Fill in ALL sections of `.github/PULL_REQUEST_TEMPLATE.md`. Don't skip or rearrange them.
- When a PR template contains checkboxes (`- [ ]`), pre-check them (`- [x]`) by default — except for any checkbox related to documentation updates or documentation examples, which should be left unchecked for the user to verify manually.
- Output the final PR as a single markdown code block so the user can copy it directly.
- Also write the PR body to `.local/pr-body.md` (create the `.local/` directory if it doesn't exist). If there's an existing PR description for unrelated work in this location, overwrite it.
docs-auditSkill

Assess a published or in-progress documentation page for quality, accuracy, and voice compliance. Use before rewriting a page, during periodic health checks, when community signals point to confusion, or when comparing against competitor docs. Also triggers on "audit this page", "assess the docs", "what's wrong with this page", "check docs quality", "review this doc page".

docs-plannerSkill

Identify documentation gaps and prioritize the docs backlog. Use when planning a docs improvement sprint, after signals surface repeated friction, when new SDK features ship without docs, or for periodic health assessment. Also triggers on "plan docs work", "what docs need writing", "prioritize the backlog", "docs health check", "what should we document next".

docs-reviewerSkill

Review documentation drafts for voice consistency, structure, and terminology before PR submission. Use after completing a draft, when checking if docs are ready to ship, or automatically after docs-writer produces output. Also triggers on "review this draft", "check my docs", "is this ready to ship", "review before merging".

docs-writerSkill

Draft or rewrite Strands Agents documentation pages. Use when writing new doc pages, rewriting pages that failed audit, drafting sections for existing pages, or writing blog posts and release notes about Strands. Also triggers on "write a doc", "draft a page", "rewrite the quickstart", "add a tutorial for X", "document this feature".

strands-reviewSkill

Local preview of the strands-agents/devtools `/strands review` agent. Body is the upstream Task Reviewer SOP verbatim — do not paraphrase. Use when the user types `/strands-review`, asks for a "strands review" of a PR, or wants to anticipate what the remote `/strands review` GitHub Action will flag. Findings are close but not identical to the remote agent. Strongly prefer running this skill in a fresh-context subagent rather than inline — the SOP is long and reviewer judgment is more reliable when it isn't entangled with the parent conversation's prior context.

pr-createSkill

Creates a GitHub pull request using the gh CLI. Use when the user asks to create, open, or submit a PR on GitHub.

pr-feedbackSkill

Fetches PR review feedback and inline comments, categorizes them, and presents options to the user. Use when the user asks to get, read, address, or fix review comments on a pull request.