Agent skill
commit-workflow
生成规范的 Git commit 消息,处理 Git 工作流。触发词:commit、提交代码、git commit。
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/commit-workflow-throokie-claude-code-skills
SKILL.md
Commit Workflow
Generate conventional commit messages following best practices.
Commit Message Format
<type>(<scope>): <subject>
<body>
<footer>
Types
| Type | Description |
|---|---|
feat |
New feature |
fix |
Bug fix |
docs |
Documentation only |
style |
Formatting, no code change |
refactor |
Code restructuring |
perf |
Performance improvement |
test |
Adding/updating tests |
chore |
Build, config, dependencies |
ci |
CI/CD changes |
revert |
Revert previous commit |
Workflow
1. Analyze Changes
git status
git diff --cached
git diff
git log --oneline -5
2. Stage Changes
# Stage specific files
git add <files>
# Or stage all
git add -A
3. Generate Commit Message
Based on the changes:
- Identify the type of change
- Determine the scope (optional)
- Write a concise subject (50 chars max)
- Add body if needed (explain why, not what)
- Reference issues in footer
4. Execute Commit
git commit -m "type(scope): subject"
# Or with body
git commit -m "type(scope): subject" -m "Body paragraph 1" -m "Body paragraph 2"
Examples
# Feature
git commit -m "feat(auth): add OAuth2 login support"
# Bug fix
git commit -m "fix(api): handle null response in user endpoint"
# With body and footer
git commit -m "feat(dashboard): add real-time metrics" -m "Implements WebSocket connection for live data updates. Includes reconnection logic and error handling." -m "Closes #123"
# Breaking change
git commit -m "feat(api)!: change user endpoint response format" -m "BREAKING CHANGE: User endpoint now returns nested object instead of flat structure"
Commit Best Practices
- One logical change per commit - Don't mix unrelated changes
- Write imperative mood - "add feature" not "added feature"
- No period at end of subject line
- Capitalize first letter of subject
- Separate subject from body with blank line
- Wrap body at 72 characters
- Use body to explain why, not what
- Reference issues in footer
Pre-commit Checklist
- All tests pass
- No debug code left
- No sensitive data in changes
- Commit message follows format
- Changes are logically grouped
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?