一键导入
write-pull-requests
Use when opening or updating a pull request — produces a bug-fix or feature description reviewers from junior to CTO can follow end to end.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when opening or updating a pull request — produces a bug-fix or feature description reviewers from junior to CTO can follow end to end.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when committing work or writing a commit message — produces a subject and body any developer from junior to CTO can read and act on.
Use when managing the document head of a frontend SPA — per-route title, meta, Open Graph, and canonical tags via TanStack Router's head option (React) or Unhead (@unhead/vue / @unhead/react), plus a correct html lang. Improves accessibility (titles announced on navigation) and SEO/social previews.
Use when building or restructuring a landing page, marketing page, or any public conversion page — audits the page against a section grammar (hero, social proof, features-as-benefits, pricing, FAQ, final CTA), enforces one conversion goal per page, a semantic HTML skeleton, and a hero LCP/CLS budget. Framework-agnostic — works on built HTML from any stack.
Use when tuning frontend performance — enables the React Compiler, splits code by route and lazy-loads heavy chunks, adds bundle analysis with a size budget, measures Core Web Vitals (LCP/INP/CLS) with web-vitals, and applies image/CLS best practices. Measure first, then optimize.
Use when adding forms and validation to a frontend project — wires React Hook Form (React) or VeeValidate (Vue) with Zod schema-first validation, where one schema is the single source of truth for shape, rules, and inferred types, with accessible fields and submit wired to a TanStack Query mutation.
Use when page copy must pass brand, legal, or regulatory rules before going live — checks the visible copy of a public page against a rules file (the project's .claude/rubrics/copy-compliance.md if present, else the bundled template covering prohibited claims, required disclaimers, tone and address, terminology, locale formatting, substantiation) and reports every violation with the quoted text, the rule it breaks, and a compliant rewrite. A cheap pre-publish gate.
| name | write-pull-requests |
| description | Use when opening or updating a pull request — produces a bug-fix or feature description reviewers from junior to CTO can follow end to end. |
The description is the cheapest review tool the author controls: it decides whether the reviewer follows the change or reverse-engineers it. Two fixed shapes, filled from the diff and from output that actually scrolled by — never from memory of what you meant to build.
git log main..HEAD --oneline # substitute the repo's default branch
git diff main --stat # or: git show <sha>, for a PR shipping one existing commit
ls .github/PULL_REQUEST_TEMPLATE.md .github/pull_request_template.md \
.github/PULL_REQUEST_TEMPLATE/ 2>/dev/null
gh pr view --json number,title,body 2>/dev/null
Change nothing yet. Three findings decide the rest:
.github/ defines a PR template, fill its sections in
its order, and carry this skill's discipline into whatever slot asks for testing or
verification. The shapes below apply only when the repo has none.One question: does the branch restore intended behavior (bug fix) or change or
extend it (feature)? Mixed branches lead with the dominant shape and carry the
remainder under Notes. Edge cases (refactors, mixed branches): ./pr-patterns.md.
Bug fix:
./pr-patterns.md).Feature:
Both shapes close with the merge checklist, posted unticked:
## Before merge
- [ ] Manual review
- [ ] Smoke tested
- [ ] Pipeline green
A box is ticked by whoever verified it — the reviewer for the manual read, the author or CI for the rest. A pre-ticked box with nothing behind it is decoration, not evidence.
No invented headings, no omissions: content that fits no section goes under Notes or
stays out. For Verification, run the commands now and paste the lines that prove the
point; anything not run is declared — "Not run: needs staging" — an honest gap beats a
fabricated pass. Write the assembled body to /tmp/pr-body.md; step 5 posts that file.
Read the draft as the three readers of ../_shared/audience.md:
Plain prose throughout. A sentence that reads like a release announcement gets rewritten as a fact.
Show the title and body for approval first — pushing and opening a PR publish the draft.
git push -u origin HEAD # if not yet pushed
gh pr create --title "<subject>" --body-file /tmp/pr-body.md
# or, when step 1 found an existing PR:
gh pr edit <number> --body-file /tmp/pr-body.md
The title carries the branch's dominant commit subject; a subject past ~72 characters
is compressed — keep the type(scope): and the one concern
(../write-commit-messages/SKILL.md). Editing the existing body in place is this skill's idempotency: a re-run regenerates the
description from the current diff and lands on the same PR.
gh pr view
Expected: one PR for the branch; six (bug fix) or seven (feature) sections in the fixed order, closed by the Before-merge checklist — or the repo template's own; every Verification entry is a command plus its observed output, not an adjective.