Skip to content

Commit 20282ff

Browse files
committed
docs: update commit command with workflow and scope definitions
Rewrite commit skill to handle all modified/untracked files, group changes logically, and create multiple commits when needed. Add fixed scope table with clear coverage mappings and example commit messages.
1 parent 1d54796 commit 20282ff

1 file changed

Lines changed: 48 additions & 27 deletions

File tree

.claude/commands/commit.md

Lines changed: 48 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,70 @@
1-
Generate a conventional commit message for the current staged changes.
1+
---
2+
model: sonnet
3+
---
24

3-
Analyze the git diff of staged files and create a commit message following conventional commits specification:
5+
Analyze all modified and untracked files, group them logically, and create one or more conventional commits.
46

57
### Conventional Commits
68

79
**Format:** `<type>(<scope>): <description>`
810

11+
Title must be **< 72 characters**.
12+
913
#### Types
1014

1115
- feat: new feature
1216
- fix: bug fix
13-
- docs: documentation
14-
- style: formatting, missing semicolons, etc.
1517
- refactor: code change that neither fixes a bug nor adds a feature
16-
- test: adding or correcting tests
18+
- style: formatting, missing semicolons, etc.
19+
- perf: performance improvement
20+
- docs: documentation
1721
- chore: maintenance tasks
1822
- ci: continuous integration changes
19-
- revert: reverts a previous commit
20-
21-
### Workflow
22-
23-
1. Run `git status` to see overall repository state. If there are are no staged changes, exit.
24-
2. Run `git diff --staged` to analyze the actual changes
25-
3. Run `git diff --stat --staged` for summary of changed files
26-
4. Run `git log --oneline -10` to review recent commit patterns
27-
5. Choose appropriate type and scope based on changes
28-
6. Write concise description (50 chars max for first line)
29-
7. Include body if changes are complex
30-
8. Commit the staged changes with the generated message
23+
- test: adding or correcting tests
3124

32-
### Co-authors
25+
#### Scopes
3326

34-
Here is the collection of all previous co-authors of the repo as reference (names and emails):
27+
Use one of these fixed scopes. Omit the scope only when a change spans too many areas to pick one.
3528

36-
- claude: `Co-Authored-By: Claude <noreply@anthropic.com>`
29+
| Scope | Covers |
30+
|---|---|
31+
| `bot` | Core game loop, decision-making logic (`bot.py`) |
32+
| `client` | BalatroBot JSON-RPC client (`client.py`) |
33+
| `llm` | LLM client wrapper, retry logic (`llm.py`) |
34+
| `executor` | Parallel execution orchestration (`executor.py`) |
35+
| `collector` | Data collection, statistics (`collector.py`) |
36+
| `strategy` | Strategy templates, rendering (`strategy.py`, `strategies/`) |
37+
| `views` | HTTP server, HTML templates (`views.py`, `views/`) |
38+
| `config` | Configuration management (`config.py`, YAML configs) |
39+
| `cli` | CLI entry point, argument parsing (`cli.py`) |
40+
| `test:unit` | Unit tests (`tests/unit/`) |
41+
| `test:integration` | Integration tests (`tests/integration/`) |
42+
| `test:fixtures` | Test fixtures and data (`tests/fixtures/`) |
43+
| `docs` | All documentation (`docs/`, `*.md` files) |
44+
| `ci` | CI/CD workflows, Makefile |
45+
| `deps` | Dependency updates (`pyproject.toml`, `uv.lock`) |
46+
| `release` | Version bumps, changelog updates |
3747

38-
Here is a list of the co-authors which contributed to this commit:
48+
#### Examples
3949

4050
```
41-
$ARGUMENTS
51+
feat(bot): add support for new game state
52+
fix(client): handle JSON-RPC timeout gracefully
53+
refactor(llm): extract retry logic into separate method
54+
test:unit: add tests for collector statistics
55+
docs: update installation instructions
56+
chore(deps): bump openai to 1.0.0
4257
```
4358

44-
If the list is empty, do not add any co-authors
45-
46-
### Notes
59+
### Workflow
4760

48-
- Do not include emojis in the commit message.
49-
- Do not include `🤖 Generated with [Claude Code](https://claude.ai/code)` in the commit message.
61+
1. Run `git status` to see overall repository state. If there are no changes (staged or unstaged), exit.
62+
2. Run `git diff` and `git diff --stat` to analyze all unstaged changes.
63+
3. Run `git diff --staged` and `git diff --stat --staged` to analyze already staged changes.
64+
4. Run `git log --oneline -10` to review recent commit patterns.
65+
5. Group the changed files logically by scope/purpose. If all changes belong to the same logical unit, make a single commit. If changes span multiple unrelated scopes, split them into separate commits (e.g., a dependency update and a new bot feature should be two commits).
66+
6. For each logical group, in order:
67+
a. Stage only the files for that group with `git add <file1> <file2> ...`
68+
b. Write a concise commit message (72 chars max for first line). Include a body if the changes are complex.
69+
c. Create the commit.
70+
7. After all commits, run `git log --oneline -5` to confirm the result.

0 commit comments

Comments
 (0)