@ai-agent-lead/skills 1.3.0 → 1.4.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.3.0",
3
+ "version": "1.4.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
@@ -25,9 +25,10 @@ Grouped by role. Trigger phrases are in each skill's `description` frontmatter.
25
25
  | `system-design` | Greenfield system architecture — modules, dependency direction, seams | `docs/architecture.md` (system map) | [system-design/](./system-design/) |
26
26
  | `design` | Designing a module or public API before implementation | Guidance only — optional `docs/features/<feature>.design.md` for non-trivial shapes | [design/](./design/) |
27
27
  | `improve-codebase-architecture` | Finding deepening opportunities — turning shallow modules into deep ones | Numbered candidate list, optional ADR / CONTEXT.md updates | [improve-codebase-architecture/](./improve-codebase-architecture/) |
28
- | `code-hygiene` | Line/function-level coding discipline (boring, naming, YAGNI, rule of 3, locality) | Guidance only — applied as a lens during `simplify` and `pr-review` | [code-hygiene/](./code-hygiene/) |
29
28
  | `zoom-out` | User-invoked: ask for higher-level context when unfamiliar with an area | Map of relevant modules and callers in `CONTEXT.md` vocabulary | [zoom-out/](./zoom-out/) |
30
29
 
30
+ The `code-hygiene` line-level lens is no longer a routable skill — it lives at [`formats/CODE-HYGIENE.md`](./formats/CODE-HYGIENE.md) and is applied during `simplify` and `pr-review` §3f.
31
+
31
32
  ### Implementation
32
33
 
33
34
  | Skill | Trigger | Produces | Location |
@@ -41,7 +42,6 @@ Grouped by role. Trigger phrases are in each skill's `description` frontmatter.
41
42
 
42
43
  | Skill | Trigger | Produces | Location |
43
44
  | --- | --- | --- | --- |
44
- | `sync-check` | Before pr-review or after refactor | Terminology/ADR drift report | [sync-check/](./sync-check/) |
45
45
  | `prod-ready` | After tdd green, before merge | Verified pre-merge checklist (incl. doc drift) | [prod-ready/](./prod-ready/) |
46
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/) |
47
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/) |
@@ -55,14 +55,14 @@ Orthogonal axis. The trigger-phrase index above tells you *when* a skill fires;
55
55
  | --- | --- | --- |
56
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. |
57
57
  | **Build** (writes code) | `tdd`, `tdd-rounds`, `simplify` | Diff-producing. Always behind a contract (feature doc + ACs). |
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. |
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. |
58
+ | **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. |
59
+ | **Diagnose** (no code, no doc — just analysis) | `debug`, `zoom-out` | Run *before* a build skill when the input isn't yet clear. |
60
60
  | **Shape** (decides module / topology) | `design`, `system-design`, `improve-codebase-architecture` | Greenfield-module / greenfield-system / brownfield. Same vocabulary ([`LANGUAGE.md`](./LANGUAGE.md)). |
61
- | **Lens** (applied during other skills, not invoked alone) | `code-hygiene`, `caveman` | Principles you carry into any turn to maintain quality or efficiency. |
61
+ | **Lens** (applied during other skills, not invoked alone) | `caveman` skill; `code-hygiene` reference ([`formats/CODE-HYGIENE.md`](./formats/CODE-HYGIENE.md)) | Principles you carry into any turn to maintain quality or efficiency. The line-level lens is a shared reference, not a routable skill. |
62
62
 
63
63
  ## Skill relationship map
64
64
 
65
- The 20 skills + their dependencies. Lateral edges are vocabulary / lens; vertical edges are workflow flow.
65
+ The skill set + its dependencies. Lateral edges are vocabulary / lens; vertical edges are workflow flow.
66
66
 
67
67
  ```
68
68
  ┌─────────────────────────────────────────────┐
@@ -81,7 +81,7 @@ The 20 skills + their dependencies. Lateral edges are vocabulary / lens; vertica
81
81
  │ │ ▲ │ │ prod-ready│
82
82
  │ │ │ │ │ │ │
83
83
  │ └──────────────┘ │ │ ▼ │
84
- │ │ │ sync-check
84
+ │ │ │
85
85
  │ system-design ──► design (per mod) ─┘ │ │ │
86
86
  │ │ │ ▼ │
87
87
  │ ▼ │ pr-review │
@@ -97,24 +97,23 @@ The 20 skills + their dependencies. Lateral edges are vocabulary / lens; vertica
97
97
  │ │ (when bug) (when surface) │
98
98
  │ │
99
99
  │ ┌────────────── LENSES & UTILITIES ──────────────┐ │
100
- │ │ code-hygiene ──► applied during simplify, │ │
101
- │ │ caveman ──► pr-review, any code reading │ │
100
+ │ │ code-hygiene (formats/) -> line-level lens │ │
101
+ │ │ caveman -> token lens, any code reading │ │
102
102
  │ │ │ │
103
- │ │ zoom-out ──► interrupts any workflow, │ │
103
+ │ │ zoom-out -> interrupts any workflow, │ │
104
104
  │ │ maps unfamiliar areas │ │
105
105
  │ └────────────────────────────────────────────────┘ │
106
106
  └──────────────────────────────────────────────────────────────────┘
107
107
  ```
108
108
 
109
- **Seven things the map shows:**
109
+ **Six things the map shows:**
110
110
 
111
- 1. `code-hygiene`, `caveman`, and `zoom-out` are not nodes in any flow — they're lenses / utilities applied across.
111
+ 1. `caveman` and `zoom-out` are not nodes in any flow — they're a lens / utility applied across. The `code-hygiene` line-level lens is the same idea, now a shared reference ([`formats/CODE-HYGIENE.md`](./formats/CODE-HYGIENE.md)) rather than a routable skill.
112
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.
113
113
  3. `tdd-rounds` is the only multi-callee orchestrator — dispatches `design`, `tdd`, `simplify`, `prod-ready`, `verify-real-deps` to Builders.
114
- 4. `pr-review` is the reviewer-side mirror of `prod-ready` — Section 7 doc-drift covered in both.
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.
114
+ 4. `pr-review` is the reviewer-side mirror of `prod-ready` — the Section 7 / §3e doc-drift audit is single-sourced in [`formats/DOC-DRIFT-AUDIT.md`](./formats/DOC-DRIFT-AUDIT.md) (the former `sync-check` skill) and run from both sides.
115
+ 5. `system-design` and `improve-codebase-architecture` are duals same [LANGUAGE.md](./LANGUAGE.md), greenfield vs brownfield.
116
+ 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.
118
117
 
119
118
 
120
119
  ## Workflows
