Skip to content

Commit 96b60de

Browse files
committed
Codify commit, PR, and Linear linking rules for agents
Make CONTRIBUTING.md the source of truth so agents stop inventing Conventional Commits prefixes, ticket IDs in subjects, and free-form PR bodies. Point AGENTS.md and README at it; add a PR template.
1 parent 2c4effc commit 96b60de

4 files changed

Lines changed: 237 additions & 13 deletions

File tree

‎.github/PULL_REQUEST_TEMPLATE.md‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
## Summary
2+
3+
<!-- Present-tense bullets: what this branch does now. No journey narrative. -->
4+
5+
-
6+
7+
## Verification
8+
9+
- [ ] `bun run typecheck`, `bun run build`, and `bun run test` pass
10+
- [ ] <!-- any manual / product check that is true on this branch -->
11+
12+
<!--
13+
When this PR fully completes a tracker issue, add one closing line (pick one):
14+
15+
Fixes CL-1234
16+
Fixes #123
17+
18+
Partial work: Related to CL-1234
19+
No tracker: delete this comment block and leave no magic-word line.
20+
21+
Do not put CL-… or #N in the PR title. Commit subjects stay plain English
22+
with no ticket IDs — see CONTRIBUTING.md.
23+
-->

‎AGENTS.md‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,13 @@ Run the full suite before declaring any task complete. Do not substitute individ
4949
scans `vendor/`, adding hundreds of unrelated results and making pass/fail
5050
counts meaningless to compare across branches — always use `bun run test`.
5151

52-
## Commits
52+
## Commits, pull requests, and issue tracking
5353

54-
Follow the `style` skill's message format: plain-English summary, no `feat:`/`fix:` prefixes, no filename in the summary. Separate refactors from feature additions. Commit with the user's local git identity.
54+
**MUST follow `CONTRIBUTING.md`.** That file is the source of truth for commit
55+
titles and bodies, PR titles and bodies, and Linear/GitHub linking. Do not use
56+
Conventional Commits prefixes (`feat:`, `fix:`, `docs:`, `ci:`, …), ticket IDs
57+
in commit subjects, or free-form PR body sections. Rewrite before push if a
58+
message violates those rules. Commit with the operator's local git identity.
5559

5660
## Pushing
5761

‎CONTRIBUTING.md‎

Lines changed: 207 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Contributing to Corbits Code
22

3-
Thanks for contributing. This document covers setup, workflow, and legal requirements. Coding conventions live in `AGENTS.md` — read that before writing code.
3+
Thanks for contributing. This document is the **source of truth** for commits,
4+
pull requests, and issue tracking. Coding conventions live in `AGENTS.md` —
5+
read that before writing code. Agents **must** follow the rules below; do not
6+
substitute a personal or skill-only convention when this file conflicts.
47

58
## Prerequisites
69

@@ -24,23 +27,214 @@ git config core.hooksPath .githooks
2427
```bash
2528
bun run typecheck
2629
bun run build
27-
bun test ./src ./tests
30+
bun run test
2831
```
2932

