home / skills / codyswanngt / lisa / git-commit

git-commit skill

/.claude/skills/git-commit

This skill assists you create conventional commits for current changes by grouping files into feature, fix, or docs commits and ensuring a clean working tree.

npx playbooks add skill codyswanngt/lisa --skill git-commit

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

Files (1)
SKILL.md
1.6 KB
---
name: git-commit
description: This skill should be used when creating conventional commits for current changes. It groups related changes into logical commits, ensures all files are committed, and verifies the working directory is clean afterward.
allowed-tools: ["Bash"]
---

# Git Commit Workflow

Create conventional commits for current changes. Optional hint: $ARGUMENTS

## Workflow

### See what has changed

!git status
!git diff --stat

### Apply these requirements

1. **Branch Check**: If on `dev`, `staging`, or `main`, create a feature branch named after the changes
2. **Commit Strategy**: Group related changes into logical conventional commits (feat, fix, chore, docs, etc.)
3. **Commit ALL Files**: Every file must be assigned to a commit group - no file gets left out or unstaged
4. **Commit Creation**: Stage and commit each group with clear messages
5. **Verification**: Run `git status` to confirm working directory is clean - must show "nothing to commit"

### Use conventional commit format

- `feat:` for new features
- `fix:` for bug fixes
- `docs:` for documentation
- `chore:` for maintenance
- `style:` for formatting
- `refactor:` for code restructuring
- `test:` for test additions

### Never

- use `--no-verify` flag
- attempt to bypass tests or quality checks
- skip tests or quality checks
- stash changes - ALL changes must be committed
- skip or exclude any files from the commit - even if they're unrelated
- leave uncommitted changes in the working directory
- ask the user which files to commit - commit everything

## Execute

Execute the workflow now.

Overview

This skill helps create conventional commits for the current repository changes. It groups related changes into logical commits, stages and commits every file, and verifies the working directory is clean afterward. It enforces branch safety by moving work off protected branches when needed.

How this skill works

The skill inspects the working tree and diff summary to identify modified, added, and deleted files. It enforces rules: create a feature branch if on dev/staging/main, partition files into conventional-commit groups, stage and commit each group, and finally run git status to confirm no uncommitted changes remain. It never stashes or excludes files and avoids bypassing hooks or checks.

When to use it

  • When you have local changes that need to be committed with conventional commit messages
  • Before pushing to a shared branch to ensure a clean history and complete commits
  • When working on dev, staging, or main so changes are moved to a feature branch
  • When you must ensure no files are left unstaged or uncommitted
  • When automated checks and pre-commit hooks must not be bypassed

Best practices

  • Always create a feature branch if your current branch is dev, staging, or main
  • Group related file changes into a single conventional commit type (feat/fix/docs/etc.)
  • Write concise, descriptive commit messages that follow conventional commit format
  • Stage and commit every changed file; do not stash or leave files out
  • Never use --no-verify or otherwise skip tests and quality checks

Example use cases

  • You modified implementation and tests: create a fix: commit for the bug fix and a test: commit for new tests
  • You updated README and configuration: create a docs: commit for docs and a chore: commit for config maintenance
  • You changed formatting across many files: create a style: commit that includes all formatting changes
  • You are on main with local changes: create a feature branch named after the change and commit there

FAQ

What if I accidentally start on dev, staging, or main?

The skill will create a new feature branch named after the change and move your staged changes there before committing.

Can I exclude files or stash changes?

No. All files must be assigned to a commit group and committed. Stashing or excluding files is not allowed.