@@ -135,8 +134,11 @@ The skills compose into canonical workflows (greenfield feature, large feature,
135
134
 
136
135
  - [`formats/ADR-FORMAT.md`](./formats/ADR-FORMAT.md) — ADR template, numbering, when-to-write criteria.
137
136
  - [`formats/CONTEXT-FORMAT.md`](./formats/CONTEXT-FORMAT.md) — `CONTEXT.md` structure, single-vs-multi-context layout, minimal example.
137
+ - [`formats/CODE-HYGIENE.md`](./formats/CODE-HYGIENE.md) — the line-level lens (boring code, naming, YAGNI, rule of 3, locality, comments, constants placement). Applied during `simplify` and `pr-review` §3f.
138
+ - [`formats/DOC-DRIFT-AUDIT.md`](./formats/DOC-DRIFT-AUDIT.md) — the terminology / ADR / doc-map audit. Run from `prod-ready` §7 (author), `pr-review` §3e (reviewer), or standalone (the former `sync-check`).
139
+ - [`formats/OKF.md`](./formats/OKF.md) — frontmatter contract for produced `docs/` files. [`formats/STYLE-comments.md`](./formats/STYLE-comments.md) — the comment bar.
138
140
 
139
- Used by `grill-plan`, `improve-codebase-architecture`, `system-design`, `investigate`, and (lazily) `feature-doc`.
141
+ Used by `grill-plan`, `improve-codebase-architecture`, `system-design`, `investigate`, `simplify`, `prod-ready`, `pr-review`, and (lazily) `feature-doc`.
140
142
 
141
143
  ## Conventions
142
144
 
@@ -2,6 +2,8 @@
2
2
 
3
3
  Canonical scaffold for every skill in this set. Copy the body below into a new `<skill-name>/SKILL.md`, fill it in, then prune sections that genuinely don't apply (rather than leaving placeholders).
4
4
 
5
+ **Before you create one:** apply the test in [ADR-0003](../docs/adr/0003-lenses-as-shared-references.md). A discipline applied only *inside* other skills — a lens or diagnostic never invoked on its own — belongs in [`formats/`](formats/) as a shared reference, not a `SKILL.md`. A `SKILL.md` is earned by a routable phase a user or another skill invokes directly.
6
+
5
7
  The order is load-bearing. Claude scans top-to-bottom — `When to use` / `When to skip` should hit early so routing is decided before the reader gets to the body.
6
8
 
7
9
  ## Naming and placement
@@ -28,6 +30,8 @@ The `description` is the routing signal. It should:
28
30
 
29
31
  A `description` that names only the happy path will route falsely. Always name what to skip.
30
32
 
33
+ **Optional frontmatter.** Add `disable-model-invocation: true` for a user-only utility that should never auto-fire (e.g. `zoom-out`); the skill then runs only on explicit invocation. No other keys are read by the harness — `name` and `description` are the whole routing contract. Don't add decorative metadata (`complexity`, `expected_duration`, etc.); it isn't consumed and only drifts.
34
+
31
35
  ## Canonical body shape
32
36
 
33
37
  ```md
@@ -98,7 +102,7 @@ A `description` that names only the happy path will route falsely. Always name w
98
102
 
99
103
  ## Voice and length
100
104
 
101
- - **Body length matches role**, not importance. Teaching skills run long (debug, security-review, tdd). Orchestration / utility / lens skills run short (tdd-rounds, simplify, code-hygiene). Don't pad an orchestration skill to match a teaching skill — it adds noise.
105
+ - **Body length matches role**, not importance. Teaching skills run long (debug, security-review, tdd). Orchestration / utility skills run short (tdd-rounds, simplify, caveman). Don't pad an orchestration skill to match a teaching skill — it adds noise.
102
106
  - **No hedging.** "Sometimes consider maybe doing X" is dead text. Pick a recommendation.
103
107
  - **No corporate voice.** Direct sentences. The reader is a fast-reading senior engineer or an LLM, not an executive.
104
108
  - **Cite paths**: `path:line` or `[link](relative/path.md)`. Don't say "see the auth module"; say `src/auth/session.go:42`.
@@ -13,7 +13,7 @@ If a phrase appears in multiple rows, the disambiguation column names how to cho
13
13
  | "before any non-trivial feature", "let's spec this out", "write a feature doc" | [`feature-doc`](feature-doc/SKILL.md) | Skip for typo / dep bump / pure refactor. |
14
14
  | "grill me on this", "stress-test this plan", "walk me through this", "is this consistent with our model" | [`grill-plan`](grill-plan/SKILL.md) | A plan exists; you want it pressure-tested. |
15
15
  | "benchmark", "performance test", "measure latency", "profile" | [`bench`](bench/SKILL.md) | Performance verification. |
16
- | "is the naming right?", "does this match our glossary?", "audit terminology", "sync check", "context audit" | [`sync-check`](sync-check/SKILL.md) | Before `pr-review` or after refactor. |
16
+ | "is the naming right?", "does this match our glossary?", "audit terminology", "sync check", "context audit" | doc-drift audit ([`formats/DOC-DRIFT-AUDIT.md`](formats/DOC-DRIFT-AUDIT.md)) | The former `sync-check` skill — now a shared reference. Run standalone, or from `prod-ready` §7 / `pr-review` §3e. |
17
17
 
18
18
  ## Design & architecture
19
19
 
@@ -22,7 +22,7 @@ If a phrase appears in multiple rows, the disambiguation column names how to cho
22
22
  | "system architecture", "module boundaries", "service boundaries", "how should I structure this system", "draw the architecture", "topology" | [`system-design`](system-design/SKILL.md) | Greenfield, multi-module. For single-module work → `design`. For reorganising an existing codebase → `improve-codebase-architecture`. |
23
23
  | "how should I structure this", "deep modules", "testability", "API design", "design this module" | [`design`](design/SKILL.md) | Single module / public API, NEW code. For existing code → `improve-codebase-architecture`. |
24
24
  | "improve architecture", "find refactoring opportunities", "consolidate", "deepen these modules", "make this more testable" | [`improve-codebase-architecture`](improve-codebase-architecture/SKILL.md) | EXISTING code, cross-module. For local single-module refactor → `design` or just refactor inline. |
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. |
25
+ | "simpler", "boring", "naming", "YAGNI", "premature abstraction", "over-engineered", "clean this up at line level" | [`code-hygiene`](formats/CODE-HYGIENE.md) lens (via `simplify`) | A shared reference, not a routable skill — applies during `simplify`, `pr-review` §3f, 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
28
  ## Utilities & efficiency
@@ -55,7 +55,7 @@ Some phrases overlap. Pick by the disambiguator:
55
55
 
56
56
  - **"design"** alone — almost always [`design`](design/SKILL.md). If the user means "system design", that phrase routes to [`system-design`](system-design/SKILL.md).
57
57
  - **"refactor"** — [`improve-codebase-architecture`](improve-codebase-architecture/SKILL.md) for cross-module; [`design`](design/SKILL.md) or just inline edits for one-module shape; [`simplify`](simplify/SKILL.md) for end-of-round line-level cleanup.
58
- - **"clean up"** — [`code-hygiene`](code-hygiene/SKILL.md) as a lens; [`simplify`](simplify/SKILL.md) as the end-of-round action; [`improve-codebase-architecture`](improve-codebase-architecture/SKILL.md) if the cleanup is structural.
58
+ - **"clean up"** — the [`code-hygiene`](formats/CODE-HYGIENE.md) lens; [`simplify`](simplify/SKILL.md) as the end-of-round action; [`improve-codebase-architecture`](improve-codebase-architecture/SKILL.md) if the cleanup is structural.
59
59
  - **"test"** — [`tdd`](tdd/SKILL.md) for writing tests against new behavior; [`debug`](debug/SKILL.md) when the test you'd write isn't obvious yet (root cause unclear); [`simplify`](simplify/SKILL.md)'s lens 4 for assessing existing tests.
60
60
  - **"ship"** — [`prod-ready`](prod-ready/SKILL.md) for the gate; [`verify-real-deps`](verify-real-deps/SKILL.md) for tagged release with third-party APIs.
61
61
 
@@ -1,6 +1,6 @@
1
1
  # Workflows
2
2
 
3
- How the 20 skills compose into the common paths users actually walk.
3
+ How the skill set composes 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,7 +32,7 @@ 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)
35
+ │ Audit terminology or ADR compliance │ doc-drift audit (DOC-DRIFT-AUDIT)│
36
36
  ├─────────────────────────────────────┼──────────────────────────────────┤
37
37
  │ Lost in unfamiliar area, mid-task │ /zoom-out (utility, anytime) │
38
38
  └─────────────────────────────────────┴──────────────────────────────────┘
@@ -73,9 +73,7 @@ For a single-package feature with a manageable acceptance-criteria count.
73
73
 
74
74
 
75
75
  prod-ready ──── 7-section checklist
76
-
77
-
78
- sync-check ──── terminology and ADR audit
76
+ (§7 = doc-drift audit: terminology + ADR + doc-map)
79
77
 
80
78
 
81
79
  (optional) pr-review ── self-check against the diff before opening
@@ -334,7 +332,7 @@ A few things that happen across all workflows:
334
332
 
335
333
  3. **`design` doesn't have a workflow of its own** — it's a sub-step inside Workflow 1, 2, and 4. Always paired with `tdd` (or implicitly with `tdd-rounds`). Optional sibling artifact `docs/features/<name>.design.md` when the module shape is non-trivial.
336
334
 
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.
335
+ 4. **`code-hygiene` is a lens, not a phase** — and now a shared reference ([`formats/CODE-HYGIENE.md`](./formats/CODE-HYGIENE.md)), not a routable skill. Apply it during the simplify sweep that follows TDD green, during `pr-review` §3f, or whenever you re-read code and pause to understand it. Especially relevant in Workflows 1, 2, 4, and 5.
338
336
 
339
337
  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.
340
338
 
@@ -352,9 +350,9 @@ A few things that happen across all workflows:
352
350
 
353
351
  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.
354
352
 
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.
353
+ 13. **Bootstrap mode for greenfield repos** is documented in one place — [`bootstrap/BOOTSTRAP.md`](./bootstrap/BOOTSTRAP.md). `feature-doc`, `system-design`, and `improve-codebase-architecture` defer there rather than re-explaining the rules.
356
354
 
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).
355
+ 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`](./formats/CODE-HYGIENE.md) lens to the changed files, plus a test-relevance and telemetry check. Distinct from the `code-hygiene` lens reference itself and from `improve-codebase-architecture` (the structural escalation when simplify finds bigger issues).
358
356
 
