$npx -y skills add kklimuk/docx-cli --skill commitCreate well-structured git commits from the current working tree. Use when the user says 'commit', 'save my work', 'let's commit this', 'make a commit', or any variation of wanting to commit code to git.
| 1 | # Commit |
| 2 | |
| 3 | Create clean, well-structured git commits that tell a coherent story. |
| 4 | |
| 5 | ## Process |
| 6 | |
| 7 | ### 1. Assess the Working Tree |
| 8 | |
| 9 | Run `git status` (never `-uall`) and `git diff` to understand what changed. Also run `git log --oneline -5` to match the repo's existing commit message style. |
| 10 | |
| 11 | If there are no changes, say so and stop. |
| 12 | |
| 13 | ### 2. Group Changes by Intent |
| 14 | |
| 15 | Look at the changed files and mentally group them: |
| 16 | |
| 17 | - **Feature**: new functionality (client + server + tests for the same feature = one commit) |
| 18 | - **Fix**: bug fixes |
| 19 | - **Refactor**: structural changes that don't change behavior |
| 20 | - **Docs**: documentation-only changes (CLAUDE.md, README, comments) |
| 21 | - **Test**: test-only additions or changes |
| 22 | - **Chore**: config, dependencies, tooling |
| 23 | |
| 24 | Rules for grouping: |
| 25 | - **Prefer fewer commits.** A feature that touches 15 files is still one commit if it's one logical change. |
| 26 | - **Only split when intent is genuinely different.** "Add collaborative editing" is one commit even if it touches client, server, DB, and tests. But "add collaborative editing" + "fix unrelated CSS bug" should be two commits. |
| 27 | - **For a first commit or large initial build, one commit is fine.** Don't artificially split an initial implementation. |
| 28 | - **Docs updates that accompany code changes go in the same commit.** Only separate docs commits for docs-only changes. |
| 29 | |
| 30 | ### 3. Present the Plan |
| 31 | |
| 32 | Before committing, show the user: |
| 33 | - How many commits you plan to make |
| 34 | - For each commit: the message and which files are included |
| 35 | - Ask for confirmation |
| 36 | |
| 37 | ### 4. Create the Commits |
| 38 | |
| 39 | For each commit: |
| 40 | 1. Stage the specific files with `git add <file1> <file2> ...` (never `git add -A` or `git add .`) |
| 41 | 2. Commit with a message using this format: |
| 42 | |
| 43 | ``` |
| 44 | <type>: <concise description> |
| 45 | |
| 46 | <optional body — explain WHY, not WHAT. The diff shows what.> |
| 47 | |
| 48 | Co-Authored-By: Claude <noreply@anthropic.com> |
| 49 | ``` |
| 50 | |
| 51 | Types: `feat`, `fix`, `refactor`, `docs`, `test`, `chore` |
| 52 | |
| 53 | Message guidelines: |
| 54 | - Subject line under 72 characters |
| 55 | - Use imperative mood ("add", not "added" or "adds") |
| 56 | - The subject should complete the sentence "This commit will..." |
| 57 | - Body is optional — use it for non-obvious context (e.g., "the old approach caused X" or "this unblocks Y") |
| 58 | - Always include the Co-Authored-By trailer |
| 59 | |
| 60 | ### 5. Verify |
| 61 | |
| 62 | After all commits, run `git log --oneline -10` to show the result. |
| 63 | |
| 64 | ## Safety Rules |
| 65 | |
| 66 | - **Never commit `.env`, credentials, or secrets.** Check staged files for these patterns and warn. |
| 67 | - **Never use `git add -A` or `git add .`** — always stage specific files. |
| 68 | - **Never amend a commit** unless the user explicitly asks. |
| 69 | - **Never force push.** |
| 70 | - **Never skip hooks** (`--no-verify`). |
| 71 | - **If a pre-commit hook fails**, fix the issue and create a NEW commit (don't amend). To diagnose, read the pre-commit hook (`.husky/pre-commit` or `.pre-commit-config.yaml`) to see what it runs, then run each command individually to find the failure. |
| 72 | |
| 73 | ## What NOT To Do |
| 74 | |
| 75 | - Don't write commit messages that describe every file changed. The diff does that. |
| 76 | - Don't split a single feature across 5 commits just because it touches 5 directories. |
| 77 | - Don't use vague messages like "update code" or "fix stuff". |
| 78 | - Don't commit generated files (`db/schema.ts`, `dist/`, `node_modules/`, `__pycache__/`). |