Back to Skills

smart-git-commit

verified

Create well-formatted git commits with conventional commit format and emoji. Automatically runs pre-commit checks (lint, build, docs), analyzes changes, suggests splitting when appropriate, and generates emoji-prefixed conventional commit messages. Use when creating commits in any repository to ensure consistent, professional commit history.

View on GitHub

Marketplace

naruto-skills

zlh-428/naruto-skills

Plugin

dev-skills

Repository

zlh-428/naruto-skills
2stars

skills/smart-git-commit/SKILL.md

Last Verified

January 24, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/zlh-428/naruto-skills/blob/main/skills/smart-git-commit/SKILL.md -a claude-code --skill smart-git-commit

Installation paths:

Claude
.claude/skills/smart-git-commit/
Powered by add-skill CLI

Instructions

# Smart Git Commit

Create well-formatted commits with conventional commit format and emoji: `$ARGUMENTS`

## Quick Start

```bash
# Basic commit with auto-generated message
/smart-git-commit

# Provide custom message
/smart-git-commit "add user authentication"

# Skip pre-commit checks
/smart-git-commit --no-verify

# Amend last commit
/smart-git-commit --amend
```

## Workflow

### 1. Pre-Commit Checks (Default)

Unless `--no-verify` is specified, automatically runs:
- `pnpm lint` - Ensure code quality
- `pnpm build` - Verify build succeeds
- `pnpm generate:docs` - Update documentation

If checks fail, asks whether to proceed or fix issues first.

### 2. Stage Analysis

Checks git status to determine staged files:
- **Files already staged**: Only commits those files
- **No files staged**: Automatically stages all modified/new files

### 3. Change Analysis

Performs `git diff --cached` to understand changes and:
- Detects commit type (feat, fix, docs, refactor, etc.)
- Identifies if multiple distinct changes are present
- Suggests splitting when appropriate

### 4. Message Generation

Creates commit message in format: `<emoji> <type>: <description>`

See [commit-types.md](references/commit-types.md) for full emoji/type reference.

## Commit Types

| Type | Emoji | Description |
|------|-------|-------------|
| `feat` | โœจ | New feature |
| `fix` | ๐Ÿ› | Bug fix |
| `docs` | ๐Ÿ“ | Documentation |
| `style` | ๐Ÿ’„ | Formatting/style |
| `refactor` | โ™ป๏ธ | Code refactoring |
| `perf` | โšก๏ธ | Performance |
| `test` | โœ… | Tests |
| `chore` | ๐Ÿ”ง | Tooling, config |
| `ci` | ๐Ÿš€ | CI/CD |

## Command Options

| Option | Description |
|--------|-------------|
| `[message]` | Custom commit description (optional) |
| `--no-verify` | Skip pre-commit checks (lint, build, docs) |
| `--amend` | Amend the previous commit |

## Splitting Guidelines

Consider splitting when:
1. **Different concerns**: Unrelated codebase areas
2. **Different types**: Features + fixes + docs mixed
3. **File 

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
2705 chars