npx skills add ...
npx skills add 0xd669/skills --skill commit
Creates and executes one coherent git commit from staged or selected working-tree changes. Use when the user asks to commit changes, stage and commit a logical change, or create a git commit with an appropriate message. Do not use for a draft-only message request or an operation that only pushes existing commits.
npx skills add 0xd669/skills --skill commit
Create exactly one coherent commit while preserving changes outside its intended scope. Write the commit message in English and communicate with the user in their language. Follow explicit user instructions and applicable repository guidance before the defaults below.
git status --shortgit diff --cachedgit diffgit ls-files --others --exclude-standardgit diff --name-only --diff-filter=Ugit branch --show-currentgit log --oneline -10When the exact target is not already staged, stage only its files with explicit pathspecs:
Use -- before paths and quote paths containing spaces, brackets, parentheses,
wildcards, or other shell-special characters. Include untracked files only when
they are part of the target change. Exclude local configuration, credentials,
temporary files, logs, and build artifacts unless repository guidance explicitly
tracks them and they are required by the change. If a target file mixes relevant
and unrelated hunks, stage only the relevant hunks; ask the user before staging
the whole file when safe partial staging is not practical.
After staging, re-run git status --short and git diff --cached. The staged diff
is now the sole source of truth for the commit.
Stop before committing when any blocking condition is present:
| Condition | Required action |
|---|---|
| Empty staged diff | Tell the user there is nothing staged for this commit. |
| Unmerged entries or real conflict markers | List the affected files and ask the user to resolve them. |
Suspected secret, credential, private key, or unintended .env file | Identify the location without repeating the value; ask the user to remove it or confirm it is non-secret test data. |
| Unclear or unrelated staged content | Explain the mismatch and ask how to scope the commit. |
Also inspect added lines for accidental debug statements, generated output, logs,
and unexplained TODO or FIXME markers. Ask only when an item appears unintended;
do not treat every occurrence as an error.
Treat the message as a compact, standalone explanation for a human or coding agent that may not inspect the diff. Prioritize the changed behavior or system rule over author activity, file lists, and implementation inventory. Ground every claim in the staged changes and relevant repository context.
First follow an explicit repository commit convention. Use recent commit history as supporting evidence, not as a replacement for written guidance. Then distill:
When no convention is defined, use these defaults:
Deduplicate retries by request ID to
Update retry handling. Omit a trailing period and keep the title concise; do
not exceed 72 characters. Exclude conventional-commit types/scopes (feat:,
fix(x):), ticket or issue IDs, and branch names. Recent commits containing
such a prefix are not sufficient reason to add one; only an explicit written
convention (e.g. CONTRIBUTING.md, a commit template, a commitlint config)
does.Previously, <old rule>. Now, <new rule>. is one natural
shape, not a required one. When no meaningful prior behavior exists (a new
capability, file, or first version), state the new rule directly; never
write a contrast whose "previously" clause merely negates the "now" clause.
Include the deciding unit, direction, or unchanged boundary only when it is
part of that delta. Omit the body only when the title itself makes the
change recoverable. Do not summarize files or tests.Attempts r1, r1, r2 now create two jobs instead of three because request ID defines identity. Keep
the example faithful to the diff; do not invent unsupported behavior.Do not turn the description into a file-by-file or hunk-by-hunk summary. Omit secondary edits, routine tests, and mechanical details unless they change the core mental model. Do not force a body or toy example based only on change size.
Before executing the commit, review git diff --cached one final time and verify:
For a subject-only message, run:
For a message with a body, use separate -m arguments so Git inserts a real blank
line. Put real line breaks in a long body; never encode them as literal \n text.
If the commit fails, inspect the error and current status before taking further action. If a hook modified files or the index, review the new staged diff and revalidate the message before retrying. Do not retry a failure blindly.
After success, inspect the complete stored message with
git log -1 --format='%B'. Verify that the title/body separator and body line
breaks are real line breaks, not literal \n text. If the just-created message
is malformed, amend it using actual line breaks and inspect it again. Then run
git log -1 --format='%h %s' and git status --short. Report the commit hash and
subject, then mention any remaining unstaged or untracked changes. Do not push
unless the user separately requested it.