install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/git-message" ~/.claude/skills/majiayu000-claude-skill-registry-git-message && rm -rf "$T"
manifest:
skills/data/git-message/SKILL.mdsource content
Agent protocol: Generate commit message
Goal: Draft a commit message that adheres to Conventional Commits specification and project standards, then present it for user approval.
When: Use when the agent needs to generate a commit message for staged changes.
: Use this skill only for generating a commit message, but
not for making commits.NOTE
Primary directives
Follow these rules when crafting, formatting, and presenting the commit message:
studyALWAYS
before drafting.references/conventional-commit.md- Aim for brevity and precision, but don't sacrifice clarity.
- Use bullet points to list changes; optionally precede with brief "why" summary.
- Character limits: Subject ≤50 chars (hard limit: 72); body/footer wrap at 72.
- Use plain text, not markdown.
use backticks (causes shell errors).NEVER - Don't use line numbers or code blocks.
Presentation directives
use shell commands, likeNEVER
,echo
, or similar, when presenting the commit message.cat- Present the commit message directly as plain text in a formatted code block within the agent's response.
Confirmation directives
After presenting the commit message, offer 4 options:
- Approve and commit - Proceed with commit
- Edit staged files -
and return to stagingUnstage - Regenerate message - Generate new message
- Abort commit process - Cancel workflow
Make option 1 the default response. Assume "Approve and commit" if the user gives an empty response.
Git directives
Git commands (use
--no-pager and --no-ext-diff for diffs):
For staged changes
git --no-pager diff --staged --no-ext-diff --stat --minimal --patience \ --histogram --find-renames --summary --no-color -U10
For unstaged
changes
unstagedgit --no-pager diff --no-ext-diff --stat --minimal --patience --histogram \ --find-renames --summary --no-color -U10 <file_group>
For repository status
git status --porcelain=v2 --branch
Efficiency directives
- Optimize all operations for token and context efficiency
- Batch git operations on all files simultaneously, avoid individual file processing
- Use parallel execution when possible
- Reduce token usage
Workflow
- Study
references/conventional-commit.md - Analyze staged changes via git directives
- Draft and format complete commit message
- Verify formatting rules and NO BACKTICKS
- Present message and prompt for confirmation with 4 options
- Await user response before further action
Output
Files created:
- None (message generation only)
Status communication:
First line of output indicates user's decision:
- user approved messageAPPROVED: [commit message follows]
- User wants to re-stageREJECTED_EDIT_FILES: user wants to modify staged files
- User wants message regeneratedREJECTED_REGENERATE: user wants new message
- User aborted processREJECTED_ABORT: user cancelled commit
- Failed to generate messageERROR: [message]
Following lines (when APPROVED): complete commit message text