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