-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Labels
choreAuto-created by issue labelerAuto-created by issue labeler
Description
Problem
When Claude commits changes in this repository, it does not automatically:
- Run
pre-commit run --all-filesbefore recording the commit. - Validate that the commit message follows the TileLang Commit Convention (
[Type] Descriptionor[Type][Scope] Description).
This means non-compliant commits (bad formatting, lint errors, wrong message format) can silently enter the branch history, causing CI failures and review friction downstream.
Root Cause
pre-commit installinstalls thepre-commitstage hook, but thecommit-msghook is not installed by default (pre-commit install --hook-type commit-msgis a separate step that is not documented in the setup instructions).- There is no Claude skill or workflow that explicitly enforces both checks before
git commitruns. - The existing
creating-pull-requestskill mentionspre-commit run --all-filesas a pre-check, but there is no equivalent guardrail at the individual commit level.
Impact
- Commit messages like
fix somethingorfeat: add op(wrong format) are accepted silently. - Formatting/lint issues are only caught at PR time, not at commit time.
- Inconsistent history makes
git logand automated changelog generation harder.
Proposed Fix
- Add a
commit-msggit hook (scripts/hooks/commit-msg) that validates the message format against the valid types defined indocs/CONTRIBUTING.md. - Register the hook in
.pre-commit-config.yamlas alocalhook withstages: [commit-msg]. - Update
Claude.mdsetup instructions to run both:pre-commit install pre-commit install --hook-type commit-msg
- Add a
commitskill (.claude/commit/SKILL.md) so Claude follows a consistent commit workflow: validate staged changes → run pre-commit → validate message → commit.
Checklist
-
scripts/hooks/commit-msgadded and executable -
.pre-commit-config.yamlupdated with localcommit-msg-formathook -
Claude.mdsetup step updated to install both hooks -
.claude/commit/SKILL.mdadded to skill index
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
choreAuto-created by issue labelerAuto-created by issue labeler