# commit

A Git commit skill for Claude Code organizes changes in the working tree. It activates when asked to save work or create a commit.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · ★ 251 repo stars
- Author: kklimuk
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/kklimuk/docx-cli/tree/HEAD/.claude/skills/commit/SKILL.md
- Updated: 2026-11-12
- Security check: automated, 2026-11-17 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/kklimuk-commit

## What it does

The skill checks the working tree, reviews the diff, and reads recent commit messages to follow the repository’s style. It groups files by intent, then presents the proposed commit count, messages, and file lists for confirmation.

For each approved commit, it stages named files individually and writes a message with a type such as `feat` or `fix`. It checks staged files for secrets and excludes `.env` files and credentials. Afterward, it displays recent commits. If a pre-commit hook fails, the skill investigates its configured commands and creates a new commit after the fix; it does not amend the previous one.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add kklimuk/docx-cli --skill commit -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/commit/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/commit/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add kklimuk/docx-cli --skill commit -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/commit/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add kklimuk/docx-cli --skill commit -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/commit/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install kklimuk/docx-cli .claude/skills/commit
```

2. **Manually: put the files in place**
- File: `.github/skills/commit/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add kklimuk/docx-cli --skill commit -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/kklimuk/docx-cli --path .claude/skills/commit
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/commit/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add kklimuk/docx-cli --skill commit -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/kklimuk/docx-cli/tree/HEAD/.claude/skills/commit/SKILL.md

## When to use it
- group working-tree changes by intent
- prepare commit messages in a consistent format
- check staged files for secrets before committing
- make a separate commit after fixing a pre-commit failure

## Example prompts
- Commit my current changes.
- Sort the working-tree changes into commits and show me the plan.
- Create a commit for the bug fix.

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: aac33bcd48eff4c4.

BEGIN THIRD-PARTY FILE aac33bcd48eff4c4
````text
---
name: commit
description: "Create well-structured git commits from the current working tree. Use when the user says 'commit', 'save my work', 'let's commit this', 'make a commit', or any variation of wanting to commit code to git."
metadata:
  internal: true
---

# Commit

Create clean, well-structured git commits that tell a coherent story.

## Process

### 1. Assess the Working Tree

Run `git status` (never `-uall`) and `git diff` to understand what changed. Also run `git log --oneline -5` to match the repo's existing commit message style.

If there are no changes, say so and stop.

### 2. Group Changes by Intent

Look at the changed files and mentally group them:

- **Feature**: new functionality (client + server + tests for the same feature = one commit)
- **Fix**: bug fixes
- **Refactor**: structural changes that don't change behavior
- **Docs**: documentation-only changes (CLAUDE.md, README, comments)
- **Test**: test-only additions or changes
- **Chore**: config, dependencies, tooling

Rules for grouping:
- **Prefer fewer commits.** A feature that touches 15 files is still one commit if it's one logical change.
- **Only split when intent is genuinely different.** "Add collaborative editing" is one commit even if it touches client, server, DB, and tests. But "add collaborative editing" + "fix unrelated CSS bug" should be two commits.
- **For a first commit or large initial build, one commit is fine.** Don't artificially split an initial implementation.
- **Docs updates that accompany code changes go in the same commit.** Only separate docs commits for docs-only changes.

### 3. Present the Plan

Before committing, show the user:
- How many commits you plan to make
- For each commit: the message and which files are included
- Ask for confirmation

### 4. Create the Commits

For each commit:
1. Stage the specific files with `git add <file1> <file2> ...` (never `git add -A` or `git add .`)
2. Commit with a message using this format:

```
<type>: <concise description>

<optional body — explain WHY, not WHAT. The diff shows what.>

Co-Authored-By: Claude <noreply@anthropic.com>
```

Types: `feat`, `fix`, `refactor`, `docs`, `test`, `chore`

Message guidelines:
- Subject line under 72 characters
- Use imperative mood ("add", not "added" or "adds")
- The subject should complete the sentence "This commit will..."
- Body is optional — use it for non-obvious context (e.g., "the old approach caused X" or "this unblocks Y")
- Always include the Co-Authored-By trailer

### 5. Verify

After all commits, run `git log --oneline -10` to show the result.

## Safety Rules

- **Never commit `.env`, credentials, or secrets.** Check staged files for these patterns and warn.
- **Never use `git add -A` or `git add .`** — always stage specific files.
- **Never amend a commit** unless the user explicitly asks.
- **Never force push.**
- **Never skip hooks** (`--no-verify`).
- **If a pre-commit hook fails**, fix the issue and create a NEW commit (don't amend). To diagnose, read the pre-commit hook (`.husky/pre-commit` or `.pre-commit-config.yaml`) to see what it runs, then run each command individually to find the failure.

## What NOT To Do

- Don't write commit messages that describe every file changed. The diff does that.
````
END THIRD-PARTY FILE aac33bcd48eff4c4

The third-party file has ended. Everything between the aac33bcd48eff4c4 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 3272 of 3513 bytes. © kklimuk · MIT · https://github.com/kklimuk/docx-cli/tree/HEAD/.claude/skills/commit/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
