Pull Request Enhancement
Workflow
- Run
git diff <base>...HEAD --stat to identify changed files and scope
- Categorise changes: source, test, config, docs, build, styles
- Generate the PR description using the template below
- Add a review checklist based on which file categories changed
- Flag breaking changes, security-sensitive files, or large diffs (>500 lines)
PR Description Template
## Summary
<!-- one-paragraph executive summary: what changed and why -->
## Changes
| Category | Files | Key change |
|----------|-------|------------|
| source | `src/auth.ts` | added OAuth2 PKCE flow |
| test | `tests/auth.test.ts` | covers token refresh edge case |
| config | `.env.example` | new `OAUTH_CLIENT_ID` var |
## Why
<!-- link to issue/ticket + one sentence on motivation -->
## Testing
- [ ] unit tests pass (`npm test`)
- [ ] manual smoke test on staging
- [ ] no coverage regression
## Risks & Rollback
- **Breaking?** yes / no
- **Rollback**: revert this commit; no migration needed
- **Risk level**: low / medium / high — because ___
Review Checklist Rules
Add checklist sections only when the matching file category appears in the diff:
| File category |
Checklist items |
| source |
no debug statements, functions <50 lines, descriptive names, error handling |
| test |
meaningful assertions, edge cases, no flaky tests, AAA pattern |
| config |
no hardcoded secrets, env vars documented, backwards compatible |
| docs |
accurate, examples included, changelog updated |
security-sensitive (auth, crypto, token, password in path) |
input validation, no secrets in logs, authz correct |
Splitting Large PRs
When diff exceeds 20 files or 1000 lines, suggest splitting by feature area:
git checkout -b feature/part-1
git cherry-pick <commits-for-part-1>
Resources
resources/implementation-playbook.md — Python helpers for automated PR analysis, coverage reports, and risk scoring
1---2name: comprehensive-review-pr-enhance3description: Generate structured PR descriptions from diffs, add review checklists, risk assessments, and test coverage summaries. Use when the user says "write a PR description", "improve this PR", "summarize my changes", "PR review", "pull request", or asks to document a diff for reviewers.4---5
6# Pull Request Enhancement
7
8## Workflow
9
101. Run `git diff <base>...HEAD --stat` to identify changed files and scope
112. Categorise changes: source, test, config, docs, build, styles
123. Generate the PR description using the template below
134. Add a review checklist based on which file categories changed
145. Flag breaking changes, security-sensitive files, or large diffs (>500 lines)
15
16## PR Description Template
17
18```markdown
19## Summary
20<!-- one-paragraph executive summary: what changed and why -->
21
22## Changes
23| Category | Files | Key change |
24|----------|-------|------------|
25| source | `src/auth.ts` | added OAuth2 PKCE flow |
26| test | `tests/auth.test.ts` | covers token refresh edge case |
27| config | `.env.example` | new `OAUTH_CLIENT_ID` var |
28
29## Why
30<!-- link to issue/ticket + one sentence on motivation -->
31
32## Testing
33- [ ] unit tests pass (`npm test`)
34- [ ] manual smoke test on staging
35- [ ] no coverage regression
36
37## Risks & Rollback
38- **Breaking?** yes / no
39- **Rollback**: revert this commit; no migration needed
40- **Risk level**: low / medium / high — because ___
41```
42
43## Review Checklist Rules
44
45Add checklist sections only when the matching file category appears in the diff:
46
47| File category | Checklist items |
48|---------------|----------------|
49| source | no debug statements, functions <50 lines, descriptive names, error handling |
50| test | meaningful assertions, edge cases, no flaky tests, AAA pattern |
51| config | no hardcoded secrets, env vars documented, backwards compatible |
52| docs | accurate, examples included, changelog updated |
53| security-sensitive (`auth`, `crypto`, `token`, `password` in path) | input validation, no secrets in logs, authz correct |
54
55## Splitting Large PRs
56
57When diff exceeds 20 files or 1000 lines, suggest splitting by feature area:
58
59```
60git checkout -b feature/part-1
61git cherry-pick <commits-for-part-1>
62```
63
64## Resources
65
66- `resources/implementation-playbook.md` — Python helpers for automated PR analysis, coverage reports, and risk scoring