Back to Skills

git-commit-validator

verified

MUST be used for ANY git workflow that involves committing code. This includes explicit commit requests AND implicit ones like 'ship it', 'wrap it up', or finishing implementation work. Handles staging, message generation, validation, and commit execution with conventional commit format.

View on GitHub

Marketplace

oh-my-claude

TechDufus/oh-my-claude

Plugin

oh-my-claude

productivity

Repository

TechDufus/oh-my-claude
48stars

plugins/oh-my-claude/skills/git-commit-validator/SKILL.md

Last Verified

January 24, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/TechDufus/oh-my-claude/blob/main/plugins/oh-my-claude/skills/git-commit-validator/SKILL.md -a claude-code --skill git-commit-validator

Installation paths:

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

Instructions

# Git Commit Validator

This skill MUST be invoked whenever you are about to create a git commit. It handles the complete workflow and enforces commit message standards.

## When This Skill Activates

**Auto-invoke this skill when the user implies code should be committed:**

| Category | Trigger Phrases |
|----------|-----------------|
| **Explicit commit** | "commit", "make a commit", "commit this" |
| **Ship intent** | "ship it", "send it" |
| **Finalization** | "wrap it up", "finalize this", "we're done", "that's it" |
| **After implementation** | When you complete work and there are uncommitted changes |

**Key insight:** If the user's intent results in `git commit` being run, this skill MUST be used first.

**Do NOT run `git commit` without this skill.**

## Complete Commit Workflow

### Step 1: Gather Context

```bash
git status                    # See what's changed
git diff HEAD                 # See all changes (staged + unstaged)
git log --oneline -5          # Recent commit style reference
```

### Step 1.5: Handle No Changes

If `git status --porcelain` returns empty AND nothing is staged:
- **Do not attempt to commit** - there's nothing to commit
- Inform the user: "No changes to commit"
- Exit the workflow

This prevents errors from running `git commit` with nothing staged.

### Step 2: Stage Changes

**Default behavior** - stage all changes:
```bash
git add -A
```

**If user specifies `--staged`** - skip staging, use only what's already staged.

**If user gives instructions** - follow them:
- "ignore the docs" → don't stage doc files
- "only the src folder" → stage selectively

### Step 3: Analyze and Generate Message

Based on the diff, determine:
1. **Type**: feat, fix, docs, refactor, test, chore, perf, ci, build, style, revert
2. **Scope** (optional): module or area affected
3. **Description**: concise, imperative mood, lowercase
4. **Body**: see decision matrix below

**Message Format:**
```
<type>[optional scope]: <description>

[body - requir

Validation Details

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