Git smart commit
Practical agent skills for real engineering workflows.
npx -y skills add lencamo/skills --skill git-smart-commitAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Use when the user wants a git commit message or wants to refine one. Detect the current project's commit convention first, then generate a matching header; include a short body when one intent spans multiple areas.
SKILL.md
4.2 KB, 952 tokens by cl100k_base, as published. Nobody here has run it
Git Smart Commit
Generate a commit message that matches the repository's actual rules. Default to one short header for cohesive changes; include a short body when one intent spans multiple areas.
Use When
- The user asks for a commit message
- The user wants to refine a draft commit header
- The user wants a commit title based on staged or working tree changes
Do Not Use
- For changelogs, PR titles, or release notes
- When the user already gave the exact final commit header
Workflow
- Inspect staged changes first:
git diff --cached --name-onlygit diff --cached --stat
- If nothing is staged, inspect working tree changes:
git status --shortgit diff --name-only
- Discover commit rules, in order:
.commitlintrc.*commitlint.config.*package.json.cz-config.*.czrc*lefthook.yml.husky/*AGENTS.mdREADME*CONTRIBUTING*- contribution or git workflow docs
git log --oneline -20
- If docs and executable config disagree, follow executable config.
- Assess cohesion:
- one logical change
- one dominant change plus incidental ripple
- several unrelated changes
- Treat formatting, lockfile, generated-file churn, and tests removed with covered code as incidental ripple.
- Write the subject from the primary intent, not from the area with the most files.
Hard rules
- Prefer
type(scope): subject. - Use
type: subjectonly when the repo does not require scope or no valid scope is clear. - Obey the repo's max header length if configured. Otherwise keep it under
72and preferably under60. - Prefer
2-6subject words. Avoid more than8unless required. - No ending period.
- Avoid vague subjects such as
update code,fix issue,minor changes,optimize. - Match the dominant language of the repo's recent commits when it is obvious.
- If the repo has no commit history and no explicit language rule, default to English.
- Do not invent custom types or scopes unless the repo explicitly allows them.
- For docs, config, lint, CI, types, tests, build, or release work, use the matching non-feature type. Do not default to
feat. - If no explicit type rules exist, use common Conventional Commit types:
feat,fix,docs,style,refactor,perf,test,build,ci,chore,revert.
Scope rules
- If scopes are enumerated, only use those values and exact spelling.
- If the repo uses package names as scopes, prefer the nearest
package.json.name. - If the repo has no scope convention and scope adds little value, omit it.
- For root-level mixed or unrelated changes, use a broad allowed scope if one exists. Otherwise omit scope.
Output
Default to one line: the recommended commit header.
When to add structure
- If one intent spans several areas, return the header, one blank line, then a short body of up to
5bullets. - If several unrelated changes are present, recommend splitting the commit first, then provide concise one-line headers grouped by path or intent.
General rules
- If
typeorscopeis genuinely ambiguous, return at most3one-line candidates, best first. - Keep the header within the same length limits whether or not a body follows.
- Never pad a cohesive change with bullets.
- Do not add labels or explanations for a normal one-line header. A multi-line message may use a single code block for readability.
- Prefer a single best answer whenever the repo signals are clear.
Examples
fix(api): trim login payloaddocs: update setup guidechore(lint): tune oxlint configrefactor(core): simplify init flow
One intent across areas:
chore(lint): align shared lint rules
- update shared eslint config
- adjust affected package scripts
- refresh lint docs
Unrelated changes:
Split this changeset:
- `fix(auth): handle expired sessions` for `src/auth/**`
- `docs: update setup guide` for `README.md`
What ships with it: 1 file
4.1 KB alongside SKILL.md
docs/
- SKILL.zh-CN.md4.1 KB