Skip to content
Back to skills

Commit Hygiene

ASecurity

Use when committing changes with git — staging files and writing commit messages. Makes the agent keep each commit focused on one logical change and write a clear, conventional message explaining why, instead of dumping unrelated edits into a single vague "update" commit.

  • 2 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 7, 2026
ai-agentsgitdocumentation

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned September 7, 2026

npx -y skills add buildmoonshot/skillpacks --skill commit-hygiene --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Commit Hygiene?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Commit Hygiene
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/buildmoonshot-commit-hygiene/badge)](https://www.skillsdirectory.com/skills/buildmoonshot-commit-hygiene)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: commit-hygiene
description: Use when committing changes with git — staging files and writing commit messages. Makes the agent keep each commit focused on one logical change and write a clear, conventional message explaining why, instead of dumping unrelated edits into a single vague "update" commit.
---

# Commit Hygiene

A commit is a unit of history someone will read later. Make each one tell a clear, single story.

## One logical change per commit

- Don't bundle unrelated work ("fix bug + rename files + add feature") into one commit. Split it. Each commit should be revertable on its own without dragging unrelated changes with it.
- If you changed several things, stage and commit them separately by concern.

## Write a message that explains *why*

Use a conventional, scannable format:

```
<type>: <short imperative summary>

<optional body: why this change, not what — the diff already shows what>
```

- **type**: `fix`, `feat`, `refactor`, `docs`, `test`, `chore` (match the repo's existing convention if it has one).
- **summary**: imperative mood, ~50 chars, no trailing period: `fix: prevent crash on empty cart`, not `fixed some stuff`.
- **body** (when it adds value): explain the reasoning, the tradeoff, or the context a future reader won't have. Skip it for trivial changes.

## Match the repo

If the project already uses a commit style (check `git log`), follow it over these defaults. Consistency beats your personal preference.

## Why this matters

`git log` is documentation that writes itself — but only if commits are clean. Focused commits make bugs bisectable, reverts safe, and reviews fast. A history of vague "update" commits is a history nobody can use.

Files in this skill

  • README.md1.2 KB
  • SKILL.md1.7 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…