git-commit
Scannednpx machina-cli add skill fvadicamo/dev-agent-skills/git-commit --openclawFiles (1)
SKILL.md
1.5 KB
Git commit
Creates git commits following Conventional Commits format.
Recent project commits
!git log --oneline -5 2>/dev/null
Quick start
# 1. Stage changes
git add <files>
# 2. Create commit
git commit -m "type(scope): subject"
Project conventions
- Scope is required (kebab-case):
validation,auth,cookie-service,api - Additional type beyond standard CC:
security(vulnerability fixes or hardening) - HEREDOC for multi-line commits:
git commit -m "$(cat <<'EOF'
feat(validation): add URLValidator with domain whitelist
Implement URLValidator class supporting:
- Domain whitelist enforcement
- Dangerous scheme blocking
Addresses Requirement 31
Part of Task 5.1
EOF
)"
Important rules
- ALWAYS check CLAUDE.md conventions first - use project format if it differs
- ALWAYS include scope in parentheses
- ALWAYS use present tense imperative verb for the subject
- NEVER end subject with a period
- NEVER exceed 50 chars in the subject line
- NEVER use generic messages ("update code", "fix bug", "changes")
- Group related changes into a single focused commit
References
references/commit_examples.md- Extended examples by type, good/bad comparisons
Source
git clone https://github.com/fvadicamo/dev-agent-skills/blob/main/skills/git-commit/SKILL.mdView on GitHub Overview
Creates git commits that follow the Conventional Commits format with type/scope/subject. Use this to save work, stage changes, and create clear, project-aligned commits. It enforces CLAUDE.md conventions, including required scope and subject rules.
How This Skill Works
Stage changes with git add, then run git commit -m "type(scope): subject". The skill enforces project conventions: scope must be kebab-case and included in parentheses, and the subject must be in present tense and not end with a period, capped at 50 chars. For multi-line messages, use the HEREDOC pattern shown in the docs.
When to Use It
- You're committing a finished feature or bug fix.
- You need to save work with a properly formatted Conventional Commit.
- You want to group related changes into a single focused commit.
- You must enforce project conventions defined in CLAUDE.md.
- You need to craft multi-line commit messages using HEREDOC.
Quick Start
- Step 1: Stage changes git add <files>
- Step 2: Create commit git commit -m "type(scope): subject"
- Step 3: For multi-line messages, use a HEREDOC as shown in the docs
Best Practices
- Always check CLAUDE.md conventions first.
- Always include scope in parentheses.
- Always use present-tense imperative verbs for the subject.
- Never end the subject with a period.
- Never exceed 50 chars and avoid generic messages.
Example Use Cases
- feat(validation): add URLValidator with domain whitelist
- fix(auth): correct token refresh bug
- security(auth): harden token storage in session
- refactor(cookie-service): rename cookies helper
- docs(api): update API usage examples
Frequently Asked Questions
Add this skill to your agents