359
357
  15. **Artifacts accumulate in `docs/`:**
360
358
 
@@ -1,8 +1,6 @@
1
1
  ---
2
2
  name: bench
3
3
  description: Performance benchmarking discipline. Measures latency, throughput, and records baseline environments. Triggered by phrases like "benchmark", "performance test", "measure latency".
4
- complexity: medium
5
- expected_duration: 30 minutes
6
4
  ---
7
5
 
8
6
  # Benchmark
@@ -1,8 +1,6 @@
1
1
  ---
2
2
  name: bootstrap
3
3
  description: Initializes a greenfield repository. Creates the docs/ directory, the initial CONTEXT.md, and the first ADR. Triggered by phrases like "new project", "initialize", "bootstrap".
4
- complexity: low
5
- expected_duration: 10 minutes
6
4
  ---
7
5
 
8
6
  # Bootstrap
@@ -1,8 +1,6 @@
1
1
  ---
2
2
  name: caveman
3
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
4
  ---
7
5
 
8
6
  # Caveman Mode (Token Optimizer)
@@ -1,8 +1,6 @@
1
1
  ---
2
2
  name: debug
3
3
  description: Disciplined reproduction, isolation, and hypothesis-testing for non-trivial bugs — runs BEFORE `tdd` when the failing assertion isn't yet known. Use when the user reports a bug whose root cause is not obvious from the symptom — triggered by phrases like "it's broken", "this is failing", "intermittent", "flaky", "regression", "not sure why", "production issue", "doesn't work in <env>". Skip for typos, clear stack traces with one-step fixes, or bugs whose fix is obvious from reading the message. Pairs with `tdd` (downstream — the failing test crystallises once the bug is reproduced) and `zoom-out` (upstream, when the area is unfamiliar).
4
- complexity: high
5
- expected_duration: 45 minutes
6
4
  ---
7
5
 
8
6
  # Debug
@@ -4,6 +4,15 @@ The single highest-leverage application of the type system: prevent bad states a
4
4
 
5
5
  The pattern: take a runtime invariant ("a verified user must have a verification timestamp") and encode it in the types. The bad state can no longer be constructed.
6
6
 
7
+ ## This is simplicity, not ceremony — bounded by "boring beats clever"
8
+
9
+ If you prefer simple code, this principle is *on your side*. Constructive typing **deletes** code: the `if (!x) throw` guards repeated across call sites, the `// invariant:` comments that rot. Making a bad state uncompilable is fewer moving parts than defending against it at runtime, not more.
10
+
11
+ The tension people feel is with *defensive* typing — casts, assertions, validate-everywhere, generics for their own sake. That's not this. The rule that keeps the two apart is [`CODE-HYGIENE`](../formats/CODE-HYGIENE.md) Principle 1, applied at the type level:
12
+
13
+ - **Reach for the boring tools first:** sum types / discriminated unions, a narrow domain type where the distinction earns its keep (`Email` vs raw `string`), parse-at-the-boundary then trust, exhaustive matching.
14
+ - **Treat the clever tools as advanced:** phantom types, conditional / mapped-type gymnastics, deep generics, type-level programming. Reach for them only when the invariant is load-bearing *and* the boring encoding can't carry it — the same "is this worth the puzzle?" bar as any clever code. When in doubt, validate at construction (see "Limits" below) instead.
15
+
7
16
  ## Example 1 — Optional fields that should move together
8
17
 
9
18
  WEAK
@@ -34,7 +43,9 @@ type User =
34
43
 
35
44
  Each state names itself. Pattern matching is exhaustive. The fourth (incoherent) state cannot compile.
36
45
 
37
- ## Example 2 — Phantom types for pipeline stages
46
+ ## Example 2 — Phantom types for pipeline stages *(advanced — reach for only when load-bearing)*
47
+
48
+ Phantom types are the "clever" end of the spectrum: powerful, but a tax on every reader. Use this only when the *ordering* invariant is genuinely load-bearing (a security-sensitive sanitize-before-persist flow) and the cost of getting the order wrong is high. For an ordinary pipeline, a sum type plus validation at the boundary is the boring, sufficient choice.
38
49
 
39
50
  When the same data flows through stages (e.g. `RawInput` → `Validated` → `Sanitized`), encode the stage in the type:
40
51
 
@@ -1,8 +1,6 @@
1
1
  ---
2
2
  name: design
3
3
  description: Module and interface design principles — deep modules and testable interfaces. Use when designing a NEW module, class, or public API; deciding what to expose vs hide; reviewing an interface before implementation; or when the user asks "how should I structure this", mentions "deep modules", "testability", or "API design". Use for NEW code shape; for finding deepening opportunities in EXISTING code, use `improve-codebase-architecture`. Skip for trivial glue, getters/setters, or single-call wrappers. Pairs with the tdd skill — good design is what makes TDD pleasant.
4
- complexity: medium
5
- expected_duration: 20 minutes
6
4
  ---
7
5
 
8
6
  # Module and Interface Design
@@ -1,8 +1,6 @@
1
1
  ---
2
2
  name: feature-doc
