|
| 1 | +--- |
| 2 | +name: commit-all |
| 3 | +description: Use this skill when the user asks to "commit all", "commit everything", or wants all outstanding changes committed. Groups unrelated changes into separate, well-described commits instead of one catch-all commit. |
| 4 | +--- |
| 5 | + |
| 6 | +# Commit All |
| 7 | + |
| 8 | +## Goal |
| 9 | + |
| 10 | +Commit every outstanding change in the working tree — but group unrelated changes into separate, informative commits so the git history stays useful. |
| 11 | + |
| 12 | +## Workflow |
| 13 | + |
| 14 | +1. **Survey all changes.** Run `git status` and `git diff` (staged + unstaged) to see the full picture. Include untracked files. |
| 15 | +2. **Identify logical groups.** Cluster files by the change they belong to. A "group" is a set of files that were modified for the same reason (e.g. a bug fix, a new feature, a config tweak, a dependency update). Use file paths, diff content, and your understanding of the codebase to decide. |
| 16 | +3. **Order commits.** Infra/config/dependency changes first, then library/core changes, then feature/UI changes, then docs/polish. |
| 17 | +4. **For each group, create one commit:** |
| 18 | + - Stage only the files belonging to that group (`git add <file> ...`). Never use `git add -A` or `git add .`. |
| 19 | + - Write a concise, informative commit message that describes *what* changed and *why*. Follow the repo's existing commit style (check `git log --oneline -10`). |
| 20 | + - Do not lump unrelated changes together just because they're small. |
| 21 | +5. **Verify.** After all commits, run `git status` to confirm the tree is clean. Run `git log --oneline -n <N>` (where N = number of commits created) to show the user what was committed. |
| 22 | + |
| 23 | +## Commit Message Rules |
| 24 | + |
| 25 | +- Keep the subject line under 72 characters. |
| 26 | +- Use imperative mood ("add", "fix", "update", not "added", "fixes"). |
| 27 | +- If a change is trivial (whitespace, typo, formatting), it's fine to batch those into one commit labeled accordingly. |
| 28 | +- End every commit message with the Co-Authored-By trailer. |
| 29 | + |
| 30 | +## Hard Rules |
| 31 | + |
| 32 | +- Never combine unrelated changes in one commit. |
| 33 | +- Never skip or discard changes — everything gets committed. |
| 34 | +- Never use `git add -A` or `git add .`. |
| 35 | +- Do not push. Only commit locally. |
| 36 | +- Do not commit files that look like they contain secrets (`.env`, credentials, tokens). Warn the user about those instead. |
0 commit comments