]> git.giacomolli.uk - onechat/blob - .agents/skills/commit/SKILL.md
Define the required code and commit rules
[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 message to a file or a here-document and sign the commit
18 with the configured key, using `git commit -S -F`. Never put `\n` in
19 `git commit -m`.
20 5. When `.githooks/commit-msg` rejects the message, fix the message and
21 commit again. Do not skip the hook with `--no-verify`.
22 6. Cryptographically verify each new commit's signature against the
23 configured key before reporting completion. A signature header alone
24 is not verification. If verification fails, stop and report it. Do
25 not claim completion or publish the commit.
26
27 ## Size
28
29 - Commit often. Split the work into small, coherent, working steps, and
30 do not wait for a full feature.
31 - Push code only with the user's authorization. A remote does not give
32 permission to push.
33 - Rebase before an authorized push only when the task permits it. Do not
34 rewrite published commits without the user's explicit approval. Stop
35 and ask when an operation needs that approval. Never make a merge
36 commit.
37
38 ## Subject
39
40 - Use 50 characters or fewer.
41 - Write a short summary in the present-tense imperative mood.
42 - Capitalize the first word. Do not end with a period.
43 - Do not use a subsystem or prefix.
44
45 ## Body
46
47 - Separate the subject from the body with exactly one blank line.
48 - Always write a body. Wrap each line at 72 characters. Fill each line
49 of a paragraph before you wrap it.
50 - Write in the present-tense declarative mood.
51 - Start with a direct summary of the complete change. Do not only repeat
52 the subject.
53 - Explain what the change does and why it is necessary. Describe the
54 resulting behavior and design.
55 - Do not describe the development process, list the changed files, or
56 give obvious implementation steps.
57
58 ## Trailers
59
60 - When the change belongs to an issue, end the message with one `Issue:`
61 trailer. Use the shortest unique git-bug issue ID in the `Issue:`
62 trailer, with a minimum of seven characters. Check uniqueness against
63 all issues, not only open issues. Add it with `git commit --trailer`.
64 Never use a closing keyword such as "Fixes" or "Closes".
65 - Link the bug report when a change fixes a reported bug.
66 - Do not add an AI tool as co-author. Do not add attribution trailers.
67
68 ## Example
69
70 ```
71 Print the program name
72
73 OneChat prints its name and exits. The program gives the Nix package a
74 binary that the install check can run, so the build pipeline is tested
75 before the first feature.
76 ```