agentleFS
brandtambrandtam/skills/skills/write-commit/SKILL.md

write-commit

Skill0 starsChanged 4 months agoMITView on GitHub

Generate structured commit messages and optionally commit for the user. Checks for repo-level commit templates, handles staging decisions, and enforces user approval before any commit. Use when user says "commit", "write a commit message", "stage and commit", or invokes /write-commit.

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. ZAidBinAsif/flutter-ai-starter★ 0same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository7 other files it gives its agents.

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. About 0 are common, 12 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈12

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run all three in parallel — never reuse results from earlier in the conversation:

    line 17
  2. Distinctive:

    If there are no changes at all (nothing staged, unstaged, or untracked), tell the user there's nothing to commit and stop.

    line 27
  3. Distinctive:

    If there are already staged files AND unstaged/untracked changes, ask the user:

    line 31
  4. Distinctive:

    If everything is already staged, skip this question.

    line 36
  5. Distinctive:

    After staging is resolved, re-run git diff --cached to see exactly what will be committed.

    line 41
  6. Distinctive:

    Check for a repo-level commit template:

    line 45
  7. Distinctive:

    If a template exists, read it and follow its format for the commit message.

    line 53
  8. Distinctive:

    If no template exists, use the default format below.

    line 54
  9. Very specific:

    If CONTEXT.md exists in the repo, use its domain terms.

    line 69
  10. Distinctive:

    Never describe corrections to things that were never committed.

    line 72
  11. Distinctive:

    After displaying the message, ask the user:

    line 81
  12. Distinctive:

    When committing, use a HEREDOC to pass the message:

    line 89
  13. Distinctive:

    After a successful commit, show the user the commit hash and summary.

    line 98

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Commit

Generate a commit message for the current changes, then optionally execute the commit with user approval.

Workflow

Step 1 — Gather fresh state

Run all three in parallel — never reuse results from earlier in the conversation:

git status
git diff HEAD
git diff --cached

Determine: are there staged files? Unstaged changes? Untracked files?

If there are no changes at all (nothing staged, unstaged, or untracked), tell the user there's nothing to commit and stop.

Step 2 — Staging decision

If there are already staged files AND unstaged/untracked changes, ask the user:

  • Staged files only — write commit for what's already staged
  • Stage all changes — run git add -A, then write commit for everything

If everything is already staged, skip this question. If nothing is staged, ask:

  • Stage all changes — run git add -A
  • Select files — let the user tell you which files to stage

After staging is resolved, re-run git diff --cached to see exactly what will be committed.

Step 3 — Check for commit template

Check for a repo-level commit template:

git config --get commit.template

Also check for .gitmessagetemplate or .git-commit-template in the repo root.

  • If a template exists, read it and follow its format for the commit message.
  • If no template exists, use the default format below.

Step 4 — Write the commit message

Default format

  1. A single summary line (imperative mood, under 70 characters)
  2. A blank line
  3. A bulleted list of what the code does NOW

Message rules

  • Describe the result, not the process. No "Fix bug that was introduced when..." or "Refactor after code review found..."
  • Each bullet: a discrete capability, integration, or architectural change as it exists in the final code
  • Imperative mood ("Add X", "Extract Y", "Update Z")
  • If CONTEXT.md exists in the repo, use its domain terms. If absent, proceed silently.
  • Group related changes into single bullets rather than listing every file
  • Omit intermediate steps, failed approaches, iterative fixes — only the current state
  • Never describe corrections to things that were never committed. If a value was wrong in the working tree but never in git history, describe the current (correct) state.
  • 8–15 bullets for large changes, fewer for small ones
  • Never append Co-Authored-By, Signed-off-by, or any trailer lines to the commit message

Display the full commit message to the user in a code block.

Step 5 — User approval

After displaying the message, ask the user:

  • Commit now — execute git commit with the displayed message
  • Make changes — user provides feedback, you revise the message, then ask again
  • End now — exit without committing

NEVER commit without the user choosing "Commit now."

When committing, use a HEREDOC to pass the message:

git commit -m "$(cat <<'EOF'
<message here>
EOF
)"

After a successful commit, show the user the commit hash and summary.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.