home / skills / ikatsuba / skills / commit

commit skill

/git/commit

This skill automatically stages all changes and creates a conventional commit, streamlining versioning and collaboration.

npx playbooks add skill ikatsuba/skills --skill commit

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
1.3 KB
---
name: git:commit
description: Smart Commit - stages all changes and creates a conventional commit
---

# Smart Commit

Stages everything and commits. No questions asked.

## Arguments

- `<args>` - Optional. Full message (`"docs: update readme"`) or type hint (`fix`, `feat(auth)`)
- If a full message is provided in quotes, use it directly — skip analysis

## Instructions

1. Run `git add -A`
2. Run `git diff --cached --stat` — if nothing staged, tell the user and stop
3. Run `git diff --cached` (first 200 lines if large)
4. Determine the commit message in Conventional Commits format:
   - **Type**: `feat`, `fix`, `docs`, `refactor`, `test`, `chore`, `perf`, `ci`, `build`, `style`, `revert`
   - **Scope**: main directory or module affected (omit if widespread)
   - **Description**: imperative mood, lowercase, no period, max 72 chars
   - If args provided a type or scope, use those
5. Run `git commit -m "<message>"`

## Constraints

- Do NOT ask questions — just commit
- Do NOT run tests, lint, type-check, or any validation
- Do NOT explore the codebase beyond the diff
- Do NOT run `git status`, `git log`, or any extra git commands
- Do NOT add `Co-Authored-By`, `Signed-off-by`, or any trailers
- Total tool calls: 3 (`git add`, `git diff --cached`, `git commit`)

Overview

This skill stages all current changes and creates a Conventional Commit without prompting. It uses a minimal, automated flow to build a conventional commit message from the staged diff and then commits it. It never runs tests, linters, or extra git commands beyond the required three.

How this skill works

The skill runs git add -A to stage everything, then inspects the staged diff summary and patch to decide the commit type, scope, and short description. If nothing is staged, it reports that and stops. If a full quoted commit message is provided as an argument, it uses that verbatim; otherwise it formats a Conventional Commit and runs git commit with the generated message.

When to use it

  • You want a fast, no-interaction commit that follows Conventional Commits.
  • You have already reviewed changes and only need to stage and commit them consistently.
  • You prefer automated commit messages based on the staged diff.
  • You want to enforce a small set of conventional types without extra validation.

Best practices

  • Invoke only when you are ready to stage and commit all local changes—this stages everything unconditionally.
  • Provide a full quoted commit message if you need a precise message; otherwise provide a type or type(scope) hint to guide the generator.
  • Review the staged diff before running this skill if you need selective commits—this tool stages all changes automatically.
  • Keep descriptions short and imperative to fit the generated 72-character limit.

Example use cases

  • Quickly commit a set of formatting and small refactors using: git:commit refactor
  • Commit a single bugfix after editing a file with: git:commit fix(auth)
  • Supply an exact message for a release note: git:commit "chore(release): bump version to 1.2.3"
  • Run as part of a scripted workflow that requires exactly three git calls and no interactive prompts

FAQ

Will this run tests or linters before committing?

No. It never runs tests, linters, type checks, or any additional validations.

What happens if nothing is staged after git add -A?

The skill checks the cached diff summary; if nothing is staged it informs you and stops without committing.