@ai-agent-lead/skills 1.2.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 +1 -1
- package/skills/README.md +19 -18
- package/skills/SKILL-TEMPLATE.md +5 -1
- package/skills/TRIGGERS.md +3 -3
- package/skills/WORKFLOWS.md +12 -15
- package/skills/bench/SKILL.md +0 -2
- package/skills/bench/templates/benchmark-report.md +10 -1
- package/skills/bootstrap/SKILL.md +0 -2
- package/skills/caveman/SKILL.md +0 -2
- package/skills/debug/SKILL.md +0 -2
- package/skills/design/ILLEGAL-STATES.md +12 -1
- package/skills/design/SKILL.md +1 -3
- package/skills/feature-doc/SKILL.md +3 -3
- package/skills/feature-doc/templates/feature-template.md +13 -1
- package/skills/formats/ADR-FORMAT.md +12 -2
- package/skills/{code-hygiene/SKILL.md → formats/CODE-HYGIENE.md} +27 -39
- package/skills/formats/CONTEXT-FORMAT.md +26 -0
- package/skills/formats/DOC-DRIFT-AUDIT.md +55 -0
- package/skills/formats/OKF.md +82 -0
- package/skills/formats/STYLE-comments.md +33 -44
- package/skills/grill-plan/SKILL.md +1 -3
- package/skills/improve-codebase-architecture/SKILL.md +1 -3
- package/skills/investigate/SKILL.md +0 -2
- package/skills/investigate/templates/research-note.md +13 -1
- package/skills/pr-review/SKILL.md +7 -20
- package/skills/prod-ready/SKILL.md +8 -8
- package/skills/security-review/SKILL.md +0 -2
- package/skills/simplify/SKILL.md +4 -12
- package/skills/system-design/SKILL.md +1 -3
- package/skills/tdd/SKILL.md +5 -2
- package/skills/tdd-rounds/SKILL.md +2 -14
- package/skills/verify-real-deps/SKILL.md +0 -2
- package/skills/verify-real-deps/templates/known-issues.md +11 -0
- package/skills/zoom-out/SKILL.md +0 -2
- package/skills/sync-check/SKILL.md +0 -69
package/package.json
CHANGED
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
|
|
59
|
-
| **Diagnose** (no code, no doc — just analysis) | `debug`, `zoom-out
|
|
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
|
|
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
|
|
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
|
-
│ │ │
|
|
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
|
|
101
|
-
│ │ caveman
|
|
100
|
+
│ │ code-hygiene (formats/) -> line-level lens │ │
|
|
101
|
+
│ │ caveman -> token lens, any code reading │ │
|
|
102
102
|
│ │ │ │
|
|
103
|
-
│ │ zoom-out
|
|
103
|
+
│ │ zoom-out -> interrupts any workflow, │ │
|
|
104
104
|
│ │ maps unfamiliar areas │ │
|
|
105
105
|
│ └────────────────────────────────────────────────┘ │
|
|
106
106
|
└──────────────────────────────────────────────────────────────────┘
|
|
107
107
|
```
|
|
108
108
|
|
|
109
|
-
**
|
|
109
|
+
**Six things the map shows:**
|
|
110
110
|
|
|
111
|
-
1. `
|
|
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
|
|
115
|
-
5. `
|
|
116
|
-
6.
|
|
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
|
|
|
@@ -156,4 +158,3 @@ Used by `grill-plan`, `improve-codebase-architecture`, `system-design`, `investi
|
|
|
156
158
|
5. Add the skill to **both** index tables above (by trigger phase AND by role).
|
|
157
159
|
6. Add an entry to [TRIGGERS.md](./TRIGGERS.md) for routing.
|
|
158
160
|
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.
|
package/skills/SKILL-TEMPLATE.md
CHANGED
|
@@ -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
|
|
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`.
|
package/skills/TRIGGERS.md
CHANGED
|
@@ -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" | [`
|
|
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`](
|
|
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`](
|
|
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
|
|
package/skills/WORKFLOWS.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Workflows
|
|
2
2
|
|
|
3
|
-
How the
|
|
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 │
|
|
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
|
|
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,11 +350,11 @@ 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 — [`
|
|
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`
|
|
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
|
|
|
361
359
|
| Location | Produced by | Type |
|
|
362
360
|
|---|---|---|
|
|
@@ -366,13 +364,12 @@ A few things that happen across all workflows:
|
|
|
366
364
|
| `docs/adr/<n>-<topic>.md` | `grill-plan`, `improve-codebase-architecture` | One per architectural decision |
|
|
367
365
|
| `docs/CONTEXT.md` | `grill-plan`, `improve-codebase-architecture` (inline updates) | One per repo / context |
|
|
368
366
|
| `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 |
|
|
367
|
+
| `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) |
|
|
368
|
+
| `docs/features/<name>/state/rounds/*.md` | `tdd-rounds` Builder | Immutable round logs (target end-state per ADR-0001) |
|
|
369
|
+
| `docs/STATE.md` | `tdd-rounds` parent | Currently the single running summary; ADR-0001 demotes it to a global manifest after migration. |
|
|
372
370
|
| `docs/security/<feature>.md` | `security-review` (high-stakes only) | One per surface-changing feature where a feature-doc section isn't enough |
|
|
373
371
|
| `docs/benchmarks/<feature>.md` | `bench` | One per performance-critical feature |
|
|
374
|
-
| `docs/known-issues.md` | `verify-real-deps` | One per repo (post-mortem record) |
|
|
372
|
+
| `docs/known-issues.md` | `verify-real-deps` | One per repo (post-mortem record); also holds follow-up tracking for accepted-but-unimplemented ADRs. |
|
|
373
|
+
| `CHANGELOG.md` | `prod-ready` Section 7 | One per repo; `[Unreleased]` accumulates between releases. |
|
|
375
374
|
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
375
|
|
|
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.
|
package/skills/bench/SKILL.md
CHANGED
|
@@ -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,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>
|
|
@@ -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
|
package/skills/caveman/SKILL.md
CHANGED
|
@@ -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)
|
package/skills/debug/SKILL.md
CHANGED
|
@@ -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
|
|
package/skills/design/SKILL.md
CHANGED
|
@@ -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
|
|
@@ -136,4 +134,4 @@ Most of the time `design` is guidance only — the shape lives in the code that
|
|
|
136
134
|
- The interface decisions are load-bearing for downstream rounds of `tdd-rounds`.
|
|
137
135
|
- 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
136
|
|
|
139
|
-
When captured, save as a sibling to the feature doc: `docs/features/<feature>.design.md
|
|
137
|
+
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.
|
|
@@ -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,12 +99,14 @@ 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](../
|
|
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
|
|
108
106
|
|
|
107
|
+
- 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
108
|
- `docs/features/<short-name>.md` exists with all four required sections.
|
|
109
|
+
- The doc opens with OKF frontmatter (`type: feature`) per [`skills/formats/OKF.md`](../formats/OKF.md).
|
|
110
110
|
- ACs are testable Given / When / Then statements.
|
|
111
111
|
- Non-Goals is non-empty (or explicitly "none — see scope in Problem").
|
|
112
112
|
- 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
|
|
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,34 +1,18 @@
|
|
|
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
|
-
|
|
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
|
-
|
|
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.
|
|
16
11
|
3. **YAGNI** — don't build for hypothetical futures.
|
|
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
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
- Writing new code, line by line — keep these in mind as you type.
|
|
23
|
-
- Reviewing a PR — these are five common smell categories.
|
|
24
|
-
- After `tdd` reaches green, during the [`simplify`](../simplify/SKILL.md) sweep — `code-hygiene` is the lens you apply.
|
|
25
|
-
- When you read code and pause to figure out what it's doing — that pause is a smell.
|
|
26
|
-
|
|
27
|
-
## When to skip
|
|
28
|
-
|
|
29
|
-
- Module-level shape (interface, depth, dependencies) — use `design`.
|
|
30
|
-
- Whole-codebase sweeps for shallow modules — use `improve-codebase-architecture`.
|
|
31
|
-
- The horizontal-vs-vertical TDD failure mode — that's `tdd`'s territory.
|
|
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.
|
|
15
|
+
7. **Constants live where they're used** — narrowest honest scope; no `constants.ts` dumping ground.
|
|
32
16
|
|
|
33
17
|
## Principle 1: Boring code beats clever code
|
|
34
18
|
|
|
@@ -66,32 +50,35 @@ Duplicate twice; extract on the third occurrence — not the second.
|
|
|
66
50
|
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
51
|
|
|
68
52
|
**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
53
|
|
|
72
|
-
## When to use
|
|
73
|
-
...
|
|
74
54
|
## Principle 5: Locality of behavior
|
|
75
55
|
|
|
76
56
|
Related code lives close together. Don't split a system by *type of code* (`controllers/`, `services/`, `repositories/`) — split by *responsibility* (`orders/`, `billing/`, `auth/`).
|
|
77
57
|
|
|
78
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.
|
|
79
59
|
|
|
80
|
-
**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
|
|
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.)
|
|
81
61
|
|
|
82
62
|
## Principle 6: Comments earn their keep
|
|
83
63
|
|
|
84
|
-
|
|
64
|
+
**The bar:** [`STYLE-comments.md`](STYLE-comments.md). Apply it *while writing*, not only during the `simplify` sweep.
|
|
85
65
|
|
|
86
|
-
**
|
|
87
|
-
|
|
88
|
-
-
|
|
89
|
-
|
|
90
|
-
|
|
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.
|
|
67
|
+
|
|
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.
|
|
69
|
+
|
|
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.
|
|
91
78
|
|
|
92
|
-
**
|
|
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.
|
|
93
80
|
|
|
94
|
-
##
|
|
81
|
+
## The bar — clean when
|
|
95
82
|
|
|
96
83
|
- Names communicate intent — a stranger reads them and forms the right mental model.
|
|
97
84
|
- The clever shortcut is replaced with the obvious version (or its cleverness is justified by a comment naming the constraint).
|
|
@@ -99,9 +86,10 @@ Default to none. Keep only WHY-comments: a constraint, an invariant, a trade-off
|
|
|
99
86
|
- Duplications either survived the 2-occurrence test (left as-is) or proved themselves at the 3rd occurrence (extracted).
|
|
100
87
|
- Related code lives near related code.
|
|
101
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.
|
|
102
90
|
|
|
103
|
-
##
|
|
91
|
+
## Scope boundaries
|
|
104
92
|
|
|
105
|
-
-
|
|
106
|
-
-
|
|
107
|
-
-
|
|
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.
|
|
@@ -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
|