30-
These match the CI workflow in `.github/workflows/ci.yml`. Run the full suite before opening a PR.
33+
These match the CI workflow in `.github/workflows/ci.yml`. Run the full suite
34+
before opening a PR. Do not substitute a bare `bun test` (it also scans
35+
`vendor/` and pollutes pass/fail counts).
36+
37+
## Commits
38+
39+
### Title (MUST)
40+
41+
- Imperative, present tense, max **72** characters
42+
- Starts with a verb: `Add`, `Fix`, `Remove`, `Harden`, `Document`, …
43+
- No trailing punctuation, no abbreviations for their own sake
44+
- No filenames or paths in the subject — the diff already lists them
45+
- Match the voice of recent history:
46+
47+
```bash
48+
git log origin/main --format='%s' | head -20
49+
```
50+
51+
**Banned subject prefixes** (all of them, including habits from other projects):
52+
53+
- Conventional Commits: `feat:`, `fix:`, `chore:`, `docs:`, `refactor:`, `test:`, `ci:`, `perf:`, `style:`, `build:`
54+
- Scoped forms: `docs(changelog):`, `net:`, `frontend:`
55+
- Ticket IDs: `CL-1234:`, `INTR-79:`, `#456:`
56+
- Status tags: `WIP:`, `[urgent]`, `(security):`
57+
58+
**Good:**
59+
60+
```text
61+
Add retry logic for failed network requests
62+
Fix race condition in transaction verification
63+
Document the permission queue behavior
64+
```
65+
66+
**Bad:**
67+
68+
```text
69+
feat: add retry logic
70+
fix(auth): race in server.ts
71+
CL-5494: flatten model picker
72+
Update code
73+
```
74+
75+
### Why not `feat:` / `fix:` / `docs:` / `ci:`?
76+
77+
Conventional Commits are useful when tools **generate** changelogs, SemVer bumps,
78+
or release notes from commit types. This project does not:
79+
80+
- Release notes are hand-written in `CHANGELOG.md` and deliberately strip ticket
81+
and PR IDs from public notes.
82+
- Reviewers and `git log` readers need a sentence that stands alone years later,
83+
not a taxonomy debate (`chore` vs `refactor` vs `fix`).
84+
- An imperative subject already encodes the action: `Fix race in the approval
85+
queue` is clearer than `fix: race in the approval queue`.
86+
- Prefixes train agents and humans to smuggle scope, ticket IDs, and file names
87+
into the subject — noise we already reject elsewhere.
88+
89+
The Git and Go projects use the same plain-English model. Familiarity with
90+
Angular-style prefixes is not a reason to adopt them here.
91+
92+
### Body (usually omit)
93+
94+
Most commits need **no** body. A clear subject plus a coherent diff is enough.
95+
96+
Add a body only when a future reader of `git log` could not answer *why this
97+
change* from the subject and the diff alone. When present:
98+
99+
- Blank line between subject and body
100+
- Wrap body lines at 72 characters
101+
- Motivation only: why this change, why now, why not the obvious alternative
102+
- Do **not** walk the diff file-by-file
103+
- Do **not** reference PR review threads, chat, or "the next commit"
104+
- Do **not** put Linear or GitHub issue IDs in the subject or body — linking is
105+
a pull-request concern (see [Issue tracking](#issue-tracking-linear-and-github))
106+
107+
Write for a stranger reading `git log` years from now with only the repo in
108+
hand, not for the person reviewing this PR today.
109+
110+
### Organization (MUST)
111+
112+
- One logical unit of work per commit
113+
- Separate refactors from feature additions
114+
- Separate formatting/whitespace from behavioral changes
115+
- Commit with the operator's local git identity (never invent author metadata)
31116

32117
## Pull requests
33118

34-
1. Keep changes focused — one concern per PR. See scope discipline in `AGENTS.md`.
35-
2. Include or update tests for behavior changes. Bug fixes start with a failing test.
36-
3. Use plain-English commit messages (no `feat:` / `fix:` prefixes). Details are in `AGENTS.md`.
37-
4. Do not commit secrets, credentials, or generated noise.
119+
### Scope (MUST)
120+
121+
1. One concern per PR. See scope discipline in `AGENTS.md`.
122+
2. Include or update tests for behavior changes. Bug fixes start with a failing
123+
test that reproduces the bug — do not start by patching.
124+
3. Do not commit secrets, credentials, or generated noise.
125+
4. Draft title and body from the current diff, not from memory of the work:
126+
127+
```bash
128+
git diff origin/main...HEAD
129+
git log origin/main..HEAD --format='%s'
130+
```
131+
132+
### Title (MUST)
133+
134+
Same rules as [commit titles](#title-must): imperative present-tense sentence,
135+
no prefixes, no ticket IDs, no trailing punctuation. The title describes the
136+
**whole branch**, not a single commit.
137+
138+
### Body (MUST)
139+
140+
Only these sections. Present tense — what the branch **does**, not the journey
141+
of writing it.
142+
143+
```markdown
144+
## Summary
145+
146+
- <what the code does now>
147+
- <optional second or third bullet>
148+
149+
## Verification
150+
151+
- `bun run typecheck`, `bun run build`, and `bun run test` pass
152+
- <any manual or product check that is true on this branch>
153+
154+
Fixes CL-1234
155+
```
156+
157+
Rules:
158+
159+
- `## Summary` and `## Verification` are required. Do not add `## Changes`,
160+
`## Context`, `## Notes`, or review-fleet diaries — the diff is the change
161+
list; review discussion belongs on the PR review, not in the description.
162+
- Optional short **Why** paragraph is allowed only when Summary would look
163+
arbitrary without motivation. Keep it to a few sentences, present tense,
164+
under the Summary section (not a separate heading).
165+
- Scan for past-tense journey verbs (`was`, `added`, `fixed`, `refactored`,
166+
`I changed`) and rewrite to present-tense product statements.
167+
- When the work tracks an issue, end the body with a magic-word link (see
168+
below). When it does not, omit the link line entirely — do not invent IDs.
169+
170+
GitHub auto-fills this shape from `.github/PULL_REQUEST_TEMPLATE.md`.
171+
172+
## Issue tracking (Linear and GitHub)
173+
174+
Link trackers at the **PR boundary**, not inside every commit.
175+
176+
### When work tracks a Linear issue (MUST)
177+
178+
1. **Branch name** — use the issue's Linear `gitBranchName` (Copy git branch
179+
name / `Cmd/Ctrl+Shift+.`). Branch names that include the issue ID are
180+
Linear's preferred auto-link path.
181+
2. **PR body** — include a **closing** magic word and the issue ID so merge
182+
automation can complete the issue:
183+
184+
```text
185+
Fixes CL-1234
186+
```
187+
188+
Full Linear URLs also work. Prefer the body over stuffing the ID into the
189+
PR title so the title stays a plain-English sentence.
190+
3. Do **not** put `CL-…` in commit subjects or bodies.
191+
192+
**Closing magic words** (issue moves to Done on merge when automation is
193+
configured): `close`, `closes`, `fix`, `fixes`, `resolve`, `resolves`,
194+
`complete`, `completes`, `implement`, `implements` (and tense variants).
195+
196+
**Non-closing** (link only; do not auto-complete): `ref`, `refs`, `related to`,
197+
`relates to`, `part of`, `contributes to`, `toward`, `towards`.
198+
199+
Use non-closing words for partial work or multi-issue branches. Only issues
200+
this PR fully completes get a closing word.
201+
202+
To deliberately **not** link an issue whose ID appears in the branch name:
203+
204+
```text
205+
skip CL-1234
206+
```
207+
208+
(or `ignore CL-1234`).
209+
210+
### When work tracks a GitHub issue only (MUST)
211+
212+
Same pattern in the PR body:
213+
214+
```text
215+
Fixes #123
216+
```
217+
218+
### When there is no tracker
219+
220+
Omit magic words. Do not invent issue IDs.
221+
222+
### After merge (SHOULD for agents running the full workflow)
223+
224+
1. Confirm the PR is merged and CI is green on the merge commit.
225+
2. Comment the PR URL and merge SHA on the Linear issue.
226+
3. Tick only description checkboxes that `main` actually completed.
227+
4. Mark the Linear issue Done only when every outcome is truly done — never on
228+
"PR opened" alone.
38229

39230
## Contributor License Agreement
40231

41-
All contributions require acceptance of the Contributor License Agreement in `CLA.md`. The CLA grants ABK Labs, Inc. rights needed to distribute contributions under the project license and alternative terms.
232+
All contributions require acceptance of the Contributor License Agreement in
233+
`CLA.md`. The CLA grants ABK Labs, Inc. rights needed to distribute
234+
contributions under the project license and alternative terms.
42235

43-
CLA Assistant enforces this on pull requests (see `.github/workflows/cla.yml`). Sign once by posting a PR comment with exactly:
236+
CLA Assistant enforces this on pull requests (see `.github/workflows/cla.yml`).
237+
Sign once by posting a PR comment with exactly:
44238

45239
```text
46240
I have read the CLA Document and I hereby sign the CLA
@@ -53,7 +247,10 @@ Signatures are stored on the `cla-signatures` branch and do not touch `main`.
53247
- `docs/ARCHITECTURE.md` — reactor loop, events, directors, permissions
54248
- `docs/IMPLEMENTATION.md` — runtime, config, CLI, state
55249
- `docs/PRODUCT.md` — product goals
250+
- `docs/TUI.md` — terminal UI behavior
251+
- `AGENTS.md` — coding conventions agents and contributors share
56252

57253
## Questions
58254

59-
Open a GitHub issue for design discussion or bugs that are not security-sensitive. For security reports, see `SECURITY.md`.
255+
Open a GitHub issue for design discussion or bugs that are not
256+
security-sensitive. For security reports, see `SECURITY.md`.

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ After pulling new changes, re-run `bun run build:bin` to refresh the binary.
3838

3939
Before your first commit: `git config core.hooksPath .githooks` and `./bin/check-env`.
4040

41-
Every change must pass `bun run typecheck`, `bun run build`, and `bun test`, and behavior changes come with tests. Conventions live in `AGENTS.md` (functional TypeScript, no classes, arktype at boundaries, plain-English commit messages); the system design is documented in `docs/ARCHITECTURE.md` and `docs/IMPLEMENTATION.md`.
41+
Every change must pass `bun run typecheck`, `bun run build`, and `bun run test`, and behavior changes come with tests. Coding conventions live in `AGENTS.md` (functional TypeScript, no classes, arktype at boundaries); commit, PR, and Linear/GitHub linking rules live in `CONTRIBUTING.md`. System design is documented in `docs/ARCHITECTURE.md` and `docs/IMPLEMENTATION.md`.
4242

4343
## Stack
4444

0 commit comments

Comments
 (0)