Skip to content
Back to skills

Writing Git Commits

ASecurity

Split staged or uncommitted changes into conventional commits. Use when asked to commit, generate commit messages, split commits, squash commits, or reorder history.

  • 81 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 8, 2026
toolsshellgitperformancedocumentation

Security analysis

A100/100

Scanned September 8, 2026

npx -y skills add edmundmiller/dotfiles --skill writing-git-commits --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Writing Git Commits?

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

Security grade badge for Writing Git Commits
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/edmundmiller-writing-git-commits/badge)](https://www.skillsdirectory.com/skills/edmundmiller-writing-git-commits)

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: writing-git-commits
description: Split staged or uncommitted changes into conventional commits. Use when asked to commit, generate commit messages, split commits, squash commits, or reorder history.
---

# Writing Git Commits

## Workflow

1. **Inspect** — `diffs --staged` (staged) and `diffs` (unstaged); fallback to `git diff --stat` when raw line stats required
2. **Group** — cluster related changes by intent
3. **Order** — commit foundational changes first (deps, config, types), then features, then tests
4. **Write** — use the message format below
5. **Stage & commit** — `git hunks list`, `git hunks add <hunk-id>` (or `git add <paths>` for whole files), then `git commit -m "..."`

## Message Format

```
<type>(<scope>): <subject>

[optional body]

[optional footer]
```

### Types

| Type       | When                                    |
| ---------- | --------------------------------------- |
| `feat`     | New feature or capability               |
| `fix`      | Bug fix                                 |
| `refactor` | Code change that neither fixes nor adds |
| `docs`     | Documentation only                      |
| `test`     | Adding or updating tests                |
| `chore`    | Build, CI, deps, tooling                |
| `style`    | Formatting, whitespace, semicolons      |
| `perf`     | Performance improvement                 |

### Rules

- **Subject**: imperative mood, lowercase, no period, ≤72 chars
- **Scope**: optional, the module/area affected (e.g., `auth`, `pi`, `nix`)
- **Body**: wrap at 72 chars, explain _what_ and _why_ (not _how_)
- **Footer**: `Closes #123`, `BREAKING CHANGE: ...`
- **Atomic**: each commit compiles/passes independently
- **No mixed concerns**: don't combine a bugfix with a refactor

### Examples

```
feat(pi): add diff-renderer extension

chore: update flake inputs

fix(auth): prevent token refresh race condition

Tokens were being refreshed concurrently, causing 401s for
in-flight requests. Added a mutex around the refresh call.

Closes #42

refactor(shell): extract zsh plugin config to module
```

## Grouping Heuristics

- Same file touched for different reasons → separate commits
- Multiple files for one feature → single commit
- Formatting/whitespace mixed with logic → split them
- Dependency updates → own commit (`chore(deps): ...`)
- Generated files (lockfiles, schemas) → commit with the change that caused them

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…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.