--- name: commit description: Commit procedure and message rules. Use for every commit. --- # Commit ## Procedure 1. Do the `check` skill. All checks must pass before you commit. 2. Stage only the files that belong to this change. Keep unrelated changes in separate commits. 3. Write the message to a file or a here-document and commit with `git commit -F`. Never put `\n` in `git commit -m`. 4. When `.githooks/commit-msg` rejects the message, fix the message and commit again. Do not skip the hook with `--no-verify`. ## Size - Commit often. Split the work into small, coherent, working steps, and do not wait for a full feature. - Before a push, rebase on the latest `master` and fix conflicts during the rebase. Never make a merge commit. ## Subject - Use 50 characters or fewer. - Write a short summary in the present-tense imperative mood. - Capitalize the first word. Do not end with a period. - Do not use a subsystem or prefix. ## Body - Separate the subject from the body with exactly one blank line. - Always write a body. Wrap each line at 72 characters. Fill each line of a paragraph before you wrap it. - Write in the present-tense declarative mood. - Start with a direct summary of the complete change. Do not only repeat the subject. - Explain what the change does and why it is necessary. Describe the resulting behavior and design. - Do not describe the development process, list the changed files, or give obvious implementation steps. ## Trailers - When the change belongs to an issue, end the message with one `Link:` trailer to that issue. Add it with `git commit --trailer`. Never use a closing keyword such as "Fixes" or "Closes". - Link the bug report when a change fixes a reported bug. - Do not add an AI tool as co-author. Do not add attribution trailers. ## Example ``` Print the program name OneChat prints its name and exits. The program gives the Nix package a binary that the install check can run, so the build pipeline is tested before the first feature. ```