]> git.giacomolli.uk - onechat/blob - .agents/skills/commit/SKILL.md
Make intentional error discards explicit
[onechat] / .agents / skills / commit / SKILL.md
1 ---
2 name: commit
3 description: Commit procedure and message rules. Use for every commit.
4 ---
5
6 # Commit
7
8 ## Procedure
9
10 1. Confirm that the configured signing key is available. If signing is
11 unavailable or fails, stop and report the problem. Never disable
12 signing, bypass it with a command or configuration override, or
13 create an unsigned commit.
14 2. Do the `check` skill. All checks must pass before you commit.
15 3. Stage only the files that belong to this change. Keep unrelated
16 changes in separate commits.
17 4. Write the complete message to a file, including all trailers. Add
18 trailers with `git interpret-trailers --trailer` before the check,
19 not after it. Never put `\n` in `git commit -m`.
20 5. Run `sh .githooks/commit-msg MESSAGE_FILE` on that final file before
21 `git commit`. Fix every failure and run the check again. Sign with
22 the configured key, using `git commit -S -F MESSAGE_FILE` on the same
23 file. Do not add or change trailers after the check. The normal
24 commit hook still runs. Never skip it with `--no-verify`.
25 6. Cryptographically verify each new commit's signature against the
26 configured key before reporting completion. A signature header alone
27 is not verification. If verification fails, stop and report it. Do
28 not claim completion or publish the commit.
29
30 ## Size
31
32 - Commit often. Split the work into small, coherent, working steps, and
33 do not wait for a full feature.
34 - Push code only with the user's authorization. A remote does not give
35 permission to push.
36 - Rebase before an authorized push only when the task permits it. Do not
37 rewrite published commits without the user's explicit approval. Stop
38 and ask when an operation needs that approval. Never make a merge
39 commit.
40
41 ## Subject
42
43 - Use 50 characters or fewer.
44 - Write a short summary in the present-tense imperative mood.
45 - Capitalize the first word. Do not end with a period.
46 - Do not use a subsystem or prefix.
47
48 ## Body
49
50 - Separate the subject from the body with exactly one blank line.
51 - Always write a body. Wrap each line at 72 characters. Fill each line
52 of a paragraph before you wrap it. `bin/reflow` formats source
53 comments at 80 columns, not commit prose. Do not use it to format a
54 commit message.
55 - Write in the present-tense declarative mood.
56 - Start with a direct summary of the complete change. Do not only repeat
57 the subject.
58 - Explain what the change does and why it is necessary. Describe the
59 resulting behavior and design.
60 - Do not describe the development process, list the changed files, or
61 give obvious implementation steps.
62
63 ## Trailers
64
65 - When the change belongs to an issue, end the message with one `Issue:`
66 trailer. Use the shortest unique git-bug issue ID in the `Issue:`
67 trailer, with a minimum of seven characters. Check uniqueness against
68 all issues, not only open issues. Assemble it with
69 `git interpret-trailers --trailer` before the message check. Never use
70 a closing keyword such as "Fixes" or "Closes".
71 - Link the bug report when a change fixes a reported bug.
72 - Do not add an AI tool as co-author. Do not add attribution trailers.
73
74 ## Example
75
76 ```
77 Print the program name
78
79 OneChat prints its name and exits. The program gives the Nix package a
80 binary that the install check can run, so the build pipeline is tested
81 before the first feature.
82 ```