Learn-skills.dev commit-message
Use when drafting a Conventional Commit message from currently staged Git changes. Triggers: 'write commit message', 'draft commit from staged changes', 'generate conventional commit', 'message for git commit -F -'. Not for creating commits, amending history, or full code review.
install
source · Clone the upstream repo
git clone https://github.com/NeverSight/learn-skills.dev
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/NeverSight/learn-skills.dev "$T" && mkdir -p ~/.claude/skills && cp -r "$T/data/skills-md/ahgraber/skills/commit-message" ~/.claude/skills/neversight-learn-skills-dev-commit-message && rm -rf "$T"
manifest:
data/skills-md/ahgraber/skills/commit-message/SKILL.mdsource content
Commit Message
Draft a Conventional Commit message from staged changes.
Critical Constraints
- Use only staged changes (
/ staged SCM state) as input.--cached - Resolve and use the repository root for all SCM calls.
- If no staged changes exist after one retry, stop and inform the user.
- Always include an
footer.AI-assistant: <AGENT> - Output only the final commit message in one markdown code block.
Workflow
- Resolve repository root.
Prefer workspace root when known; otherwise run
.git rev-parse --show-toplevel - Retrieve staged changes.
Prefer
withget_changed_files
and staged state. If that tool is unavailable, use SCM tooling with explicit repo context. If SCM tooling is unavailable, userepositoryPath: <repo-root>
.git -C <repo-root> diff --cached - Validate staged content exists. If empty, retry once with explicit repo root; if still empty, inform user and stop.
- Analyze the staged diff. Identify changed files, behavior impact, logical scope, and likely commit type.
- Incorporate user arguments/context when provided. Preserve explicit issue refs and constraints from user input.
- Draft the commit message using
.references/conventional-commit-rules.md - Return only the final message in a fenced code block, ready for
.git commit -F -
References
- subject/body/footer rules and examples.references/conventional-commit-rules.md