From claude-skills
Activate this skill when the user asks you to **commit**, **make a commit**, or **run the commit workflow**.
How this skill is triggered — by the user, by Claude, or both
Slash command
/claude-skills:commitThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Activate this skill when the user asks you to **commit**, **make a commit**, or **run the commit workflow**.
Activate this skill when the user asks you to commit, make a commit, or run the commit workflow.
The commit workflow follows these steps in order:
CHANGELOG.mdBefore doing anything else, find and read every Markdown file in the project to understand the intent, architecture, and conventions:
find . -name "*.md" -not -path "*/node_modules/*" -not -path "*/.git/*"
Read each file. Pay particular attention to:
README.md — project purpose and structureARCHITECTURE.md, CONTRIBUTING.md, or DESIGN.md — coding conventionsCHANGELOG.md — existing version history (if present)docs/ subdirectoryCheck for any of the following indicators:
| Indicator | How to check |
|---|---|
package.json has a test script | jq -r '.scripts.test // empty' package.json |
pytest / unittest test files | find . -name "test_*.py" -o -name "*_test.py" (excluding node_modules/ and .git/) |
| Jest / Mocha / Vitest test files | find . -name "*.test.*" -o -name "*.spec.*" (excluding node_modules/ and .git/) |
| Go test files | find . -name "*_test.go" |
Makefile with test target | grep -q "^test:" Makefile 2>/dev/null |
Any tests/ or test/ directory | `[ -d tests ] |
If no tests are found, skip to Step 3 and note "No tests found" in the commit message footer.
Run the appropriate command based on what was detected:
npm test (or yarn test / pnpm test)pytestpython -m unittest discovergo test ./...make testIf any test fails, you MUST stop the commit workflow immediately.
Do NOT proceed to Step 3. Instead:
❌ COMMIT ABORTED — Tests failed header.Only continue to Step 3 after ALL tests pass.
Run:
git diff HEAD
git status --short
Read and understand every change:
If you notice obvious mistakes (e.g., console.log debug statements, commented-out code blocks, merge conflict markers), point them out to the user and ask if they should be cleaned up before committing.
The version follows the format MAJOR.MINOR.PATCH (e.g., 0.1.3).
Rules:
main. When MINOR increments, PATCH resets to 0.Check in this priority order:
CHANGELOG.md — look for the most recent version header (## [X.Y.Z] or ## X.Y.Z).package.json — read the version field.VERSION or version.txt file.0.0.0.Detect the current branch:
git rev-parse --abbrev-ref HEAD
main (or master): increment MINOR, reset PATCH to 0.Example:
0.1.4 on a feature branch → next version 0.1.50.1.5 on main (after merge) → next version 0.2.0After calculating the new version, update it in every file that declares the version:
package.json → "version": "X.Y.Z".claude-plugin/plugin.json → "version": "X.Y.Z" (if present).cursor-plugin/plugin.json → "version": "X.Y.Z" (if present).claude-plugin/marketplace.json → "version": "X.Y.Z" (if present)VERSION or version.txt → replace the single lineCreate CHANGELOG.md at the repository root with:
Template for a new CHANGELOG:
# Changelog
<!-- One-paragraph description of the repository synthesised from README.md -->
<repository description here>
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
---
## [X.Y.Z] — YYYY-MM-DD
### <Category>
- <change description>
Add a new section at the top of the existing version history (below the header/preamble) in this format:
## [X.Y.Z] — YYYY-MM-DD
### Added
- ...
### Changed
- ...
### Fixed
- ...
### Removed
- ...
Only include categories that are relevant to this commit. Write entries in past-tense to match the Keep a Changelog convention (e.g., "Added commit skill" not "Add commit skill").
Write a commit message following the Conventional Commits specification:
<type>(<optional scope>): <short summary> [v X.Y.Z]
<body — what changed and why, wrapped at 72 chars>
<footer>
- Tests: <passed N/N | no tests found>
- Version: X.Y.Z
- Changelog: updated
Types: feat, fix, docs, chore, refactor, test, style, perf, ci, build
Keep the subject line to 72 characters or fewer. The [v X.Y.Z] tag at the end of the subject line makes the version immediately visible in git log --oneline.
Example:
feat(skills): add commit workflow skill [v 0.1.0]
Introduce the 'commit' skill that automates the full pre-commit
workflow: reads docs, runs tests, reviews changes, bumps version,
updates CHANGELOG, and creates a structured commit message.
- Tests: no tests found
- Version: 0.1.0
- Changelog: created
git add -A
git commit -m "<commit message from Step 6>"
After committing, confirm success by showing:
git --no-pager log --oneline -3
And report:
✅ Committed successfully as v X.Y.Z Commit:
<short SHA> <subject>
| Situation | Action |
|---|---|
No changes to commit (git status is clean) | Report "Nothing to commit — working tree clean" and stop |
| Tests fail | Stop immediately; provide per-failure suggestions (see Step 2c) |
| Version file not found | Start from 0.0.0 and note this in the commit footer |
| Partial staging issues | Show git status and ask user to resolve before continuing |
| Any command exits non-zero unexpectedly | Show the error, explain the likely cause, and ask the user how to proceed |
Guides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub samanvayms/claude --plugin claude-skills