Skip to content

Commit f99cf14

Browse files
dingsdaxclaude
andcommitted
docs(sdk): Add PR template page and updater skill
Add canonical .github/pull_request_template.md content for Sentry SDK repositories, derived from the sentry-skills:create-pr skill and code submission standards. The docs page covers description structure (what, why, alternatives, context), Linear magic words for issue references, and requirements for draft mode, changelog entries, and AI attribution. The pr-template skill fetches both the docs page and the create-pr skill at runtime and uses them to update existing templates across SDK repos, with a batch rollout table for the 8 non-compliant repositories. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 40af597 commit f99cf14

2 files changed

Lines changed: 211 additions & 3 deletions

File tree

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
---
2+
name: pr-template
3+
description: Update .github/pull_request_template.md in a Sentry SDK repository to match the canonical template. Use when asked to "update pr template", "sync pr template", "standardize pr template", or when rolling out the canonical template across SDK repos.
4+
---
5+
6+
# PR Template Updater
7+
8+
Updates `.github/pull_request_template.md` in a Sentry SDK repository using two sources of truth:
9+
10+
- **[PR Template docs](https://develop.sentry.dev/sdk/getting-started/templates/pr-template/)** — defines the canonical template content
11+
- **[`sentry-skills:create-pr`](https://github.com/getsentry/skills/blob/main/plugins/sentry-skills/skills/create-pr/SKILL.md)** — defines how PRs are written and what structure the template must support
12+
13+
**Requires**: GitHub CLI (`gh`) authenticated and available, with push access to the target repository.
14+
15+
## Step 1: Read the sources of truth
16+
17+
Fetch the canonical template and the pr-writer skill:
18+
19+
```bash
20+
# Canonical template (read the Template section)
21+
curl -s https://develop.sentry.dev/sdk/getting-started/templates/pr-template.md
22+
23+
# PR writer skill
24+
curl -s https://raw.githubusercontent.com/getsentry/skills/main/plugins/sentry-skills/skills/create-pr/SKILL.md
25+
```
26+
27+
The canonical template content is:
28+
29+
```markdown
30+
### Description
31+
32+
<!-- Brief description of what the PR does.
33+
Why these changes are being made — the motivation.
34+
Alternative approaches considered, if any.
35+
Any additional context reviewers need. -->
36+
37+
### Issues
38+
39+
<!--
40+
* Fixes #1234
41+
* Refs LINEAR-ABC-123
42+
-->
43+
```
44+
45+
Linear magic words for the Issues section:
46+
47+
- **Closing**: `close`, `closes`, `closed`, `closing`, `fix`, `fixes`, `fixed`, `fixing`, `resolve`, `resolves`, `resolved`, `resolving`, `complete`, `completes`, `completed`, `completing`
48+
- **Non-closing**: `ref`, `refs`, `references`, `part of`, `related to`, `contributes to`, `toward`, `towards`
49+
50+
## Step 2: Read the existing template
51+
52+
```bash
53+
cat .github/pull_request_template.md 2>/dev/null \
54+
|| cat .github/PULL_REQUEST_TEMPLATE.md 2>/dev/null \
55+
|| echo "NO TEMPLATE"
56+
```
57+
58+
Note any repo-specific content that must be preserved:
59+
60+
- **`sentry-cli`**: Legal boilerplate clause for external contributors — keep it.
61+
- **`sentry-go`**: `### Changelog Entry` section used by Craft release tooling — keep it.
62+
- Any other non-standard section: flag it before removing.
63+
64+
## Step 3: Write the updated template
65+
66+
For most repositories, the new content is the canonical template verbatim. For repositories with preserved additions, append them after the `### Issues` block.
67+
68+
Example for `sentry-cli`:
69+
70+
```markdown
71+
### Description
72+
73+
<!-- Brief description of what the PR does.
74+
Why these changes are being made — the motivation.
75+
Alternative approaches considered, if any.
76+
Any additional context reviewers need. -->
77+
78+
### Issues
79+
80+
<!--
81+
* Fixes #1234
82+
* Refs LINEAR-ABC-123
83+
-->
84+
85+
### Legal Boilerplate
86+
87+
Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.
88+
```
89+
90+
## Step 4: Create a branch and commit
91+
92+
```bash
93+
git checkout -b <your-username>/meta/standardize-pr-template
94+
95+
git add .github/pull_request_template.md
96+
git commit -m "meta: Standardize PR template
97+
98+
Align .github/pull_request_template.md with the canonical Sentry SDK
99+
template at https://develop.sentry.dev/sdk/getting-started/templates/pr-template/.
100+
101+
Removes checklist sections and 'How did you test it?' prompts that
102+
contradict the code submission standards."
103+
```
104+
105+
## Step 5: Open a draft PR
106+
107+
```bash
108+
gh pr create --draft \
109+
--title "meta: Standardize PR template" \
110+
--body "$(cat <<'EOF'
111+
### Description
112+
113+
Aligns `.github/pull_request_template.md` with the canonical Sentry SDK template.
114+
115+
Removes sections that contradict the [code submission standards](https://develop.sentry.dev/sdk/getting-started/standards/code-submission/): checklist checkboxes, 'How did you test it?' prompts, and type-of-change radio buttons.
116+
117+
### Issues
118+
119+
* Refs https://develop.sentry.dev/sdk/getting-started/templates/pr-template/
120+
121+
🤖 Generated with [Claude Code](https://claude.com/claude-code)
122+
EOF
123+
)"
124+
```
125+
126+
## Batch Rollout
127+
128+
To update multiple repos at once, run this skill in parallel agents — one per repository. Target repositories where the current template conflicts with the standards:
129+
130+
| Repo | Issue |
131+
|------|-------|
132+
| `getsentry/sentry-java` | "How did you test it?" + checklist |
133+
| `getsentry/sentry-cocoa` | "How did you test it?" + checklist |
134+
| `getsentry/sentry-dart` | "How did you test it?" + checklist |
135+
| `getsentry/sentry-kotlin-multiplatform` | "How did you test it?" + checklist |
136+
| `getsentry/sentry-react-native` | "How did you test it?" + checklist + type-of-change |
137+
| `getsentry/sentry-javascript` | Checkbox list |
138+
| `getsentry/sentry-ruby` | Prose instruction list |
139+
| `getsentry/sentry-dotnet` | No template exists — create it |
140+
141+
Repositories `sentry-python`, `sentry-symfony`, `sentry-rust`, `sentry-php`, `sentry-laravel`, and `sentry-elixir` already match the canonical template and need no changes.
142+
143+
## References
144+
145+
- [PR Template](https://develop.sentry.dev/sdk/getting-started/templates/pr-template/)
146+
- [Code Submission Standards](https://develop.sentry.dev/sdk/getting-started/standards/code-submission/)
147+
- [PR Writer Skill](https://github.com/getsentry/skills/blob/main/plugins/sentry-skills/skills/create-pr/SKILL.md)
Lines changed: 64 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,71 @@
11
---
22
title: PR Template
33
sidebar_order: 30
4+
description: Canonical .github/pull_request_template.md for Sentry SDK repositories.
45
---
56

6-
<CopyableCard title="PR Template">
7+
<Alert>
8+
This document uses key words such as "MUST", "SHOULD", and "MAY" as defined
9+
in [RFC 2119](https://www.ietf.org/rfc/rfc2119.txt) to indicate requirement
10+
levels.
11+
</Alert>
712

8-
TBD
13+
`.github/pull_request_template.md` is a Markdown file that GitHub pre-fills into the PR description editor when someone opens a pull request. Its job is to guide the author toward writing a real description — not to enforce process through checkboxes.
914

10-
</CopyableCard>
15+
## Description
16+
17+
Every PR description **MUST** cover:
18+
19+
- **What** — brief description of what the PR does
20+
- **Why** — motivation for the change
21+
- **Alternatives** — other approaches considered, if any
22+
- **Context** — anything reviewers need that isn't obvious from the code
23+
24+
**Do NOT include:**
25+
- "Test plan" sections
26+
- Checkbox lists of testing steps
27+
- Redundant summaries of the diff
28+
29+
**Do include:**
30+
- Clear explanation of what and why
31+
- Links to relevant issues or tickets
32+
- Context that isn't obvious from the code
33+
- Notes on specific areas that need careful review
34+
35+
A blank, template-only, or AI-generated filler description is not acceptable. The CI bot checks description quality; use the `trivial` label to override for genuinely trivial changes (typo fixes, formatting-only commits).
36+
37+
## Issues
38+
39+
Reference issues using Linear magic words:
40+
41+
**Closing** (closes the issue on merge): `close`, `closes`, `closed`, `closing`, `fix`, `fixes`, `fixed`, `fixing`, `resolve`, `resolves`, `resolved`, `resolving`, `complete`, `completes`, `completed`, `completing`
42+
43+
**Non-closing** (links without closing): `ref`, `refs`, `references`, `part of`, `related to`, `contributes to`, `toward`, `towards`
44+
45+
## Other Requirements
46+
47+
- **Draft mode** — PRs **MUST** start as drafts. Mark ready for review once CI passes and the description is complete. Seer AI code review runs automatically when a PR moves out of draft.
48+
- **Changelog** — User-facing changes (`feat`, `fix`, `perf`, breaking) **REQUIRE** a `CHANGELOG.md` entry under `## Unreleased`.
49+
- **AI attribution** — For AI-assisted commits, add `Co-Authored-By: Claude <noreply@anthropic.com>` in the **commit footer**. Add `🤖 Generated with [Claude Code](https://claude.com/claude-code)` to the PR description when the PR was AI-generated.
50+
51+
## Template
52+
53+
Place this file at `.github/pull_request_template.md` in the repository root.
54+
55+
Use the [`sentry-skills:create-pr`](https://github.com/getsentry/skills/blob/main/plugins/sentry-skills/skills/create-pr/SKILL.md) skill to generate PR descriptions that follow this structure and meet the quality bar.
56+
57+
```markdown
58+
### Description
59+
60+
<!-- Brief description of what the PR does.
61+
Why these changes are being made — the motivation.
62+
Alternative approaches considered, if any.
63+
Any additional context reviewers need. -->
64+
65+
### Issues
66+
67+
<!--
68+
* Fixes #1234
69+
* Refs LINEAR-ABC-123
70+
-->
71+
```

0 commit comments

Comments
 (0)