commit
Creates git commits with conventional commit messages. Use when the user says "commit", "commit changes", "create a commit", "save my changes", or asks to commit code.
安装与使用
请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。
查看来源 ↗使用指南技能说明
Git Commit
Analyze changes and create well-formatted commits using conventional commit format.
Instructions
- Run
git statusto see staged, unstaged, and untracked files - Run
git diff --staged(orgit diffif nothing staged) to view changes - Run
git log --oneline -5to match existing commit style - Run /update-readme skill to ensure documentation is in sync with changes
- Stage changes with
git addif needed (ask user if unclear what to stage) - Create commit with conventional format (see below)
- Run
git statusto verify success
Conventional commit format
<type>[scope]: <description>
[optional body]
Types: feat, fix, docs, style, refactor, test, chore, build, ci, perf
Example:
feat(auth): add password reset flow
Implements forgot password email and reset token validation.
Closes #42
Rules
- MUST use imperative mood ("add" not "added")
- MUST keep first line under 72 characters
- MUST use heredoc for multi-line messages
- Never add "Generated with Claude Code" or attribution
- Never add Co-Authored-By headers
- Never add attribution to PR descriptions either
- Never use
git commit --amendunless explicitly requested - Never use
git reset --hard- it destroys local changes - Never use
git pushunless explicitly requested - Never push directly to main/master; always use a feature branch and PR
- Never create a PR without explicit user approval
- After committing, ASK the user before pushing or creating a PR
- Never stage files containing secrets (.env, credentials, API keys)
- Never stage or commit CLAUDE.md files
Heredoc format
git commit -m "$(cat <<'EOF'
type(scope): description
Body text here.
EOF
)"
使用示例
查看来源仓库中的使用示例与配置说明。
查看来源 ↗来源历史
- 收录时间
- 2026-01-20
- 索引更新时间
- 2026-01-26
- Branch
- main
收录与同步日期属于本站记录。源码修改历史请查看来源仓库。
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!