Claude-project-skills-template commit
Execute git commit with conventional commit message analysis, intelligent staging, and message generation. Use when user asks to commit changes or mentions "/commit".
install
source · Clone the upstream repo
git clone https://github.com/dohernandez/claude-project-skills-template
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/dohernandez/claude-project-skills-template "$T" && mkdir -p ~/.claude/skills && cp -r "$T/.claude/skills/commit" ~/.claude/skills/dohernandez-claude-project-skills-template-commit && rm -rf "$T"
manifest:
.claude/skills/commit/SKILL.mdsource content
Commit
Purpose
Create standardized, semantic git commits using the Conventional Commits specification. Analyze the actual diff to determine appropriate type, scope, and message. Enforces project-specific rules: no AI attribution, no ticket references, no emojis.
Quick Reference
- Creates: Git commit with conventional message
- Requires: Staged or unstaged changes
Conventional Commit Format
<type>(<scope>): <subject> <optional body - 1-2 sentences or omit>
Commit Types
| Type | Purpose |
|---|---|
| New feature |
| Bug fix |
| Documentation only |
| Formatting/style (no logic) |
| Code refactor (no feature/fix) |
| Performance improvement |
| Add/update tests |
| Build system/dependencies |
| CI/config changes |
| Maintenance/misc |
| Revert commit |
Project Rules (MUST VERIFY)
- Title <= 50 characters
- Title is SPECIFIC (avoid vague: "improve", "enhance", "update")
- NO AI attribution (see policy below)
- NO ticket references in body (no "Fixes #123")
- NO emojis in commit message
- Body: 1-2 sentences max, or omit if title is clear
- Focus on WORK done, not file operations
AI Attribution Policy
STRICTLY FORBIDDEN - Never include ANY of the following in commit messages:
,Co-Authored-By: Claude
, or any AI nameCo-Authored-By: GPT- Any AI-related emojis
- "Generated by", "Created with", or similar phrases
- Any reference to AI tools (Claude, ChatGPT, Copilot, etc.)
Commits must appear as human-authored work. This is a strict project requirement.
Workflow
0. Branch Validation (REQUIRED)
BRANCH=$(git branch --show-current) if [ "$BRANCH" = "main" ] || [ "$BRANCH" = "master" ]; then echo "ERROR: Cannot commit directly to $BRANCH" echo "Create a feature branch: git checkout -b <branch-name>" fi
1. Analyze Changes
git status --porcelain git diff --staged git diff
2. Stage Files (if needed)
If nothing is staged, ask user what to stage. Never commit secrets (.env, credentials, private keys).
3. Generate Commit Message
Analyze the diff to determine:
- Type: What kind of change is this?
- Scope: What area is affected? (workflows, scripts, ci, runner, config)
- Description: One-line summary (present tense, imperative mood)
4. User Review
ALWAYS confirm before committing:
- Show the generated commit message
- Ask: "Commit with this message? (y/n)"
- If yes: proceed
- If no: ask "Any changes I should make?" and revise
5. Execute Commit
git commit -m "<type>(<scope>): <description>"
Examples
Good:
ci(workflows): add dispatch handler for e2e trigger
feat(scripts): add runner provisioning with docker setup Installs Go, Docker Compose, and Actions runner agent.
fix(runner): correct genvm binary download path
Bad:
(vague - what update?)chore(config): update configuration
(vague - how?)ci(workflows): improve workflow
(focus on file, not work)docs(plans): add implementation plan
Git Safety Protocol
- NEVER commit directly to main/master - always use a feature branch
- NEVER update git config
- NEVER run destructive commands (--force, hard reset) without explicit request
- NEVER skip hooks (--no-verify) unless user asks
- NEVER force push to main/master
- If commit fails due to hooks, fix the issue and create NEW commit (don't amend)
Automation
See
skill.yaml for patterns and procedure.
See sharp-edges.yaml for common pitfalls.