commit-messages
WHEN writing git/conventional commits; NOT for PR text; returns concise, why-first commit lines with proper type/scope.
- License 许可
- MIT
- 所属仓库
- mintuz/skills
- 最近更新
- 2026-11-13
- Stars
- ★ 35
- Forks
- 7
01 前言 Front Matter
- name
- commit-messages
- description
- WHEN writing git/conventional commits; NOT for PR text; returns concise, why-first commit lines with proper type/scope.
03 SKILL.md 正文
Commit Messages
Write an evidence-backed Conventional Commit for one logical change.
1. Establish the evidence
The evidence is the staged diff and facts the user supplied. Every type, scope, effect, issue number, and metric must trace to it. If the change itself is missing, stop and ask for the staged diff or a short summary of what changed. If only the motivation is missing, write the header and omit the body.
2. Keep the commit atomic
One commit holds changes with one intent that should be reverted together. A fix and its focused regression test belong together. File count, directories, or multiple implementation types alone do not justify a split.
Split unrelated intents or changes that should be independently revertible. For each proposed commit, group its changes and give its exact message. Leave the index unchanged unless the user explicitly asks you to alter it.
3. Write the message
type(scope)!: subject
optional body
optional footer
Choose the type from the observed intent:
feat: new user-facing capabilityfix: user-facing defect correctiondocs,style,refactor,perf: documentation, formatting-only, behaviour-preserving restructuring, or measured performance worktest: standalone test work; keep focused regression tests with their changebuild,ci: build/dependency or CI changeschore: evidenced maintenance outside source and testsrevert: an evidenced revert of an earlier commit
Follow the repository's scope convention. When none is supplied, use the smallest owning area the evidence supports; omit the scope when no single area owns the change.
Write the subject in lowercase imperative mood with no trailing period. Aim for 50 characters; never exceed 72. Name the specific outcome.
Add a body only for motivation or context the header cannot carry. Explain why the change was needed, not what the diff mechanically does. Wrap at 72 characters.
Add issue references, claims, and metrics only when the evidence supplies them. When the user asks for an unsupported claim, leave it out, name it, and give the reason.
For a breaking change, add ! to the header and a BREAKING CHANGE: footer
stating the old contract, new contract, and migration action.
For a revert, use the revert type and name the reverted change in the subject,
reusing the reverted commit's subject wording unless it breaks the subject
rules. Add a footer naming the reverted commit hash, such as Refs: <hash>.
Give the observed problem as the motivation.
Return
- Enough evidence: the complete ready-to-use message, no tutorial.
- Multiple logical changes: one line stating how their intents differ, not a bare list of messages. Then one exact message per commit, index unchanged.
- Missing evidence: name the parts of the message that would be guesswork, such as the type, the scope, or the effect. Ask only for the minimum facts needed. An instruction to answer without questions does not make a guess trustworthy.
04 同仓库更多 Skills
lens-review
USE WHEN reviewing uncommitted work, a branch diff or a pull request through several installed skills, each run as its own review lens; NOT WHEN you need one cold second opinion (double-check), a verdict against a specification (acceptance-review) or the built-in fixed-lens /code-review. Runs each lens in an isolated read-only agent, has a separate agent try to refute every finding, and returns one severity-ranked report.
xstate
WHEN React state changes in response to an external answer — async submit, in-flight or loading flags, retries, cancellation, polling, optimistic updates, stale responses — or to an interaction with an interruptible middle, such as a drag or a gesture; or WHEN building, reviewing, testing, or visualising XState 5 actors and @xstate/react integrations; NOT for a value one event sets completely, such as a text draft, a focus flag, or a plain open and closed toggle; models typed lifecycles and renders legal Mermaid stateDiagram-v2 charts.
web-design
WHEN refining UI layout, typography, color, or polish; NOT code implementation; provides concise principles for intentional, legible design.
tailwind
USE WHEN writing, fixing or reviewing styling in a project that uses Tailwind CSS, even a one-class change or a request that does not name Tailwind: colours, focus rings, spacing, class names chosen by a prop, map or CVA variants, theme tokens and dark mode in the Tailwind stylesheet or tailwind.config, setup or upgrades (if unsure whether the project uses Tailwind, check package.json or the main stylesheet first); NOT WHEN writing plain CSS or Sass in a project without Tailwind; produces class names Tailwind can find, syntax for the installed major version, visible focus indicators, and no unrequested dependency or invented brand value.
refactoring
WHEN you need a plan to refactor, restructure, or clean up working code and the test result is known, either green or a recorded failing set; NOT for new feature delivery or any behavior change; reversible-baseline safety with prioritized improvements.
react
USE WHEN changing the logic, data, props, state, Effects or rendered text of a React component, hook or page, even a one-line change; NOT WHEN the request is styling only (class names, Tailwind, CSS, dark mode, spacing, shadows) or tests only, or when it models submit, in-flight, loading, retry or failure states, even for a named React form (xstate covers that, including its React wiring); applies React 19 composition, state, Effect, structure, API and performance rules with only the project's installed libraries.