NativeAIHub
๐Ÿ“ฆ

Commit Skill

A structured git commit workflow that reviews your changes, writes clear commit messages, stages appropriate files, and commits safely. Triggered with /commit.

Skillยท/commitยท3 sectionsยท1 min read
codingdevops
Install Prompt

Paste this into Claude Code to set it up:

I want to add the /commit skill to my Claude Code setup.

Create the directory ~/.claude/skills/commit/ and inside it create SKILL.md with the commit workflow instructions.

The skill should:
- Run git status, git diff, and git log in parallel
- Analyze changes and draft a commit message
- Stage specific files (never git add -A)
- Wait for explicit user approval before committing
- Never commit .env files or API keys

After creating the file, the skill is immediately available via /commit.

01What It Does

Safe, structured commits every time

Type /commit and Claude walks you through the entire process: reviewing the diff, categorizing changes, drafting a clear message, and staging only the files that should be committed. It never commits without your explicit approval and never stages sensitive files like .env or API keys.
1

Gather context

Runs git status, git diff, and git log in parallel to understand what changed and what recent commit messages look like.

2

Analyze changes

Categorizes new, modified, and deleted files. Flags any sensitive files (.env, credentials, tokens) immediately.

3

Draft the message

Writes a conventional commit message (feat, fix, refactor, docs, etc.) focused on "why" not "what." Under 72 characters on the first line.

4

Present the plan

Shows exactly which files will be staged, which are excluded, and the proposed message. Asks for your approval before proceeding.

5

Execute safely

Stages files by name (never git add -A), commits with the approved message, and verifies success with git status.

02Commit Types

When to Use
featA new feature or capability
fixA bug fix
refactorCode restructuring without behavior change
docsDocumentation changes
testAdding or updating tests
choreBuild, config, dependency updates
styleFormatting, whitespace (no logic changes)
perfPerformance improvements

03Safety Rules

Never commits without asking first. Always presents the plan and waits for your explicit approval.
Never uses git add -A or git add . Stages files by name to avoid accidentally including sensitive or unrelated files.
Never commits sensitive files. Warns immediately if .env, credentials, tokens, or secrets are detected in the diff.
Never pushes automatically. Committing and pushing are separate actions. Only pushes when you explicitly ask.
Never amends previous commits. If a pre-commit hook fails, fixes the issue and creates a new commit instead.