plugins/git/skills/creating-commits/SKILL.md
Creates well-structured conventional commits from working tree changes — analyzes diffs, writes short snappy commit titles with detailed bodies, and splits messy working trees into multiple focused commits with line-level precision. Use when committing changes, organizing uncommitted work into commits, splitting a large changeset into atomic commits, writing commit messages, cleaning up a repo into clean commits, or proactively after completing a piece of implementation work to keep the repo clean.
npx skillsauth add lucasilverentand/skills creating-commitsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use this skill proactively whenever you finish implementing something — don't wait for the user to ask. After completing a task, check git status and if there are uncommitted changes, commit them using this workflow. Clean commits after each piece of work keeps the repo history readable and reviewable.
git branch --show-currentbasename $(git rev-parse --show-toplevel)git status and git diff, then route to single or multi-commit based on whether changes are focusedEvery commit should touch one logical concern. If you find yourself needing "and" in the subject line, split it. Examples of clean scope:
Examples of scope violations — split these:
When in doubt, fewer larger commits are better than many trivial ones. Don't split for the sake of splitting — split when the changes are genuinely unrelated.
Run these in parallel:
git status — see what's tracked, staged, untrackedgit diff and git diff --staged — see actual changesgit log --oneline -5 — match the repo's commit styleRead changed files if you need more context. Don't commit blindly — understand what the changes do and why.
Stage files by name — avoid git add -A or git add . which can pull in secrets or binaries. If there are untracked files, decide whether they belong in this commit or should be ignored.
Never stage files that look like secrets (.env, credentials, tokens, private keys). Warn the user if they ask to commit these.
Short, snappy, conventional commit format. Under 50 characters is ideal, 72 is the hard max.
type(scope): what changed
Types: feat, fix, refactor, test, docs, chore, perf, ci, build, style
The subject is a headline — terse and scannable. Imperative mood ("add", not "added"). No period.
Good subjects:
feat(api): add webhook endpointfix(auth): handle expired refresh tokensrefactor(db): extract query builderchore: update biome configBad subjects (too long, too vague, describes files not intent):
fix: update auth.ts and session.ts to handle edge case with tokens (too long)fix: update files (too vague)feat(api): add new webhook endpoint for processing incoming events from third-party services (way too long)The body has two jobs — what changed and why.
<blank line after subject>
What changed — a brief summary of the concrete changes. What files,
what was added/removed/modified, what behavior is different. A reader
should understand the shape of the diff without opening it.
Why — the reasoning behind this change. What problem it solves, what
motivated it, what alternative was considered and rejected. This is
the part that's invisible in the diff.
Skip the body only for truly trivial changes (typo fix, version bump). Everything else gets a body.
Always use a heredoc:
git commit -m "$(cat <<'EOF'
type(scope): subject line
What changed: added X, removed Y, modified Z to do W.
Why: the previous approach caused <problem>. This fixes it by
<approach>. Considered <alternative> but rejected because <reason>.
EOF
)"
Run git status after committing to confirm the working tree is clean or has only the expected remaining changes.
Use this when the working tree has unrelated changes mixed together.
Run git diff (and git diff --staged) to see all changes. Group them by logical concern — apply the scope discipline rules above. Each group becomes one commit.
Order commits so dependencies come first:
Present the plan to the user before starting — list the planned commits with their types, scopes, and subject lines.
For each planned commit:
git add <specific files>git status to confirm remaining changes are as expectedRun git log --oneline -N (N = number of commits created) to show the result. The sequence should read as a coherent narrative.
Use this when asked to "clean up" a repo, or when the working tree is a mess of interleaved changes across many files. This is the most rigorous mode — commits are split at the line level, not just the file level.
Run git diff to get the complete picture. For each changed file, read the diff carefully and annotate which lines belong to which logical concern. A single file often contains changes for multiple concerns:
Group every changed line into a logical concern. Each concern becomes a commit. Be granular — the goal is that every commit in the resulting history is independently reviewable and tells one story.
Present the plan as a table:
| # | Type | Scope | Subject | Files (lines) |
|---|----------|---------|--------------------------------|--------------------------------------|
| 1 | refactor | auth | extract token validation | auth.ts (12-45), utils.ts (3-8) |
| 2 | fix | session | prevent double-refresh race | auth.ts (67-89) |
| 3 | chore | deps | update biome config | biome.json, package.json |
Wait for user approval before proceeding.
For each commit, use git add -p or targeted approaches to stage only the exact lines for that concern:
git add <file>git add <file>git checkout -- <file> does NOT work here since it would undo staging. Instead, after git add, write back the saved content so the working tree has all remaining changesgit add <file>This is tedious but produces a clean history. Take it one commit at a time.
For each planned commit, after staging the right lines:
git diff --staged that only the intended changes are stagedgit diff to confirm remaining unstaged changes are what you expectRun git log --oneline -N and git status to show the result. The working tree should be clean (or have only intentionally uncommitted files). The log should read as a clean, reviewable history.
tools
Creates, audits, and updates public open-source repository documentation, including README files, CONTRIBUTING guides, SECURITY and SUPPORT docs, project badges, quickstarts, usage guidance, community links, and contributor onboarding. Use when maintaining docs for public GitHub projects, libraries, CLIs, apps, or reusable packages, especially when the user says "update this README", "write CONTRIBUTING.md", "make these docs open-source ready", or "improve the public project docs".
development
Creates, audits, and updates private or closed-source project documentation, including internal README hubs, codebase navigation guides, ownership links, Linear initiative links, onboarding notes, runbooks, and contribution guidance for teams. Use when maintaining docs for private repositories, internal apps, services, infrastructure, or company projects, especially when the user says "make this README an internal hub", "document how to navigate this repo", "add Linear links to the docs", or "write private project documentation".
development
Creates, updates, estimates, and tidies Linear issues using Luca's issue-shaping rules. Use when the user asks to create a Linear issue, write ticket-ready issue text, refine an existing issue, add acceptance criteria, set issue relationships, estimate points, audit issue hygiene, tidy a Linear project, find duplicates, fix stale blockers, or normalize labels, milestones, priorities, and issue state.
testing
Keeps an existing Linear project tidy after planning and during execution. Use when the user asks to "tidy Linear", "clean up the project", "audit issues", "find duplicates", "check stale blockers", "fix project drift", or run periodic Linear housekeeping on a project, initiative, or milestone set. Use when planning is underway or execution has started and relationships, labels, priorities, documents, and issue states need coherence without changing product scope.