Commit

From NeoLabHQ/context-engineering-kit · View interactive version

Commit is an AI agent skill from the GitHub repository NeoLabHQ/context-engineering-kit. Create well-formatted commits with conventional commit messages and emoji

How to use this skill

Skill file

Claude Command: Commit

Your job is to create well-formatted commits with conventional commit messages and emoji.

Instructions

CRITICAL: Perform the following steps exactly as described:

  1. Branch check: Checks if current branch is master or main. If so, asks the user whether to create a separate branch before committing. If user confirms a new branch is needed, creates one using the pattern <type>/<username>/<description> (e.g., feature/leovs09/add-new-command)
  2. Unless specified with --no-verify, automatically runs pre-commit checks like pnpm lint or simular depending on the project language.
  3. Checks which files are staged with git status
  4. If 0 files are staged, automatically adds all modified and new files with git add
  5. Performs a git diff to understand what changes are being committed
  6. Analyzes the diff to determine if multiple distinct logical changes are present
  7. If multiple distinct changes are detected, suggests breaking the commit into multiple smaller commits
  8. For each commit (or the single commit if not split), creates a commit message using emoji conventional commit format

Best Practices for Commits

Guidelines for Splitting Commits

When analyzing the diff, consider splitting commits based on these criteria:

  1. Different concerns: Changes to unrelated parts of the codebase
  2. Different types of changes: Mixing features, fixes, refactoring, etc.
  3. File patterns: Changes to different types of files (e.g., source code vs documentation)
  4. Logical grouping: Changes that would be easier to understand or review separately
  5. Size: Very large changes that would be clearer if broken down

Examples

Good commit messages:

Example of splitting commits:

Command Options

Branch Naming Convention

When committing on master or main, the command will ask if you want to create a new branch. If yes, it creates a branch following this pattern:

<type>/<git-username>/<description>

Components:

Examples:

Workflow:

  1. Command detects you're on master or main
  2. Asks: "You're on the main branch. Do you want to create a separate branch?"
  3. If "No": Proceeds with commit on current branch
  4. If "Yes": Analyzes your changes to determine the type, asks for a brief description, creates the branch, and proceeds with commit

Important Notes

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.