# Commit

> Analyzes staged changes and generates a high-quality, conventional commit message, then executes the commit.

- Skill: `majiayu000/commit-15` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds add majiayu000/commit-15`
- Raw SKILL.md: https://api.skillmd.com/api/skills/majiayu000/commit-15/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: majiayu000 (https://skillmd.com/u/majiayu000)
- Updated: 2026-09-09
- Page: https://skillmd.com/skills/majiayu000/commit-15

---


# Smart Commit Skill

When I say "commit this" or "generate a commit message," follow this workflow:

## 1. Intelligence Gathering
* **Run** `git diff --cached` to see exactly what is being committed.
* **Identify Change Type**: Determine if it is a `feat`, `fix`, `docs`, `style`, `refactor`, `test`, or `chore`.
* **Analyze Scope**: Identify the specific module or component affected (e.g., `api`, `models`, `ui`).

## 2. Generate the Message
Follow the **Conventional Commits** specification:

```text
<type>(<scope>): <short summary in imperative mood>

[optional body: explain the WHY, not just the WHAT]

[optional footer: relate to Issue IDs, e.g., Closes #123]

```

don't add Co-Authored-By on message

## 3. Execution

1. **Present** the generated message to the user.
2. **Run** `git commit -m "[message]"` (or `-m "[subject]" -m "[body]"` for multi-line).

## 4. The Gotcha

**Warning**: Remind the user if they are committing too many unrelated changes at once (non-atomic commits). If the diff is too large, suggest splitting it into two separate commits.


### Why this works for you
* **Context Aware**: Because it runs `git diff --cached`, it knows exactly what you've staged, unlike generic AI tools that look at your whole folder.
* **Structured**: It forces the "Conventional Commit" format, which makes your `git log` look professional and machine-readable.

### Example Interaction
**User:** "Claude, commit these Pydantic changes."

**Claude:**
> **Proposed Message**:
> `feat(models): implement Pydantic v2 validation for User schema`
> 
> `Updated UserRecord to inherit from BaseModel and added EmailStr validation for the email field. This prevents malformed data from reaching the service layer.`
>


