@nurix/etna 0.19.66 → 0.19.68
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/bin/etna.js +10 -1
- package/data/harness-index.json +1 -5
- package/data/harnesses/code/CLAUDE.md +2 -0
- package/data/harnesses/code/agents/maintenance.md +4 -1
- package/data/harnesses/code/harness.json +7 -2
- package/data/harnesses/code/hooks/awareness.mjs +69 -0
- package/data/harnesses/code/hooks/compliance.mjs +2 -14
- package/data/harnesses/code/hooks/lib/approved.mjs +30 -0
- package/data/harnesses/code/hooks/lib/frozen.mjs +3 -0
- package/data/harnesses/code/hooks/lib/ownership.mjs +3 -1
- package/data/harnesses/code/skills/documentation/references/frontmatter.md +1 -1
- package/data/harnesses/code/skills/documentation/scripts/doc-lint.mjs +1 -1
- package/data/harnesses/code/skills/documentation/templates/Readme.md +2 -0
- package/data/harnesses/code/skills/documentation/templates/structure.md +1 -0
- package/data/harnesses/delivery/agents/maintenance.md +4 -1
- package/data/harnesses/delivery/harness.json +2 -2
- package/data/harnesses/delivery/skills/documentation/references/frontmatter.md +1 -1
- package/data/harnesses/delivery/skills/documentation/scripts/doc-lint.mjs +1 -1
- package/data/harnesses/delivery/skills/documentation/templates/Readme.md +2 -0
- package/data/harnesses/delivery/skills/documentation/templates/structure.md +1 -0
- package/data/harnesses/etna/agents/maintenance.md +4 -1
- package/data/harnesses/etna/harness.json +2 -2
- package/data/harnesses/etna/skills/documentation/references/frontmatter.md +1 -1
- package/data/harnesses/etna/skills/documentation/scripts/doc-lint.mjs +1 -1
- package/data/harnesses/etna/skills/documentation/templates/Readme.md +2 -0
- package/data/harnesses/etna/skills/documentation/templates/structure.md +1 -0
- package/lib/install/materialize.mjs +51 -57
- package/package.json +2 -2
- package/data/harnesses/apollo/.mcp.json +0 -8
- package/data/harnesses/apollo/.prettierignore +0 -29
- package/data/harnesses/apollo/.prettierrc.json +0 -3
- package/data/harnesses/apollo/.vscode/settings.json +0 -19
- package/data/harnesses/apollo/CLAUDE.md +0 -162
- package/data/harnesses/apollo/agents/bookkeeper.md +0 -28
- package/data/harnesses/apollo/agents/brainstorm.md +0 -144
- package/data/harnesses/apollo/agents/change-review.md +0 -251
- package/data/harnesses/apollo/agents/lld-mode.md +0 -58
- package/data/harnesses/apollo/agents/maintenance.md +0 -234
- package/data/harnesses/apollo/agents/performance-review.md +0 -223
- package/data/harnesses/apollo/agents/retro.md +0 -46
- package/data/harnesses/apollo/codex/agents/bookkeeper.toml +0 -26
- package/data/harnesses/apollo/codex/agents/brainstorm.toml +0 -142
- package/data/harnesses/apollo/codex/agents/change-review.toml +0 -249
- package/data/harnesses/apollo/codex/agents/lld-mode.toml +0 -52
- package/data/harnesses/apollo/codex/agents/maintenance.toml +0 -228
- package/data/harnesses/apollo/codex/agents/performance-review.toml +0 -222
- package/data/harnesses/apollo/codex/agents/retro.toml +0 -45
- package/data/harnesses/apollo/harness.json +0 -19
- package/data/harnesses/apollo/hooks/approved-packages.md +0 -44
- package/data/harnesses/apollo/hooks/awareness.mjs +0 -405
- package/data/harnesses/apollo/hooks/check-bookkeeping-clean.mjs +0 -19
- package/data/harnesses/apollo/hooks/check-changelog-presence.mjs +0 -57
- package/data/harnesses/apollo/hooks/check-completion-integrity.mjs +0 -71
- package/data/harnesses/apollo/hooks/check-ownership.mjs +0 -22
- package/data/harnesses/apollo/hooks/compliance.mjs +0 -457
- package/data/harnesses/apollo/hooks/hooks.json +0 -23
- package/data/harnesses/apollo/hooks/lib/frozen.mjs +0 -58
- package/data/harnesses/apollo/hooks/lib/ownership.mjs +0 -242
- package/data/harnesses/apollo/hooks/lib/state.mjs +0 -170
- package/data/harnesses/apollo/rules/changelog.md +0 -27
- package/data/harnesses/apollo/rules/database.md +0 -34
- package/data/harnesses/apollo/rules/frontend.md +0 -30
- package/data/harnesses/apollo/rules/general.md +0 -40
- package/data/harnesses/apollo/rules/nomenclature.md +0 -30
- package/data/harnesses/apollo/rules/pnpm.md +0 -57
- package/data/harnesses/apollo/rules/testing.md +0 -64
- package/data/harnesses/apollo/skills/boundary/SKILL.md +0 -75
- package/data/harnesses/apollo/skills/boundary/references/index.md +0 -16
- package/data/harnesses/apollo/skills/boundary/references/mechanisms.md +0 -99
- package/data/harnesses/apollo/skills/boundary/references/packs/async-messaging.md +0 -81
- package/data/harnesses/apollo/skills/boundary/references/packs/auth.md +0 -93
- package/data/harnesses/apollo/skills/boundary/references/packs/build-config-runtime.md +0 -93
- package/data/harnesses/apollo/skills/boundary/references/packs/cloudflare.md +0 -93
- package/data/harnesses/apollo/skills/boundary/references/packs/frontend.md +0 -93
- package/data/harnesses/apollo/skills/boundary/references/packs/generic-tail.md +0 -55
- package/data/harnesses/apollo/skills/boundary/references/packs/persistence.md +0 -93
- package/data/harnesses/apollo/skills/boundary/references/packs/wire-api.md +0 -87
- package/data/harnesses/apollo/skills/brainstorm/README.md +0 -56
- package/data/harnesses/apollo/skills/brainstorm/SKILL.md +0 -173
- package/data/harnesses/apollo/skills/brainstorm/references/doctrine.md +0 -98
- package/data/harnesses/apollo/skills/brainstorm/references/harvest.md +0 -86
- package/data/harnesses/apollo/skills/brainstorm/references/session-schema.md +0 -186
- package/data/harnesses/apollo/skills/brainstorm/scripts/detector.mjs +0 -460
- package/data/harnesses/apollo/skills/design/SKILL.md +0 -121
- package/data/harnesses/apollo/skills/design/components/charts.md +0 -76
- package/data/harnesses/apollo/skills/design/components/collections.md +0 -132
- package/data/harnesses/apollo/skills/design/components/feedback.md +0 -47
- package/data/harnesses/apollo/skills/design/components/hooks.md +0 -35
- package/data/harnesses/apollo/skills/design/components/index.md +0 -143
- package/data/harnesses/apollo/skills/design/components/inputs.md +0 -327
- package/data/harnesses/apollo/skills/design/components/layout.md +0 -52
- package/data/harnesses/apollo/skills/design/components/media.md +0 -66
- package/data/harnesses/apollo/skills/design/components/motion.md +0 -82
- package/data/harnesses/apollo/skills/design/components/navigation.md +0 -29
- package/data/harnesses/apollo/skills/design/components/overlays.md +0 -72
- package/data/harnesses/apollo/skills/design/components/setup.md +0 -40
- package/data/harnesses/apollo/skills/design/components/typography.md +0 -46
- package/data/harnesses/apollo/skills/design/components/utils.md +0 -37
- package/data/harnesses/apollo/skills/design/data/blueprints/browse.md +0 -38
- package/data/harnesses/apollo/skills/design/data/blueprints/creation-flow.md +0 -38
- package/data/harnesses/apollo/skills/design/data/blueprints/dashboard.md +0 -38
- package/data/harnesses/apollo/skills/design/data/blueprints/grid.md +0 -38
- package/data/harnesses/apollo/skills/design/data/blueprints/queue.md +0 -38
- package/data/harnesses/apollo/skills/design/data/blueprints/record-detail.md +0 -38
- package/data/harnesses/apollo/skills/design/data/blueprints/settings.md +0 -38
- package/data/harnesses/apollo/skills/design/data/charts/census.csv +0 -58
- package/data/harnesses/apollo/skills/design/data/checklists/browse.md +0 -21
- package/data/harnesses/apollo/skills/design/data/checklists/creation-flow.md +0 -20
- package/data/harnesses/apollo/skills/design/data/checklists/dashboard.md +0 -21
- package/data/harnesses/apollo/skills/design/data/checklists/grid.md +0 -21
- package/data/harnesses/apollo/skills/design/data/checklists/queue.md +0 -21
- package/data/harnesses/apollo/skills/design/data/checklists/record-detail.md +0 -21
- package/data/harnesses/apollo/skills/design/data/checklists/settings.md +0 -21
- package/data/harnesses/apollo/skills/design/data/chrome/board-column.md +0 -68
- package/data/harnesses/apollo/skills/design/data/chrome/data-table.md +0 -63
- package/data/harnesses/apollo/skills/design/data/chrome/side-panel.md +0 -60
- package/data/harnesses/apollo/skills/design/data/chrome/sidebar.md +0 -78
- package/data/harnesses/apollo/skills/design/data/chrome/stat-cards.md +0 -62
- package/data/harnesses/apollo/skills/design/data/chrome/topbar.md +0 -65
- package/data/harnesses/apollo/skills/design/data/elevation/ant-design-directional-shadow.md +0 -19
- package/data/harnesses/apollo/skills/design/data/elevation/apple-liquid-glass-material.md +0 -18
- package/data/harnesses/apollo/skills/design/data/elevation/atlassian-surface-shadow-pairing.md +0 -20
- package/data/harnesses/apollo/skills/design/data/elevation/fluent-2-key-ambient-ramp.md +0 -20
- package/data/harnesses/apollo/skills/design/data/elevation/github-primer-sparing-shadow.md +0 -19
- package/data/harnesses/apollo/skills/design/data/elevation/ibm-carbon-layer-and-border.md +0 -19
- package/data/harnesses/apollo/skills/design/data/elevation/linear-dark-surface-ladder.md +0 -17
- package/data/harnesses/apollo/skills/design/data/elevation/material-2-key-ambient-dp-ramp.md +0 -19
- package/data/harnesses/apollo/skills/design/data/elevation/material-3-tonal-elevation.md +0 -21
- package/data/harnesses/apollo/skills/design/data/elevation/neobrutalist-hard-offset.md +0 -19
- package/data/harnesses/apollo/skills/design/data/elevation/neumorphic-soft-dual-shadow.md +0 -18
- package/data/harnesses/apollo/skills/design/data/elevation/notion-warm-minimal-hairline.md +0 -17
- package/data/harnesses/apollo/skills/design/data/elevation/polaris-elevation-inset-bevel.md +0 -21
- package/data/harnesses/apollo/skills/design/data/elevation/radix-themes-alpha-ring-scale.md +0 -19
- package/data/harnesses/apollo/skills/design/data/elevation/shadcn-neutral-derived-radius.md +0 -19
- package/data/harnesses/apollo/skills/design/data/elevation/stripe-brand-tinted-dual-shadow.md +0 -18
- package/data/harnesses/apollo/skills/design/data/elevation/tailwind-default-utility-scale.md +0 -19
- package/data/harnesses/apollo/skills/design/data/elevation/vercel-geist-shadow-as-border.md +0 -20
- package/data/harnesses/apollo/skills/design/data/iconography.md +0 -199
- package/data/harnesses/apollo/skills/design/data/motion/accordion-expand.md +0 -18
- package/data/harnesses/apollo/skills/design/data/motion/destructive-hold-confirm.md +0 -18
- package/data/harnesses/apollo/skills/design/data/motion/drag-dismiss-momentum.md +0 -18
- package/data/harnesses/apollo/skills/design/data/motion/empty-state-arrive.md +0 -18
- package/data/harnesses/apollo/skills/design/data/motion/hover-lift.md +0 -18
- package/data/harnesses/apollo/skills/design/data/motion/modal-center-arrive.md +0 -18
- package/data/harnesses/apollo/skills/design/data/motion/number-ticker-roll.md +0 -18
- package/data/harnesses/apollo/skills/design/data/motion/onboarding-bounce.md +0 -18
- package/data/harnesses/apollo/skills/design/data/motion/panel-slide.md +0 -18
- package/data/harnesses/apollo/skills/design/data/motion/press-feedback.md +0 -18
- package/data/harnesses/apollo/skills/design/data/motion/progress-linear-loop.md +0 -18
- package/data/harnesses/apollo/skills/design/data/motion/route-crossfade.md +0 -18
- package/data/harnesses/apollo/skills/design/data/motion/rubber-band-overscroll.md +0 -18
- package/data/harnesses/apollo/skills/design/data/motion/skeleton-shimmer.md +0 -18
- package/data/harnesses/apollo/skills/design/data/motion/stagger-arrive.md +0 -18
- package/data/harnesses/apollo/skills/design/data/motion/toast-enter-stack.md +0 -18
- package/data/harnesses/apollo/skills/design/data/motion/tooltip-chain-instant.md +0 -18
- package/data/harnesses/apollo/skills/design/data/motion/trigger-anchored-reveal.md +0 -18
- package/data/harnesses/apollo/skills/design/data/tells.csv +0 -34
- package/data/harnesses/apollo/skills/design/data/voices/bright-collaborator.md +0 -29
- package/data/harnesses/apollo/skills/design/data/voices/direct-operator.md +0 -29
- package/data/harnesses/apollo/skills/design/data/voices/earnest-helper.md +0 -29
- package/data/harnesses/apollo/skills/design/data/voices/editorial-composed.md +0 -29
- package/data/harnesses/apollo/skills/design/data/voices/quiet-concierge.md +0 -29
- package/data/harnesses/apollo/skills/design/data/voices/warm-guide.md +0 -29
- package/data/harnesses/apollo/skills/design/references/compose.md +0 -23
- package/data/harnesses/apollo/skills/design/references/content.md +0 -28
- package/data/harnesses/apollo/skills/design/references/emission.md +0 -21
- package/data/harnesses/apollo/skills/design/references/existing-apps.md +0 -27
- package/data/harnesses/apollo/skills/design/references/foundations.md +0 -57
- package/data/harnesses/apollo/skills/design/references/intake.md +0 -40
- package/data/harnesses/apollo/skills/design/references/object-pass.md +0 -24
- package/data/harnesses/apollo/skills/design/references/ship-gate.md +0 -29
- package/data/harnesses/apollo/skills/design/references/ux-patterns/Readme.md +0 -195
- package/data/harnesses/apollo/skills/design/references/ux-patterns/ai-layer.md +0 -49
- package/data/harnesses/apollo/skills/design/references/ux-patterns/attributes-lifecycle.md +0 -43
- package/data/harnesses/apollo/skills/design/references/ux-patterns/container-choice.md +0 -44
- package/data/harnesses/apollo/skills/design/references/ux-patterns/creation-paths.md +0 -46
- package/data/harnesses/apollo/skills/design/references/ux-patterns/dashboards.md +0 -42
- package/data/harnesses/apollo/skills/design/references/ux-patterns/modes.md +0 -42
- package/data/harnesses/apollo/skills/design/references/ux-patterns/object-model.md +0 -46
- package/data/harnesses/apollo/skills/design/references/ux-patterns/page-archetype.md +0 -48
- package/data/harnesses/apollo/skills/design/references/ux-patterns/promotion-demotion.md +0 -37
- package/data/harnesses/apollo/skills/design/references/ux-patterns/settings.md +0 -42
- package/data/harnesses/apollo/skills/design/references/ux-patterns/standard-pages.md +0 -46
- package/data/harnesses/apollo/skills/design/references/ux-patterns/state-matrix.md +0 -41
- package/data/harnesses/apollo/skills/design/references/ux-patterns/table-mechanics.md +0 -48
- package/data/harnesses/apollo/skills/design/references/ux-patterns/verbs.md +0 -45
- package/data/harnesses/apollo/skills/design/references/ux-patterns/viewer-context.md +0 -40
- package/data/harnesses/apollo/skills/design/scripts/README-validator.md +0 -27
- package/data/harnesses/apollo/skills/design/scripts/select-chart.mjs +0 -622
- package/data/harnesses/apollo/skills/design/scripts/validate-design-md.mjs +0 -1198
- package/data/harnesses/apollo/skills/documentation/SKILL.md +0 -135
- package/data/harnesses/apollo/skills/documentation/references/examples.md +0 -279
- package/data/harnesses/apollo/skills/documentation/references/frontmatter.md +0 -44
- package/data/harnesses/apollo/skills/documentation/references/instruction-style.md +0 -50
- package/data/harnesses/apollo/skills/documentation/references/style-guide.md +0 -384
- package/data/harnesses/apollo/skills/documentation/references/untemplated.md +0 -38
- package/data/harnesses/apollo/skills/documentation/scripts/doc-lint.mjs +0 -140
- package/data/harnesses/apollo/skills/documentation/templates/Readme.md +0 -35
- package/data/harnesses/apollo/skills/documentation/templates/api-reference.md +0 -20
- package/data/harnesses/apollo/skills/documentation/templates/architecture-decision.md +0 -121
- package/data/harnesses/apollo/skills/documentation/templates/backlog.md +0 -33
- package/data/harnesses/apollo/skills/documentation/templates/behavioral-checklist.md +0 -81
- package/data/harnesses/apollo/skills/documentation/templates/bookkeeping.md +0 -18
- package/data/harnesses/apollo/skills/documentation/templates/changelog-entry.md +0 -57
- package/data/harnesses/apollo/skills/documentation/templates/changelog-index.md +0 -41
- package/data/harnesses/apollo/skills/documentation/templates/docs-readme.md +0 -72
- package/data/harnesses/apollo/skills/documentation/templates/domain-model.md +0 -30
- package/data/harnesses/apollo/skills/documentation/templates/environment-registry.md +0 -15
- package/data/harnesses/apollo/skills/documentation/templates/feature.md +0 -150
- package/data/harnesses/apollo/skills/documentation/templates/glossary.md +0 -11
- package/data/harnesses/apollo/skills/documentation/templates/implementation-map.md +0 -42
- package/data/harnesses/apollo/skills/documentation/templates/journal.md +0 -13
- package/data/harnesses/apollo/skills/documentation/templates/memory-main.md +0 -25
- package/data/harnesses/apollo/skills/documentation/templates/migration-runbook.md +0 -34
- package/data/harnesses/apollo/skills/documentation/templates/non-goals.md +0 -11
- package/data/harnesses/apollo/skills/documentation/templates/operations-procedure.md +0 -36
- package/data/harnesses/apollo/skills/documentation/templates/plan.md +0 -88
- package/data/harnesses/apollo/skills/documentation/templates/protected-files.md +0 -37
- package/data/harnesses/apollo/skills/documentation/templates/root-readme.md +0 -104
- package/data/harnesses/apollo/skills/documentation/templates/security-overview.md +0 -27
- package/data/harnesses/apollo/skills/documentation/templates/structure.md +0 -65
- package/data/harnesses/apollo/skills/documentation/templates/system-overview.md +0 -32
- package/data/harnesses/apollo/skills/documentation/templates/testing-strategy.md +0 -29
- package/data/harnesses/apollo/skills/schema-design/SKILL.md +0 -141
- package/data/harnesses/apollo/skills/test/SKILL.md +0 -104
- package/data/harnesses/apollo/skills/testing/SKILL.md +0 -166
- package/data/harnesses/apollo/skills/workflow-mapper/SKILL.md +0 -451
- package/data/harnesses/apollo/skills/workflow-mapper/references/patterns.md +0 -214
- /package/data/harnesses/{apollo → code}/docs/README.md +0 -0
- /package/data/harnesses/{apollo → code}/docs/history/CHANGELOG.md +0 -0
- /package/data/harnesses/{apollo → code}/docs/history/backlog.md +0 -0
- /package/data/harnesses/{apollo → code}/docs/memory/main.md +0 -0
- /package/data/harnesses/{apollo → code}/docs/structure.md +0 -0
- /package/data/harnesses/{apollo → code}/rules/cloudflare.md +0 -0
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: documentation
|
|
3
|
-
description: "Use when creating or substantively editing ANY markdown doc — invoke BEFORE writing. Templates + style authority for technical docs: LLDs, ADs, plans, changelogs, READMEs, runbooks. Owns the tense rule: truth docs state the present; history only in dated records. Baselining is the maintenance agent."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Technical Documentation Skill
|
|
7
|
-
|
|
8
|
-
**This skill is a template & generator library, not an orchestrator.** It supplies the templates, the frontmatter-derivation generator, and the co-authoring workflow that _agents_ call to produce individual docs. It does **not** baseline, audit, or reconcile a repo's doc tree — that is the **`maintenance` agent (baseline mode)**, which calls this skill for each template it scaffolds. Reach here to generate _one_ doc from a template; reach for the `maintenance` agent (baseline mode) to bring a whole repo into shape.
|
|
9
|
-
|
|
10
|
-
Document contracts and architecture, not implementation details. Show function signatures and API shapes — never paste full implementations (they rot fast). Use ASCII diagrams over prose for flows. Only document state at persistence boundaries (Redux persistence, DB schemas, API shapes), not component-level or transient state. Mark deprecated fields with `// UNUSED:` comments stating why the field is dead now — never where it went or when it dies. Breaking changes belong in changelogs only, not module docs.
|
|
11
|
-
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
## Present tense, always
|
|
15
|
-
|
|
16
|
-
**A document states what is — never how it got there, and never how far along it is.** Write as if the current design had always been the plan. This is the most-violated rule in the skill, so it sits at the top; it applies to every document written or edited through this skill, whatever the template.
|
|
17
|
-
|
|
18
|
-
| ❌ Strip this | ✅ Write this |
|
|
19
|
-
| --- | --- |
|
|
20
|
-
| "Build Sequence phases 0–4 are complete." | Nothing — progress lives in the plan/backlog record |
|
|
21
|
-
| "There is no standalone `skills/components/` — treat any reference to it as stale." | Nothing — fix the references; state only the present design |
|
|
22
|
-
| "Folded in from the `NuStack-X` repo (2026-06-12)." | "Vendor-connector catalogue; one subpath per vendor." |
|
|
23
|
-
| "was X, now Y", "the old worker", "Phase 2 softened this", "v1 → v2" | The current fact, with no predecessor named |
|
|
24
|
-
|
|
25
|
-
The journey — dates, migrations, progress, supersessions — lives only in records (`docs/history/`); when reality changes, a truth document simply becomes correct. The full strip-list and the record-side rules: [`references/style-guide.md`](references/style-guide.md) § The Two Natures — Tense & History.
|
|
26
|
-
|
|
27
|
-
The mechanical subset of these rules is checked by [`scripts/doc-lint.mjs`](scripts/doc-lint.mjs) — run it over changed docs before finishing. Block-severity findings must be fixed; `<!-- doc-lint-disable: <id> -->` with a reason beside it is the escape hatch.
|
|
28
|
-
|
|
29
|
-
---
|
|
30
|
-
|
|
31
|
-
## The Two Natures
|
|
32
|
-
|
|
33
|
-
Every document is exactly one of two things. Decide which before writing a word — every rule in this skill derives from the split.
|
|
34
|
-
|
|
35
|
-
| | **Truth document** | **Record** |
|
|
36
|
-
| --- | --- | --- |
|
|
37
|
-
| States | Absolutes — how the system is, **now** | What happened — a dated account of activity |
|
|
38
|
-
| Named by | Topic: `auth.md`, `AD-003-persistence.md` | Date: `YYYY-MM-DD-slug.md` (or append position) |
|
|
39
|
-
| On change | Body rewritten in place the moment reality changes | Never edited — frozen at completion or append-only |
|
|
40
|
-
| Read to | Act correctly today | Trace provenance, diagnose, audit |
|
|
41
|
-
| Lives in | `docs/features/`, `docs/architecture/`, `docs/operations/`, `docs/tests/`, READMEs | `docs/history/` (plans, changelog, brainstorms, research, migrations), `docs/research/`, `docs/memory/` |
|
|
42
|
-
|
|
43
|
-
The two guarantees are complementary and both break on mixing: a reader holding a **truth document** must never need history to interpret it; a reader holding a **record** must be able to trust it was never rewritten. So the natures never share a document body.
|
|
44
|
-
|
|
45
|
-
- **Truth documents never narrate history** — the § Present tense, always rule above, applied to this nature. When the system changes, the change-story goes to `docs/history/` (a changelog entry) and the truth document simply becomes correct in present tense. When you find historical narration in a truth document, rewrite it to the present-tense fact and let the record carry the story.
|
|
46
|
-
- **Records are never edited to match the present.** A completed plan stays wrong-in-hindsight; a changelog entry describes close-time state; a scope change gets a *new* dated record that links back, never an edit to a frozen one.
|
|
47
|
-
- **Two sanctioned bridges — head is truth, tail is provenance.** An **Architecture Decision (AD)** ends with a **Decision Changelog** (for a decision, the journey — what each revision reversed and what triggered it — is part of the reasoning), and `docs/structure.md` ends with the maintenance agent's **Health Log** (tooling-stamped audit rows, the structural cousin of `last-reviewed:`). In both, the body stays current-truth-only; the tail carries the dates. No other truth document carries dated history.
|
|
48
|
-
- **Truth documents cite records for the _why_, never the _when_.** `Provenance: AD-002` is good; "decided in AD-002 and shipped 2026-06-13" is not. Routing/index docs point only to truth documents as a topic's authority — never a plan or changelog entry as the "read first" source. (An index _of the records themselves_ — a History section listing `plans/`, `changelog/` — is sanctioned.)
|
|
49
|
-
|
|
50
|
-
**No empty stubs.** Never leave a template section as an empty placeholder — omit any section with nothing real to say (each template declares its required core; everything else is optional). Write an explicit "None" only where the absence itself is information (e.g., a plan's Cross-Module Contracts Affected, an LLD's Ownership Conflicts). An empty table stub reads as "not yet researched"; an omitted section reads as "doesn't apply" — keep those meanings distinct.
|
|
51
|
-
|
|
52
|
-
**No redirect docs.** When moving a doc to a new location, delete the old file entirely. Update all references (cross-doc links, memory files) to point to the new path. Never leave a stub file that says "Moved to X" — redirect docs rot, clutter the repo, and create false search hits.
|
|
53
|
-
|
|
54
|
-
---
|
|
55
|
-
|
|
56
|
-
## Routing
|
|
57
|
-
|
|
58
|
-
| Request | Route |
|
|
59
|
-
| --- | --- |
|
|
60
|
-
| Baseline / reconcile docs | `maintenance` agent (baseline mode) — it calls this skill per template |
|
|
61
|
-
| Document feature/module (LLD) | [`templates/feature.md`](templates/feature.md) |
|
|
62
|
-
| Document data flow / state / Redux | [`templates/feature.md`](templates/feature.md) — they are sections of the feature doc |
|
|
63
|
-
| Create/update changelog entry | [`templates/changelog-entry.md`](templates/changelog-entry.md) (record — one per unit of work; carries the refinement fields, frozen inside its commit, distilled by the `retro` agent) |
|
|
64
|
-
| Create/update plan | [`templates/plan.md`](templates/plan.md) (record) |
|
|
65
|
-
| Record/revise architecture decision | [`templates/architecture-decision.md`](templates/architecture-decision.md) — one AD per subject; revisions update it in place |
|
|
66
|
-
| System at a glance | [`templates/system-overview.md`](templates/system-overview.md) |
|
|
67
|
-
| Domain model | [`templates/domain-model.md`](templates/domain-model.md) |
|
|
68
|
-
| Glossary | [`templates/glossary.md`](templates/glossary.md) |
|
|
69
|
-
| Non-goals | [`templates/non-goals.md`](templates/non-goals.md) |
|
|
70
|
-
| Catalog the API surface | [`templates/api-reference.md`](templates/api-reference.md) |
|
|
71
|
-
| Document env vars / config | [`templates/environment-registry.md`](templates/environment-registry.md) |
|
|
72
|
-
| Security / threat model | [`templates/security-overview.md`](templates/security-overview.md) |
|
|
73
|
-
| Testing strategy | [`templates/testing-strategy.md`](templates/testing-strategy.md) |
|
|
74
|
-
| Behavioral checklist for one feature (`docs/tests/{feature}.md`) | [`templates/behavioral-checklist.md`](templates/behavioral-checklist.md) — the verification gate's driving script, and the source its suite tests are drawn from |
|
|
75
|
-
| Recurring procedure/setup | [`templates/operations-procedure.md`](templates/operations-procedure.md) |
|
|
76
|
-
| Cold-start build order (implementation map) | [`templates/implementation-map.md`](templates/implementation-map.md) — authored by the executing session at build start, updated in place as waves complete |
|
|
77
|
-
| Capture mid-execution knowledge (`docs/history/journal.md`) | [`templates/journal.md`](templates/journal.md) (record — append-only; a row resolves by landing in its owning doc) |
|
|
78
|
-
| Bookkeeping work queue (`docs/operations/bookkeeping.md`) | [`templates/bookkeeping.md`](templates/bookkeeping.md) — machine-read row grammar; appended by hooks and sessions, drained by the `bookkeeper` agent, walled at Stop and commit |
|
|
79
|
-
| One-shot migration/upgrade | [`templates/migration-runbook.md`](templates/migration-runbook.md) (record) |
|
|
80
|
-
| Add to protected files | [`templates/protected-files.md`](templates/protected-files.md) |
|
|
81
|
-
| Create/update root README | [`templates/root-readme.md`](templates/root-readme.md) |
|
|
82
|
-
| Scaffold a standard doc (docs index, `structure.md`, CHANGELOG, backlog, memory) | [`templates/Readme.md`](templates/Readme.md) — the index names each scaffold file |
|
|
83
|
-
| Derive/update a feature doc's `owns:` | [`references/frontmatter.md`](references/frontmatter.md) |
|
|
84
|
-
| Update existing doc | § Editing an existing doc (below) |
|
|
85
|
-
| Instruction file (`CLAUDE.md`, a rule, an agent, skill prose) | [`references/instruction-style.md`](references/instruction-style.md) — not these templates; every-load prose stays lean, and the present-tense rule still applies |
|
|
86
|
-
| Author or restructure a **skill** (fit, triggers, shape, anatomy, shipping) | The skill-authoring field guide — the `etna` repo (`nurixlabs/etna`), folder `docs/architecture/skills/playbook/`, chapters `00`–`10`. **No etna checkout available ⇒ ask the user for access to the etna repo, or proceed from first principles** with [`references/instruction-style.md`](references/instruction-style.md) governing the prose. This row is the only place the playbook is referenced |
|
|
87
|
-
| **No template matches** | [`references/untemplated.md`](references/untemplated.md) — shape decisions + the co-authoring workflow |
|
|
88
|
-
|
|
89
|
-
---
|
|
90
|
-
|
|
91
|
-
## Editing an existing doc
|
|
92
|
-
|
|
93
|
-
"Substantive" = anything beyond typo, link, or formatting fixes. On a substantive edit:
|
|
94
|
-
|
|
95
|
-
1. **Determine the nature first.** A frozen record (a `Status: Complete`/`Abandoned` plan, a changelog entry, an executed runbook) is never edited — write a new dated record that links back.
|
|
96
|
-
2. **Preserve structure, not violations.** Keep the doc's existing section shape, but every section touched sheds history narration, progress markers, and stale tripwires on the way through (§ Present tense, always).
|
|
97
|
-
3. **Stamp and re-derive.** A substantive feature-doc update bumps `last-reviewed:`; if the documented scope moved, update `owns:` ([`references/frontmatter.md`](references/frontmatter.md)).
|
|
98
|
-
|
|
99
|
-
---
|
|
100
|
-
|
|
101
|
-
## Naming & Lifecycle
|
|
102
|
-
|
|
103
|
-
| Document | Nature | Name | Lifecycle |
|
|
104
|
-
| --- | --- | --- | --- |
|
|
105
|
-
| Feature (LLD) | Truth | `kebab-case.md` | Living; `status:` `draft` → `active` → `deprecated` |
|
|
106
|
-
| Architecture Decision | Truth | `AD-NNN-kebab-case.md` | Living; `Proposed` → `Accepted` → `Deprecated`; revisions rewrite the body + append to its Decision Changelog |
|
|
107
|
-
| Steering docs (overview, domain model, glossary, non-goals, security, testing strategy) | Truth | fixed names | Living |
|
|
108
|
-
| API reference / environment registry | Truth | fixed names | Living |
|
|
109
|
-
| Operations procedure | Truth | `kebab-case.md` | Living |
|
|
110
|
-
| Protected files | Truth | `protected-files.md` | Living |
|
|
111
|
-
| Plan | Record | `YYYY-MM-DD-kebab-case.md` | Freezes at `Complete` / `Abandoned` |
|
|
112
|
-
| Changelog entry | Record | `YYYY-MM-DD-kebab-case.md` | Frozen; master index append-only |
|
|
113
|
-
| Migration runbook | Record | `YYYY-MM-DD-kebab-case.md` | Freezes once executed, outcome stamped |
|
|
114
|
-
| Research | Record | `history/research/{topic}/` | Frozen snapshot |
|
|
115
|
-
| Memory | Record | `{agent-name}.md` | Append-only dated ledger |
|
|
116
|
-
|
|
117
|
-
---
|
|
118
|
-
|
|
119
|
-
## Frontmatter Derivation
|
|
120
|
-
|
|
121
|
-
A feature doc carries ownership frontmatter — `owns:` (required), `module:` (optional), `keywords:` (required), `status:` (required), optional `last-reviewed:`. Deriving it from code and keeping it accurate is [`references/frontmatter.md`](references/frontmatter.md) — every feature-doc create or update, and the `maintenance` agent's baseline pass, route there.
|
|
122
|
-
|
|
123
|
-
---
|
|
124
|
-
|
|
125
|
-
## Resources
|
|
126
|
-
|
|
127
|
-
| File | Use For |
|
|
128
|
-
| --- | --- |
|
|
129
|
-
| `templates/` | One file per template, indexed by [`Readme.md`](templates/Readme.md) — feature (LLD), changelog, plan, AD, steering docs, API reference, environment registry, operations procedure, migration runbook, protected files, READMEs, and the baseline scaffolds |
|
|
130
|
-
| `references/style-guide.md` | Writing rules, formatting conventions, the two-natures tense rules |
|
|
131
|
-
| `references/instruction-style.md` | The style for instruction files (`CLAUDE.md`, rules, agents, skill prose) — the every-line test, armor vs. narration, voice, negative space |
|
|
132
|
-
| `references/frontmatter.md` | Deriving a feature doc's `owns:` / `module:` / `keywords:` / `status:` from code |
|
|
133
|
-
| `references/untemplated.md` | How to write a document no template covers (nature, placement, shape) + the co-authoring workflow |
|
|
134
|
-
| `references/examples.md` | Good vs bad documentation examples |
|
|
135
|
-
| `scripts/doc-lint.mjs` | Mechanical checks over written docs (tense narration, dates, stubs, redirects) — run over changed docs before finishing |
|
|
@@ -1,279 +0,0 @@
|
|
|
1
|
-
# Documentation Examples
|
|
2
|
-
|
|
3
|
-
Good vs bad examples showing the key differences.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Example 1: Function Documentation
|
|
8
|
-
|
|
9
|
-
### ❌ Bad: Full Implementation
|
|
10
|
-
|
|
11
|
-
```markdown
|
|
12
|
-
### mergeData
|
|
13
|
-
|
|
14
|
-
function mergeData(server, local, changes) { const result = {}; const serverMap = new Map(server.map((i) => [i.id, i])); // ... 30 more lines return result; }
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
**Problems:** Will become obsolete, focuses on HOW not WHAT.
|
|
18
|
-
|
|
19
|
-
### ✅ Good: Contract Only
|
|
20
|
-
|
|
21
|
-
```markdown
|
|
22
|
-
### `mergeData(serverData, localData, changes)`
|
|
23
|
-
|
|
24
|
-
**Goal:** Merge server data with local changes
|
|
25
|
-
|
|
26
|
-
**Input:**
|
|
27
|
-
|
|
28
|
-
- `serverData` (array) - Fresh from API
|
|
29
|
-
- `localData` (array) - Current state
|
|
30
|
-
- `changes` (object) - `{ added, updated, removed }`
|
|
31
|
-
|
|
32
|
-
**Output:** `{ merged: array, conflicts: array }`
|
|
33
|
-
|
|
34
|
-
**Merge Rules:**
|
|
35
|
-
|
|
36
|
-
- Server wins for conflicts
|
|
37
|
-
- Local additions preserved
|
|
38
|
-
- Local removals marked as intent
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
---
|
|
42
|
-
|
|
43
|
-
## Example 2: State Documentation
|
|
44
|
-
|
|
45
|
-
### ❌ Bad: State Everywhere
|
|
46
|
-
|
|
47
|
-
```markdown
|
|
48
|
-
## Component State
|
|
49
|
-
|
|
50
|
-
const [items, setItems] = useState([]);
|
|
51
|
-
|
|
52
|
-
## Hook State
|
|
53
|
-
|
|
54
|
-
{ data: items, isLoading: loading, error: null }
|
|
55
|
-
|
|
56
|
-
## Redux State
|
|
57
|
-
|
|
58
|
-
{ items: [], loading: false, error: null }
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
**Problems:** Documents transient state, repeats shapes.
|
|
62
|
-
|
|
63
|
-
### ✅ Good: Persistence Points Only
|
|
64
|
-
|
|
65
|
-
```markdown
|
|
66
|
-
## State
|
|
67
|
-
|
|
68
|
-
**Frontend (at persistence):**
|
|
69
|
-
|
|
70
|
-
{
|
|
71
|
-
"data": [],
|
|
72
|
-
"changes": { "added": [], "updated": [], "removed": [] }
|
|
73
|
-
// "cache": {} // UNUSED: dead key; kept so old persisted state rehydrates
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
**Storage:** localStorage `app_state`
|
|
77
|
-
|
|
78
|
-
**Backend:**
|
|
79
|
-
|
|
80
|
-
export const items = pgTable('items', {
|
|
81
|
-
id: text('id').primaryKey(),
|
|
82
|
-
data: jsonb('data'),
|
|
83
|
-
});
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
---
|
|
87
|
-
|
|
88
|
-
## Example 3: Changelog
|
|
89
|
-
|
|
90
|
-
### ❌ Bad: Vague
|
|
91
|
-
|
|
92
|
-
```markdown
|
|
93
|
-
# 2025-01-05 - Updates
|
|
94
|
-
|
|
95
|
-
## Changes
|
|
96
|
-
|
|
97
|
-
- Updated editor
|
|
98
|
-
- Fixed bugs
|
|
99
|
-
- Improved performance
|
|
100
|
-
|
|
101
|
-
## Files
|
|
102
|
-
|
|
103
|
-
- Various files in src/
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
### ✅ Good: Function-Level Detail
|
|
107
|
-
|
|
108
|
-
```markdown
|
|
109
|
-
# 2025-01-05 - Version-Based Merge
|
|
110
|
-
|
|
111
|
-
## Summary
|
|
112
|
-
|
|
113
|
-
Replaced change-tracking merge with version-based conflict resolution.
|
|
114
|
-
|
|
115
|
-
## Changes
|
|
116
|
-
|
|
117
|
-
### Added
|
|
118
|
-
|
|
119
|
-
- `mergeAndDerive(server, local, versionsMatch, type)` in `src/utils/merge.js`
|
|
120
|
-
- Purpose: Single-pass merge with change detection
|
|
121
|
-
- Returns: `{ merged, changes }`
|
|
122
|
-
|
|
123
|
-
### Changed
|
|
124
|
-
|
|
125
|
-
- `useDataSync()` in `src/hooks/useDataSync.js`
|
|
126
|
-
- Changed: Now compares versions before merge
|
|
127
|
-
|
|
128
|
-
### Removed
|
|
129
|
-
|
|
130
|
-
- `deriveChanges()` from `src/utils/derive.js`
|
|
131
|
-
- Replaced by: Logic in `mergeAndDerive()`
|
|
132
|
-
|
|
133
|
-
## Breaking Changes
|
|
134
|
-
|
|
135
|
-
⚠️ **Merge behavior changed**
|
|
136
|
-
|
|
137
|
-
- Old: Local changes always preserved
|
|
138
|
-
- New: Local preserved only if versions match
|
|
139
|
-
|
|
140
|
-
## Files Changed
|
|
141
|
-
|
|
142
|
-
- `src/hooks/useDataSync.js`
|
|
143
|
-
- `src/utils/merge.js`
|
|
144
|
-
- `src/utils/derive.js` (deleted)
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
---
|
|
148
|
-
|
|
149
|
-
## Example 4: Data Flow
|
|
150
|
-
|
|
151
|
-
### ❌ Bad: Prose Description
|
|
152
|
-
|
|
153
|
-
```markdown
|
|
154
|
-
When the page loads, the useAppInit hook calls the syncData function. This function first fetches data from the server using the API. Then it gets the local data from Redux. After that, it compares versions...
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
### ✅ Good: Diagram + Key Points
|
|
158
|
-
|
|
159
|
-
```markdown
|
|
160
|
-
## Data Flow
|
|
161
|
-
|
|
162
|
-
┌─────────────────────────────────────────┐
|
|
163
|
-
│ DATA SYNC │
|
|
164
|
-
├─────────────────────────────────────────┤
|
|
165
|
-
│ │
|
|
166
|
-
│ ┌──────┐ ┌──────┐ ┌──────┐ │
|
|
167
|
-
│ │Server│────▶│Merge │────▶│Redux │ │
|
|
168
|
-
│ │ API │ │ │ │Store │ │
|
|
169
|
-
│ └──────┘ └──────┘ └──────┘ │
|
|
170
|
-
│ │ │
|
|
171
|
-
│ ▼ │
|
|
172
|
-
│ Version Check │
|
|
173
|
-
│ │
|
|
174
|
-
└─────────────────────────────────────────┘
|
|
175
|
-
|
|
176
|
-
**Trigger:** `useAppInit()` on page load
|
|
177
|
-
|
|
178
|
-
**Version Rule:** Match → local wins, Mismatch → server wins
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
---
|
|
182
|
-
|
|
183
|
-
## Example 5: Architecture Decision revision
|
|
184
|
-
|
|
185
|
-
### ❌ Bad: Supersession chain
|
|
186
|
-
|
|
187
|
-
```
|
|
188
|
-
docs/architecture/decisions/
|
|
189
|
-
├── AD-002-auth-keycloak.md (status: Superseded)
|
|
190
|
-
├── AD-006-auth-better-auth.md (status: Superseded, "supersedes AD-002")
|
|
191
|
-
└── AD-011-auth-better-auth-v2.md (status: Accepted, "supersedes AD-006")
|
|
192
|
-
```
|
|
193
|
-
|
|
194
|
-
**Problems:** Three files hold one subject; the reader must diff a chain to learn the current truth; two of the three are wrong-but-present (the same pathology as keeping `report_v1.sql` beside the live `report_v2.sql`); the reasoning that killed Keycloak is stranded in a dead file nobody opens.
|
|
195
|
-
|
|
196
|
-
### ✅ Good: One subject, updated in place
|
|
197
|
-
|
|
198
|
-
```
|
|
199
|
-
docs/architecture/decisions/
|
|
200
|
-
└── AD-002-auth.md (status: Accepted, last-updated bumped)
|
|
201
|
-
```
|
|
202
|
-
|
|
203
|
-
```markdown
|
|
204
|
-
## Decision
|
|
205
|
-
|
|
206
|
-
We use Better Auth with one-shot credential issuance… ← current truth, no journey
|
|
207
|
-
|
|
208
|
-
…
|
|
209
|
-
|
|
210
|
-
## Decision Changelog
|
|
211
|
-
|
|
212
|
-
- 2026-05-02 — Moved issuance to one-shot tokens because refresh-token theft
|
|
213
|
-
surfaced in review. Implemented by [plan](…). (Previously: long-lived refresh tokens.)
|
|
214
|
-
- 2026-03-18 — Replaced Keycloak with Better Auth because self-hosting cost
|
|
215
|
-
outweighed SSO needs. Implemented by [plan](…). (Previously: Keycloak.)
|
|
216
|
-
- 2026-01-10 — Initial decision accepted. Implemented by [plan](…).
|
|
217
|
-
```
|
|
218
|
-
|
|
219
|
-
**Why it works:** The body answers "how does auth work and why" without archaeology; the tail preserves every reversal with its trigger; the rejected alternatives stay findable in the one file a reader actually opens.
|
|
220
|
-
|
|
221
|
-
---
|
|
222
|
-
|
|
223
|
-
## Example 6: Stripping history from a truth doc
|
|
224
|
-
|
|
225
|
-
The move agents fumble: deleting narration is only half the job — the story must land in a record.
|
|
226
|
-
|
|
227
|
-
### ❌ Bad: The journey narrated in place
|
|
228
|
-
|
|
229
|
-
```markdown
|
|
230
|
-
## Export Pipeline
|
|
231
|
-
|
|
232
|
-
The exporter was extracted from the legacy `reports` worker (2026-06-02) and
|
|
233
|
-
now lives in `src/export/`. Phases 0–2 of the rewrite are complete; streaming
|
|
234
|
-
output is not yet implemented. Treat any reference to `reports/export.js` as
|
|
235
|
-
stale — it was superseded by `src/export/run.js`.
|
|
236
|
-
```
|
|
237
|
-
|
|
238
|
-
### ✅ Good: Present-tense truth doc + a dated record carrying the story
|
|
239
|
-
|
|
240
|
-
The feature doc states only what is:
|
|
241
|
-
|
|
242
|
-
```markdown
|
|
243
|
-
## Export Pipeline
|
|
244
|
-
|
|
245
|
-
`src/export/run.js` renders every export format from one job queue. Output is
|
|
246
|
-
buffered per job (streaming is out of scope — see `docs/history/backlog.md`).
|
|
247
|
-
```
|
|
248
|
-
|
|
249
|
-
And the change-story goes to `docs/history/changelog/2026-06-02-export-extraction.md`:
|
|
250
|
-
|
|
251
|
-
```markdown
|
|
252
|
-
# 2026-06-02 — Export pipeline extracted
|
|
253
|
-
|
|
254
|
-
## Summary
|
|
255
|
-
|
|
256
|
-
Extracted export logic from the `reports` worker into `src/export/`.
|
|
257
|
-
|
|
258
|
-
## Changes
|
|
259
|
-
|
|
260
|
-
### Removed
|
|
261
|
-
|
|
262
|
-
- `reports/export.js` — replaced by `src/export/run.js`; all callers repointed.
|
|
263
|
-
```
|
|
264
|
-
|
|
265
|
-
**Why it works:** the truth doc needs no archaeology to act on; the dates, the predecessor, and the supersession live in a frozen record; the unbuilt part is a backlog pointer, not a "not yet" hedge; and no stale-reference tripwire survives because the references themselves were fixed.
|
|
266
|
-
|
|
267
|
-
---
|
|
268
|
-
|
|
269
|
-
## Quick Comparison
|
|
270
|
-
|
|
271
|
-
| Aspect | Bad | Good |
|
|
272
|
-
| ---------- | -------------------- | --------------------------- |
|
|
273
|
-
| Code | Full implementations | Signatures + contracts |
|
|
274
|
-
| State | Every occurrence | Persistence points only |
|
|
275
|
-
| Flows | Prose paragraphs | ASCII diagrams |
|
|
276
|
-
| Changelogs | "Updated X" | Function names + migrations |
|
|
277
|
-
| Decisions | New doc per revision | One AD per subject, updated in place |
|
|
278
|
-
| History | Narrated in the doc | Present-tense doc + dated record |
|
|
279
|
-
| Length | 100+ lines | 20-40 lines |
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
# Frontmatter Derivation — feature-doc ownership
|
|
2
|
-
|
|
3
|
-
Load when: creating a feature doc, updating one whose documented scope moved, or running a baseline/reconcile pass over many docs.
|
|
4
|
-
|
|
5
|
-
When creating or updating a feature doc, derive its **`owns:` frontmatter** — the code-path globs it is canonical for — from the source the doc describes. Code ownership lives in each feature doc's `owns:` frontmatter (the SessionStart hook unions them into the injected ownership index); there is no hand-maintained ownership map.
|
|
6
|
-
|
|
7
|
-
## When to run
|
|
8
|
-
|
|
9
|
-
- **Baseline / reconcile** — for every feature doc whose code paths aren't yet declared in its `owns:` frontmatter (the `maintenance` agent (baseline mode) calls this)
|
|
10
|
-
- **New feature doc** — when creating a doc via the [Feature template](../templates/feature.md), project its `owns:` globs
|
|
11
|
-
- **Doc update** — when the documented scope changes, update the doc's `owns:` globs
|
|
12
|
-
|
|
13
|
-
## How to derive the frontmatter
|
|
14
|
-
|
|
15
|
-
A feature doc's ownership frontmatter is `owns:` (required), `module:` (optional), `keywords:` (required), and `status:` (required). An optional `last-reviewed:` date (stamped whenever the doc is substantively reviewed or updated) gives the `maintenance` agent a staleness signal to rank its audits by — it is tooling metadata, never narrated in the body. `type:` (required — the genre, enum = the template names) and `rev:` (generator-written generation stamp) are the same class: external tooling reads them, sessions **preserve them on edits** and never narrate or inject them. The `maintenance` agent stamps `type:` on docs that predate the key.
|
|
16
|
-
|
|
17
|
-
**1. `owns:`** (the path scope)
|
|
18
|
-
|
|
19
|
-
Read the doc's content. Extract every source file path it references (file listings, function locations, component paths). Group them into the narrowest glob patterns that cover all referenced files without overlapping another doc's `owns:` globs at equal specificity. A doc may own several globs.
|
|
20
|
-
|
|
21
|
-
| Doc references | Glob |
|
|
22
|
-
| ------------------------------------ | ------------------------- |
|
|
23
|
-
| Multiple files under one directory | `src/feature/**` |
|
|
24
|
-
| Specific files in a shared directory | List each file explicitly |
|
|
25
|
-
| A single entry-point file | The exact file path |
|
|
26
|
-
|
|
27
|
-
Glob each pattern against the codebase. At `status: active`, drop any that match nothing; at `status: draft`, projected globs may match nothing yet — confirm them against real code when the doc flips to `active`.
|
|
28
|
-
|
|
29
|
-
**2. `module:`**
|
|
30
|
-
|
|
31
|
-
The single bounded-context label this feature belongs to, or omit it for a cross-cutting feature that belongs to no single context. A module is a label, not a folder — features sharing a `module:` value are what ties that module to code (a filter over the generated ownership index).
|
|
32
|
-
|
|
33
|
-
**3. `keywords:` & `status:`**
|
|
34
|
-
|
|
35
|
-
`keywords:` are the discovery terms topic→doc lookup rides. `status:` is `active`, `draft`, or `deprecated` — it steers the model toward live docs and away from draft/deprecated ones.
|
|
36
|
-
|
|
37
|
-
A doc's dependencies on other docs are expressed inline in its prose (links); cross-cutting contracts are diagnosed by the `boundary` skill from source, not persisted.
|
|
38
|
-
|
|
39
|
-
## Rules
|
|
40
|
-
|
|
41
|
-
- One canonical doc per path. A doc's `owns:` globs must not overlap another doc's at equal specificity — the narrower glob wins; equal-specificity overlap is an ownership conflict to resolve.
|
|
42
|
-
- Use glob patterns for directories, explicit paths for individual files. At `active`, never list paths that don't exist in the codebase; a `draft`'s projected paths are confirmed at `active`.
|
|
43
|
-
- When a doc covers a deep feature with sub-specs (e.g., `editor/`), each sub-spec owns its own globs — don't duplicate a path across siblings.
|
|
44
|
-
- For baseline/reconcile with many docs, use parallel sub-agents to read source and propose `owns:` globs.
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
# Instruction-File Style
|
|
2
|
-
|
|
3
|
-
The shared style for every file an agent obeys — a `CLAUDE.md`, a rule, an agent definition, skill prose. Prose style only: frontmatter is metadata, not style. Docs-tree documents follow the skill's templates and [`style-guide.md`](style-guide.md) instead.
|
|
4
|
-
|
|
5
|
-
## The test for every line
|
|
6
|
-
|
|
7
|
-
An instruction file is paid for whenever it loads, scaled by its load class: `CLAUDE.md` and rules load on **every turn of every session** — the most expensive prose in a repo per word; an agent definition loads per dispatch, a skill per invocation. The bar is not "is this true?" but **"must this be in front of the agent whenever this file loads?"** Measure weight in tokens, not lines; trim biggest-first on every edit.
|
|
8
|
-
|
|
9
|
-
**Rewriting, the test is armor vs. narration.** A reason clause either blocks a move an agent would otherwise make — the failure is counter-intuitive, the wrong fix looks correct, or the rule reads as arbitrary tidiness and gets "improved away" — or it explains the self-evident. Ask of each: *does the forbidden move look correct to an agent mid-task?* Keep the first kind, cut the second. **A constraint may lose its explanation; it may never lose its existence** — compression is fewer words for the same constraints, so a passage that cannot shrink without dropping one stays long.
|
|
10
|
-
|
|
11
|
-
## Coherence
|
|
12
|
-
|
|
13
|
-
A rewrite is not only a trim — read the file as one artifact and fix what disagrees or is missing:
|
|
14
|
-
|
|
15
|
-
- **Two statements of one fact agree, or become one.** A defaults block vs. the worked example beside it, a table row vs. a bullet — reconcile against the code the rule governs and keep one canonical statement; a silent disagreement is worse than either version alone, because each reader picks a different one.
|
|
16
|
-
- **Every cross-reference resolves** — the cited `§`, sibling file, or command exists and still says what the citation claims. Section numbers are a public surface other files cite: append, never reshuffle.
|
|
17
|
-
- **The body delivers what the scope line promises, and nothing it disclaims.** A topic named then left to guesswork is a hole; material the scope routes elsewhere is a leak.
|
|
18
|
-
- **Report what you cannot fix.** A defect outside the file — a stale sibling, an unshipped copy — is named in the handback, never fixed by widening the edit.
|
|
19
|
-
|
|
20
|
-
## Two genres, one style
|
|
21
|
-
|
|
22
|
-
Policy files (`CLAUDE.md`, rules) are declarative — assertion bullets and tables, no second person. Agent and skill bodies are procedures — second person, numbered steps, one observable action per step. The genre sets the shape; everything below applies to both.
|
|
23
|
-
|
|
24
|
-
## Routing
|
|
25
|
-
|
|
26
|
-
- **Link, don't copy — one canonical source per topic.** `CLAUDE.md` is a **router, not a manual**: per workflow, when to enter, what to dispatch, where the output lands — mechanics live in the agent or skill file, which loads only when it runs.
|
|
27
|
-
- **A rule never references a sibling rule.** Rules co-load, so pointing at one from another routes a reader to text already in front of them — noise that also drifts the moment either file moves. State what the rule owns, self-contained; the only outward links a rule carries are to skills and agents, whose bodies do *not* co-load. Routing downward from `CLAUDE.md` to a rule is fine — that is the router doing its job.
|
|
28
|
-
- **Cut generic engineering advice.** Agents already know how to code; keep only what is true of *this* stack and not derivable by looking at it.
|
|
29
|
-
- **Keep load-bearing rules even when project-specific.** Genericizing is for reference material, not guardrails — deleting a hard rule removes a constraint the agent will otherwise violate.
|
|
30
|
-
|
|
31
|
-
## Voice
|
|
32
|
-
|
|
33
|
-
- **Assertion — reason, in one breath.** "**Never name a deployed-value file `.env`** — the dev server auto-loads a root `.env` as local vars, so a prod-valued `.env` silently becomes the local environment." The reason is the rule's armor: an agent that knows the failure mode won't "improve" the rule away; a bare imperative invites second-guessing.
|
|
34
|
-
- **A reason appears once — at the rule it armors.** "One breath" caps a reason's length, not its multiplicity: the same rationale in the scope line, a section intro, and a bullet is the restatement trimming exists to remove. A convention whose only reason is consistency states that once, in the scope line.
|
|
35
|
-
- **One example, carrying every point it can — never a second example of the same point.** An example calibrates a rule an agent would otherwise read loosely; a second one demonstrating the same rule is restatement in costume. Prefer one worked case rich enough for several rules to cite over a fresh citation per bullet.
|
|
36
|
-
- **Grade the bindingness with words.** Bold **never / always / only / must** for hard constraints; "prefer", "default", "acceptable when" for defaults — and every escape hatch states its trigger and its price.
|
|
37
|
-
- **Absolute present tense.** Describe the current design as if it had always been the plan — no "previously", no version narration, no stale-reference tripwires, no progress markers. When something moves or is removed, fix every reference and state only the present fact; the journey lives in git history and `docs/history/`. (Docs-tree tense rules: [`style-guide.md`](style-guide.md) § The Two Natures.)
|
|
38
|
-
|
|
39
|
-
## Negative space
|
|
40
|
-
|
|
41
|
-
- **Name the rejected alternative.** A package table carries a **Don't use** column because an agent that knows the popular alternative reaches for it unless the file closes the door by name.
|
|
42
|
-
- **Pre-empt the workaround.** Where a failure predictably triggers improvisation, spell out the forbidden moves and the exact stop-and-report. The umbrella: **no silent fallback** — fail loudly rather than route around.
|
|
43
|
-
|
|
44
|
-
## Material & mechanics
|
|
45
|
-
|
|
46
|
-
- **Tables for enumerable facts, prose for judgment.** One row per item kills the urge to explain; anything that needs a *because* lives in prose around the table, never inside a cell.
|
|
47
|
-
- **No ASCII diagrams.** A box-and-arrow diagram costs many tokens for what a sentence or a small table carries.
|
|
48
|
-
- Inline-code every identifier, filename, command, and config key.
|
|
49
|
-
- ❌ / ✅ only inside banned/blessed lists, not as general decoration.
|
|
50
|
-
- `>` blockquotes set off interruptions — cross-pointers, callouts, agent guards — not the main line.
|