20 specialized agents, 10 skills, 17 slash commands, 6 plugins, 12 hooks with scripts, 8 rule sets, 3 CLAUDE.md templates, 14 MCP server configs, and interactive setup installer.
2.7 KiB
2.7 KiB
/smart-commit:commit
Analyze all staged git changes and generate an intelligent conventional commit message.
Process
-
Run
git diff --cached --statto identify all staged files and their change magnitudes. -
Run
git diff --cachedto read the full diff of staged changes. -
Determine the primary commit type based on the nature of changes:
feat- New functionality, new files introducing features, new endpoints or UI componentsfix- Bug corrections, error handling improvements, null checks, edge case fixesrefactor- Code restructuring without behavior change, renaming, extraction of functionsdocs- Documentation-only changes, comments, README updates, docstringstest- Adding or modifying tests, test fixtures, test utilitieschore- Build config, dependency updates, CI changes, tooling, linting rulesperf- Performance improvements, caching, query optimization, lazy loadingstyle- Formatting, whitespace, semicolons, code style (no logic change)ci- CI/CD pipeline changes, workflow files, deployment configs
-
Derive the scope from the most affected directory or module:
- Use the top-level directory name if changes span one area (e.g.,
auth,api,ui) - Use a broader scope if changes span multiple areas (e.g.,
core,app) - Omit scope if changes are truly cross-cutting or trivial
- Use the top-level directory name if changes span one area (e.g.,
-
Write the commit subject line (max 72 characters):
- Use imperative mood ("add" not "added", "fix" not "fixes")
- Focus on WHY the change was made, not WHAT files changed
- Be specific: "fix race condition in websocket reconnect" not "fix bug"
- Do not end with a period
-
Determine if a body is needed (skip for obvious single-line changes):
- Explain the motivation behind the change
- Describe the approach taken and why alternatives were rejected
- Keep each line under 80 characters
-
Add footers when applicable:
BREAKING CHANGE: <description>if the change breaks existing APIs or behaviorCloses #<number>if the change resolves a tracked issueRefs: <context>for related PRs, issues, or discussions
-
Present the commit message for review, then execute
git commitwith the approved message.
Output Format
type(scope): concise imperative description
Optional body explaining the motivation and approach.
Optional footers.
Rules
- Never fabricate issue numbers or references
- If multiple types apply equally, prefer the one with the largest behavioral impact
- When in doubt between
featandrefactor, ask: does the user-visible behavior change? - Run
git log --oneline -10first to match the repository's existing commit style - If nothing is staged, inform the user and suggest what to stage