3
3
  description: One-page contract for a non-trivial feature or bug fix — Problem, User Story, Acceptance Criteria, Non-Goals. The ACs become the test list for `tdd`. Use before any non-trivial feature or bug fix; when the user mentions "spec this out", "write a feature doc", "before any non-trivial feature", or describes a feature without listing ACs. Skip for typo fixes, dependency bumps, or pure refactors. Pairs with `tdd` / `tdd-rounds` (downstream — ACs feed the test list), `investigate` (upstream — when direction itself is unclear), and `grill-plan` (when the chosen plan needs stress-testing against existing model).
4
- complexity: low
5
- expected_duration: 10 minutes
6
4
  ---
7
5
 
8
6
  # Feature Doc
@@ -101,7 +99,7 @@ Once the doc is reviewed and ACs are stable:
101
99
  - **Larger delivery** (≥10 ACs or multi-package) → run [`tdd-rounds`](../tdd-rounds/SKILL.md). The AC list maps to round splits.
102
100
  - **Direction still feels uncertain after writing the doc**:
103
101
  - Project has `CONTEXT.md` and/or ADRs → run [`grill-plan`](../grill-plan/SKILL.md) to stress-test against the existing model.
104
- - No `CONTEXT.md` or ADRs yet → run [`investigate`](../investigate/SKILL.md) to map options first; or, if the plan is chosen but vocabulary is fuzzy, run `grill-plan` in [bootstrap mode](../grill-plan/BOOTSTRAP.md).
102
+ - No `CONTEXT.md` or ADRs yet → run [`investigate`](../investigate/SKILL.md) to map options first; or, if the plan is chosen but vocabulary is fuzzy, run `grill-plan` in [bootstrap mode](../bootstrap/BOOTSTRAP.md).
105
103
  - **Hard-to-reverse / surface-changing** (new auth flow, public API, sensitive data flow) → run [`security-review`](../security-review/SKILL.md) alongside `tdd` / `tdd-rounds`.
106
104
 
107
105
  ## Done when
@@ -1,15 +1,10 @@
1
- ---
2
- name: code-hygiene
3
- description: Day-to-day coding discipline at the line and function level — boring code, naming as primary refactor, YAGNI, rule of 3, locality of behavior. Use when reviewing or writing code, when names feel wrong, when tempted to abstract too early, when a solution looks clever, when the simplify pass after `tdd` runs, or when the user mentions "simpler", "boring", "naming", "YAGNI", "premature abstraction", "over-engineered". Skip for module-level interface design — use `design` instead. Skip for whole-codebase architectural sweeps — use `improve-codebase-architecture`.
4
- complexity: low
5
- expected_duration: 5 minutes
6
- ---
7
-
8
1
  # Code Hygiene
9
2
 
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.
3
+ The line-level and function-level lens this skill set carries into any turn that writes or reads code. Smaller in scope than [`design`](../design/SKILL.md) (which shapes module interfaces) — these are the day-to-day habits that keep a codebase readable, navigable, and easy to change.
4
+
5
+ This is a **shared reference**, not a standalone skill. It is the lens applied *while writing*, during the [`simplify`](../simplify/SKILL.md) sweep after `tdd` reaches green, and during [`pr-review`](../pr-review/SKILL.md) (§3f). Read it once; apply it many times.
11
6
 
12
- Six principles.
7
+ Seven principles.
13
8
 
14
9
  1. **Boring code beats clever code** — prefer the obvious solution over the elegant trick.
15
10
  2. **Naming is the primary refactor** — a bad name misleads longer than a bad implementation.
@@ -17,19 +12,7 @@ Six principles.
17
12
  4. **Rule of 3 before extracting** — duplicate twice; extract on the third occurrence, not the second.
18
13
  5. **Locality of behavior** — related code lives together; don't split by category.
19
14
  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.
20
-
21
- ## When to use
22
-
23
- - Writing new code, line by line — keep these in mind as you type.
24
- - Reviewing a PR — these are six common smell categories.
25
- - After `tdd` reaches green, during the [`simplify`](../simplify/SKILL.md) sweep — `code-hygiene` is the lens you apply.
26
- - When you read code and pause to figure out what it's doing — that pause is a smell.
27
-
28
- ## When to skip
29
-
30
- - Module-level shape (interface, depth, dependencies) — use `design`.
31
- - Whole-codebase sweeps for shallow modules — use `improve-codebase-architecture`.
32
- - The horizontal-vs-vertical TDD failure mode — that's `tdd`'s territory.
15
+ 7. **Constants live where they're used** — narrowest honest scope; no `constants.ts` dumping ground.
33
16
 
34
17
  ## Principle 1: Boring code beats clever code
35
18
 
@@ -74,17 +57,28 @@ Related code lives close together. Don't split a system by *type of code* (`cont
74
57
 
75
58
  **Why**: a new contributor should be able to read one folder and understand one feature, not bounce across five folders to follow one request.
76
59
 
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.)
60
+ **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 an [`improve-codebase-architecture`](../improve-codebase-architecture/SKILL.md) issue at scale, but at smaller scale you can fix it inline by colocating files.)
78
61
 
79
62
  ## Principle 6: Comments earn their keep
80
63
 
81
- **The bar:** [`skills/formats/STYLE-comments.md`](../formats/STYLE-comments.md). Apply it *while writing*, not only during the `simplify` sweep.
64
+ **The bar:** [`STYLE-comments.md`](STYLE-comments.md). Apply it *while writing*, not only during the `simplify` sweep.
82
65
 
83
66
  **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
67
 
85
68
  **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
69
 
87
- ## Done when
70
+ ## Principle 7: Constants live where they're used
71
+
72
+ A constant belongs at the **narrowest honest scope** — next to the code that uses it, not in a far-off catch-all file.
73
+
74
+ - **Default to local.** Define it in the function or module that uses it. Widen the scope only when a *second* caller genuinely shares the same value (rule of 3) or it's a single-source-of-truth domain value (a timeout, a retry limit, a page size, an external URL) that must not diverge between call sites.
75
+ - **Reject the dumping ground.** A `constants.ts` / `config.ts` / `utils.ts` god-file of unrelated constants breaks locality — you bounce across files to understand one feature. Group constants by the *responsibility* they serve, not by the fact that they're all constants.
76
+ - **Name a literal only when its meaning is non-obvious.** `MAX_RETRIES = 3` earns its name; `index + 1` and `slice(0, 1)` don't. A magic number whose *meaning* a reader can't infer is a naming problem (Principle 2); a self-evident one isn't.
77
+ - **Environment-varying values are config from env, not constants in source.** A timeout you tune per environment, an API base URL, a feature flag — those come from the env / secret store ([`prod-ready`](../prod-ready/SKILL.md) §3), not a hardcoded literal. Centralizing constants and hardcoding env values are opposite mistakes; don't make both.
78
+
79
+ **Smell**: a top-level `constants.ts` that grows every feature, imported by half the codebase. Each import is a caller reaching across the codebase for one value that probably belonged next to its single use.
80
+
81
+ ## The bar — clean when
88
82
 
89
83
  - Names communicate intent — a stranger reads them and forms the right mental model.
90
84
  - The clever shortcut is replaced with the obvious version (or its cleverness is justified by a comment naming the constraint).
@@ -92,9 +86,10 @@ Related code lives close together. Don't split a system by *type of code* (`cont
92
86
  - Duplications either survived the 2-occurrence test (left as-is) or proved themselves at the 3rd occurrence (extracted).
93
87
  - Related code lives near related code.
94
88
  - Every surviving comment names a why, an invariant, a trade-off, or a provenance link. None restates the code.
