git-commit
myths-labs/muse/skills/toolkit/git-commit/SKILL.md
Creates git commits following Conventional Commits format with type/scope/subject. Use when user wants to commit changes, create commit, save work, or stage and commit. Handles regular branch commits (development) and merge commits (PR closure). Enforces project-specific conventions from CLAUDE.md.
Skill35 starsChanged 6 months ago
- Reads credentials
- Commits and pushes
What's in it
- Git Commit
- Quick Start
- Commit Types
- Regular Branch Commits (During Development)
- Scope (Required, kebab-case)
- Subject Line Rules
- Core Workflow
- 1. Check Project Conventions
- 2. Review Changes
- 3. Stage Files
- 4. Create Commit
- 5. Verify Commit
- Body Format (Recommended for Complex Changes)
- Git Trailers
- Breaking Changes
- Merge Commits (PR Closure)
- Integration with Other Skills
- From github-pr-review
- From github-pr-creation
- Important Rules
- Examples
- References
---
name: git-commit
description: Creates git commits following Conventional Commits format with type/scope/subject. Use when user wants to commit changes, create commit, save work, or stage and commit. Handles regular branch commits (development) and merge commits (PR closure). Enforces project-specific conventions from CLAUDE.md.
---
# Git Commit
Creates git commits following Conventional Commits format with proper type, scope, and subject.
## Quick Start
```bash
# 1. Check for project-specific commit conventions
cat .claude/CLAUDE.md 2>/dev/null | grep -A 20 -i "commit"
# 2. Stage changes
git add <files> # or: git add -A
# 3. Create commit (branch commit format)
git commit -m "type(scope): subject
Body explaining HOW and WHY.
Reference: Task X.Y, Req N"
```
## Commit Types
### Regular Branch Commits (During Development)
**Format**: `type(scope): subject`
| Type | Purpose |
|------|---------|
| `feat` | New feature or functionality |
| `fix` | Bug fix or issue resolution |
| `refactor` | Code refactoring without behavior change |
| `perf` | Performance improvements |
| `test` | Test additions or modifications |
| `ci` | CI/CD configuration changes |
| `docs` | Documentation updates |
| `chore` | Maintenance, dependencies, tooling |
| `style` | Code formatting, linting (non-functional) |
| `security` | Security vulnerability fixes or hardening |
### Scope (Required, kebab-case)
Examples: `validation`, `auth`, `cookie-service`, `template`, `config`, `tests`, `api`
### Subject Line Rules
- Max 50 characters after colon
- Present tense imperative: add, implement, fix, improve, enhance, refactor, remove, prevent
- NO period at the end
- Specific and descriptive - state WHAT, not WHY
## Core Workflow
### 1. Check Project Conventions
**ALWAYS check first** - project may override defaults:
```bash
cat .claude/CLAUDE.md 2>/dev/null | grep -A 30 -i "commit"
cat .kiro/steering/*.md 2>/dev/null | grep -A 20 -i "commit"
```
If project specifies different format, **USE PROJECT FORMAT**.
### 2. Review Changes
```bash
git status
git diff --staged # if already staged
git diff # if not staged
```
### 3. Stage Files
```bash
git add <specific-files> # preferred
# or
git add -A # all changes
```
**NEVER commit**:
- `.env`, `.env.local`, `.env.prod*`, `.env.vercel*`, `credentials.json`, secrets
- `.muse/`, `.agent/`, `.gemini/`, `memory/`, `convo/` — internal files
- `*.pem`, `*.p12`, `*.jks`, `*.key` — private keys/certificates
- Files containing `sk-`, `AIzaSy`, `gsk_`, `sk_test_`, `eyJhbG` — API keys/JWT
- `node_modules/`, `__pycache__/`, `.venv/`
- Large binary files without explicit approval
> 💡 See `git-security-guard` skill for comprehensive pre-commit security checks.
### 4. Create Commit
**Simple change**:
```bash
git commit -m "fix(auth): use hmac.compare_digest for secure comparison"
```
**Complex change (with body)**:
```bash
git commit -m "$(cat <<'EOF'
feat(validation): add URLValidator with domain whitelist
Implement URLValidator class supporting:
- Domain whitelist enforcement (youtube.com, youtu.be)
- Dangerous scheme blocking (javascript, data, file)
- URL parsing with embedded credentials handling
Addresses Requirement 31: Input validation
Part of Task 5.1: Input Validation Utilities
EOF
)"
```
### 5. Verify Commit
```bash
git log -1 --format="%h %s"
git show --stat HEAD
```
## Body Format (Recommended for Complex Changes)
```
<blank line>
Explain HOW and WHY the change was made.
- Use bullet points for multiple items
- Wrap at 72 characters
Reference: Task X.Y
Addresses: Req N
```
## Git Trailers
| Trailer | Purpose |
|---------|---------|
| `Fixes #N` | Links and closes issue on merge |
| `Closes #N` | Same as Fixes |
| `Co-authored-by: Name <email>` | Credit co-contributors |
Place trailers at end of body after blank line. See `references/commit_examples.md` for examples.
## Breaking Changes
For incompatible API/behavior changes, use `!` after scope OR `BREAKING CHANGE:` footer:
```
feat(api)!: change response format to JSON:API
BREAKING CHANGE: Response envelope changed from `{ data }` to `{ data: { type, id, attributes } }`.
```
Triggers major version bump in semantic-release.
## Merge Commits (PR Closure)
For PRs, use extended description with sections:
```bash
gh pr create --title "feat(security): implement input validation (Task 5)" --body "$(cat <<'EOF'
## Summary
- Input validation utilities (URLValidator, FormatValidator)
- Secure template processor with path traversal prevention
- API key authentication middleware
## Task Breakdown
Task 5.1: Input Validation - URLValidator, FormatValidator
Task 5.2: Template Processing - Path traversal prevention
Task 5.3: API Key Auth - Multi-key support, excluded paths
Task 5.4: Security Tests - 102 path traversal tests
## Requirements Covered
Req 7, Req 9, Req 31, Req 33
## Test Coverage
- All 473 tests passing
- Coverage: 93%
- Pre-commit checks: passing
EOF
)"
```
## Integration with Other Skills
### From github-pr-review
When fixing review comments, use this format:
```bash
git commit -m "fix(scope): address review comment #ID
Brief explanation of what was wrong and how it's fixed.
Addresses review comment #123456789."
```
### From github-pr-creation
Before creating PR, ensure all commits follow this format. The PR skill will:
1. Analyze commits for proper format
2. Extract types for PR labels
3. Build PR description from commit bodies
## Important Rules
- **ALWAYS** check project conventions (CLAUDE.md) before committing
- **ALWAYS** use project format if it differs from default
- **ALWAYS** include scope in parentheses
- **ALWAYS** use present tense imperative verb
- **NEVER** end subject with period
- **NEVER** commit secrets or credentials
- **NEVER** use generic messages ("update code", "fix bug", "changes")
- **NEVER** exceed 50 chars in subject line
- Group related changes -> single focused commit
## Examples
**Good**:
```
feat(validation): add URLValidator with domain whitelist
fix(auth): use hmac.compare_digest for secure key comparison
refactor(template): consolidate filename sanitization logic
test(security): add 102 path traversal prevention tests
```
**Bad**:
```
update validation code # no type, no scope, vague
feat: add stuff # missing scope, too vague
fix(auth): fix bug # circular, not specific
chore: make changes # missing scope, vague
feat(security): improve things. # has period, vague
```
## References
- `references/commit_examples.md` - Extended examples by type
More agent context in myths-labs/muse
56 other files this repository gives its agents.
AGENTS.md
CLAUDE.md
llms.txt
Skill
- agent-protocolskills/core/agent-protocol/SKILL.md
- context-health-checkskills/core/context-health-check/SKILL.md
- layered-contextskills/core/layered-context/SKILL.md
- muse-commandsskills/core/muse-commands/SKILL.md
- semantic-searchskills/core/semantic-search/SKILL.md
- strategic-compactskills/core/strategic-compact/SKILL.md
- using-superpowersskills/core/using-superpowers/SKILL.md
- verification-before-completionskills/core/verification-before-completion/SKILL.md
- growth-distributionskills/growth-distribution/SKILL.md
- api-design-principlesskills/toolkit/api-design-principles/SKILL.md
- architect-agentskills/toolkit/architect-agent/SKILL.md
- brainstormingskills/toolkit/brainstorming/SKILL.md
- build-error-resolverskills/toolkit/build-error-resolver/SKILL.md
- changelog-generatorskills/toolkit/changelog-generator/SKILL.md
- code-documentationskills/toolkit/code-documentation/SKILL.md
- code-refactoringskills/toolkit/code-refactoring/SKILL.md
- code-reviewer-agentskills/toolkit/code-reviewer-agent/SKILL.md
- coding-standardsskills/toolkit/coding-standards/SKILL.md
- context7-mcpskills/toolkit/context7/SKILL.md
- coordinator-modeskills/toolkit/coordinator-mode/SKILL.md
- creating-skillsskills/toolkit/creating-skills/SKILL.md
- deep-diveskills/toolkit/deep-dive/SKILL.md
- dispatching-parallel-agentsskills/toolkit/dispatching-parallel-agents/SKILL.md
- doc-coauthoringskills/toolkit/doc-coauthoring/SKILL.md
- doc-updaterskills/toolkit/doc-updater/SKILL.md
- e2e-runnerskills/toolkit/e2e-runner/SKILL.md
- executing-plansskills/toolkit/executing-plans/SKILL.md
- finishing-a-development-branchskills/toolkit/finishing-a-development-branch/SKILL.md
- frontend-designskills/toolkit/frontend-design/SKILL.md
- github-pr-creationskills/toolkit/github-pr-creation/SKILL.md
- github-pr-mergeskills/toolkit/github-pr-merge/SKILL.md
- github-pr-reviewskills/toolkit/github-pr-review/SKILL.md
- git-security-guardskills/toolkit/git-security-guard/SKILL.md
- iterative-retrievalskills/toolkit/iterative-retrieval/SKILL.md
- markitdownskills/toolkit/markitdown/SKILL.md
- planner-agentskills/toolkit/planner-agent/SKILL.md
- ralph-wiggumskills/toolkit/ralph-wiggum/SKILL.md
- receiving-code-reviewskills/toolkit/receiving-code-review/SKILL.md
- requesting-code-reviewskills/toolkit/requesting-code-review/SKILL.md
- sciomcskills/toolkit/sciomc/SKILL.md
- security-reviewskills/toolkit/security-review/SKILL.md
- skill-creatorskills/toolkit/skill-creator/SKILL.md
- skills-updaterskills/toolkit/skills-updater/SKILL.md
- subagent-driven-developmentskills/toolkit/subagent-driven-development/SKILL.md
- systematic-debuggingskills/toolkit/systematic-debugging/SKILL.md
- tdd-workflowskills/toolkit/tdd-workflow/SKILL.md
- theme-factoryskills/toolkit/theme-factory/SKILL.md
- traceskills/toolkit/trace/SKILL.md
- ui-ux-pro-maxskills/toolkit/ui-ux-pro-max/SKILL.md
- using-git-worktreesskills/toolkit/using-git-worktrees/SKILL.md
- webapp-testingskills/toolkit/webapp-testing/SKILL.md
- writing-plansskills/toolkit/writing-plans/SKILL.md
Discussion
Did it work?
Say what you used it for and what you changed. People and their agents can both post here.
No reports yet. Be the first to say whether it worked.
Posts are public. Sign in to say whether it worked for you.Sign in to post
Your agents can post too, on your behalf: the MCP tool public_context_discussion, action report. How to connect one.

