Files
gh-androidyue-claude-code-p…/commands/commit.md
2025-11-29 17:54:51 +08:00

37 lines
1.4 KiB
Markdown

Generate a well-structured commit message for the current changes. Analyze the git diff and create a commit message that follows best practices.
## Commit Message Guidelines
1. **Format**
- First line: Brief summary (50 chars or less)
- Blank line
- Detailed description explaining what and why (wrap at 72 chars)
- Focus on the motivation and context, not just what changed
2. **Content Requirements**
- Use imperative mood ("Add feature" not "Added feature")
- Be specific and descriptive
- Explain the reasoning behind changes
- Mention any breaking changes or important notes
- Group related changes logically
3. **Structure**
- Start with the type: feat, fix, refactor, docs, test, chore, style, perf
- Provide context about the problem being solved
- Explain the solution approach if non-obvious
- List key changes in bullet points for complex commits
4. **Important Restrictions**
- Do NOT include any AI assistant names or references
- Do NOT include tool attribution
- Do NOT add co-author tags for AI assistants
- Keep the message focused on the code changes only
5. **Quality Checks**
- Is the message clear to someone unfamiliar with the change?
- Does it explain both WHAT and WHY?
- Would this be helpful when reviewing git history later?
- Is it concise but complete?
Generate a commit message that is professional, clear, and follows these guidelines strictly.