89
+ - Constants sit at their narrowest honest scope — no unrelated-constants dumping ground; env-varying values come from config, not source literals.
95
90
 
96
- ## Pairing with other skills
91
+ ## Scope boundaries
97
92
 
98
- - **`design`** sets module shape; `code-hygiene` polishes within the module. Different scopes; both apply.
99
- - **`tdd`** reaches green; `code-hygiene` is part of the simplify sweep that follows.
100
- - **`improve-codebase-architecture`** finds shallow modules; if the diagnosis is "shallow" but the fix is line-level (rename, inline, delete dead helper), this skill applies. If the fix is structural (deepen the module), that one does.
93
+ - Module-level shape (interface, depth, dependencies) is [`design`](../design/SKILL.md)'s job, not this lens's.
94
+ - Whole-codebase sweeps for shallow modules are [`improve-codebase-architecture`](../improve-codebase-architecture/SKILL.md). If the diagnosis is "shallow" but the fix is line-level (rename, inline, delete dead helper), this lens applies; if the fix is structural (deepen the module), that skill does.
95
+ - Architecture vocabulary (module, interface, depth, seam) comes from [`LANGUAGE.md`](../LANGUAGE.md) don't redefine.
@@ -0,0 +1,55 @@
1
+ # Doc-Drift Audit
2
+
3
+ The single source for one question: *does this change leave the durable docs consistent with the code?* Implementation lands → docs drift. The natural moment to catch the drift is at the merge boundary, not "next sprint".
4
+
5
+ This is a **shared reference**, run from three places with the same checks but a different lens:
6
+
7
+ - [`prod-ready`](../prod-ready/SKILL.md) Section 7 — **author lens.** Walk the checks before opening the PR; fix drift inline now.
8
+ - [`pr-review`](../pr-review/SKILL.md) §3e — **reviewer lens.** Second line of defense; what the author missed, classified by severity.
9
+ - **Standalone** — the old `sync-check` role. Run mid-stream after a significant refactor, or when a name feels "off", to surface terminology and ADR drift before it calcifies. Produces a numbered findings list (see "Standalone report" below).
10
+
11
+ Files don't need to pre-exist — `docs/adr/`, `CONTEXT.md`, design notes are created lazily when the first relevant change appears. If a doc type isn't relevant to this work, write `n/a` — explicit beats implicit.
12
+
13
+ ## The six checks
14
+
15
+ One question per doc type: *did this work change X? Then update Y.*
16
+
17
+ 1. **New decision with viable alternatives** → an ADR exists in `docs/adr/`, names what it supersedes (if anything), and is referenced from code where the decision is load-bearing. See [`ADR-FORMAT.md`](ADR-FORMAT.md).
18
+ 2. **New or changed domain term** → [`docs/CONTEXT.md`](../../docs/CONTEXT.md) entry created or updated, including `_Avoid_:` aliases if the term risks being confused with an existing one. A new term that collides with an existing `_Avoid_:` alias (e.g. "Account" where the glossary says "Customer") is the highest-signal finding here.
19
+ 3. **New/removed package, changed public interface, or shifted module boundary** → the feature's design note (`docs/features/<feature>.design.md`) is updated: module map, file layout, public-interface signatures, test boundaries.
20
+ 4. **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.
21
+ 5. **User-visible change** → `CHANGELOG.md` has 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. (Overlaps but is **not identical** to `feature-doc`'s skip list, which also waives the *doc* for typo fixes and one-line config tweaks. A typo fix can still merit a one-liner here.)
22
+ 6. **New or changed produced doc under `docs/`** → it opens with OKF frontmatter carrying a non-empty `type` from [`OKF.md`](OKF.md) §2. A produced doc with no `type` breaks bundle conformance.
23
+
24
+ ## ADR consistency (read alongside check 1)
25
+
26
+ Beyond "does an ADR exist", check the change against the ones already recorded:
27
+
28
+ - **Direct contradiction** — does the change do something an active ADR explicitly forbids (e.g. uses an ORM where an ADR mandates hand-written SQL)? That's a blocker until the ADR is superseded.
29
+ - **Surprise deviation** — does the change introduce a pattern that *warrants* a new ADR (hard to reverse, surprising, a real trade-off) but doesn't have one?
30
+
31
+ ## Severity
32
+
33
+ - **Blocker** — the missing/contradicted doc is load-bearing for the next reader: an ADR for a hard-to-reverse decision, a `CONTEXT.md` entry for a term other changes will use, an AC drift hiding behavior, or a direct ADR contradiction.
34
+ - **Suggestion** — the doc would help but the diff is self-explanatory in isolation.
35
+
36
+ In the author lens (`prod-ready`) every check resolves to `✓`, `✗ + remediation`, or `n/a + reason` and is fixed before the PR. In the reviewer lens (`pr-review`) an unresolved check without `n/a + reason` is a finding at the severity above.
37
+
38
+ ## Standalone report
39
+
40
+ When run on its own (the former `sync-check`), output a numbered list. For each finding:
41
+
42
+ - **Location** — `file:line` or `ADR-NNNN`.
43
+ - **Severity** — `Blocker` or `Suggestion` per above.
44
+ - **Finding** — e.g. "Code uses 'Account', but `CONTEXT.md` specifies 'Customer'."
45
+ - **Recommended action** — e.g. "Rename to 'Customer', or update `CONTEXT.md` if the concept is genuinely new."
46
+
47
+ If a contradiction is found in *existing* code (not just this diff), escalate to [`grill-plan`](../grill-plan/SKILL.md) to resolve the terminology or architectural mismatch.
48
+
49
+ ## Done when
50
+
51
+ - Every relevant check is `✓`, `✗ + remediation`, or `n/a + reason`.
52
+ - Every `_Avoid_:` alias appearing in the diff has been flagged.
53
+ - Every deviation from an active ADR has been surfaced.
54
+
55
+ 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.
@@ -1,8 +1,6 @@
1
1
  ---
2
2
  name: grill-plan
3
3
  description: Grilling session that stress-tests a chosen plan against the existing domain model, sharpens terminology, and updates documentation (CONTEXT.md, ADRs) inline as decisions crystallise. Use AFTER a direction has been picked (post-`investigate` or post-`feature-doc`), when the user wants to pressure-test the plan — triggered by phrases like "grill me on this", "stress-test this plan", "walk me through this", "is this consistent with our model". Skip if the direction is still being explored — use `investigate` instead.
4
- complexity: medium
5
- expected_duration: 20 minutes
6
4
  ---
7
5
 
8
6
  ## When to use
@@ -98,7 +96,7 @@ If any of the three is missing, skip the ADR. Use the format in [`../formats/ADR
98
96
  ## Pairing with other skills
99
97
 
100
98
  - **[`investigate`](../investigate/SKILL.md)** — runs *before* when direction is unclear. Once a direction is chosen, hand off here.
101
- - **[`sync-check`](../sync-check/SKILL.md)** — escalates here when a terminology collision or ADR contradiction is found in existing code.
99
+ - **[`DOC-DRIFT-AUDIT.md`](../formats/DOC-DRIFT-AUDIT.md)** — the terminology/ADR audit (formerly the `sync-check` skill) escalates here when it finds a terminology collision or ADR contradiction in existing code.
102
100
  - **[`feature-doc`](../feature-doc/SKILL.md)** — runs *before* when a feature doc is the input to grilling, or *after* when grilling refines the plan into a feature doc.
103
101
  - **[`system-design`](../system-design/SKILL.md)** — defers here for hard-to-reverse topology decisions.
104
102
  - **[`improve-codebase-architecture`](../improve-codebase-architecture/SKILL.md)** — borrows this skill's grilling discipline in its own grilling loop.
@@ -1,8 +1,6 @@
1
1
  ---
2
2
  name: improve-codebase-architecture
3
3
  description: Find deepening opportunities in EXISTING code, informed by the domain language in CONTEXT.md and the decisions in docs/adr/. Use when the user wants to improve architecture, find refactoring opportunities, consolidate tightly-coupled modules, or make a codebase more testable and AI-navigable. Use for EXISTING code; for designing the shape of a new module from scratch, use `design`. Skip for single-module local refactors with no cross-module impact — use `design` or just refactor inline.
4
- complexity: high
5
- expected_duration: 45 minutes
6
4
  ---
7
5
 
8
6
  # Improve Codebase Architecture
@@ -20,7 +18,7 @@ Surface architectural friction and propose **deepening opportunities** — refac
20
18
  - Designing the shape of a new module from scratch — use [`design`](../design/SKILL.md).
21
19
  - Greenfield system topology — use [`system-design`](../system-design/SKILL.md).
22
20
  - Single-module local refactor with no cross-module impact — use `design` or refactor inline.
23
- - Line-level cleanup (renames, dead-code removal) — use [`code-hygiene`](../code-hygiene/SKILL.md) + [`simplify`](../simplify/SKILL.md).
21
+ - Line-level cleanup (renames, dead-code removal) — use the [`code-hygiene`](../formats/CODE-HYGIENE.md) lens + [`simplify`](../simplify/SKILL.md).
24
22
 
25
23
  ## Glossary
26
24
 
@@ -1,8 +1,6 @@
1
1
  ---
2
2
  name: investigate
3
3
  description: Use when the user asks for investigation, research, a proposal, or "options" before any code lands; or proactively for non-trivial structural decisions (new dependency, framework choice, API contract change, cross-cutting refactor). Triggered by phrases like "investigate X", "research Y", "give me a proposal", "what are our options", "how would we approach", "let's explore", "should we...". Produces a durable research note in `docs/research/<topic>.md`. Skip for tasks where one obvious approach exists (typo fixes, config tweaks, mechanical refactors). Pairs with `feature-doc` (captures *what* we're building once a direction is chosen) and `grill-plan` (stress-tests a chosen plan).
4
- complexity: medium
5
- expected_duration: 20 minutes
6
4
  ---
7
5
 
8
6
  # Investigation Workflow
@@ -1,8 +1,6 @@
1
1
  ---
2
2
  name: pr-review
3
- description: Discipline for reviewing someone else's pull request — the inverse of `prod-ready` (which is the author's pre-merge gate). Use when the user asks to "review this PR", "look over the diff", "check this change", "give feedback on", or invokes a code-review slash command. Reviews against the linked feature doc / ADRs / domain vocabulary, classifies findings by severity (blocker / suggestion / nit), and returns a structured report. Skip for trivial PRs (typo, dep bump, lint-only) — approve directly. Pairs with `prod-ready` (the author's checklist; the reviewer verifies it landed honestly), `security-review` (escalation when the diff is surface-changing), and `code-hygiene` (the line-level lens applied during the read).
4
- complexity: medium
5
- expected_duration: 20 minutes
3
+ description: Discipline for reviewing someone else's pull request — the inverse of `prod-ready` (which is the author's pre-merge gate). Use when the user asks to "review this PR", "look over the diff", "check this change", "give feedback on", or invokes a code-review slash command. Reviews against the linked feature doc / ADRs / domain vocabulary, classifies findings by severity (blocker / suggestion / nit), and returns a structured report. Skip for trivial PRs (typo, dep bump, lint-only) — approve directly. Pairs with `prod-ready` (the author's checklist; the reviewer verifies it landed honestly), `security-review` (escalation when the diff is surface-changing), and the `code-hygiene` lens (`formats/CODE-HYGIENE.md`, applied line-level during the read).
6
4
  ---
7
5
 
8
6
  # PR Review
@@ -87,24 +85,11 @@ For non-surface-changing diffs: walk `prod-ready` Section 3 (defense-in-depth) b
87
85
 
88
86
  #### 3e. Doc-drift audit
89
87
 
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
-
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
- - **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
- - **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
- - **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.
98
-
99
- If any answer is "no" without `n/a + reason`, that's a finding. Severity:
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).
101
- - **Suggestion** — the doc would help but the diff is self-explanatory in isolation.
102
-
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.
88
+ Walk the six checks in [`skills/formats/DOC-DRIFT-AUDIT.md`](../formats/DOC-DRIFT-AUDIT.md) against the diff — **reviewer lens**. This is the second line of defense for `prod-ready` Section 7: the author may have missed it; you catch what's left. Any check that resolves to "no" without `n/a + reason` is a finding, at the severity that reference defines — **Blocker** for load-bearing drift (a missing ADR for a hard-to-reverse decision, a `CONTEXT.md` entry for a term other PRs will use, AC drift hiding behavior, a direct ADR contradiction), **Suggestion** when the diff is self-explanatory in isolation.
104
89
 
105
90
  #### 3f. Hygiene (line level)
106
91
 
107
- Apply `code-hygiene` as a lens here, not as a primary phase:
92
+ Apply the [`code-hygiene`](../formats/CODE-HYGIENE.md) lens here, not as a primary phase:
108
93
 
109
94
  - **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`).
110
95
  - Names that mislead (boolean returning non-bool, `getX` that mutates, `Manager`/`Helper` suffixes hiding what the thing is).
@@ -186,9 +171,9 @@ The classification (blocker / suggestion / nit) lives in the parent's notes; onl
186
171
  ## Pairing with other skills
187
172
 
188
173
  - **`prod-ready`** is the author's pre-merge checklist. Reviewer verifies it landed.
189
- - **`sync-check`** is the diagnostic context auditor. Reviewer runs it (or verifies it was run) to catch terminology drift and ADR contradictions early.
174
+ - **[`DOC-DRIFT-AUDIT.md`](../formats/DOC-DRIFT-AUDIT.md)** is the shared terminology/ADR/doc-map audit run from §3e the former `sync-check` skill, now single-sourced and shared with `prod-ready` Section 7.
190
175
  - **`security-review`** is the surface-change escalation. Reviewer flags when required.
191
- - **`code-hygiene`** is the line-level lens applied during the read.
176
+ - **[`code-hygiene`](../formats/CODE-HYGIENE.md)** is the line-level lens applied during the read (§3f).
192
177
  - **`grill-plan`** is where load-bearing disagreements go (a new ADR, not a PR comment thread).
193
178
  - **`debug`** if a finding turns out to be "this PR introduces a bug" — switch to debug to characterise it before recommending a change.
194
179
 
@@ -1,8 +1,6 @@
1
1
  ---
2
2
  name: prod-ready
3
3
  description: Pre-merge production-readiness checklist — operational, infrastructure, and consistency checks that tests alone don't surface. Use after `tdd` reaches green; before opening a PR or merging to main; after significant infra changes (new DB, new deployment target, new auth flow); or when the user mentions "shipping", "ready to merge", "before deploy", "production readiness", or "prod-ready". Pairs with the `tdd` skill — tdd proves the feature works; this catches what tests can't see (server timeouts, DB pragmas, error-response consistency, secrets at rest).
4
- complexity: low
5
- expected_duration: 10 minutes
6
4
  ---
7
5
 
8
6
  # Prod-Readiness Checklist
@@ -54,16 +52,16 @@ Walk each section. An item is OK to fail **only if** the feature doc's Notes / N
54
52
 
55
53
  ### 7. Documentation (the doc-map)
56
54
 
57
- Implementation lands → docs drift. The natural moment to catch drift is now, not "next sprint". One question per doc type: *did this work change X? Then update Y.* Files don't need to pre-exist — create `docs/adr/`, `CONTEXT.md`, design notes lazily when the first relevant change appears.
55
+ Implementation lands → docs drift. The natural moment to catch drift is now, not "next sprint". Walk the six checks in [`skills/formats/DOC-DRIFT-AUDIT.md`](../formats/DOC-DRIFT-AUDIT.md) **author lens**: tick each `✓`, `✗ + remediation`, or `n/a + reason`, and fix the drift inline before the PR (don't kick it to a follow-up). Files don't need to pre-exist — create `docs/adr/`, `CONTEXT.md`, design notes lazily when the first relevant change appears.
58
56
 
59
- - [ ] **New decision with viable alternatives** → ADR exists in `docs/adr/`, names what it supersedes (if anything), and is referenced from code where the decision is load-bearing.
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
- - [ ] **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
- - [ ] **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.
57
+ - [ ] ADR for any new decision with viable alternatives (and no active ADR is contradicted).
58
+ - [ ] `CONTEXT.md` updated for any new/changed domain term, with `_Avoid_:` aliases where confusion is likely.
59
+ - [ ] Design note updated for any new/removed package, changed public interface, or shifted module boundary.
60
+ - [ ] Feature doc reflects what was actually built (no silently-dropped or silently-added behavior).
61
+ - [ ] `CHANGELOG.md` `[Unreleased]` entry for any user-visible change.
62
+ - [ ] Every new/changed `docs/` file opens with OKF `type` frontmatter.
65
63
 
66
- If a doc type isn't relevant to this work, write "n/a" explicit beats implicit.
64
+ Per-check definitions, skip lists, and severity live in [`DOC-DRIFT-AUDIT.md`](../formats/DOC-DRIFT-AUDIT.md) — this is the same audit `pr-review` §3e runs from the reviewer side.
67
65
 
68
66
  ## When to skip
69
67
 
@@ -1,8 +1,6 @@
1
1
  ---
2
2
  name: security-review
3
3
  description: Threat-model + control-review pass for surface-changing work — runs alongside `tdd` and as a heavier gate than `prod-ready` Section 3 when the change introduces or alters trust boundaries, authentication, authorization, sensitive data flows, or external surfaces. Use when the user mentions "security review", "threat model", "STRIDE", "auth flow", "permissions", "secrets", "PII", "public API", "external surface", "abuse", "hardening", or whenever a feature doc / PR adds a new entry point, identity flow, or sensitive-data path. Skip for pure-internal refactors with no surface change, dependency bumps that don't change runtime behavior, or doc-only changes. Pairs with `feature-doc` (informs the threat model) and `prod-ready` (which has the lighter operational-security checklist for every change).
4
- complexity: high
5
- expected_duration: 30 minutes
6
4
  ---
7
5
 
8
6
  # Security Review
@@ -1,8 +1,6 @@
1
1
  ---
2
2
  name: simplify
3
- description: Single end-of-round sweep that tightens what `tdd` just left green — review every changed file for reuse, quality, efficiency, and test relevance. Use after `tdd` reaches green and before opening a PR (or before a Builder closes a round in `tdd-rounds`). Triggered by phrases like "simplify pass", "tighten this", "clean up before commit", "end-of-round sweep", or appearing as a step in a Builder brief. Skip for trivial diffs (typo, dep bump, doc-only). Pairs with `tdd` (runs immediately after green), `code-hygiene` (the lens applied during the sweep), and `pr-review` (a self-check after this).
4
- complexity: low
5
- expected_duration: 10 minutes
3
+ description: Single end-of-round sweep that tightens what `tdd` just left green — review every changed file for reuse, quality, efficiency, and test relevance. Use after `tdd` reaches green and before opening a PR (or before a Builder closes a round in `tdd-rounds`). Triggered by phrases like "simplify pass", "tighten this", "clean up before commit", "end-of-round sweep", or appearing as a step in a Builder brief. Skip for trivial diffs (typo, dep bump, doc-only). Pairs with `tdd` (runs immediately after green), the `code-hygiene` lens (`formats/CODE-HYGIENE.md`, applied during the sweep), and `pr-review` (a self-check after this).
6
4
  ---
7
5
 
8
6
  # Simplify
@@ -34,7 +32,7 @@ The simplify pass catches these once, deliberately, before the diff lands. Witho
34
32
  - Slices where the diff is one or two lines and there's nothing to sweep.
35
33
  - During red phase — never refactor while red. See [`tdd/SKILL.md`](../tdd/SKILL.md).
36
34
 
37
- ## The four lenses
35
+ ## The five lenses
38
36
 
39
37
  Walk every changed file. Apply each lens in order. Fix what you find inline.
40
38
 
@@ -49,14 +47,7 @@ Walk every changed file. Apply each lens in order. Fix what you find inline.
49
47
  - Names that read clearly out of context — would a stranger guess what `result`, `data`, `value` referred to? If not, rename.
50
48
  - Error messages that name the failing input — `"could not parse: <value>"` beats `"parse error"`.
51
49
  - Abstractions that haven't earned their keep — a base class with one subclass, an interface with one implementation. Inline.
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"`).
50
+ - Comments — **default during the sweep is DELETE.** Apply [`CODE-HYGIENE.md`](../formats/CODE-HYGIENE.md) Principle 6 and the bar in [`STYLE-comments.md`](../formats/STYLE-comments.md): delete WHAT-comments, obvious-from-signature docstrings, "used by X" caller references, commented-out code, banners, and in-function section headers (`// validate`, `// build response`); keep only why-comments the next reader would otherwise reattempt. Normalize any kept citation (`ADR-007 §7`, `R6 AC-3`, `v0.3 R1b2`) to [`STYLE-comments.md`](../formats/STYLE-comments.md) §3.
60
51
 
61
52
  ### 3. Efficiency — dead code, redundant work, premature defensive checks
62
53
 
@@ -100,7 +91,7 @@ In single-feature flow (no rounds), the sweep can land as a separate commit befo
100
91
  ## Pairing with other skills
101
92
 
102
93
  - **`tdd`** runs first. Simplify runs after green. Never simplify while red.
103
- - **`code-hygiene`** is the lens — its 5 principles (boring code, naming, YAGNI, rule of 3, locality) are what you apply during the sweep. Read it once; apply it many times.
94
+ - **[`code-hygiene`](../formats/CODE-HYGIENE.md)** is the lens — its seven principles (boring code, naming, YAGNI, rule of 3, locality, comments, constants placement) are what you apply during the sweep. Read it once; apply it many times.
104
95
  - **`pr-review`** comes after — a self-check against the diff. Some of the same lenses, applied as a reviewer rather than an author.
105
96
  - **`improve-codebase-architecture`** is the escalation — when simplify surfaces structural issues bigger than a sweep can fix.
106
97
 
@@ -1,8 +1,6 @@
1
1
  ---
2
2
  name: system-design
3
3
  description: System-level architecture for greenfield work — name the modules, define responsibilities, set dependency direction, identify seams. Use when starting a new multi-module system or service from scratch, when defining topology before code lands, or when the user mentions "system architecture", "module boundaries", "service boundaries", "how should I structure this system", "draw the architecture", "topology". Skip for single-module work — use `design` instead. Skip for reorganizing an existing codebase — use `improve-codebase-architecture`. Pairs with `investigate` (comes before, surveying options) and `design` (comes after, shaping each module's interface).
4
- complexity: high
5
- expected_duration: 30 minutes
6
4
  ---
7
5
 
8
6
  # System Design
@@ -38,7 +36,7 @@ Before drawing anything, read what already exists:
38
36
  - `docs/adr/` — decisions already taken.
39
37
  - The feature set — what the system has to do.
40
38
 
41
- If `CONTEXT.md` doesn't exist yet, **resolve the core domain terms first** — defer to [`grill-plan` bootstrap mode](../grill-plan/BOOTSTRAP.md) (single source of truth for the lazy-creation rules). Module names without domain terms are placeholders.
39
+ If `CONTEXT.md` doesn't exist yet, **resolve the core domain terms first** — defer to [`grill-plan` bootstrap mode](../bootstrap/BOOTSTRAP.md) (single source of truth for the lazy-creation rules). Module names without domain terms are placeholders.
42
40
 
43
41
  ### 2. List the modules
44
42
 
@@ -1,8 +1,6 @@
1
1
  ---
2
2
  name: tdd
3
3
  description: Test-driven development with the red-green-refactor loop. Use when implementing a feature, fixing a bug, changing core logic, or when the user mentions "TDD", "test-first", "red-green-refactor", or "integration tests". Skip for trivial UI glue, config changes, or pure docs edits.
4
- complexity: medium
5
- expected_duration: 20 minutes
6
4
  ---
7
5
 
8
6
  # Test-Driven Development
@@ -1,8 +1,6 @@
1
1
  ---
2
2
  name: tdd-rounds
3
3
  description: Multi-round TDD orchestration. Use when delivering a feature larger than one TDD slice — typically 5-15 acceptance criteria across multiple packages — by dispatching Builder sub-agents per round, with the parent maintaining state and verifying. Triggered when the user mentions "drive the sub-agent team", "multi-round TDD", "orchestrate rounds", "Builder agents", or when a plan from `feature-doc` lists more ACs than one agent should reasonably tackle in a single invocation. Pairs with `tdd` (Builders invoke that skill per round) and `prod-ready` (final round before tag).
4
- complexity: high
5
- expected_duration: 1 hour
6
4
  ---
7
5
 
8
6
  # Multi-Round TDD Orchestration
@@ -1,8 +1,6 @@
1
1
  ---
2
2
  name: verify-real-deps
3
3
  description: Pre-tag smoke test against real third-party APIs. Use after `prod-ready` is clean, before tagging vN.0 — the gate that catches wire-shape mismatches that fakes accept but real upstreams reject. Triggered when the user mentions "smoke test", "real API", "live verify", "before tag", or "end-to-end against actual <vendor>". Pairs with `prod-ready` (which catches ops/infra issues tests miss) and `tdd-rounds` (the orchestration that feeds into this gate).
4
- complexity: high
5
- expected_duration: 45 minutes
6
4
  ---
7
5
 
8
6
  # Verify Against Real Dependencies
@@ -2,8 +2,6 @@
2
2
  name: zoom-out
3
3
  description: User-invoked utility — pulls the agent up an abstraction layer when the user is lost in unfamiliar code. Produces a map of relevant modules, callers, and seams in `docs/CONTEXT.md` vocabulary. Use when the user says "I'm lost", "zoom out", "give me higher-level context", "I don't know this area", "what depends on what here", or invokes the slash command. Does not change which workflow the user is in — interrupts to orient, then hands back. Skip when the user already has the map and just needs to read code.
4
4
  disable-model-invocation: true
5
- complexity: low
6
- expected_duration: 5 minutes
7
5
  ---
8
6
 
9
7
  # Zoom Out
@@ -1,69 +0,0 @@
1
- ---
2
- name: sync-check
3
- description: Diagnostic "Context Auditor" that scans code changes for terminology drift against `CONTEXT.md` and architectural contradictions against `docs/adr/`. Use before `pr-review`, after significant refactors, or when names feel "off." Prevents term collisions (e.g., "Account" vs "Customer") and silent deviations from established architectural decisions. Pairs with `grill-plan` (to resolve contradictions found) and `pr-review` (downstream gate).
4
- complexity: low
5
- expected_duration: 10 minutes
6
- ---
7
-
8
- # Sync Check (Context Auditor)
9
-
10
- The discipline of ensuring that the code's implementation matches the project's **Domain Language** and **Architectural History**.
11
-
12
- ## Why this skill exists
13
-
14
- As a codebase grows, it is easy for synonyms ("User", "Account", "Profile") to bleed into the code, diluting the domain model. Similarly, architectural decisions recorded in ADRs are often forgotten by developers (or LLMs) focused on local implementation. `sync-check` is the background auditor that surfaces these drifts before they calcify.
15
-
16
- ## When to use
17
-
18
- - Before starting a `pr-review` (as a primary step).
19
- - After a large refactor round in `tdd-rounds`.
20
- - When you encounter a term in the code that isn't in `CONTEXT.md`.
21
- - When the user asks "is this consistent with our model?" or "are we following our ADRs?"
22
-
23
- ## When to skip
24
-
25
- - Initial project setup (pre-vocabulary).
26
- - Pure doc/comment changes.
27
- - Trivial typo/config fixes.
28
-
29
- ## Process
30
-
31
- ### 1. Identify the Scope
32
-
33
- Map the files changed in the current branch or round to their corresponding domain contexts.
34
- - Use `CONTEXT-MAP.md` if it exists.
35
- - Otherwise, use the root `CONTEXT.md`.
36
-
37
- ### 2. Terminology Audit
38
-
39
- Scan the `git diff` for new or changed public identifiers (classes, functions, types, variables).
40
-
41
- - **Term Collision**: Check if a new term is listed as an `_Avoid_:` alias in `CONTEXT.md`.
42
- - **Fuzzy Mapping**: Check if a term exists in the code but is missing from the glossary.
43
- - **Synonym Drift**: Check if the code uses two different words for the same domain concept.
44
-
45
- ### 3. ADR Consistency Check
46
-
47
- Read the `docs/adr/` entries relevant to the changed packages.
48
-
49
- - **Direct Contradiction**: Does the change perform an action explicitly forbidden by an ADR (e.g., using an ORM when an ADR mandates manual SQL)?
50
- - **Surprise Deviation**: Does the change introduce a pattern that warrants a new ADR (hard to reverse, surprising, real trade-off)?
51
-
52
- ### 4. Report Drifts
53
-
54
- Output a numbered list of findings. For each:
55
- - **Location**: `file:line` or `ADR-NNNN`.
56
- - **Severity**: `Blocker` (direct contradiction/collision) or `Suggestion` (fuzzy mapping).
57
- - **Finding**: "Code uses 'Account', but `CONTEXT.md` specifies 'Customer'."
58
- - **Recommended Action**: "Rename to 'Customer' or update `CONTEXT.md` if the concept is genuinely new."
59
-
60
- ## Done when
61
-
62
- - All changed files have been cross-referenced with the glossary and relevant ADRs.
63
- - Every "Avoid" alias found in the diff has been flagged.
64
- - Every architectural deviation from active ADRs has been surfaced.
65
-
66
- ## Handoff
67
-
68
- - If contradictions are found → run `grill-plan` to resolve the terminology or architectural mismatch.
69
- - If clean → proceed to `pr-review`.