@ai-agent-lead/skills 1.1.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  A library of Claude Code skills that encode engineering discipline so Claude follows it by default.
4
4
 
5
+ **Website:** [AgentLead.Dev](https://AgentLead.Dev)
6
+
5
7
  ## Why
6
8
 
7
9
  Out of the box Claude writes code competently, but shipping well needs more than that: investigate before building, design the interface before writing, test-first, review at PR boundaries, and verify before merge.
@@ -19,7 +21,7 @@ The goal: turn engineering discipline from something I have to enforce into some
19
21
  You can install all the skills in this repository directly using `npx`:
20
22
 
21
23
  ```bash
22
- npx github:ai-agent-lead/skills
24
+ npx @ai-agent-lead/skills
23
25
  ```
24
26
 
25
27
  ### Options and Customization
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-agent-lead/skills",
3
- "version": "1.1.0",
3
+ "version": "1.3.0",
4
4
  "description": "Install AI agent skills for Claude Code, Codex, Antigravity, and OpenCode",
5
5
  "main": "bin/install.js",
6
6
  "bin": {
package/skills/README.md CHANGED
@@ -41,6 +41,7 @@ Grouped by role. Trigger phrases are in each skill's `description` frontmatter.
41
41
 
42
42
  | Skill | Trigger | Produces | Location |
43
43
  | --- | --- | --- | --- |
44
+ | `sync-check` | Before pr-review or after refactor | Terminology/ADR drift report | [sync-check/](./sync-check/) |
44
45
  | `prod-ready` | After tdd green, before merge | Verified pre-merge checklist (incl. doc drift) | [prod-ready/](./prod-ready/) |
45
46
  | `security-review` | Surface-changing work — new entry points, identity flows, authz, sensitive data, external deps | Threat model + verified controls; appended to feature doc, or `docs/security/<feature>.md` for high-stakes | [security-review/](./security-review/) |
46
47
  | `pr-review` | Reviewing someone else's PR (or self-reviewing before opening) | Structured review with severity-classified findings (blocker / suggestion / nit / question) | [pr-review/](./pr-review/) |
@@ -52,16 +53,16 @@ Orthogonal axis. The trigger-phrase index above tells you *when* a skill fires;
52
53
 
53
54
  | Role | Skills | What they have in common |
54
55
  | --- | --- | --- |
55
- | **Doc-producing** (writes a durable artifact under `docs/`) | `feature-doc`, `investigate`, `system-design`, `grill-plan`, `debug` (optional), `security-review` (optional), `verify-real-deps` | Output survives the conversation. The discipline of writing it is the value. |
56
+ | **Doc-producing** (writes a durable artifact under `docs/`) | `feature-doc`, `investigate`, `system-design`, `grill-plan`, `debug` (optional), `security-review` (optional), `verify-real-deps`, `bench`, `bootstrap` | Output survives the conversation. The discipline of writing it is the value. |
56
57
  | **Build** (writes code) | `tdd`, `tdd-rounds`, `simplify` | Diff-producing. Always behind a contract (feature doc + ACs). |
57
- | **Gate** (verifies before merge / tag) | `prod-ready`, `security-review`, `pr-review`, `verify-real-deps` | Pre-merge or pre-tag — refuse to advance until the checklist passes. |
58
+ | **Gate** (verifies before merge / tag) | `prod-ready`, `security-review`, `pr-review`, `verify-real-deps`, `sync-check` | Pre-merge or pre-tag — refuse to advance until the checklist passes. |
58
59
  | **Diagnose** (no code, no doc — just analysis) | `debug`, `zoom-out`, `sync-check` | Run *before* a build skill when the input isn't yet clear. |
59
60
  | **Shape** (decides module / topology) | `design`, `system-design`, `improve-codebase-architecture` | Greenfield-module / greenfield-system / brownfield. Same vocabulary ([`LANGUAGE.md`](./LANGUAGE.md)). |
60
- | **Lens** (applied during other skills, not invoked alone) | `code-hygiene` | Five principles you carry into `simplify`, `pr-review`, and any code-reading session. |
61
+ | **Lens** (applied during other skills, not invoked alone) | `code-hygiene`, `caveman` | Principles you carry into any turn to maintain quality or efficiency. |
61
62
 
62
63
  ## Skill relationship map
63
64
 
64
- The 16 skills + their dependencies. Lateral edges are vocabulary / lens; vertical edges are workflow flow.
65
+ The 20 skills + their dependencies. Lateral edges are vocabulary / lens; vertical edges are workflow flow.
65
66
 
66
67
  ```
67
68
  ┌─────────────────────────────────────────────┐
@@ -80,16 +81,16 @@ The 16 skills + their dependencies. Lateral edges are vocabulary / lens; vertica
80
81
  │ │ ▲ │ │ prod-ready│
81
82
  │ │ │ │ │ │ │
82
83
  │ └──────────────┘ │ │ ▼ │
83
- │ │ │ pr-review
84
+ │ │ │ sync-check
84
85
  │ system-design ──► design (per mod) ─┘ │ │ │
85
86
  │ │ │ ▼ │
86
- │ ▼ │ verify-real-deps
87
+ │ ▼ │ pr-review
87
88
  │ docs/architecture.md │ │ │
88
89
  │ │ ▼ │
89
- │ improve-codebase-architecture ─────────────────┘ [merge]
90
- │ ▲
91
- │ │
92
- │ tdd-rounds (orchestrator) ── dispatches Builders ──────────────│
90
+ │ improve-codebase-architecture ─────────────────┘ verify-real-deps
91
+ │ ▲
92
+ │ │
93
+ │ tdd-rounds (orchestrator) ── dispatches Builders ────── [merge]│
93
94
  │ │ ▲ ▲ ▲ │
94
95
  │ │ │ │ │ │
95
96
  │ │ debug security-review │
@@ -97,7 +98,7 @@ The 16 skills + their dependencies. Lateral edges are vocabulary / lens; vertica
97
98
  │ │
98
99
  │ ┌────────────── LENSES & UTILITIES ──────────────┐ │
99
100
  │ │ code-hygiene ──► applied during simplify, │ │
100
- │ │ pr-review, any code reading │ │
101
+ │ │ caveman ──► pr-review, any code reading │ │
101
102
  │ │ │ │
102
103
  │ │ zoom-out ──► interrupts any workflow, │ │
103
104
  │ │ maps unfamiliar areas │ │
@@ -105,14 +106,16 @@ The 16 skills + their dependencies. Lateral edges are vocabulary / lens; vertica
105
106
  └──────────────────────────────────────────────────────────────────┘
106
107
  ```
107
108
 
108
- **Six things the map shows:**
109
+ **Seven things the map shows:**
109
110
 
110
- 1. `code-hygiene` and `zoom-out` are not nodes in any flow — they're lenses / utilities applied across.
111
+ 1. `code-hygiene`, `caveman`, and `zoom-out` are not nodes in any flow — they're lenses / utilities applied across.
111
112
  2. `grill-plan` is the only skill invoked from three upstreams (`investigate`, `feature-doc`, `improve-codebase-architecture`) — it's the shared pressure-test step.
112
113
  3. `tdd-rounds` is the only multi-callee orchestrator — dispatches `design`, `tdd`, `simplify`, `prod-ready`, `verify-real-deps` to Builders.
113
114
  4. `pr-review` is the reviewer-side mirror of `prod-ready` — Section 7 doc-drift covered in both.
114
- 5. `system-design` and `improve-codebase-architecture` are duals same [LANGUAGE.md](./LANGUAGE.md), greenfield vs brownfield.
115
- 6. The shared substrate ([LANGUAGE.md](./LANGUAGE.md), [formats/](./formats/), [TRIGGERS.md](./TRIGGERS.md)) is referenced everywhere — never copy-paste the content into a skill.
115
+ 5. `sync-check` sits before `pr-review` as a final terminology and ADR audit.
116
+ 6. `system-design` and `improve-codebase-architecture` are duals — same [LANGUAGE.md](./LANGUAGE.md), greenfield vs brownfield.
117
+ 7. The shared substrate ([LANGUAGE.md](./LANGUAGE.md), [formats/](./formats/), [TRIGGERS.md](./TRIGGERS.md)) is referenced everywhere — never copy-paste the content into a skill.
118
+
116
119
 
117
120
  ## Workflows
118
121
 
@@ -153,4 +156,3 @@ Used by `grill-plan`, `improve-codebase-architecture`, `system-design`, `investi
153
156
  5. Add the skill to **both** index tables above (by trigger phase AND by role).
154
157
  6. Add an entry to [TRIGGERS.md](./TRIGGERS.md) for routing.
155
158
  7. Update [WORKFLOWS.md](./WORKFLOWS.md) if the skill participates in a canonical workflow or as a cross-workflow pattern.
156
- . Update [WORKFLOWS.md](./WORKFLOWS.md) if the skill participates in a canonical workflow or as a cross-workflow pattern.
@@ -25,6 +25,12 @@ If a phrase appears in multiple rows, the disambiguation column names how to cho
25
25
  | "simpler", "boring", "naming", "YAGNI", "premature abstraction", "over-engineered", "clean this up at line level" | [`code-hygiene`](code-hygiene/SKILL.md) | Lens, not phase — applies during simplify, pr-review, or whenever you re-read code. |
26
26
  | "I'm lost", "give me higher-level context", "zoom out", "I don't know this area" | [`zoom-out`](zoom-out/SKILL.md) | User-invoked utility (`disable-model-invocation`). |
27
27
 
28
+ ## Utilities & efficiency
29
+
30
+ | Phrase / situation | Routes to | Disambiguator |
31
+ | --- | --- | --- |
32
+ | "caveman mode", "be concise", "save tokens", "ooga booga" | [`caveman`](caveman/SKILL.md) | Token optimization lens. |
33
+
28
34
  ## Implementation
29
35
 
30
36
  | Phrase / situation | Routes to | Disambiguator |
@@ -1,6 +1,6 @@
1
1
  # Workflows
2
2
 
3
- How the 16 skills compose into the common paths users actually walk.
3
+ How the 20 skills compose into the common paths users actually walk.
4
4
 
5
5
  The skills aren't a flat menu — they form a workflow with branching. This file maps the canonical paths so you can see where to enter, what to expect, and what produces what.
6
6
 
@@ -32,6 +32,8 @@ Got a task? Pick by what you have in front of you:
32
32
  │ Surface-changing work (auth, public │ /security-review (gate, runs │
33
33
  │ API, sensitive data, new entry pt)│ alongside Workflow 1/2/6) │
34
34
  ├─────────────────────────────────────┼──────────────────────────────────┤
35
+ │ Audit terminology or ADR compliance │ /sync-check (gate) │
36
+ ├─────────────────────────────────────┼──────────────────────────────────┤
35
37
  │ Lost in unfamiliar area, mid-task │ /zoom-out (utility, anytime) │
36
38
  └─────────────────────────────────────┴──────────────────────────────────┘
37
39
  ```
@@ -73,6 +75,9 @@ For a single-package feature with a manageable acceptance-criteria count.
73
75
  prod-ready ──── 7-section checklist
74
76
 
75
77
 
78
+ sync-check ──── terminology and ADR audit
79
+
80
+
76
81
  (optional) pr-review ── self-check against the diff before opening
77
82
 
78
83
 
@@ -331,25 +336,27 @@ A few things that happen across all workflows:
331
336
 
332
337
  4. **`code-hygiene` is a lens, not a phase.** Apply it during the simplify sweep that follows TDD green, during `pr-review`, or whenever you re-read code and pause to understand it. Especially relevant in Workflows 1, 2, 4, and 5.
333
338
 
334
- 5. **`debug` runs *before* `tdd` for non-trivial bugs.** Workflow 5b makes this explicit. The reproduction from `debug` becomes the failing test for `tdd`. Skip for bugs whose root cause is obvious from the trace (Workflow 5a).
339
+ 5. **`caveman` is an efficiency lens.** Apply it whenever token optimization is needed, particularly in Builder reports or long sessions. It doesn't change the workflow but compresses the communication.
335
340
 
336
- 6. **`security-review` is a gate, not a workflow.** Fires when a change is **surface-changing** — new entry point, identity / session / token flow, authorization logic, sensitive-data path, new external dependency, secrets handling. Runs alongside `design` and `tdd` in Workflows 1, 2, 4, 5a, 5b, 6 whenever those criteria hit. Not a substitute for `prod-ready` Section 3 both run when the surface changes.
341
+ 6. **`debug` runs *before* `tdd` for non-trivial bugs.** Workflow 5b makes this explicit. The reproduction from `debug` becomes the failing test for `tdd`. Skip for bugs whose root cause is obvious from the trace (Workflow 5a).
337
342
 
338
- 7. **`pr-review` is a utility workflow.** Runs when reviewing someone else's PR. Also runs (lighter form) as a self-check before opening the PR. The `tdd-rounds` parent's per-round verification borrows from it.
343
+ 7. **`security-review` is a gate, not a workflow.** Fires when a change is **surface-changing** new entry point, identity / session / token flow, authorization logic, sensitive-data path, new external dependency, secrets handling. Runs alongside `design` and `tdd` in Workflows 1, 2, 4, 5a, 5b, 6 whenever those criteria hit. Not a substitute for `prod-ready` Section 3 both run when the surface changes.
339
344
 
340
- 8. **`prod-ready` is the universal pre-merge gate** for Workflows 1, 2, 4, and sometimes 5. Single exit ramp before opening a PR.
345
+ 8. **`pr-review` is a utility workflow.** Runs when reviewing someone else's PR. Also runs (lighter form) as a self-check before opening the PR. The `tdd-rounds` parent's per-round verification borrows from it.
341
346
 
342
- 9. **`verify-real-deps` fires whenever a workflow ends in a tagged release that touches a third-party API.** Most commonly that's Workflow 2 (large feature → tag), but it also applies when Workflow 1, 4, or 6 culminates in a release whose code path talks to an upstream you don't control. It does **not** fire for pure-internal services with database-only state, or for continuous-deploy environments that don't tag.
347
+ 9. **`prod-ready` is the universal pre-merge gate** for Workflows 1, 2, 4, and sometimes 5. Single exit ramp before opening a PR.
343
348
 
344
- 10. **`system-design` runs once per system, not per feature.** It's the greenfield precursor to Workflows 1 and 2. Once the topology is set, individual features run their own Workflow 1 or 2 inside it.
349
+ 10. **`verify-real-deps` fires whenever a workflow ends in a tagged release that touches a third-party API.** Most commonly that's Workflow 2 (large feature tag), but it also applies when Workflow 1, 4, or 6 culminates in a release whose code path talks to an upstream you don't control. It does **not** fire for pure-internal services with database-only state, or for continuous-deploy environments that don't tag.
345
350
 
346
- 11. **Vocabulary is shared.** All architecture-talking skills (`design`, `system-design`, `improve-codebase-architecture`, `pr-review`, `grill-plan`) read from [`skills/LANGUAGE.md`](./LANGUAGE.md). Format references (ADRs, CONTEXT.md) live in [`skills/formats/`](./formats/). Domain vocabulary (Customer, Order, etc.) lives in `docs/CONTEXT.md`. Keep them distinct.
351
+ 11. **`system-design` runs once per system, not per feature.** It's the greenfield precursor to Workflows 1 and 2. Once the topology is set, individual features run their own Workflow 1 or 2 inside it.
352
+
353
+ 12. **Vocabulary is shared.** All architecture-talking skills (`design`, `system-design`, `improve-codebase-architecture`, `pr-review`, `grill-plan`) read from [`skills/LANGUAGE.md`](./LANGUAGE.md). Format references (ADRs, CONTEXT.md) live in [`skills/formats/`](./formats/). Domain vocabulary (Customer, Order, etc.) lives in `docs/CONTEXT.md`. Keep them distinct.
347
354
 
348
355
  13. **Bootstrap mode for greenfield repos** is documented in one place — [`grill-plan/BOOTSTRAP.md`](./grill-plan/BOOTSTRAP.md). `feature-doc` and `system-design` defer there rather than re-explaining the rules.
349
356
 
350
357
  14. **`simplify` is the end-of-slice / end-of-round sweep.** Runs after every `tdd` slice goes green; in `tdd-rounds`, lands as its own commit per [`tdd-rounds/COMMITS.md` rule 4](./tdd-rounds/COMMITS.md). Applies the `code-hygiene` lens to the changed files, plus a test-relevance check. Distinct from `code-hygiene` (the lens) and from `improve-codebase-architecture` (the structural escalation when simplify finds bigger issues).
351
358
 
352
- 12. **Artifacts accumulate in `docs/`:**
359
+ 15. **Artifacts accumulate in `docs/`:**
353
360
 
354
361
  | Location | Produced by | Type |
355
362
  |---|---|---|
@@ -359,11 +366,12 @@ A few things that happen across all workflows:
359
366
  | `docs/adr/<n>-<topic>.md` | `grill-plan`, `improve-codebase-architecture` | One per architectural decision |
360
367
  | `docs/CONTEXT.md` | `grill-plan`, `improve-codebase-architecture` (inline updates) | One per repo / context |
361
368
  | `docs/architecture.md` | `system-design` | One per system (the system map) |
362
- | `docs/STATE.md` | `tdd-rounds` parent (append-only) | One per multi-round project |
369
+ | `docs/features/<name>/state/snapshot.md` | `tdd-rounds` parent | Living snapshot per feature (target end-state per ADR-0001; not yet wired through `tdd-rounds` skill text) |
370
+ | `docs/features/<name>/state/rounds/*.md` | `tdd-rounds` Builder | Immutable round logs (target end-state per ADR-0001) |
371
+ | `docs/STATE.md` | `tdd-rounds` parent | Currently the single running summary; ADR-0001 demotes it to a global manifest after migration. |
363
372
  | `docs/security/<feature>.md` | `security-review` (high-stakes only) | One per surface-changing feature where a feature-doc section isn't enough |
364
373
  | `docs/benchmarks/<feature>.md` | `bench` | One per performance-critical feature |
365
- | `docs/known-issues.md` | `verify-real-deps` | One per repo (post-mortem record) |
374
+ | `docs/known-issues.md` | `verify-real-deps` | One per repo (post-mortem record); also holds follow-up tracking for accepted-but-unimplemented ADRs. |
375
+ | `CHANGELOG.md` | `prod-ready` Section 7 | One per repo; `[Unreleased]` accumulates between releases. |
366
376
  All `docs/` files are created **lazily** — they don't have to pre-exist for a workflow to run. The skill creates them on first use.
367
- s/known-issues.md` | `verify-real-deps` | One per repo (post-mortem record) |
368
377
 
369
- All `docs/` files are created **lazily** — they don't have to pre-exist for a workflow to run. The skill creates them on first use.
@@ -1,7 +1,16 @@
1
+ ---
2
+ type: benchmark
3
+ title: "Benchmark Report: <feature>"
4
+ description: <one sentence — what was measured and the headline result>
5
+ tags: [performance, <area>]
6
+ timestamp: YYYY-MM-DD
7
+ ---
8
+
9
+ <!-- Frontmatter is OKF per skills/formats/OKF.md (`type: benchmark`). -->
10
+
1
11
  # Benchmark Report
2
12
 
3
13
  **Feature:** <feature>
4
- **Date:** YYYY-MM-DD
5
14
 
6
15
  ## Environment
7
16
  - **Hardware:** <e.g., Apple M1 Max, 64GB RAM>
@@ -0,0 +1,60 @@
1
+ ---
2
+ name: caveman
3
+ description: Ultra-concise communication utility for token optimization. Use when the user mentions "caveman mode", "be concise", "save tokens", or "ooga booga". Strips articles, pleasantries, and filler words to maximize efficiency. Skip when the user explicitly requests professional or detailed explanations.
4
+ complexity: low
5
+ expected_duration: 5 minutes
6
+ ---
7
+
8
+ # Caveman Mode (Token Optimizer)
9
+
10
+ The discipline of "speaking in tokens" to minimize cost and maximize context window longevity.
11
+
12
+ ## Why this skill exists
13
+
14
+ Standard AI responses are often padded with 30-50% filler words ("Certainly," "I have completed," "As a senior engineer"). In long-running sessions or multi-round orchestration, this "politeness tax" adds up to significant cost and premature context exhaustion.
15
+
16
+ ## When to use
17
+
18
+ - The user explicitly invokes "caveman mode" or "ooga booga".
19
+ - The session is approaching context limits (warning from system).
20
+ - You are operating as a Builder sub-agent where brevity is the primary mandate.
21
+
22
+ ## When to skip
23
+
24
+ - The user asks for a detailed explanation or architectural rationale.
25
+ - You are producing a durable artifact (like a feature doc or ADR) where clarity and professional tone are required.
26
+
27
+ ## Process
28
+
29
+ ### 1. Strip the "Fluff"
30
+
31
+ Remove all conversational filler:
32
+ - "Sure, I can help with that."
33
+ - "I have successfully updated the file."
34
+ - "Let me know if you need anything else."
35
+
36
+ ### 2. Compress the Prose
37
+
38
+ Remove articles (a, an, the) and simplify verbs:
39
+ - **Normal**: "I am updating the user controller to handle the new session timeout logic."
40
+ - **Caveman**: "Update user controller. Handle session timeout."
41
+
42
+ ### 3. Bullet-Only Output
43
+
44
+ Prefer short, punchy bullet points over paragraphs. One line per action.
45
+
46
+ ## Anti-patterns
47
+
48
+ - **Losing Technical Accuracy.** Conciseness must not compromise path names, variable names, or command flags. `Update src/main.go` is good; `Fix file` is bad.
49
+ - **Being Rude.** Caveman mode is about *token density*, not hostility. It is a technical optimization, not a personality shift.
50
+
51
+ ## Pairing with other skills
52
+
53
+ - **[`tdd-rounds`](../tdd-rounds/SKILL.md)** — Excellent for Builder reports.
54
+ - **[`simplify`](../simplify/SKILL.md)** — Use to report the "before/after" of a cleanup pass.
55
+
56
+ ## Done when
57
+
58
+ - The response contains zero conversational filler.
59
+ - All technical details remain accurate and actionable.
60
+ - Token usage for the turn is significantly lower than a standard response.
@@ -9,18 +9,19 @@ expected_duration: 5 minutes
9
9
 
10
10
  Day-to-day discipline that keeps a codebase readable, navigable, and easy to change. Smaller in scope than `design` (which shapes module interfaces) — these are line-level and function-level habits.
11
11
 
12
- Five principles.
12
+ Six principles.
13
13
 
14
14
  1. **Boring code beats clever code** — prefer the obvious solution over the elegant trick.
15
15
  2. **Naming is the primary refactor** — a bad name misleads longer than a bad implementation.
16
16
  3. **YAGNI** — don't build for hypothetical futures.
17
17
  4. **Rule of 3 before extracting** — duplicate twice; extract on the third occurrence, not the second.
18
18
  5. **Locality of behavior** — related code lives together; don't split by category.
19
+ 6. **Comments earn their keep** — default NONE; keep only why-comments tied to an invariant, trade-off, or provenance the next reader would otherwise miss.
19
20
 
20
21
  ## When to use
21
22
 
22
23
  - Writing new code, line by line — keep these in mind as you type.
23
- - Reviewing a PR — these are five common smell categories.
24
+ - Reviewing a PR — these are six common smell categories.
24
25
  - After `tdd` reaches green, during the [`simplify`](../simplify/SKILL.md) sweep — `code-hygiene` is the lens you apply.
25
26
  - When you read code and pause to figure out what it's doing — that pause is a smell.
26
27
 
@@ -67,8 +68,6 @@ The first occurrence is unique. The second might be coincidence. The third is a
67
68
 
68
69
  **Why**: premature abstractions calcify. Once a wrong abstraction exists, callers shape themselves to it, and rewriting becomes expensive. Three concrete copies are cheap; one wrong abstraction is not.
69
70
 
70
- **Smell**: a helper function with one caller, or a base class with one subclass. That's an abstraction in search of a use.
71
-
72
71
  ## Principle 5: Locality of behavior
73
72
 
74
73
  Related code lives close together. Don't split a system by *type of code* (`controllers/`, `services/`, `repositories/`) — split by *responsibility* (`orders/`, `billing/`, `auth/`).
@@ -77,6 +76,14 @@ Related code lives close together. Don't split a system by *type of code* (`cont
77
76
 
78
77
  **Smell**: changing one feature requires editing 5 files in 5 directories. That's a sign the structure separates *type* of code, not *responsibility*. (This is a `improve-codebase-architecture` issue at scale, but at smaller scale you can fix it inline by colocating files.)
79
78
 
79
+ ## Principle 6: Comments earn their keep
80
+
81
+ **The bar:** [`skills/formats/STYLE-comments.md`](../formats/STYLE-comments.md). Apply it *while writing*, not only during the `simplify` sweep.
82
+
83
+ **Default: NONE.** If you're unsure whether a comment earns its line, delete it. Keep only WHY-comments: a constraint, an invariant, a trade-off, or a provenance link to an ADR / round / snapshot — and only if the next reader would otherwise reattempt the rejected alternative.
84
+
85
+ **Delete on sight**: WHAT-comments, "used by X" / "added for Y" caller references, banner dividers, commented-out code, in-function section headers (`// validate`, `// build response`), and docstrings on exports whose contract is obvious from the signature.
86
+
80
87
  ## Done when
81
88
 
82
89
  - Names communicate intent — a stranger reads them and forms the right mental model.
@@ -84,6 +91,7 @@ Related code lives close together. Don't split a system by *type of code* (`cont
84
91
  - No "in case we need it" parameters, classes, or interfaces remain.
85
92
  - Duplications either survived the 2-occurrence test (left as-is) or proved themselves at the 3rd occurrence (extracted).
86
93
  - Related code lives near related code.
94
+ - Every surviving comment names a why, an invariant, a trade-off, or a provenance link. None restates the code.
87
95
 
88
96
  ## Pairing with other skills
89
97
 
@@ -136,4 +136,4 @@ Most of the time `design` is guidance only — the shape lives in the code that
136
136
  - The interface decisions are load-bearing for downstream rounds of `tdd-rounds`.
137
137
  - A `prod-ready` reviewer will need to verify "module map / public-interface signatures / test boundaries" against something explicit (per [prod-ready Section 7](../prod-ready/SKILL.md)).
138
138
 
139
- When captured, save as a sibling to the feature doc: `docs/features/<feature>.design.md`. Skip when the interface is small enough that the code is the design.
139
+ When captured, save as a sibling to the feature doc: `docs/features/<feature>.design.md`, opening with OKF frontmatter (`type: design`) per [`skills/formats/OKF.md`](../formats/OKF.md). Skip when the interface is small enough that the code is the design.
@@ -106,7 +106,9 @@ Once the doc is reviewed and ACs are stable:
106
106
 
107
107
  ## Done when
108
108
 
109
+ - A feature branch (e.g. `feat/<short-name>` or `fix/<short-name>`) is checked out and the contract doc is committed on it, **not on `main`**.
109
110
  - `docs/features/<short-name>.md` exists with all four required sections.
111
+ - The doc opens with OKF frontmatter (`type: feature`) per [`skills/formats/OKF.md`](../formats/OKF.md).
110
112
  - ACs are testable Given / When / Then statements.
111
113
  - Non-Goals is non-empty (or explicitly "none — see scope in Problem").
112
114
  - One reviewer has signed off.
@@ -1,8 +1,20 @@
1
+ ---
2
+ type: feature
3
+ title: <Feature Name>
4
+ description: <one sentence — the user pain this feature solves>
5
+ tags: [<area>]
6
+ timestamp: YYYY-MM-DD
7
+ status: Draft
8
+ owner: <name>
9
+ ---
10
+
11
+ <!-- Frontmatter is OKF per skills/formats/OKF.md. `timestamp` is the canonical date;
12
+ `status`/`owner` mirror the human-facing lines below (OKF models neither). -->
13
+
1
14
  # <Feature Name>
2
15
 
3
16
  **Status:** Draft | Approved | In Progress | Shipped
4
17
  **Owner:** <name — primary author and point of contact for follow-up>
5
- **Date:** YYYY-MM-DD
6
18
 
7
19
  <!--
8
20
  Status values:
@@ -4,18 +4,28 @@ ADRs live in `docs/adr/` and use sequential numbering: `0001-slug.md`, `0002-slu
4
4
 
5
5
  Create the `docs/adr/` directory lazily — only when the first ADR is needed.
6
6
 
7
+ An ADR is a produced doc, so it opens with OKF frontmatter per [`OKF.md`](OKF.md) (`type: adr`).
8
+
7
9
  ## Template
8
10
 
9
11
  ```md
12
+ ---
13
+ type: adr
14
+ title: {Short title of the decision}
15
+ description: {one sentence — what we decided and why}
16
+ tags: [{area}]
17
+ timestamp: YYYY-MM-DD
18
+ status: accepted
19
+ ---
20
+
10
21
  # {Short title of the decision}
11
22
 
12
23
  **Status:** accepted
13
- **Date:** YYYY-MM-DD
14
24
 
15
25
  {1-3 sentences: what's the context, what did we decide, and why.}
16
26
  ```
17
27
 
18
- That's it. An ADR can be a single paragraph plus the two header lines. The value is in recording *that* a decision was made and *why* — not in filling out sections.
28
+ That's it. An ADR can be a single paragraph plus the frontmatter and the `Status` line. The value is in recording *that* a decision was made and *why* — not in filling out sections. The date lives in `timestamp`; don't also keep a `**Date:**` line.
19
29
 
20
30
  ## Optional sections
21
31
 
@@ -1,8 +1,18 @@
1
1
  # CONTEXT.md Format
2
2
 
3
+ `CONTEXT.md` is a produced doc, so it opens with OKF frontmatter per [`OKF.md`](OKF.md) (`type: context`; a `CONTEXT-MAP.md` uses `type: context-map`).
4
+
3
5
  ## Structure
4
6
 
5
7
  ```md
8
+ ---
9
+ type: context
10
+ title: {Context Name}
11
+ description: {one sentence on what this context is and why it exists}
12
+ tags: [{area}]
13
+ timestamp: YYYY-MM-DD
14
+ ---
15
+
6
16
  # {Context Name}
7
17
 
8
18
  {One or two sentence description of what this context is and why it exists.}
@@ -52,6 +62,14 @@ _Avoid_: Client, buyer, account
52
62
  The opening example uses an Ordering/Billing domain to show cross-context structure. For a smaller project a `CONTEXT.md` may be just a handful of terms and no relationships:
53
63
 
54
64
  ```md
65
+ ---
66
+ type: context
67
+ title: Todo App
68
+ description: Vocabulary used across internal/auth and internal/todos.
69
+ tags: [auth, todos]
70
+ timestamp: 2026-05-22
71
+ ---
72
+
55
73
  # Todo App
56
74
 
57
75
  Vocabulary used across `internal/auth` and `internal/todos`.
@@ -85,6 +103,14 @@ An item on a User's personal list — text plus a done flag. Owned by exactly on
85
103
  **Multiple contexts:** A `CONTEXT-MAP.md` at the repo root lists the contexts, where they live, and how they relate to each other:
86
104
 
87
105
  ```md
106
+ ---
107
+ type: context-map
108
+ title: Context Map
109
+ description: Lists the bounded contexts in this repo and how they relate.
110
+ tags: [architecture]
111
+ timestamp: 2026-05-22
112
+ ---
113
+
88
114
  # Context Map
89
115
 
90
116
  ## Contexts
@@ -0,0 +1,82 @@
1
+ # OKF Frontmatter for Produced Docs
2
+
3
+ Every document a skill writes under `docs/` carries [Open Knowledge Format](https://github.com/GoogleCloudPlatform/knowledge-catalog/tree/main/okf) (OKF v0.1) YAML frontmatter. That makes the whole `docs/` tree a consumable OKF **bundle** — a directory of markdown "concept" files any OKF-aware tool, agent, or static server can ingest, with no change to how we author.
4
+
5
+ This is the substrate every doc-producing skill consumes (`feature-doc`, `investigate`, `bootstrap`, `grill-plan`, `bench`, `tdd-rounds`, `verify-real-deps`, …) — the way `STYLE-comments.md` is the substrate for comments. The per-skill templates carry a filled-in frontmatter block; this doc is the contract behind them.
6
+
7
+ > **Why OKF and not our own scheme:** the format is vendor-neutral and additive — the only hard requirement is a non-empty `type`, and consumers preserve unknown keys. We get interop for free without giving up any of our existing structure.
8
+
9
+ ---
10
+
11
+ ## 1. The frontmatter block
12
+
13
+ Every non-reserved `.md` file under `docs/` opens with a YAML frontmatter block:
14
+
15
+ ```yaml
16
+ ---
17
+ type: feature
18
+ title: Distributed State for TDD Rounds
19
+ description: Feature-scoped state replaces the global STATE.md to cut merge conflicts.
20
+ tags: [tdd-rounds, state, architecture]
21
+ timestamp: 2026-05-25
22
+ ---
23
+ ```
24
+
25
+ | Field | OKF status | Rule |
26
+ | --- | --- | --- |
27
+ | `type` | **required** | One value from the vocabulary in §2. Non-empty. This is the only field a bundle is rejected for missing. |
28
+ | `title` | recommended | Human-readable display name. Mirror the `# H1`. Omit only if the filename already says it. |
29
+ | `description` | recommended | One sentence. Reuse the doc's opening sentence — don't invent a second summary. |
30
+ | `tags` | recommended | YAML list of short cross-cutting labels. Skip rather than pad. |
31
+ | `timestamp` | recommended | ISO 8601 date (or datetime) of the last meaningful change. This is the canonical home for the date — do **not** also keep a `**Date:**` bold line. |
32
+ | `resource` | recommended | A URI for the underlying asset. Our docs are abstract concepts, so in practice this is usually **absent** — include it only when the doc fronts a real external resource (a dashboard, a BigQuery table, an API). |
33
+
34
+ **Extension keys** are allowed and encouraged where a doc kind carries status OKF doesn't model. Our kinds keep `status:` (and `owner:` on feature docs) as extension keys *in addition to* the human-facing `**Status:**` / `**Owner:**` bold lines the skills already read. OKF consumers preserve them; our skills keep working.
35
+
36
+ ---
37
+
38
+ ## 2. The `type` vocabulary
39
+
40
+ OKF does not register types centrally — producers pick descriptive, self-explanatory values and consumers tolerate unknowns. These are the values this repo's skills emit:
41
+
42
+ | Doc kind | `type` | Produced by | Lives in |
43
+ | --- | --- | --- | --- |
44
+ | Architecture decision record | `adr` | `bootstrap`, `grill-plan`, `investigate` handoff | `docs/adr/NNNN-slug.md` |
45
+ | Feature contract | `feature` | `feature-doc` | `docs/features/<name>.md` |
46
+ | Module / interface design note | `design` | `design` | `docs/features/<name>.design.md` |
47
+ | Research / options note | `research` | `investigate` | `docs/research/<topic>.md` |
48
+ | Ubiquitous-language map | `context` | `bootstrap`, `grill-plan` | `docs/CONTEXT.md` |
49
+ | Multi-context map | `context-map` | `bootstrap` | `CONTEXT-MAP.md` |
50
+ | Repo conventions | `convention` | `bootstrap` | `docs/CONVENTIONS.md` |
51
+ | Accepted-but-unimplemented tracker | `known-issues` | `tdd-rounds`, `verify-real-deps` | `docs/known-issues.md` |
52
+ | Benchmark report | `benchmark` | `bench` | `docs/bench/<name>.md` |
53
+ | Round / feature state | `state` | `tdd-rounds` | `docs/features/<name>/state/*.md` |
54
+
55
+ Pick the closest existing value before inventing a new one. A new doc kind adds a row here in the same change that first emits it.
56
+
57
+ ---
58
+
59
+ ## 3. Bundle conventions
60
+
61
+ `docs/` is the bundle root. Two filenames are **reserved** by OKF and never used for a concept:
62
+
63
+ - **`index.md`** — a directory listing for progressive disclosure. No frontmatter. Entries are `* [Title](relative-url) — short description`, optionally grouped under `## Section` headings. Add `docs/index.md` once the bundle has more than a couple of files; keep it current as docs are added.
64
+ - **`log.md`** — a date-grouped changelog. Our repo's root **`CHANGELOG.md`** already plays this role (Keep-a-Changelog, newest first); treat it as the bundle's log rather than adding a second file. An OKF consumer tolerates the absence of `log.md`.
65
+
66
+ **Cross-references** between docs are plain markdown links. OKF accepts two forms: **bundle-relative** (begin with `/`, resolved from the bundle root: `/adr/0001-distributed-state.md`) and **relative** (`../known-issues.md`). Bundle-relative is the more move-stable form, but this repo's docs use ordinary **relative** links by convention (they also reach files outside the bundle, like `../skills/formats/OKF.md`), and both are equally valid. A link asserts a *relationship* — the kind (supersedes, depends-on, refines) is carried by the surrounding prose, not the link. Broken links are tolerated, not malformed.
67
+
68
+ **Body:** no required sections. Favor structural markdown (headings, lists, tables, fenced code) over prose — it aids both human reading and agent retrieval. The headings `# Schema`, `# Examples`, `# Citations` carry their conventional OKF meaning when present.
69
+
70
+ ---
71
+
72
+ ## 4. Conformance checklist
73
+
74
+ A produced doc is OKF-conformant when:
75
+
76
+ - [ ] It opens with a parseable YAML frontmatter block.
77
+ - [ ] `type` is present and non-empty, drawn from §2 (or added there in the same change).
78
+ - [ ] `title` mirrors the H1; `description` reuses the opening sentence; the date lives only in `timestamp`.
79
+ - [ ] Reserved filenames (`index.md`, `log.md` / `CHANGELOG.md`) follow §3 and are **not** used for concepts.
80
+ - [ ] Cross-links use bundle-relative (`/…`) or relative paths.
81
+
82
+ This checklist is enforced at the doc-drift audits in `pr-review` (§3e) and `prod-ready` (Section 7) — a produced doc missing `type` is a finding.
@@ -0,0 +1,102 @@
1
+ # Comment Style
2
+
3
+ Codifies the comment discipline for this codebase. New contributors (human or agent) match what's here, rather than re-deriving conventions per package.
4
+
5
+ > **Default: write NO comment.** Add one only when the WHY is non-obvious AND a future reader is likely to make the opposite assumption.
6
+
7
+ The code's identifiers, types, and structure explain the *what*. A comment earns its line only when it captures something the reader cannot recover by reading the next ten lines: a constraint, an invariant, a trade-off, or a pointer to the decision record. If you're unsure whether a comment earns its keep, **delete it** — git history and the next maintainer will be fine.
8
+
9
+ ---
10
+
11
+ ## 1. Three kinds of comment we keep
12
+
13
+ ### 1.1 Package docstring (one per package, only when the design needs it)
14
+
15
+ A package whose design choice or invariant would not be obvious from reading the primary file gets a short docstring block:
16
+ - One-line purpose.
17
+ - One paragraph on the design choice and its rationale.
18
+ - The failure mode or invariant the next reader needs to know.
19
+
20
+ A package that is what it says it is (a thin utility, a generated stub, a glue adapter) does not need a docstring. Don't pad.
21
+
22
+ ### 1.2 Docstrings on exported identifiers (only when the contract is non-obvious from the signature)
23
+
24
+ Skip the docstring on getters, simple constructors, and any function whose name + types already convey the contract. Write one only when:
25
+ - The call is **not** cheap, idempotent, or safe under concurrency, and the next reader would assume it was.
26
+ - The function may be invoked multiple times per request (e.g. retried) and that matters.
27
+ - A parameter or return has non-obvious zero-value or nil semantics (`0 = "unknown"`, `(nil, nil) = "not found"`).
28
+
29
+ When you write one, start with the identifier name (`// Cache stores …`, not `// Stores …`).
30
+
31
+ ### 1.3 Invariant / constraint / trade-off / provenance (only when the alternative would otherwise be reattempted)
32
+
33
+ A comment whose absence would let the next maintainer write the bug, reattempt the rejected alternative, or "fix" the deliberate choice. If the next reader would just say "OK, sure" and move on, the comment is not earning its line.
34
+
35
+ - **Invariant** — `// Zero means 'unknown'` (and re-stated where the bug would bite).
36
+ - **Constraint** — `// Selector must be cheap and side-effect-free; ServeHTTP may invoke Pick multiple times on 429 retry.`
37
+ - **Trade-off** — `// Cold-cache choice: an account whose (pk, model) is not yet in the cache is treated as INELIGIBLE.`
38
+ - **Provenance** — `// Manual SQL instead of ORM — see ADR-007 §"Query shape".`
39
+
40
+ ---
41
+
42
+ ## 2. Six kinds of comment we delete on sight
43
+
44
+ 1. **Restates the code.** `// increment i`, `// return the user`, `// loop over items`.
45
+ 2. **Commented-out code.** Git has it. Delete.
46
+ 3. **"Added for X" / "Used by Y" caller references.** These rot the day someone renames or removes the caller. Use `grep`.
47
+ 4. **Banner / ASCII-art dividers.** `// =====` and `// --- section ---`. Use a function or a file boundary, not a banner.
48
+ 5. **Stale TODO / FIXME / HACK with no owner, ticket, ADR, or date.** Either link it to a decision record or fix it now.
49
+ 6. **Section-header comments inside a function.** `// validate`, `// build response`, `// compute total`. If a function needs internal section headers, extract those sections into named functions — the function name is the comment.
50
+
51
+ ---
52
+
53
+ ## 3. Provenance grammar (canonical forms)
54
+
55
+ When a kept comment cites the project record, use **exactly one** of these forms. Comments that follow the canonical grammar are greppable and stable.
56
+
57
+ | Kind | Canonical form | Examples |
58
+ | -------------------------------------- | ----------------------- | --------------------------------------- |
59
+ | Architectural decision record | `ADR-NNN §SECTION` | `ADR-007 §7`, `ADR-002 §"Routing"` |
60
+ | TDD round | `RN` | `R6`, `R3` |
61
+ | TDD round + acceptance criterion | `RN AC-M` | `R6 AC-3`, `R1 AC-12` |
62
+ | Tagged round + batch within a release | `vX.Y RNbM` | `v0.3 R1b2`, `v0.8 R2b1` |
63
+ | Dated verification | `<kind> YYYY-MM-DD` | `smoke-test 2026-05-09` |
64
+ | Feature state snapshot | `snapshot §SECTION` | `snapshot §"Invariants"` |
65
+
66
+ **Avoid** (normalize to the table above):
67
+ - `Round 6`, `round-six`, `R 6` → `R6`
68
+ - `ADR 007`, `ADR7`, `ADR-7`, `adr-007` → `ADR-007`
69
+ - `AC 3`, `AC3`, `ac-3` → `AC-3`
70
+ - Section anchors: prefer `§7` or `§"Quoted Heading"`; avoid `section 7`, `sec. 7`, `(7)`.
71
+
72
+ ---
73
+
74
+ ## 4. When the comment grows
75
+
76
+ If the explanation needs more than **~6 lines**, the right home is an ADR or a `docs/research/<topic>.md` note. Leave a one-line pointer in the code:
77
+
78
+ ```go
79
+ // Selection rationale: see docs/research/tier-spill.md and ADR-002 §"Routing".
80
+ ```
81
+
82
+ ---
83
+
84
+ ## 5. Test files
85
+
86
+ Non-trivial tests — those with fakes, harnesses, time control, or unusual lifecycle — get a **5–20 line block comment** at the top of the file (or above the harness type) stating:
87
+ - What is **faked** versus real (and why each choice).
88
+ - Why the design (deterministic? avoid `time.Sleep`? exercise a specific retry path?).
89
+ - Which knobs are overridden and to **what value**.
90
+
91
+ Trivial tests get nothing. The test name carries the intent.
92
+
93
+ ---
94
+
95
+ ## 6. Done when
96
+
97
+ Apply this checklist during the [`simplify`](../simplify/SKILL.md) sweep or in code review:
98
+ - [ ] Every surviving comment names a why, invariant, trade-off, or provenance link — none restates the code.
99
+ - [ ] No commented-out code, no `// used by X`, no banner dividers, no orphan TODOs, no in-function section headers.
100
+ - [ ] Every provenance citation matches the canonical grammar in §3.
101
+ - [ ] Docstrings on exported identifiers exist only where the contract isn't obvious from the signature.
102
+ - [ ] Test files with non-trivial harnesses have a strategy preamble; trivial ones do not.
@@ -1,8 +1,20 @@
1
+ ---
2
+ type: research
3
+ title: "Research: <topic>"
4
+ description: <one sentence — the question this note investigates>
5
+ tags: [<area>]
6
+ timestamp: YYYY-MM-DD
7
+ status: Open
8
+ owner: <user>
9
+ ---
10
+
11
+ <!-- Frontmatter is OKF per skills/formats/OKF.md. `timestamp` is the canonical date;
12
+ `status`/`owner` mirror the human-facing lines below (OKF models neither). -->
13
+
1
14
  # Research: <topic>
2
15
 
3
16
  **Status:** Open | Decided | Superseded
4
17
  **Owner:** <user>
5
- **Date:** YYYY-MM-DD
6
18
 
7
19
  <!--
8
20
  Status values:
@@ -87,12 +87,14 @@ For non-surface-changing diffs: walk `prod-ready` Section 3 (defense-in-depth) b
87
87
 
88
88
  #### 3e. Doc-drift audit
89
89
 
90
- This is the second line of defense for `prod-ready` Section 7. Author may have missed it; reviewer catches what's left. Walk these four questions against the diff:
90
+ This is the second line of defense for `prod-ready` Section 7. Author may have missed it; reviewer catches what's left. Walk these questions against the diff:
91
91
 
92
92
  - **New decision with viable alternatives** → does an ADR exist in `docs/adr/` for it? Does it name what it supersedes? If load-bearing, is it referenced from the code?
93
93
  - **New or changed domain term** → has [`docs/CONTEXT.md`](../../docs/CONTEXT.md) been updated? Are `_Avoid_:` aliases listed if there's risk of confusion?
94
94
  - **New / removed package, changed public interface, shifted module boundary** → is the feature's design note (`docs/features/<feature>.design.md`) updated? Module map, file layout, public-interface signatures, test boundaries.
95
95
  - **Changed acceptance criteria** → does the feature doc reflect what was actually built? Silently-dropped or silently-added behavior is the most common drift class — flag and don't accept "we'll fix in a follow-up".
96
+ - **User-visible change** → does `CHANGELOG.md` have an entry under `[Unreleased]`, grouped by `Added / Changed / Fixed / Removed`? Skip only for formatter-only / lint-only / test-only / internal-refactor-with-no-behavior-change / dep-bump-with-no-runtime-impact diffs. Missing entry on a user-visible change = finding.
97
+ - **New or changed produced doc under `docs/`** → does it open with OKF frontmatter carrying a non-empty `type` from [`skills/formats/OKF.md`](../formats/OKF.md) §2? A produced doc with no `type` breaks bundle conformance = finding.
96
98
 
97
99
  If any answer is "no" without `n/a + reason`, that's a finding. Severity:
98
100
  - **Blocker** — the missing doc is load-bearing for the next reader (ADR for a hard-to-reverse decision; CONTEXT.md entry for a term other PRs will use; AC drift hiding behavior).
@@ -100,10 +102,11 @@ If any answer is "no" without `n/a + reason`, that's a finding. Severity:
100
102
 
101
103
  The doc-map is small enough to walk in 2–3 minutes. Skip it and you're trading 3 minutes now for an hour of orientation in 3 months.
102
104
 
103
- #### 3e. Hygiene (line level)
105
+ #### 3f. Hygiene (line level)
104
106
 
105
107
  Apply `code-hygiene` as a lens here, not as a primary phase:
106
108
 
109
+ - **Comment noise**: new WHAT-comments, docstrings on exports whose contract is obvious from the signature, in-function section headers (`// validate`, `// build response`), stale "used by X" references, citation grammar that doesn't match the repo's comment style doc ([`skills/formats/STYLE-comments.md`](../formats/STYLE-comments.md)). Flag as **nits by default**; promote to a suggestion only when cumulative comment noise obscures the diff (signal the author skipped `simplify`).
107
110
  - Names that mislead (boolean returning non-bool, `getX` that mutates, `Manager`/`Helper` suffixes hiding what the thing is).
108
111
  - Cleverness that earns its cost? Or could be boring?
109
112
  - YAGNI — "in case we need it" parameters / interfaces / classes? Strip.
@@ -60,6 +60,8 @@ Implementation lands → docs drift. The natural moment to catch drift is now, n
60
60
  - [ ] **New or changed domain term** → `CONTEXT.md` entry created or updated. Includes `_Avoid_:` aliases if the term is at risk of being confused with an existing one.
61
61
  - [ ] **New/removed package, changed public interface, or shifted module boundary** → the feature's design note (e.g., `docs/features/<feature>.design.md`) updated. Specifically: Module map, File layout, public-interface signatures, Test boundaries.
62
62
  - [ ] **Changed acceptance criteria** → the feature doc reflects what was actually built. Silently-dropped or silently-added behavior is the most common drift class — fix here, don't kick to a follow-up.
63
+ - [ ] **User-visible change** → `CHANGELOG.md` has an entry under `[Unreleased]`, grouped by `Added / Changed / Fixed / Removed`. Skip only if the diff is formatter-only, lint-only, test-only, internal refactor with no behavior change, or a dependency bump with no runtime impact. (Overlaps but is **not identical** to `feature-doc`'s skip list — that one also waives the *doc* for typo fixes and one-line config tweaks. A typo fix can still merit a one-liner here.)
64
+ - [ ] **New or changed doc under `docs/`** → it opens with OKF frontmatter carrying a non-empty `type` from [`skills/formats/OKF.md`](../formats/OKF.md) §2. A produced doc with no `type` breaks the bundle's conformance — fix here.
63
65
 
64
66
  If a doc type isn't relevant to this work, write "n/a" — explicit beats implicit.
65
67
 
@@ -49,7 +49,14 @@ Walk every changed file. Apply each lens in order. Fix what you find inline.
49
49
  - Names that read clearly out of context — would a stranger guess what `result`, `data`, `value` referred to? If not, rename.
50
50
  - Error messages that name the failing input — `"could not parse: <value>"` beats `"parse error"`.
51
51
  - Abstractions that haven't earned their keep — a base class with one subclass, an interface with one implementation. Inline.
52
- - Comments that explain *what* the code does — delete; the code already says it. Keep comments that explain *why* (a constraint, an invariant, a workaround).
52
+ - Comments **default during the sweep is DELETE**:
53
+ - Delete WHAT-comments (the code already says it).
54
+ - Delete docstrings on exports whose contract is obvious from the signature.
55
+ - Delete "used by X" / "added for Y" caller references — these rot; use grep.
56
+ - Delete commented-out code (git has it).
57
+ - Delete banner / ASCII-art dividers and in-function section headers (`// validate`, `// build response`).
58
+ - KEEP only why-comments — constraint, invariant, trade-off, provenance — and only when the next reader would otherwise reattempt the rejected alternative.
59
+ - If a kept comment cites a round / ADR / AC / snapshot, normalize to [`skills/formats/STYLE-comments.md`](../formats/STYLE-comments.md) §3 (`ADR-007 §7`, `R6 AC-3`, `v0.3 R1b2`, `snapshot §"Invariants"`).
53
60
 
54
61
  ### 3. Efficiency — dead code, redundant work, premature defensive checks
55
62
 
@@ -19,6 +19,11 @@ expected_duration: 20 minutes
19
19
  - Trivial getters / setters with no behavior.
20
20
  - Bug whose root cause isn't yet known — run [`debug`](../debug/SKILL.md) first; the reproduction crystallises into the failing test.
21
21
 
22
+ ## Pre-conditions
23
+
24
+ - **Current branch is not `main` / `master`.** If it is, stop and run `git checkout -b feat/<short-name>` (or `fix/...`) before writing the first test. Code lands on a feature branch; `main` receives merges, not commits.
25
+ - A feature doc (`docs/features/<short-name>.md`) exists with testable ACs — or a `debug` reproduction names the root cause.
26
+
22
27
  ## Philosophy
23
28
 
24
29
  Tests verify **behavior through public interfaces**, not implementation details. Code can change entirely; tests shouldn't.
@@ -22,6 +22,7 @@ Distills the pattern of a parent agent driving Builder sub-agents through a feat
22
22
 
23
23
  ## The parent's contract
24
24
 
25
+ - **Dispatch on a feature branch, never `main`.** Verify the current branch before dispatching the first Builder; if it's `main` / `master`, create `feat/<short-name>` first. The whole multi-round delivery lives on one feature branch (or a stack of feature branches), merged to `main` only at the end.
25
26
  - **Plan once.** The plan file lists rounds, each round's ACs, the dependency order, and the skills cadence per round (which rounds need `design`; when to invoke `improve-codebase-architecture` mid-project; when to invoke `prod-ready`).
26
27
  - **Brief per round.** A self-contained brief — the Builder shouldn't need conversation history.
27
28
  - **Briefing Sub-agent**: For complex rounds, invoke a sub-agent to autonomously generate the brief by analyzing `docs/STATE.md`, the `feature-doc`, and the results of the previous round. See `templates/builder-brief.md` for the schema.
@@ -32,6 +33,7 @@ Distills the pattern of a parent agent driving Builder sub-agents through a feat
32
33
 
33
34
  When dispatched for a round, the Builder:
34
35
 
36
+ 0. **Pre-flight.** Verifies the current branch is **not** `main` / `master`. If it is, refuses immediately and returns a blocking report — does not proceed to step 1.
35
37
  1. Reads the brief, the plan file, `docs/STATE.md`, and any ADRs / feature docs the brief cites.
36
38
  2. **Executes the listed skills sequentially in this single invocation.** When a brief says "Skills (in order): design, tdd, simplify" — that means run all three in this run, not return to the parent between them. This rule is non-obvious; the brief template makes it explicit.
37
39
  3. Commits per AC slice (or per behavior slice for refactor rounds), prefix `R<N>:`. **Read [`COMMITS.md`](COMMITS.md) before the first commit** — it captures the seven rules (`R<N>:` prefix, `#<X>` for bug fixes, per-AC slicing, separate simplify-pass commit, separate doc commits, single-commit-with-justification, honest messages) and the message-body shape. The parent reads commits as the review surface; a clean sequence is reviewable one diff at a time, a mono-commit isn't.
@@ -69,7 +71,7 @@ Known follow-ups: <one line>
69
71
  - **Builder stuck (test won't go green / design feels wrong).** Builder reports a *blocking* open question instead of thrashing. Hard rule: **Builder must not silently descope an AC.**
70
72
  - **Concrete escalation signals** (any one fires → stop and surface):
71
73
  - 3 consecutive failed attempts at making the same test green with the same approach.
72
- - 2 design-level questions that the brief + STATE.md + cited ADRs don't answer.
74
+ - 2 design-level questions that the brief + feature state + cited ADRs don't answer.
73
75
  - The Builder finds itself wanting to modify a file in the "must NOT touch" allowlist to make progress.
74
76
  - A new test would require mocking >3 internal collaborators (smell: design is wrong, not the test).
75
77
  - **Parent's response**: shrink scope (split the round), or invoke `design` explicitly with the friction described, or run `grill-plan` if a load-bearing decision is wobbling. Don't push the Builder to keep trying.
@@ -94,3 +96,4 @@ When the final round completes:
94
96
  1. Run `verify-real-deps`. Capture surfaced bugs into `docs/known-issues.md`.
95
97
  2. Iterate fix-rounds until clean, or document deferrals to vN.1 with rationale.
96
98
  3. Tag and publish via whatever release / distribution channel applies.
99
+
@@ -1,3 +1,14 @@
1
+ ---
2
+ type: known-issues
3
+ title: "Known issues — post-vN.0 smoke test findings"
4
+ description: Bugs surfaced by the first end-to-end run against the real upstream.
5
+ tags: [smoke-test, known-issues]
6
+ timestamp: YYYY-MM-DD
7
+ ---
8
+
9
+ <!-- Frontmatter is OKF per skills/formats/OKF.md (`type: known-issues`).
10
+ `timestamp` tracks the last edit; the Discovered line below pins the first run. -->
11
+
1
12
  # Known issues — post-vN.0 smoke test findings
2
13
 
3
14
  **Discovered:** YYYY-MM-DD (first end-to-end run against real <upstream>).