Skip to content
Back to skills

Write Commit

ASecurity

Draft a commit message from the staged or pasted diff, in the project's style

  • 2 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 17, 2026
ai-agentsbashgit

Security analysis

A100/100

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

Scanned December 3, 2026

npx -y skills add ku5ic/claude-kit --skill write-commit --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Write Commit?

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

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

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: write-commit
description: Draft a commit message from the staged or pasted diff, in the project's style
argument-hint: "<optional: short hint about the change intent>"
allowed-tools:
  - Bash(git status *)
  - Bash(git diff *)
  - Bash(git log *)
  - Bash(git branch --show-current)
  - Bash(git rev-parse *)
---

# /write-commit

Generate a commit message from the staged or pasted diff, matching project style; with no history to match, use Conventional Commits.

Tone and shape: `skills/kit-rules/reference/output.md` section 4, which wins over this file; the sections this file defines stay.

<!-- chat: only
In claude.ai chat, the arguments are the user's message and the material is what they pasted. Nothing can be run: if the diff, log, or text this needs isn't in the conversation, ask for it.
-->

Loading this skill isn't enough. Before the step a row names, read its file.

| Before                          | Read                                                           |
| ------------------------------- | -------------------------------------------------------------- |
| Writing the subject or the body | [reference/message-practice.md](reference/message-practice.md) |

## Procedure

<!-- chat: skip -->

1. Check staged state: `git status --short`
2. Pull the staged diff: `git diff --cached`
3. Pull recent commit history to detect style: `git log --oneline -20`

<!-- chat: end -->

4. Detect the project's commit convention from the history:
   - Conventional Commits (`feat:`, `fix:`, `chore:`, scoped: `feat(auth):`)
   - Ticket prefix (`ABC-123:`, `#456:`). The id comes from the hint, else the branch name. With neither, ask for it.
   - Plain summary line
   - Emoji-based (gitmoji)
5. Write a message matching the detected style.

<!-- chat: skip -->

The branch name for a ticket prefix comes from `git branch --show-current`.

<!-- chat: end -->

## Message rules

- Subject and body: [reference/message-practice.md](reference/message-practice.md), unless the project's history shows another shape.
- Body explains why, not what. The diff shows what.

<!-- chat: skip -->

- Signatures, footers, and co-author tags: `skills/kit-rules/reference/workflow.md` section 1.

<!-- chat: end -->

- If arguments are provided, use them as the intent hint and shape the subject around them.
- With no staged diff and none pasted, say so and stop. A pasted diff stands in for the staged one.
- If the staged diff mixes unrelated changes: say so, list the clusters, and propose splitting into separate commits.

## Output

Print the proposed message in a fenced block, then stop. Committing is the user's call.

<!-- chat: skip -->

Arguments: `$ARGUMENTS`

<!-- chat: end -->

Files in this skill

  • SKILL.md2.4 KB
  • reference/message-practice.md784 B
  • sources.md528 B

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.

View all in ai-agents →

Comments

Loading comments…

Newsletter

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