Project Commit
Skill2 starsChanged 59 days agoMITView on GitHub
Project-aware commits — discover conventions from CLAUDE.md, run pre-commit checks, format messages
In this repository13 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- Auto MemorySkill
- Skill CreationSkill
- Incremental ImprovementSkill
- Memory DumpSkill
- Patch EvaluationSkill
- Documentation RefreshSkill
- Repo ConfigSkill
- Code ReviewSkill
- Review ToolboxSkill
- Sanity CheckSkill
- TODOSkill
- Verify Security FixSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
17 rules. About 0 are common, 15 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈15
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 26
Do NOT use when:
- Distinctive: line 32
Discover, don't assume: Read project docs and history to find conventions.
- Distinctive: line 33
Never carry conventions from one project to another.
- Distinctive: line 39
Fail before committing, not after: All checks run before git commit.
- Very specific: line 58
Look for .claude/repo-config.yml (see the repo-config skill).
- Distinctive: line 71
Look for: prefix format, required checks, validation script paths, line width limits, version history conventions.
- Distinctive: line 84
No consistent pattern — freeform
- Distinctive: line 88
Check for version-tracked files to know what needs version bump checks:
- Distinctive: line 126
Run all checks, report all findings.
- Distinctive: line 130
If a validation script was discovered, run it on the relevant scope:
- Distinctive: line 140
If a line width convention was discovered, check only staged files:
- Distinctive: line 153
If staged changes include version-tracked files with substantive content changes (not just whitespace), check whether the version field …
- Distinctive: line 171
If changes span unrelated directories or concerns, suggest splitting.
- Distinctive: line 172
Always WARN, never FAIL — the user decides.
- Distinctive: line 186
All PASS → proceed to Phase 3
- Distinctive: line 203
None: follow built-in message rules
- Very specific: line 215
Follow the built-in commit instructions: stage specific files (not git add -A), use HEREDOC format for the message, include Co-Authored-By …
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Project Commit Skill (Experimental)
Purpose: Augment Claude Code's built-in commit workflow with project-specific conventions — prefix format, pre-commit validation, and quality checks discovered from the project's own documentation and history.
Experimental: New skill, not yet validated across diverse projects. Convention discovery heuristics may need tuning for non-standard setups.
When to Use This Skill
Use when:
- Committing in a project with documented commit conventions (prefix, message structure)
- Project has validation scripts that should run before every commit
- Want to catch forgotten version bumps, line width violations, or scope mixing
- Want consistent commit formatting across sessions in the same project
Do NOT use when:
- The project has no conventions and the built-in commit workflow is sufficient
- The user explicitly asks for a quick commit without checks
Core Principles
Discover, don't assume. Read project docs and history to find conventions. Never carry conventions from one project to another.
Augment, don't replace. The built-in commit instructions handle staging, Co-Authored-By, and message drafting. This skill adds convention discovery and pre-commit checks on top.
Fail before committing, not after. All checks run before git commit. A
check that runs after commit is a wasted check.
Generic checks, project-specific config. The check types (line width,
version bump, validation) are generic. The parameters (120 chars, SKILL.md,
validate_skills.sh) come from the project -- authoritatively from
.claude/repo-config.yml when present (see the repo-config skill), with
doc/git-history discovery as fallback.
Workflow
Phase 1: Discover Conventions
Goal: Build a convention profile from project documentation and git history.
1. Read repo-config (authoritative)
Look for .claude/repo-config.yml (see the repo-config skill). If present,
it is the source of truth — keys: line_width, version_files, validation,
disabled_checks, and a commit: block (prefix, body_style). Use those
values verbatim and skip discovery for any key the file sets. Only fall through
to the sources below for keys the config omits, or when no config file exists.
2. Read project documentation (fallback)
grep -i -A 5 'commit\|prefix\|message.*format' CLAUDE.md 2>/dev/null
grep -i -A 3 'commit\|version.*convention' MEMORY.md 2>/dev/nullLook for: prefix format, required checks, validation script paths, line width limits, version history conventions.
3. Infer from git history
git log --oneline -20Detect prefix pattern from recent commits:
scope: message— scope-prefix (e.g.,review: trim v3.9)type(scope): message— conventional commitsTICKET-123: message— ticket-prefix- No consistent pattern — freeform
4. Detect project type
Check for version-tracked files to know what needs version bump checks:
*/SKILL.md— skills repo (checkversion:in frontmatter)package.json— JS/TS (check"version":)pyproject.toml/setup.py— PythonCargo.toml— Rustpom.xml— Java
5. Find validation commands
grep -oE '[a-zA-Z0-9/_.-]+\.(sh|py)' CLAUDE.md MEMORY.md 2>/dev/null \
| sort -uAlso check: Makefile (make lint/test), package.json (npm run lint/test).
6. Output the discovered profile
Report what was found before proceeding — the user should see and confirm:
Discovered conventions:
Prefix: "skill-name: " (from repo-config)
Validation: create-skill/validate_skills.sh (from repo-config)
Line width: 120 chars (from repo-config)
Version: */SKILL.md version: field (from repo-config)
Body style: verbose — detail in commit message (from repo-config)Label each value with its real source (repo-config when the key came from
.claude/repo-config.yml, otherwise the fallback it was discovered from).
Phase 2: Pre-Commit Checks
Goal: Catch project-specific issues before committing.
Run all checks, report all findings. Do not stop at the first failure.
Check 1: Project validation
If a validation script was discovered, run it on the relevant scope:
path/to/validate.sh; echo "Exit: $?"Non-zero exit code → FAIL.
Check 2: Line width
If a line width convention was discovered, check only staged files:
for f in $(git diff --cached --name-only); do
[ -f "$f" ] && awk -v f="$f" -v w=120 \
'length > w {print f":"NR": "length" chars"}' "$f"
doneAny hits → WARN with file:line details.
Check 3: Version bump
If staged changes include version-tracked files with substantive content changes (not just whitespace), check whether the version field changed:
git diff --cached -- '*.md' | grep '^[+-]version:'Content changed but no version diff → WARN. This is advisory — the user may intentionally skip a version bump for minor edits.
Check 4: Scope coherence
Review staged file list for unrelated changes:
git diff --cached --statIf changes span unrelated directories or concerns, suggest splitting. Always WARN, never FAIL — the user decides.
Report findings
Pre-commit checks:
[PASS] Validation: 0 errors
[WARN] Line width: 2 lines over 120 chars in review/SKILL.md
[WARN] Version: review/SKILL.md changed but version not bumped
[PASS] Scope: all changes in review/- Any FAIL → stop and fix before committing
- Any WARN → report to user, ask whether to proceed or fix
- All PASS → proceed to Phase 3
Phase 3: Draft and Commit
Goal: Format the commit message per discovered conventions and execute.
1. Apply prefix format
Based on discovered pattern:
- Scope-prefix (
skill: message): determine scope from the primary directory of changed files - Conventional (
type(scope): message): infer type from diff —featfor new files,fixfor bug fixes,docsfor docs only,refactorfor restructuring - Ticket-prefix: extract from branch name or prompt user
- None: follow built-in message rules
2. Structure the body
- Verbose (e.g., this skills repo): summary line + blank line + bullet-point details of each change + blank line + Co-Authored-By. Verbose details go in the commit message because version history files are kept to one-liners.
- Brief: summary line + Co-Authored-By trailer only.
3. Execute
Follow the built-in commit instructions: stage specific files (not
git add -A), use HEREDOC format for the message, include Co-Authored-By
trailer. Do not use --no-verify unless the user explicitly asks.
4. Post-commit verify
git log -1 --format='%s'Confirm the prefix and format match the discovered conventions.
Version History
- 1.0.0 (2026-07-18): Initial version
See Also
- repo-config — Authoritative source for prefix, validation, line width, and version files
- create-skill — Includes validate_skills.sh used as pre-commit validation example
- refresh-docs — For updating project docs that contain commit conventions
- auto-memory — For maintaining MEMORY.md where commit conventions may be documented
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

