conventional-commits

Crafts conventional commit messages and recovers from pre-commit hook failures.

Updated Mar 30, 2026
One-click install
npx skills add https://github.com/TrayMachi/dotfiles --skill conventional-commits-traymachi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: conventional-commits
Source: https://github.com/TrayMachi/dotfiles/tree/main/agents/skills/conventional-commits
Command: npx skills add https://github.com/TrayMachi/dotfiles --skill conventional-commits-traymachi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing commit messages that satisfy project-specific rules (commitlint configs, Dangerfile prefix checks, commit-msg hooks) is error-prone, and pre-commit hooks that autofix files or fail mid-commit leave repositories in confusing states. This Skill manages the full commit lifecycle so messages pass validation and hook failures are diagnosed and recovered from cleanly. ## Core Features & Use Cases - Convention Discovery: Detects commitlint configs, Dangerfiles, husky/lefthook hooks, and custom hooksPath settings to learn the project's exact allowed types, scopes, and header length before writing anything. - Compliant Message Crafting: Generates Conventional Commits 1.0.0 messages (type, scope, imperative description, body, footer) and supports splitting unrelated changes into multiple commits. - Hook Failure Recovery: Handles autofix hooks by staging fixes and amending the commit, diagnoses lint/test failures from hook output, and warns before ever using --no-verify. - Use Case: You stage a feature change and commit, but the pre-commit hook reformats two files. The Skill detects the autofix, stages the changes, amends the commit, and verifies a clean working tree. ## Quick Start Ask the assistant to commit your current staged changes with a conventional commit message that passes the project's pre-commit hooks.

Frequently Asked Questions about conventional-commits

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write a conventional commit message?

Use the format type(scope): description, with types like feat, fix, docs, refactor, or chore. Keep the description lowercase, imperative, and under the project's header-max-length (default 72 characters), and check for a commitlint config that may restrict allowed types and scopes.

How do I commit when a pre-commit hook modifies files?

When an autofix hook modifies files during commit, those changes are not included in the commit. Stage them with git add -A, then run git commit --amend --no-edit to fold the fixes into the same commit, and verify with git status.

Why did my commit-msg hook reject my commit message?

The commit-msg hook validates your message against rules from commitlint configs or Dangerfile patterns, such as required ticket prefixes like [PROJ-123] or a restricted type enum. Read the hook's error output to see which rule failed, adjust the message, and retry.

Can I skip pre-commit hooks with git commit --no-verify?

Yes, --no-verify bypasses hooks, but it should only be used when hooks hang or crash, and never to skip secret detection or lint failures. The Skill warns the user and asks for confirmation before skipping any hook.

How do I split unrelated changes into multiple commits?

Use git add -p to interactively stage only the hunks belonging to the first concern, commit them, then stage the rest with git add -A and commit again. Each commit gets its own conventional message reflecting its primary type and scope.