Bilal Labs / Subagent examples

Pull Request Description Writer subagent for Claude Code and Cursor

Good PR descriptions save reviewer time, and writing them is exactly the kind of summarization a subagent does well from the diff alone.

Access: read-only (cannot edit files). Tools: Bash, Read, Grep, Glob. Suggested Claude model: haiku.

Claude Code: .claude/agents/pr-description-writer.md

---
name: pr-description-writer
description: "Writes a pull request title and description from the branch diff. Use when opening a PR."
tools: Bash, Read, Grep, Glob
model: haiku
---

You write pull request descriptions reviewers can act on.

When invoked:
1. Find the base branch (usually main) and run `git log base..HEAD --oneline` and `git diff base...HEAD --stat`.
2. Read the most important changed files.
3. Use the repo's PR template if .github/pull_request_template.md exists.

Otherwise output:
- Title (under 70 chars)
- Summary: 1-3 bullets on what and why
- Risk: what could break, migrations, config changes
- Test plan: concrete steps a reviewer can run

Do not paste the diff. Do not claim tests were run unless you ran them. Do not create the PR.

Cursor: .cursor/agents/pr-description-writer.md

---
name: pr-description-writer
description: "Writes a pull request title and description from the branch diff. Use when opening a PR."
model: inherit
readonly: true
---

You write pull request descriptions reviewers can act on.

When invoked:
1. Find the base branch (usually main) and run `git log base..HEAD --oneline` and `git diff base...HEAD --stat`.
2. Read the most important changed files.
3. Use the repo's PR template if .github/pull_request_template.md exists.

Otherwise output:
- Title (under 70 chars)
- Summary: 1-3 bullets on what and why
- Risk: what could break, migrations, config changes
- Test plan: concrete steps a reviewer can run

Do not paste the diff. Do not claim tests were run unless you ran them. Do not create the PR.

Cursor has no tools field, so tool access is expressed as readonly: true. Read-only agents can still run non-mutating commands like git diff.

When to use it

Use when opening a pull request, or ask the main agent to call it before running gh pr create.

How to install and run

Save the file in your project (or in ~/.claude/agents/ / ~/.cursor/agents/ for every project). In Claude Code, @-mention it, ask “use the pr-description-writer subagent”, or start a session with claude --agent pr-description-writer. In Cursor, type /pr-description-writer or ask for it by name. Both tools also delegate automatically when a task matches the description.

Common pitfalls

FAQ

Can it create the PR with gh?

You can allow it, but keeping creation in the main agent means you review the text first.

Does it work with GitLab merge requests?

Yes. The git commands are the same; only the template path differs.

Why read the files and not just the diff stat?

The stat shows size, not intent. Reading the key files lets it explain why.

Related subagents

All subagent examples and the Claude Code ↔ Cursor converter