git-commit
Git Commit
Collaborating skills
- Create PR: skill:
create-prfor creating pull requests after committing changes - Refactor: skill:
refactorfor commit messages during refactoring sessions
Overview
Generate concise, descriptive git commit messages based on staged code changes. Analyzes staged changes and recent commit history to craft well-structured messages following best practices.
When work is ready for review, use the create-pr skill to create a pull request.
Commit Message Format
<Subject>
<Description>
Do not add Co-Authored-By unless explicitly instructed by the user.
Best Practices
1. Capitalization and Punctuation
- Capitalize the first word of the subject line
- Do NOT end the subject line with punctuation
2. Imperative Mood
Use imperative mood in the subject line—give the tone of giving an order or request.
Good:
- Add fix for dark mode toggle state
- Update API authentication flow
- Remove deprecated database fields
Bad:
- Added fix for dark mode toggle state
- Updating API authentication flow
- Removing deprecated database fields
3. Length Limits
- Subject line: Maximum 50 characters
- Body lines: Maximum 72 characters
4. Content Style
Be direct and concise. Eliminate filler words and phrases such as:
- "though"
- "maybe"
- "I think"
- "kind of"
- "just"
- "simply"
Think like a journalist—state what was done clearly and directly.
Analysis Framework
To craft thoughtful commit messages, consider:
- Why were these changes made?
- What effect do the changes have?
- Why was the change needed?
- What are the changes in reference to (issue numbers, PRs, tickets)?
Examples
Simple bug fix:
Fix authentication timeout
Increase session timeout from 30 to 60 minutes to prevent
frequent re-authentication for active users.
Fixes #123
Feature addition:
Add dark mode support
Implement system-wide dark mode using CSS custom properties.
Users can toggle between light and dark themes via new
settings menu option.
Refs #456
Refactoring:
Extract payment processing module
Move payment-related logic into dedicated module to improve
testability and reduce controller complexity.
Breaking change:
Remove deprecated user endpoints
Delete /users/legacy endpoints which were marked for removal
in v2.0. Clients must use /v2/users endpoints instead.
BREAKING CHANGE: Migrate to v2 endpoints before upgrading
Workflow
- Run
git statusto see staged changes - Run
git diff --stagedto review the actual changes - Run
git log -5 --onelineto understand recent commit message style - Analyze changes to understand the "why" and "what"
- Draft the commit message following the format and practices above
- Verify: subject under 50 chars, imperative mood, no trailing punctuation
More from mguinada/agent-skills
refactor
TDD-based code refactoring preserving behavior through tests. Use Red-Green-Refactor cycles to apply refactoring patterns one test-verified change at a time. **TRIGGERS**: 'clean up code', 'make code simpler', 'reduce complexity', 'refactor this', 'apply DRY', 'extract method', 'remove duplication'. **DISTINCT FROM**: Adding features (use /tdd) or fixing bugs. **PROACTIVE**: Auto-invoke when test-covered code has complexity (functions >50 lines, high cyclomatic complexity, duplication).
16ai-engineering
Build AI agents and agentic workflows. Use when designing/building/debugging agentic systems: choosing workflows vs agents, implementing prompt patterns (chaining/routing/parallelization/orchestrator-workers/evaluator-optimizer), building autonomous agents with tools, designing ACI/tool specs, or troubleshooting/optimizing implementations. **PROACTIVE ACTIVATION**: Auto-invoke when building agentic applications, designing workflows vs agents, or implementing agent patterns. **DETECTION**: Check for agent code (MCP servers, tool defs, .mcp.json configs), or user mentions of \"agent\", \"workflow\", \"agentic\", \"autonomous\". **USE CASES**: Designing agentic systems, choosing workflows vs agents, implementing prompt patterns, building agents with tools, designing ACI/tool specs, troubleshooting/optimizing agents.
13tdd
Guide Test-Driven Development workflow (Red-Green-Refactor) for new features, bug fixes, and refactoring. Supports both Python (pytest) and Ruby (RSpec). Use when writing tests, implementing features, or following TDD methodology. **PROACTIVE ACTIVATION**: Auto-invoke when implementing features or fixing bugs in projects with test infrastructure. **DETECTION**: Check for tests/ directory, pytest.ini, pyproject.toml with pytest config, spec/ directory, .rspec file, or *_spec.rb files. **USE CASES**: Writing production code, fixing bugs, adding features, legacy code characterization.
11create-pr
Creates GitHub pull requests with properly formatted titles, a body matching the project's PR template, and appropriate type/scope labels. Automatically creates labels if they don't exist. Use when creating PRs, submitting changes for review, or when the user says /pr or asks to create a pull request. **PROACTIVE ACTIVATION**: Auto-invoke when a branch has commits ahead of main and the user signals the work is ready. **DETECTION**: Run git log origin/main..HEAD - if commits exist and user signals readiness, offer to open a PR. User says \"open a PR\", \"ready for review\", \"this is done\", \"let's merge\", \"submit this\". **USE CASES**: Feature or fix complete, user finished a series of commits and mentions review or merging.
11prompt-engineering
Creates system prompts, writes tool descriptions, and structures agent instructions for agentic systems. Use when the user asks to create, generate, or design prompts for AI agents, especially for tool-using agents, planning agents, or autonomous systems. **PROACTIVE ACTIVATION**: Auto-invoke when designing prompts for agents, tools, or agentic workflows in AI projects. **DETECTION**: Check for agent/tool-related code, prompt files, or user mentions of \"prompt\", \"agent\", \"LLM\". **USE CASES**: Designing system prompts, tool descriptions, agent instructions, prompt optimization, reducing hallucinations.
10copilot-sdk
Build agentic applications with GitHub Copilot SDK. Use when embedding AI agents in apps, creating custom tools, implementing streaming responses, managing sessions, connecting to MCP servers, or creating custom agents. Triggers on Copilot SDK, GitHub SDK, agentic app, embed Copilot, programmable agent, MCP server, custom agent. **PROACTIVE ACTIVATION**: Auto-invoke when building agentic applications or integrating Copilot SDK. **DETECTION**: Check for @github/copilot-sdk imports, copilot dependencies in package.json/pyproject.toml/go.mod. **USE CASES**: Embedding agents in apps, creating custom tools, implementing streaming, managing sessions, connecting to MCP servers.
9