@ai-agent-lead/skills 1.2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-agent-lead/skills",
3
- "version": "1.2.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
@@ -156,4 +156,3 @@ Used by `grill-plan`, `improve-codebase-architecture`, `system-design`, `investi
156
156
  5. Add the skill to **both** index tables above (by trigger phase AND by role).
157
157
  6. Add an entry to [TRIGGERS.md](./TRIGGERS.md) for routing.
158
158
  7. Update [WORKFLOWS.md](./WORKFLOWS.md) if the skill participates in a canonical workflow or as a cross-workflow pattern.
159
- . Update [WORKFLOWS.md](./WORKFLOWS.md) if the skill participates in a canonical workflow or as a cross-workflow pattern.
@@ -356,7 +356,7 @@ A few things that happen across all workflows:
356
356
 
357
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).
358
358
 
359
- 12. **Artifacts accumulate in `docs/`:**
359
+ 15. **Artifacts accumulate in `docs/`:**
360
360
 
361
361
  | Location | Produced by | Type |
362
362
  |---|---|---|
@@ -366,13 +366,12 @@ A few things that happen across all workflows:
366
366
  | `docs/adr/<n>-<topic>.md` | `grill-plan`, `improve-codebase-architecture` | One per architectural decision |
367
367
  | `docs/CONTEXT.md` | `grill-plan`, `improve-codebase-architecture` (inline updates) | One per repo / context |
368
368
  | `docs/architecture.md` | `system-design` | One per system (the system map) |
369
- | `docs/features/<name>/state/snapshot.md` | `tdd-rounds` parent | Living snapshot per feature |
370
- | `docs/features/<name>/state/rounds/*.md` | `tdd-rounds` Builder | Immutable round logs |
371
- | `docs/STATE.md` | `tdd-rounds` parent | Global manifest (index only) |
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. |
372
372
  | `docs/security/<feature>.md` | `security-review` (high-stakes only) | One per surface-changing feature where a feature-doc section isn't enough |
373
373
  | `docs/benchmarks/<feature>.md` | `bench` | One per performance-critical feature |
374
- | `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. |
375
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.
376
- s/known-issues.md` | `verify-real-deps` | One per repo (post-mortem record) |
377
377
 
378
- 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>
@@ -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
 
@@ -66,11 +67,7 @@ Duplicate twice; extract on the third occurrence — not the second.
66
67
  The first occurrence is unique. The second might be coincidence. The third is a pattern. Extracting at two reveals only one axis of variation; extracting at three reveals the *real* axis.
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
- 5. **Locality of behavior** — related code lives together; don't split by category.
70
- 6. **Comments earn their keep** — default to none. Keep only WHY-comments: a constraint, an invariant, a trade-off, or a provenance link to an ADR / round / snapshot.
71
70
 
72
- ## When to use
73
- ...
74
71
  ## Principle 5: Locality of behavior
75
72
 
76
73
  Related code lives close together. Don't split a system by *type of code* (`controllers/`, `services/`, `repositories/`) — split by *responsibility* (`orders/`, `billing/`, `auth/`).
@@ -81,15 +78,11 @@ Related code lives close together. Don't split a system by *type of code* (`cont
81
78
 
82
79
  ## Principle 6: Comments earn their keep
83
80
 
84
- Default to none. Keep only WHY-comments: a constraint, an invariant, a trade-off, or a provenance link to an ADR / round / snapshot. Delete WHAT-comments, "used by X" / "added for Y" caller references, banner dividers, and commented-out code on sight.
81
+ **The bar:** [`skills/formats/STYLE-comments.md`](../formats/STYLE-comments.md). Apply it *while writing*, not only during the `simplify` sweep.
85
82
 
86
- **Smells**:
87
- - A comment that restates the next line of code.
88
- - A comment naming a caller — that reference rots the moment someone renames or removes the caller. Use `grep`.
89
- - A TODO / FIXME / HACK with no owner, ticket, ADR, or date.
90
- - Commented-out code "in case we need it again". Git has it.
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.
91
84
 
92
- **Project-specific conventions** (package docstrings, provenance grammar) live in the repo's comment style doc usually [`skills/formats/STYLE-comments.md`](../formats/STYLE-comments.md).
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.
93
86
 
94
87
  ## Done when
95
88
 
@@ -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.
@@ -1,59 +1,58 @@
1
1
  # Comment Style
2
2
 
3
- Codifies the comment discipline for this codebase. New contributors (human or agent) should match what's here, and what's already in the code, rather than re-deriving conventions per package.
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
4
 
5
- > Default: write **no** comment. Add one only when the WHY is non-obvious.
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
6
 
7
- The code's identifiers, types, and structure already 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, a workaround, or a pointer to the decision record.
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
8
 
9
9
  ---
10
10
 
11
- ## 1. Five kinds of comment we keep
11
+ ## 1. Three kinds of comment we keep
12
12
 
13
- ### 1.1 Package docstring (required, one per package)
13
+ ### 1.1 Package docstring (one per package, only when the design needs it)
14
14
 
15
- Every package starts with a multi-paragraph docstring block in its primary file.
16
-
17
- Shape:
15
+ A package whose design choice or invariant would not be obvious from reading the primary file gets a short docstring block:
18
16
  - One-line purpose.
19
17
  - One paragraph on the design choice and its rationale.
20
- - Round / ADR provenance for major decisions.
21
18
  - The failure mode or invariant the next reader needs to know.
22
19
 
23
- ### 1.2 Docstrings on every exported identifier (required)
24
-
25
- - Starts with the identifier name (`// Cache stores …`, not `// Stores …`).
26
- - Interface methods state the **contract**, not just the action: is the call cheap, idempotent, safe under concurrency, called once per request or many times?
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.
27
21
 
28
- ### 1.3 Invariant / constraint comments (encouraged)
22
+ ### 1.2 Docstrings on exported identifiers (only when the contract is non-obvious from the signature)
29
23
 
30
- A comment that catches a bug the next maintainer would otherwise write.
31
- - `// Zero means 'unknown'` (and re-stated where the bug would bite).
32
- - `// Selector must be cheap and side-effect-free; ServeHTTP may invoke Pick multiple times on 429 retry.`
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"`).
33
28
 
34
- ### 1.4 Trade-off comments (encouraged)
29
+ When you write one, start with the identifier name (`// Cache stores …`, not `// Stores …`).
35
30
 
36
- Name the alternative considered and why it lost. Cite the failure mode if the choice has one.
31
+ ### 1.3 Invariant / constraint / trade-off / provenance (only when the alternative would otherwise be reattempted)
37
32
 
38
- ### 1.5 Provenance comments (use the grammar in §3)
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.
39
34
 
40
- Anchor non-obvious behavior to its decision record (ADR, round, AC, snapshot).
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".`
41
39
 
42
40
  ---
43
41
 
44
- ## 2. Five kinds of comment we delete on sight
42
+ ## 2. Six kinds of comment we delete on sight
45
43
 
46
- 1. **Restates the code.** `// increment i`, `// return the user`, `// loop over items`. The code already says it.
44
+ 1. **Restates the code.** `// increment i`, `// return the user`, `// loop over items`.
47
45
  2. **Commented-out code.** Git has it. Delete.
48
- 3. **"Added for X" / "Used by Y" caller references.** These rot the day someone renames or removes the caller. Use `grep` instead.
46
+ 3. **"Added for X" / "Used by Y" caller references.** These rot the day someone renames or removes the caller. Use `grep`.
49
47
  4. **Banner / ASCII-art dividers.** `// =====` and `// --- section ---`. Use a function or a file boundary, not a banner.
50
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.
51
50
 
52
51
  ---
53
52
 
54
53
  ## 3. Provenance grammar (canonical forms)
55
54
 
56
- When a comment cites the project record, use **exactly one** of these forms. Comments that follow the canonical grammar are greppable and stable.
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.
57
56
 
58
57
  | Kind | Canonical form | Examples |
59
58
  | -------------------------------------- | ----------------------- | --------------------------------------- |
@@ -82,32 +81,22 @@ If the explanation needs more than **~6 lines**, the right home is an ADR or a `
82
81
 
83
82
  ---
84
83
 
85
- ## 5. "Documented for the next reader" framing
86
-
87
- When a comment exists because a future reader is **likely to make the opposite assumption**, say so explicitly:
88
-
89
- ```go
90
- // Cold-cache choice (documented for the next reader): an account whose
91
- // (pk, model) is not yet in the cache is treated as INELIGIBLE …
92
- ```
93
-
94
- ---
95
-
96
- ## 6. Test files
84
+ ## 5. Test files
97
85
 
98
- Non-trivial tests — those with fakes, harnesses, time control, channel-driven ceremonies, or unusual lifecycle — get a **5–20 line block comment at the top** of the file (or above the harness type) stating:
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:
99
87
  - What is **faked** versus real (and why each choice).
100
88
  - Why the design (deterministic? avoid `time.Sleep`? exercise a specific retry path?).
101
- - Which knobs are overridden for the test and to **what value**.
89
+ - Which knobs are overridden and to **what value**.
90
+
91
+ Trivial tests get nothing. The test name carries the intent.
102
92
 
103
93
  ---
104
94
 
105
- ## 7. Done when
95
+ ## 6. Done when
106
96
 
107
97
  Apply this checklist during the [`simplify`](../simplify/SKILL.md) sweep or in code review:
108
- - [ ] Every package has a docstring matching §1.1.
109
- - [ ] Every exported identifier has a docstring starting with its name.
110
- - [ ] Every comment that survived the sweep is a why, an invariant, a trade-off, or a provenance link — none restates the code.
111
- - [ ] No commented-out code, no `// used by X`, no banner dividers, no orphan TODOs.
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.
112
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.
113
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,11 +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
 
107
- - **Comment churn**: new WHAT-comments, 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)). These are nits individually; in aggregate they're a signal the author didn't run `simplify`. Flag as suggestions, not blockers.
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`).
108
110
  - Names that mislead (boolean returning non-bool, `getX` that mutates, `Manager`/`Helper` suffixes hiding what the thing is).
109
111
  - Cleverness that earns its cost? Or could be boring?
110
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,13 +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:
52
+ - Comments — **default during the sweep is DELETE**:
53
53
  - Delete WHAT-comments (the code already says it).
54
+ - Delete docstrings on exports whose contract is obvious from the signature.
54
55
  - Delete "used by X" / "added for Y" caller references — these rot; use grep.
55
56
  - Delete commented-out code (git has it).
56
- - Delete banner / ASCII-art dividers.
57
- - KEEP why-comments: constraint, invariant, trade-off, provenance.
58
- - If a kept comment cites a round / ADR / AC / snapshot, normalize to the project grammar in [`skills/formats/STYLE-comments.md`](../formats/STYLE-comments.md) (§3 `ADR-007 §7`, `R6 AC-3`, `v0.3 R1b2`, `snapshot §"Invariants"`).
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"`).
59
60
 
60
61
  ### 3. Efficiency — dead code, redundant work, premature defensive checks
61
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.
@@ -94,16 +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.
97
- hape the Builder returns.
98
99
 
99
- ## Supporting docs
100
-
101
- - [`COMMITS.md`](COMMITS.md) — commit cadence and message style (per-AC slicing, `R<N>:` prefix, when single-commit is OK, honesty rule). Builders read this before the first commit.
102
-
103
- ## Handoff
104
-
105
- When the final round completes:
106
-
107
- 1. Run `verify-real-deps`. Capture surfaced bugs into `docs/known-issues.md`.
108
- 2. Iterate fix-rounds until clean, or document deferrals to vN.1 with rationale.
109
- 3. Tag and publish via whatever release / distribution channel applies.
@@ -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>).