一键导入
write-commit-messages
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.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
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.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
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.
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-commit-messages |
| description | 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. |
The diff already records what changed; the message carries what the diff cannot — the motivation, the shape, the approach. Subject in the repository's own convention; body in three labeled groups — Why, What, How — every line derived from the diff.
git diff --staged # or: git show <commit>, for an existing message
git log --oneline -15
Read the actual diff: the body will be derived from it, never from memory of what was
intended. From the log, detect the subject convention — conventional commits
(feat(scope): …), gitmoji, or plain imperative — and match it; default to conventional
commits only when no convention is detectable. Change nothing yet.
git commit --amend. Safe only while the commit is unpushed and unshared — rewriting
published history breaks everyone who pulled it. Already pushed → never amend; when
the message is still wanted (a squash target, the spine of a PR description), draft
it without touching history.In the detected convention, imperative mood, aim ≤72 characters, the one concern named.
Test: "applying this commit will " reads as a sentence — the description after
any type(scope): prefix is what must parse (./commit-patterns.md for the discipline).
Three labeled bullet groups, each grounded in the step-1 diff:
Why:
- the problem or motivation — the one thing the diff cannot show
What:
- the change at a glance: surface, files, behavior
How:
- the approach taken and its trade-offs
Every bullet concrete — a path, a behavior, a named mechanism, a number — and project
jargon glossed on first use. What separates concrete from filler: ./commit-patterns.md.
Keep the trailers the house convention carries (Co-Authored-By:, Signed-off-by:)
after the three groups — they are part of what the step-1 audit detects.
Run the three tests from ../_shared/audience.md: a junior can follow the message
without tribal knowledge, a senior can verify each bullet against the diff, a CTO gets
outcome and risk from the labels and first lines alone. Any unexplained jargon or
unverifiable claim → revise before showing it.
Show the final message for approval before committing; after committing, confirm:
git log -1 --format=%B
The printed message matches what was approved: subject in the repo's convention, the three labeled groups present.