80 lines
1.8 KiB
Markdown
80 lines
1.8 KiB
Markdown
---
|
|
name: commit
|
|
description: "OCA/Odoo conventional commit in English with dynamic Claude Code attribution."
|
|
disable-model-invocation: true
|
|
allowed-tools:
|
|
- Bash(git add:*)
|
|
- Bash(git status:*)
|
|
- Bash(git commit:*)
|
|
- Bash(git diff:*)
|
|
- Bash(git log:*)
|
|
- Bash(claude --version)
|
|
- Bash(cat:*)
|
|
- Bash(python3:*)
|
|
---
|
|
|
|
## Context
|
|
|
|
- Git status: !`git status`
|
|
- Full diff: !`git diff HEAD`
|
|
- Current branch: !`git branch --show-current`
|
|
- Last 5 commits (for style reference): !`git log --oneline -5`
|
|
- Claude Code version: !`claude --version 2>/dev/null | head -1`
|
|
|
|
## Task
|
|
|
|
Before committing, retrieve the active model with:
|
|
```bash
|
|
python3 -c "
|
|
import json, os
|
|
path = os.path.expanduser('~/.claude/settings.json')
|
|
try:
|
|
d = json.load(open(path))
|
|
print(d.get('model', 'claude-sonnet-4-6'))
|
|
except:
|
|
print('claude-sonnet-4-6')
|
|
"
|
|
```
|
|
|
|
Then create an OCA/Odoo-compliant commit.
|
|
|
|
### OCA Tags
|
|
|
|
| Tag | Usage |
|
|
|-----|-------|
|
|
| `[IMP]` | Improvement / new feature |
|
|
| `[FIX]` | Bug fix |
|
|
| `[REF]` | Refactoring |
|
|
| `[ADD]` | New module |
|
|
| `[REM]` | Remove code/module |
|
|
| `[MOV]` | Move/rename |
|
|
| `[I18N]` | Translations |
|
|
|
|
### Format
|
|
```
|
|
[TAG] module_name: short description in imperative mood
|
|
|
|
Explain WHY the change was made (not what — the diff already shows that).
|
|
Keep lines under 80 characters.
|
|
|
|
Generated by Claude Code {VERSION} {MODEL}
|
|
|
|
Co-Authored-By: Your Name <your@email.com>
|
|
```
|
|
|
|
### Rules
|
|
|
|
- **English only**, imperative mood, subject line under 50 chars
|
|
- Use the Odoo technical module name (e.g. `sale_order`, `account`, `stock`)
|
|
- If multiple modules are impacted, suggest splitting into separate commits
|
|
|
|
### Execute
|
|
```bash
|
|
git add -A && git commit --author="Your Name <your@email.com>" -m "[TAG] module: description
|
|
|
|
Explain WHY here.
|
|
|
|
Generated by Claude Code {VERSION} {MODEL}
|
|
|
|
Co-Authored-By: Your Name <your@email.com>"
|
|
```
|