Skip to content

zyl100200/clean-commit-skill

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

clean-commit

Keep AI noise out of your git history. A cross-platform agent skill that blocks Co-Authored-By bots, generator footers, and model-name watermarks in commit messages — so git log, git blame, and changelogs stay signal, not spam.

A portable Agent Skill that stops your AI coding assistant from leaking model names, tool watermarks, Co-Authored-By: Claude, Generated with Cursor, and similar attribution into your git commit messages.

It does one thing only: keep commit messages in a pure human-authored voice. It does not enforce a particular format (Conventional Commits, ticket prefixes, etc.) — your existing repo conventions stay intact.

Why

Most AI coding agents default to appending their own signature when they run git commit on your behalf. That noise pollutes git log, git blame, release notes, and changelogs, and often leaks internal tool choices to external readers. clean-commit turns that default off.

What it does

  • Forbids AI co-author trailers (Claude, ChatGPT, Cursor, Copilot, Codex, Gemini, ...).
  • Strips generator footers and bot emoji signatures (🤖 Generated with ...).
  • Blocks model and product names used as authorship.
  • Blocks AI self-references ("As an AI ...", "I generated ...").
  • Keeps real human Co-Authored-By: and Signed-off-by: trailers.
  • Allows AI product names when the commit is genuinely about that product.
  • Only allows AI attribution when the user explicitly asks for it in the current turn.

See SKILL.md for the full ruleset.

What it does not do

  • Does not enforce commit subject style, length, scopes, or Conventional Commits.
  • Does not install a git hook. This is an agent-side rule only, not a server-side gate.
  • Does not rewrite existing history. Pre-existing dirty commits are left alone unless you ask.

Install

clean-commit is a single skill directory. Any agent that supports the SKILL.md spec can load it. Drop the folder named exactly clean-commit into your agent's skills directory.

Cursor

  • Personal (all projects on your machine): ~/.cursor/skills/clean-commit/
  • Project-scoped (committed to the repo, shared with the team): <repo>/.cursor/skills/clean-commit/

Claude Code

  • Personal: ~/.claude/skills/clean-commit/
  • Project-scoped: <repo>/.claude/skills/clean-commit/

OpenCode and other agents

Any agent that follows the Agent Skills convention (a directory containing a SKILL.md with YAML frontmatter) can use this skill. Consult the agent's docs for the exact skills directory, then place the clean-commit/ folder there.

Quick install via git

# Personal Cursor install
git clone https://github.com/<your-org>/clean-commit-skill.git ~/.cursor/skills/clean-commit

# Personal Claude Code install
git clone https://github.com/<your-org>/clean-commit-skill.git ~/.claude/skills/clean-commit

The directory name at the destination must be clean-commit (matching the name: in SKILL.md). If you clone with a different name, just rename it.

Verify it is active

Ask the agent, in a fresh session:

Commit the staged changes with a short message.

The resulting commit message should contain only a subject line and optional body describing the change. It should not contain any of:

  • Co-Authored-By: Claude, ChatGPT, Cursor, Copilot, Codex, Gemini
  • Generated with ..., Generated by ..., via Claude, via Cursor
  • A trailing 🤖 line
  • As an AI, I generated, by AI

If any of those appear, the skill is either not installed in the right location, not being picked up by your agent, or being overridden by another instruction. Re-check the install path and restart the agent session.

Known pitfall: IDE-level attribution (out-of-band)

Some IDEs and agent CLIs attach an attribution trailer after the message leaves the agent, by wrapping git commit with an extra --trailer flag. The skill only governs the message the AI writes, so it cannot block a trailer that is injected by the tool itself. If you see a line like Made-with: Cursor appearing even with this skill installed, that is what is happening.

Check your IDE/CLI's attribution settings. Known cases:

Cursor

Cursor Agent adds Made-with: Cursor to every commit by default. Turn it off in two places — IDE setting alone does not always propagate to the agent CLI.

  1. IDE toggle: Cursor Settings → Agents → Attribution → turn OFF "Commit Attribution" (and "PR Attribution" if you use that too). Restart Cursor.

  2. CLI config: create or edit ~/.cursor/cli-config.json:

    {
      "commitAttribution": false,
      "prAttribution": false
    }
  3. Rules for AI fallback, if settings get ignored: add to Cursor Settings → Rules for AI:

    Never add "Made-with: Cursor", "Co-authored-by: Cursor", or any Cursor attribution/trailer to commits, PRs, or code comments.

References: Cursor Docs — Git, How to Disable Made-with Cursor Attribution.

Emergency bypass inside a running agent session

The two settings above are loaded at agent startup, so a session started before you changed them will still inject the trailer until you restart Cursor. If you need a clean commit right now without restarting:

Cursor's wrapper appears to inject the trailer by literal substring match on shell commands containing git commit. Any invocation where the command text does not contain the literal string git commit slips past it. In particular, this also catches subcommands like git commit-tree, because they share the git commit prefix — so the workaround also has to avoid those names on the command line directly.

PowerShell example: call git through a variable holding the full path, and use the commit-tree plumbing command:

$g = 'C:\Program Files\Git\cmd\git.exe'   # adjust to your git.exe path
$tree = (& $g rev-parse 'HEAD^{tree}').Trim()
$sha  = (& $g commit-tree $tree -m 'your clean message').Trim()
& $g update-ref refs/heads/main $sha
& $g log -1 --format=%B                   # verify: body should only contain your message

Replace refs/heads/main with your branch. For a non-root commit, add -p <parent-sha> to the commit-tree call.

Caveats:

  • This relies on a specific wrapper implementation and may stop working if Cursor changes it. The durable fix is still "restart the session after applying the settings".
  • git commit --amend does not work as a bypass — it goes through git commit and will re-inject the trailer.
  • commit-tree rewrites the commit SHA. If the old dirty commit has already been pushed, pushing the rewritten history requires --force-with-lease and explicit agreement from anyone else working on the branch.

Other agents

If your IDE or agent CLI injects its own trailer and the behaviour is not documented here, check its settings for "attribution", "commit trailer", "signature", or similar keywords. A quick way to confirm an out-of-band injection is to run:

git log -1 --format=%B

If the trailer is present but you did not write it and this skill is active, the source is the IDE/CLI layer, not the agent's message content.

PRs adding vendor-specific remediation for other tools are welcome.

Explicitly opting in to AI attribution

When you do want an AI co-author on a particular commit, just say so in that turn:

Commit this and add a Co-Authored-By: Claude trailer.

The skill treats that as an explicit override for that single commit only.

Contributing

Issues and PRs welcome, especially:

  • New vendor names or footer patterns observed in the wild.
  • Edge cases where the scan rules produce false positives or false negatives.

Please keep SKILL.md concise. Progressive-disclose anything lengthy into a separate file in this repo and link to it from SKILL.md.

License

MIT. See LICENSE. After cloning, fill in your name and year in the copyright line if you plan to redistribute.

About

Keep AI noise out of your git history. A cross-platform agent skill that blocks Co-Authored-By bots, generator footers, and model-name watermarks in commit messages — so git log, git blame, and changelogs stay signal, not spam.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors