@nurix/etna 0.20.24 → 0.20.26
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/data/harness-index.json +1 -1
- package/data/harnesses/code/CLAUDE.md +5 -5
- package/data/harnesses/code/agents/bookkeeper.md +1 -1
- package/data/harnesses/code/agents/change-review.md +1 -1
- package/data/harnesses/code/agents/lld-mode.md +1 -1
- package/data/harnesses/code/agents/maintenance.md +7 -9
- package/data/harnesses/code/docs/structure.md +133 -71
- package/data/harnesses/code/harness.json +4 -4
- package/data/harnesses/code/hooks/awareness.mjs +0 -10
- package/data/harnesses/code/hooks/hooks.json +4 -4
- package/data/harnesses/code/hooks/lib/ownership.mjs +4 -2
- package/data/harnesses/code/hooks/lib/sweep.mjs +4 -8
- package/data/harnesses/code/skills/design/components/index.md +1 -1
- package/data/harnesses/code/skills/documentation/SKILL.md +20 -9
- package/data/harnesses/code/skills/documentation/references/frontmatter.md +3 -3
- package/data/harnesses/code/skills/documentation/references/style-guide.md +70 -27
- package/data/harnesses/code/skills/documentation/references/untemplated.md +2 -1
- package/data/harnesses/code/skills/documentation/scripts/doc-lint.mjs +87 -1
- package/data/harnesses/code/skills/documentation/templates/Readme.md +4 -3
- package/data/harnesses/code/skills/documentation/templates/bookkeeping.md +1 -1
- package/data/harnesses/code/skills/documentation/templates/docs-readme.md +15 -36
- package/data/harnesses/code/skills/documentation/templates/doctrine.md +82 -0
- package/data/harnesses/code/skills/documentation/templates/feature.md +31 -123
- package/data/harnesses/code/skills/documentation/templates/handover.md +174 -0
- package/data/harnesses/code/skills/documentation/templates/operations-procedure.md +1 -1
- package/data/harnesses/code/skills/documentation/templates/package.md +28 -94
- package/data/harnesses/code/skills/documentation/templates/root-readme.md +103 -65
- package/data/harnesses/code/skills/documentation/templates/setup.md +138 -0
- package/data/harnesses/code/skills/documentation/templates/system.md +25 -109
- package/data/harnesses/delivery/agents/lld-mode.md +1 -1
- package/data/harnesses/delivery/agents/maintenance.md +7 -9
- package/data/harnesses/delivery/harness.json +2 -2
- package/data/harnesses/delivery/hooks/hooks.json +1 -1
- package/data/harnesses/delivery/skills/documentation/SKILL.md +20 -9
- package/data/harnesses/delivery/skills/documentation/references/frontmatter.md +3 -3
- package/data/harnesses/delivery/skills/documentation/references/style-guide.md +70 -27
- package/data/harnesses/delivery/skills/documentation/references/untemplated.md +2 -1
- package/data/harnesses/delivery/skills/documentation/scripts/doc-lint.mjs +87 -1
- package/data/harnesses/delivery/skills/documentation/templates/Readme.md +4 -3
- package/data/harnesses/delivery/skills/documentation/templates/bookkeeping.md +1 -1
- package/data/harnesses/delivery/skills/documentation/templates/docs-readme.md +15 -36
- package/data/harnesses/delivery/skills/documentation/templates/doctrine.md +82 -0
- package/data/harnesses/delivery/skills/documentation/templates/feature.md +31 -123
- package/data/harnesses/delivery/skills/documentation/templates/handover.md +174 -0
- package/data/harnesses/delivery/skills/documentation/templates/operations-procedure.md +1 -1
- package/data/harnesses/delivery/skills/documentation/templates/package.md +28 -94
- package/data/harnesses/delivery/skills/documentation/templates/root-readme.md +103 -65
- package/data/harnesses/delivery/skills/documentation/templates/setup.md +138 -0
- package/data/harnesses/delivery/skills/documentation/templates/system.md +25 -109
- package/data/harnesses/discussion/harness.json +2 -2
- package/data/harnesses/discussion/hooks/hooks.json +1 -1
- package/data/harnesses/etna/agents/change-review.md +1 -1
- package/data/harnesses/etna/agents/lld-mode.md +1 -1
- package/data/harnesses/etna/agents/maintenance.md +7 -9
- package/data/harnesses/etna/harness.json +2 -2
- package/data/harnesses/etna/hooks/hooks.json +1 -1
- package/data/harnesses/etna/skills/documentation/SKILL.md +20 -9
- package/data/harnesses/etna/skills/documentation/references/frontmatter.md +3 -3
- package/data/harnesses/etna/skills/documentation/references/style-guide.md +70 -27
- package/data/harnesses/etna/skills/documentation/references/untemplated.md +2 -1
- package/data/harnesses/etna/skills/documentation/scripts/doc-lint.mjs +87 -1
- package/data/harnesses/etna/skills/documentation/templates/Readme.md +4 -3
- package/data/harnesses/etna/skills/documentation/templates/bookkeeping.md +1 -1
- package/data/harnesses/etna/skills/documentation/templates/docs-readme.md +15 -36
- package/data/harnesses/etna/skills/documentation/templates/doctrine.md +82 -0
- package/data/harnesses/etna/skills/documentation/templates/feature.md +31 -123
- package/data/harnesses/etna/skills/documentation/templates/handover.md +174 -0
- package/data/harnesses/etna/skills/documentation/templates/operations-procedure.md +1 -1
- package/data/harnesses/etna/skills/documentation/templates/package.md +28 -94
- package/data/harnesses/etna/skills/documentation/templates/root-readme.md +103 -65
- package/data/harnesses/etna/skills/documentation/templates/setup.md +138 -0
- package/data/harnesses/etna/skills/documentation/templates/system.md +25 -109
- package/lib/install/materialize.mjs +18 -14
- package/lib/install/plan.mjs +4 -11
- package/package.json +3 -2
- package/data/harnesses/code/skills/documentation/templates/structure.md +0 -71
- package/data/harnesses/delivery/skills/documentation/templates/structure.md +0 -71
- package/data/harnesses/etna/skills/documentation/templates/structure.md +0 -71
|
@@ -1,131 +1,65 @@
|
|
|
1
1
|
# Package Documentation (docs/architecture/packages/{package}.md)
|
|
2
2
|
|
|
3
|
-
Truth document. Use for: **one workspace package —
|
|
3
|
+
Truth document. Use for: **one workspace package** — one unit of distribution: a manifest, a build, a binary, a bundle, a Worker. One file per package, named for its folder.
|
|
4
4
|
|
|
5
|
-
**A
|
|
5
|
+
**A document is read by people, and its footer is for the agent** (`references/style-guide.md` § Documents are read by people). A package document tells a person what the package is for, why it is its own unit, how it ships and to whom, how it is meant to be used, and what its consumers can rely on. Its manifest, build, entry, internal layout and test wiring are the code graph's (`docs/architecture/systems/knowledge-layer.md`), not a roster here.
|
|
6
6
|
|
|
7
|
-
**
|
|
7
|
+
**A package document's deepest layer is its public contract** (`references/style-guide.md` § Shape — the model first, the detail after): the commands and flags a person types, the exports another package imports, what is installed and where. For a CLI the flags *are* the promise, so they belong in How it is used. It stops before internal layout, build steps and which file holds what.
|
|
8
8
|
|
|
9
|
-
**
|
|
9
|
+
**A package document is the residual owner of its own tree.** Its `owns:` is the whole package glob — the broadest claim on those paths, so it loses to every narrower system or feature claim. The one enumerable fact it declares is the ownership table: which subtrees other documents claim.
|
|
10
10
|
|
|
11
|
-
**Required
|
|
12
|
-
|
|
13
|
-
Package documents run long because they are exhaustive over their residue — roughly 150 to 600 lines is the working range, and the top of that range is a package holding an application, not a document that has lost discipline.
|
|
11
|
+
**Required:** the frontmatter, the identity line, the goal line, **Why it exists**, **Ownership** (one paragraph or a table), **How it is used**, **What it promises**, **For the agent**. **What was decided** once any choice was made the code cannot explain. **Known gaps** only when there is one. Nothing else — the feature template's lint rules apply. Forty to a hundred and twenty lines.
|
|
14
12
|
|
|
15
13
|
```yaml
|
|
16
14
|
---
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
type: package
|
|
16
|
+
status: active
|
|
17
|
+
objects: [nustack cli, device credential] # required — the objects this package designs or ships
|
|
18
|
+
owns: ["packages/{name}/**"] # required until the graph computes ownership — the residual claim
|
|
19
|
+
applies: [docs/architecture/common/api.md] # optional
|
|
22
20
|
---
|
|
23
21
|
```
|
|
24
22
|
|
|
25
|
-
> A package document carries no `module:` — a package is already a bounded unit, and a second label
|
|
26
|
-
> for the same boundary is a thing to keep in sync for nothing. `last-reviewed:` is optional and,
|
|
27
|
-
> like `type:`, is tooling metadata: preserve it, never narrate it.
|
|
28
|
-
|
|
29
23
|
```
|
|
30
24
|
# {package-path} — {the one-line role}
|
|
31
25
|
|
|
32
|
-
**Package:** `@scope/name` · **Ships as:** {
|
|
33
|
-
source-first workspace package / a Worker on {domain}} · **Source:** `packages/{name}`
|
|
34
|
-
|
|
35
|
-
{One paragraph: what this package is and the job it does in the product. Name what it holds that
|
|
36
|
-
nothing else does, and what it deliberately does not hold. Written for someone who has not opened
|
|
37
|
-
the folder.}
|
|
38
|
-
|
|
39
|
-
{One paragraph: the ownership boundary. This document is the residual owner of `packages/{name}/**`;
|
|
40
|
-
these subtrees are claimed at higher specificity by these documents and are pointed at, not
|
|
41
|
-
restated. Where the routing is more than a sentence, make it the table below instead.}
|
|
26
|
+
**Package:** `@scope/name` · **Ships as:** {…} · **Source:** `packages/{name}`
|
|
42
27
|
|
|
43
|
-
{
|
|
44
|
-
`packages/{name}/` unless they name another package."}
|
|
28
|
+
{One sentence: the job this package does in the product, for whom.}
|
|
45
29
|
|
|
46
|
-
##
|
|
30
|
+
## Why it exists
|
|
47
31
|
|
|
48
|
-
{
|
|
49
|
-
halves exist and which do not, with the source evidence for each claim, and say what a reader who
|
|
50
|
-
runs the unbuilt half will actually observe. A package whose subject as a whole does not run is
|
|
51
|
-
`status: draft` and says so here; a scoped gap in a working package stays `active` and takes an
|
|
52
|
-
UNBUILT marker at the section that describes the gap.}
|
|
32
|
+
{Why it is its own unit, what it holds that nothing else does, what it deliberately does not hold, who consumes it, how and when it ships. Prose.}
|
|
53
33
|
|
|
54
|
-
## Ownership
|
|
34
|
+
## Ownership
|
|
55
35
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
**The package glob is the residual claim.** A system or feature document's `owns:` is more specific
|
|
59
|
-
and wins by specificity, so this document describes only what none of them claims, and points to
|
|
60
|
-
each for the rest.
|
|
61
|
-
|
|
62
|
-
| Path | What it is |
|
|
63
|
-
| --- | --- |
|
|
64
|
-
| `src/index.ts` | {the residue: the entry, the dispatch, the layout} |
|
|
36
|
+
This document is the residual owner of `packages/{name}/**`. Claimed at higher specificity:
|
|
65
37
|
|
|
66
38
|
| Subtree | Stated and owned by |
|
|
67
39
|
| --- | --- |
|
|
68
40
|
| `src/{machine}/**` | [{system}](../systems/{system}.md) |
|
|
69
|
-
| `src/surfaces/{x}/**` | [{feature}](../../features/{feature}.md) |
|
|
70
41
|
|
|
71
|
-
##
|
|
42
|
+
## How it is used
|
|
72
43
|
|
|
73
|
-
{
|
|
74
|
-
(commands, the store, the on-ramp) and what a UI package owes (the host port, the frame, the route
|
|
75
|
-
zones, the component pool) share no headings. Name each section for the thing it describes and
|
|
76
|
-
order them the way a reader meets them — identity and build first, then the surface, then what it
|
|
77
|
-
writes, then how it is verified. Prefer a table wherever the content is a roster (commands, routes,
|
|
78
|
-
exports, bindings, environment variables); prefer prose wherever the content is a rule and its
|
|
79
|
-
reason. State mechanisms and contracts, never pasted implementations.}
|
|
44
|
+
{What a person or another package does with it, in plain words — install, run, import, call — and what they see. Terms introduced on first use. Code named only at a seam.}
|
|
80
45
|
|
|
81
|
-
##
|
|
46
|
+
## What was decided
|
|
82
47
|
|
|
83
|
-
{
|
|
84
|
-
commands a reader runs. A package whose verification is a build check names the check instead
|
|
85
|
-
(`## Checks`, `## Build and test`); a package with no suite of its own says so in one line in the
|
|
86
|
-
build section and carries no heading here.}
|
|
48
|
+
{Themed paragraphs.}
|
|
87
49
|
|
|
88
|
-
##
|
|
50
|
+
## What it promises
|
|
89
51
|
|
|
90
|
-
|
|
91
|
-
| --- | --- |
|
|
92
|
-
| `packages/{name}/package.json` | {the manifest: the bin, the exports, the scripts} |
|
|
93
|
-
| `packages/{name}/src/index.ts` | {the entry} |
|
|
52
|
+
{What a consumer can rely on and what the package refuses; checkable sentences, grouped.}
|
|
94
53
|
|
|
95
|
-
|
|
96
|
-
from the document to the code. Close with the inverse where it helps: "Read here, owned elsewhere:"
|
|
97
|
-
naming the paths the body describes but another document claims.}
|
|
54
|
+
## Known gaps
|
|
98
55
|
|
|
99
|
-
|
|
56
|
+
{One paragraph, only when needed.}
|
|
100
57
|
|
|
101
|
-
|
|
102
|
-
- [`{other-package}.md`]({other-package}.md) — {the seam between the two}
|
|
103
|
-
- [`{doctrine}.md`](../common/{doctrine}.md) — {the cross-cutting contract this package answers to}
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
### The identity line
|
|
58
|
+
## For the agent
|
|
107
59
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
workspace, **how does it ship** (a public tarball, a private source-first package, a deployed
|
|
111
|
-
Worker, a signed installer), and **where is its source**. A package that ships two artifacts names
|
|
112
|
-
both. Add a `**Crate:**` or `**Deploys as:**` term where the package has one; drop any term that
|
|
113
|
-
would restate the title.
|
|
60
|
+
Objects: {…}. Commands {…} and exports {…} — the public contract. Code root `packages/{name}/`. Seams {…} by name. Checklist `tests/{package}.md`. See also {neighbour} ({why}). No file lists or symbol rosters — those are the graph's.
|
|
61
|
+
```
|
|
114
62
|
|
|
115
63
|
### Marking what is decided and unbuilt
|
|
116
64
|
|
|
117
|
-
|
|
118
|
-
half does not exist — wrap the prose in a marker so the gap is machine-findable and its evidence
|
|
119
|
-
travels with it:
|
|
120
|
-
|
|
121
|
-
```
|
|
122
|
-
<!-- UNBUILT:START — {what is decided, where it is decided (an AD or an owner ruling), and the
|
|
123
|
-
source evidence that it is not built: the file that does not exist, the route that is not mounted,
|
|
124
|
-
the binding that is not declared} -->
|
|
125
|
-
{the prose describing the unbuilt half}
|
|
126
|
-
<!-- UNBUILT:END -->
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
**A design that was decided *against* carries no marker.** A marker means the work is owed and
|
|
130
|
-
absent; using one for a rejected design turns the register of debt into a register of opinions.
|
|
131
|
-
Say in prose that it is not built and not owed, and name the decision that settled it.
|
|
65
|
+
`<!-- UNBUILT:START — {…} -->` … `<!-- UNBUILT:END -->` around the prose for a decided, unbuilt half; a design decided *against* carries no marker.
|
|
@@ -1,104 +1,142 @@
|
|
|
1
|
-
# Project Root README
|
|
1
|
+
# Project Root README (/README.md)
|
|
2
2
|
|
|
3
|
-
Truth document. Use for: the
|
|
3
|
+
Truth document. Use for: the repository root `/README.md`. It opens outward — what the product does, for whom, and where it runs, in a user's terms — then turns inward for the team and coding agents: what state the repo is in, how it works, what its parts are and what must not break, then routes every other question into `docs/`. The outward part comes first because it is what a stranger reads; the inward part is longer because it is what the team uses. **It hosts nothing it can link to.** It is distinct from `docs/README.md`, which describes the folders of the docs tree, and from `CLAUDE.md` / `AGENTS.md`, the standing rules an agent loads. It points at both and restates neither.
|
|
4
4
|
|
|
5
|
-
###
|
|
5
|
+
### What it carries
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Sections come in this order; 1 to 3 are the outward-facing first screen, 4 onward the inward page. Skip any section the repo cannot fill truthfully. Never pad it, and never leave a stub.
|
|
8
8
|
|
|
9
|
-
1. **
|
|
10
|
-
2. **What
|
|
11
|
-
3. **
|
|
12
|
-
4. **
|
|
13
|
-
5. **
|
|
14
|
-
6. **How
|
|
15
|
-
7. **What
|
|
9
|
+
1. **Identity.** The H1 plus two or three sentences in a user's terms: what the product is, where it runs, and what using it is like.
|
|
10
|
+
2. **What it does.** Two to four paragraphs, outward-facing: the core loop as a person meets it, what surrounds that loop, how the product follows the person across its surfaces, and who it is for, closing with what it deliberately is not. Plain words, no feature roster, no superlatives.
|
|
11
|
+
3. **Where it runs.** One paragraph: the addresses, the distributed artifacts and where they are published, where identity comes from, and whether a self-hosted edition exists.
|
|
12
|
+
4. **The turn.** A rule and one paragraph saying the rest is for the team and agents, with the scope line: what lives in this repo and what lives elsewhere.
|
|
13
|
+
5. **State.** Optional: a one-line blockquote, present only while something repo-wide is true that a newcomer must know (frozen, mid-migration, mid-breaking-change on `dev`). It links the plan or runbook that owns the change. Say here which units publish and where, if any do.
|
|
14
|
+
6. **How it works.** Three to six short paragraphs, or numbered stages, along the main request or data path: who arrives, what is built, where state lives, how the result leaves. Name a technology only where it explains a stage. End with a link to the system overview.
|
|
15
|
+
7. **What is in the repository.** A sentence on how the tree is organised, then one table row per top-level unit (package, app, service), giving its path, what it is in one line, and its owning doc; the top folders that are not packages get a sentence each. This replaces the tree.
|
|
16
|
+
8. **Rules that bite.** Optional. At most five one-line invariants, public/internal boundaries, never-edit paths (generated, protected) or non-goals, each linked to the doc that argues it.
|
|
17
|
+
9. **Where to go.** An intent-to-destination table. Its last row is the one for agents.
|
|
18
|
+
10. **Everyday commands.** Optional. At most four commands run on every change, ending at the gate a push must pass. First-run commands are never here.
|
|
16
19
|
|
|
17
|
-
|
|
20
|
+
### What it leaves out
|
|
21
|
+
|
|
22
|
+
| Left out | Lives in |
|
|
23
|
+
| --- | --- |
|
|
24
|
+
| Getting started, install, prerequisites, env files, first run, troubleshooting | `docs/operations/setup.md` |
|
|
25
|
+
| Stack: technologies, what each is for, where its version is pinned | `docs/operations/setup.md` § Stack. Why it was chosen goes in `docs/architecture/` |
|
|
26
|
+
| Directory or file tree | `docs/structure.md`, the only tree |
|
|
27
|
+
| Daily loop, watch modes, per-package traps | `docs/operations/local-development.md` |
|
|
28
|
+
| Contributing procedure, branch model, commit rules | `CLAUDE.md` and `docs/operations/` |
|
|
29
|
+
| Feature list, news, "what's new", roadmap, changelog | `docs/features/`, `docs/history/` |
|
|
30
|
+
| Badges, logos, images, screenshots, social links, sponsors, hand-written TOC, license text, superlatives | Nowhere. The outward sections are plain prose too. Agents cannot read them and the team does not need them. License is one line or absent |
|
|
18
31
|
|
|
19
32
|
### Writing rules
|
|
20
33
|
|
|
21
|
-
- **
|
|
22
|
-
- **
|
|
23
|
-
- **
|
|
24
|
-
- **
|
|
25
|
-
- **
|
|
26
|
-
- **
|
|
27
|
-
- **
|
|
28
|
-
- **
|
|
34
|
+
- **Budget: between 60 and 140 non-blank lines, the outward part under a third of it.** Prose is welcome — How it works and Rules that bite read better as paragraphs than as rows — but past the ceiling a section is hosting content that belongs in a doc. Move it and leave the link.
|
|
35
|
+
- **Every section is either a fact the reader acts on or a link.** If a section needs a paragraph, it needs a doc.
|
|
36
|
+
- **One H1, then H2 sections, in plain Markdown.** Sentence-case headings, no emoji, no HTML layout, and no `#` comment lines inside code blocks (they parse as H1s).
|
|
37
|
+
- **Relative links into the repo only.** Never an absolute repo URL. Never an external site as the home of a canonical doc.
|
|
38
|
+
- **Link folders and mandated scaffolds, never rosters.** The allowed targets are folders, `docs/README.md`, `docs/structure.md`, `docs/operations/setup.md`, `docs/history/CHANGELOG.md`, `docs/history/backlog.md`, `CLAUDE.md` and the owning docs in the Map. A procedure is named only where a Where-to-go row needs it. Never list individual feature docs: the ownership index finds them.
|
|
39
|
+
- **No tree.** The Map stops at top-level units and never lists files. Mark paths that look primary but are not, for example "`legacy/`: reference only, never edited".
|
|
40
|
+
- **The Map is a coarse view of the ownership index, not a rival to it.** The Owning doc column names the doc that the index's `owns:` globs resolve to. When the two disagree the index wins, and the Map row is fixed in the same change.
|
|
41
|
+
- **No version numbers and no dates.** Name the file that pins a version (`.nvmrc`, `packageManager`, `rust-toolchain.toml`). Write in the present tense, with no "coming soon" and no "as of".
|
|
42
|
+
- **State rules, don't argue them.** One line each. The reasoning lives in the linked doc, and agent process rules stay in `CLAUDE.md`.
|
|
43
|
+
- **Commands come from the repo.** Detect the package manager from the lockfile (`pnpm-lock.yaml` gives pnpm, `yarn.lock` gives yarn, otherwise npm). Use only scripts that exist, each with a trailing comment saying what it does.
|
|
29
44
|
|
|
30
45
|
### Template
|
|
31
46
|
|
|
32
47
|
```markdown
|
|
33
|
-
# {
|
|
48
|
+
# {Project name}
|
|
34
49
|
|
|
35
|
-
{
|
|
50
|
+
{Two or three sentences in a user's terms: what the product is, where it runs, what using it is like.}
|
|
36
51
|
|
|
37
|
-
## What
|
|
52
|
+
## What it does
|
|
38
53
|
|
|
39
|
-
|
|
40
|
-
- **{Family 2}** — {what's in it.}
|
|
41
|
-
- **{Family 3}** — {what's in it.}
|
|
54
|
+
{The core loop as a person meets it: what they bring, what the product does, what they get back and what record it leaves.}
|
|
42
55
|
|
|
43
|
-
|
|
56
|
+
{What surrounds the loop: the capabilities a team needs to run it, named plainly.}
|
|
44
57
|
|
|
45
|
-
|
|
58
|
+
{How it follows the person across surfaces: CLI, desktop, integrations, agents' doors.}
|
|
46
59
|
|
|
47
|
-
|
|
48
|
-
- {Build tool} {version}
|
|
49
|
-
- {Other load-bearing deps}
|
|
60
|
+
{Who it is for, and what it deliberately is not.}
|
|
50
61
|
|
|
51
|
-
##
|
|
62
|
+
## Where it runs
|
|
52
63
|
|
|
53
|
-
|
|
54
|
-
{pm} install
|
|
55
|
-
{pm} run dev # what it does (port, URL)
|
|
56
|
-
{pm} run build # what it does
|
|
57
|
-
{pm} run preview # what it does (omit if not applicable)
|
|
58
|
-
\`\`\`
|
|
64
|
+
{Addresses; distributed artifacts and where they publish; where identity comes from; whether a self-hosted edition exists.}
|
|
59
65
|
|
|
60
|
-
|
|
66
|
+
---
|
|
61
67
|
|
|
62
|
-
|
|
68
|
+
The rest of this page is for the team and for coding agents working in this repository. {What lives in this repo and what lives elsewhere.} {One sentence: the sections below route every other question into docs/.}
|
|
63
69
|
|
|
64
|
-
{
|
|
70
|
+
> **State:** {one line: what is in flux right now; which units publish where} → [{plan or runbook}](docs/history/{plans|migrations}/{file}.md) ← optional; delete when the flux ends
|
|
65
71
|
|
|
66
|
-
|
|
67
|
-
| -------------------- | ---------------------- |
|
|
68
|
-
| `{route or command}` | {description} |
|
|
72
|
+
## How it works
|
|
69
73
|
|
|
70
|
-
|
|
74
|
+
1. **{Stage}**: {what happens, naming the mechanism only where it explains the step}.
|
|
75
|
+
2. **{Stage}**: {…}.
|
|
76
|
+
3. **{Stage}**: {where state lives}.
|
|
77
|
+
4. **{Stage}**: {the outbound effect: what is written, deployed or returned}.
|
|
71
78
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
└── {folder}/ # {purpose}
|
|
78
|
-
\`\`\`
|
|
79
|
+
{Optional, one sentence naming the seam everything passes through, e.g. "Every client reaches data through `{path}`; nothing else talks to the database."} The full account: [{system overview}](docs/architecture/{overview}.md).
|
|
80
|
+
|
|
81
|
+
## What is in the repository
|
|
82
|
+
|
|
83
|
+
{One or two sentences: the workspace shape and where each unit's design document lives.}
|
|
79
84
|
|
|
80
|
-
|
|
85
|
+
| Path | Role | Owning doc |
|
|
86
|
+
| --- | --- | --- |
|
|
87
|
+
| [`{packages/unit}/`]({packages/unit}/) | {one line: what it is and who consumes it} | [{doc}](docs/architecture/packages/{unit}.md) |
|
|
88
|
+
| [`{packages/unit}/`]({packages/unit}/) | {one line} | [{doc}]({path}) |
|
|
89
|
+
| [`{top-folder}/`]({top-folder}/) | {one line; "generated" or "reference only" where true} | — |
|
|
81
90
|
|
|
82
|
-
|
|
83
|
-
2. {Re-export from the public surface.}
|
|
84
|
-
3. {Wire into the playground / example app / test harness so reviewers can see it render.}
|
|
85
|
-
4. {Document any divergence from upstream in `docs/{...}`.}
|
|
91
|
+
{One sentence each for the top folders that are not packages — `registry/`, `scripts/`, `docs/` — with their owning doc.} Where every doc lives: [docs/structure.md](docs/structure.md).
|
|
86
92
|
|
|
87
|
-
##
|
|
93
|
+
## Rules that bite
|
|
88
94
|
|
|
89
|
-
{
|
|
95
|
+
{One sentence saying these are stated here and argued in the documents they point at.}
|
|
90
96
|
|
|
91
|
-
|
|
97
|
+
- **{Invariant}**: {the rule, one line}. → [{source}]({path})
|
|
98
|
+
- **{Boundary}**: `{path}` is the only {public | published} surface; everything else is internal.
|
|
99
|
+
- **{Never-edit paths}**: `{path}` is {generated by `{command}` | protected}; edit {the source} instead.
|
|
100
|
+
- **Not here:** {a non-goal stated as a refusal}.
|
|
92
101
|
|
|
93
|
-
|
|
102
|
+
## Where to go
|
|
94
103
|
|
|
95
|
-
|
|
104
|
+
| I want to… | Go to |
|
|
105
|
+
| --- | --- |
|
|
106
|
+
| Set up a machine and run it the first time | [docs/operations/setup.md](docs/operations/setup.md) |
|
|
107
|
+
| Work on it day to day | [docs/operations/{local-development}.md](docs/operations/{local-development}.md) |
|
|
108
|
+
| Understand the design | [docs/architecture/](docs/architecture/) |
|
|
109
|
+
| Change a feature | [docs/features/](docs/features/), found through the ownership index |
|
|
110
|
+
| Change a contract ({db schema · wire envelope · auth · events · env}) | [{contract doc}]({path}), boundary-checked before the change |
|
|
111
|
+
| Ship or release | [docs/operations/{deployment}.md](docs/operations/{deployment}.md) |
|
|
112
|
+
| Place a new doc | [docs/structure.md](docs/structure.md) · [docs/README.md](docs/README.md) |
|
|
113
|
+
| See what changed and what is open | [CHANGELOG](docs/history/CHANGELOG.md) · [backlog](docs/history/backlog.md) |
|
|
114
|
+
| Work here as a coding agent | [CLAUDE.md](CLAUDE.md) ([AGENTS.md](AGENTS.md) for other runtimes): load before any edit |
|
|
96
115
|
|
|
97
|
-
|
|
116
|
+
## Everyday commands
|
|
117
|
+
|
|
118
|
+
\`\`\`bash
|
|
119
|
+
{pm} {typecheck} # {what it checks}
|
|
120
|
+
{pm} {test} # {the unit suite, from a cold shell}
|
|
121
|
+
{pm} {gate} # {what a change must pass before it is pushed}
|
|
122
|
+
\`\`\`
|
|
123
|
+
|
|
124
|
+
`{pm} --filter <unit> run` lists a unit's own scripts.
|
|
125
|
+
|
|
126
|
+
{License, one line, e.g. "UNLICENSED, internal use only."} ← optional
|
|
98
127
|
```
|
|
99
128
|
|
|
100
129
|
### Baseline scaffolding behavior
|
|
101
130
|
|
|
102
|
-
The baseline
|
|
131
|
+
The baseline **does** scaffold `/README.md` when it is missing, and it fills each section from the repo:
|
|
132
|
+
|
|
133
|
+
- **Identity, What it does, Where it runs:** from the product charter and vision documents under `docs/architecture/common/` (what the product is, the core loop, who it is for), the package manifests (what publishes where), and the deploy config (addresses). Written in a user's terms; where the charter is missing, the baseline writes Identity only and raises a `note:` row for the rest.
|
|
134
|
+
- **How it works:** from the system overview.
|
|
135
|
+
- **Map:** from the workspace globs and the ownership index.
|
|
136
|
+
- **Rules:** from `docs/operations/protected-files.md` and the architecture doctrine.
|
|
137
|
+
- **Commands:** from the lockfile and the root scripts.
|
|
138
|
+
- **Where to go:** only the rows whose targets exist.
|
|
139
|
+
|
|
140
|
+
It drops every section it cannot fill concretely.
|
|
103
141
|
|
|
104
|
-
**
|
|
142
|
+
**It never overwrites an existing root README.** If one is present, even sparse or outdated, the baseline leaves it untouched and raises a `note:` row proposing the reshape. Reshaping is a separate, explicit request. When it runs, each removed section moves in the same change: getting-started, install and env content and the Stack go to `docs/operations/setup.md`, a drawn tree becomes the Map (the tree itself stays in `structure.md`), and a contributing checklist goes to `docs/operations/`. Nothing is deleted without a home.
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
# Setup (docs/operations/setup.md)
|
|
2
|
+
|
|
3
|
+
Truth document, operations genre (`type: operations`). Use for: **the one-time path from a fresh machine to a first verified run.** It covers what the repo is built on, prerequisites, install, env files, local services, the first commands, proof that it works, and the failures a fresh clone hits. There is **one per repo**, always named `setup.md`, and it is a mandated scaffold. The root README's only setup content is a Where-to-go row linking it.
|
|
4
|
+
|
|
5
|
+
It is distinct from `local-development.md`, the daily loop: watch modes, resetting state, per-package traps, the inner test cycle. Setup runs once per machine. Local development runs every session. Setup ends by handing off to it, and neither copies the other. Deploying is `deployment.md`.
|
|
6
|
+
|
|
7
|
+
Required: **Goal**, **Stack**, **Prerequisites**, **Install**, **First run**, **Verify**. Optional, included only with real content: the audience fork, **Before cloning**, **Environment files**, **Local services**, **Reset**, **Common failures**.
|
|
8
|
+
|
|
9
|
+
### Writing rules
|
|
10
|
+
|
|
11
|
+
- **Never write a version a file already pins.** Each row names the pinning file (`.nvmrc`, `package.json` `engines` / `packageManager`, `rust-toolchain.toml`, `go.mod`) and the command that checks it. A typed number is a second source that drifts on the next bump.
|
|
12
|
+
- **Stack is one row per layer.** Give the technology, what it is for in this repo, and where its version is pinned. Why it was chosen belongs to `docs/architecture/`, linked once. Don't repeat the dependency list: the manifests are the roster.
|
|
13
|
+
- **One path, from the lockfile.** `pnpm-lock.yaml` gives pnpm, `yarn.lock` gives yarn, otherwise npm. Say how it is activated (`corepack enable`). Never write "or npm / yarn". Give a per-OS variant only where the commands really differ.
|
|
14
|
+
- **Traps before commands.** Anything a fresh clone hits before the first command goes in Before cloning, not halfway down the steps: LFS, submodules, a required stub file, an access grant, a credential that has to be requested.
|
|
15
|
+
- **Copy-paste runnable, one action per step, each with its expected outcome.** Run non-interactively where the tool allows it, so an agent can execute the step unchanged. "It should work now" is never a step.
|
|
16
|
+
- **Script first, then document.** If a bootstrap script or task exists, it is the step, and the doc carries only the judgment around it. A setup sequence run often with no script gets a script.
|
|
17
|
+
- **Env files as a table, never a variable dump.** One row per file: where it is copied from, what must be filled, where the values come from, whether it is required to boot. The variable contract is the example file and the code's env type, linked and never copied. Secret values never appear.
|
|
18
|
+
- **Destructive commands state their blast radius where they appear:** what is deleted or truncated, whether it prompts, and the flag that skips the prompt.
|
|
19
|
+
- **Verification is observable:** a health probe and its expected status, a URL and what it shows, a seeded login, a doctor command and its output, or the test command passing from a cold shell.
|
|
20
|
+
- **Common failures are keyed by the exact error text,** followed by the cause and the fix, where the fix is a command or a file edit. Append a failure only once it has been root-caused, never as speculation.
|
|
21
|
+
- **Per-package divergence is a subsection of this file.** A unit whose setup differs gets a `### {unit}` block under First run, or a row linking its own procedure. It never gets a second setup doc.
|
|
22
|
+
|
|
23
|
+
### Template
|
|
24
|
+
|
|
25
|
+
```markdown
|
|
26
|
+
---
|
|
27
|
+
type: operations
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
# Setup
|
|
31
|
+
|
|
32
|
+
**Goal:** take a fresh machine from clone to a verified first run of {what runs: e.g. "the product Worker on :{port} and the web shell on :{port}, signed in as the dev fixture"}. Done once per machine; the daily loop is [`local-development.md`]({local-development}.md).
|
|
33
|
+
|
|
34
|
+
{Optional audience fork: "Only running {the CLI / one package}? Stop after Install and see [`{procedure}`]({path})."}
|
|
35
|
+
|
|
36
|
+
## Stack
|
|
37
|
+
|
|
38
|
+
| Layer | Technology | For | Version pinned by |
|
|
39
|
+
| --- | --- | --- | --- |
|
|
40
|
+
| {Runtime} | {Node} | {what runs on it} | [`.nvmrc`](../../.nvmrc) |
|
|
41
|
+
| {Server} | {framework · data layer} | {what it serves} | [`{package.json}`](../../{path}/package.json) |
|
|
42
|
+
| {Client} | {framework · build tool · styling} | {which surfaces} | [`{package.json}`](../../{path}/package.json) |
|
|
43
|
+
| {Tests} | {runners} | {unit · e2e} | {manifest} |
|
|
44
|
+
|
|
45
|
+
Why these were chosen: [{system overview}](../architecture/{overview}.md).
|
|
46
|
+
|
|
47
|
+
## Prerequisites
|
|
48
|
+
|
|
49
|
+
| Tool | Version from | Check |
|
|
50
|
+
| --- | --- | --- |
|
|
51
|
+
| {Node} | [`.nvmrc`](../../.nvmrc) | `node -v` |
|
|
52
|
+
| {pnpm} | `packageManager` in [`package.json`](../../package.json), via `corepack enable` | `pnpm -v` |
|
|
53
|
+
| {Docker / Rust / wrangler / …} | {pinning file, or "any current"} | `{command}` |
|
|
54
|
+
|
|
55
|
+
- **Access:** {repo, secrets store, cloud account, registry token, and who grants each}.
|
|
56
|
+
|
|
57
|
+
## Before cloning ← delete if none
|
|
58
|
+
|
|
59
|
+
- **{Trap}:** {what a fresh clone hits and the one command that clears it, e.g. `git lfs install`, `git submodule update --init`}.
|
|
60
|
+
|
|
61
|
+
## Install
|
|
62
|
+
|
|
63
|
+
\`\`\`bash
|
|
64
|
+
git clone {url} && cd {repo}
|
|
65
|
+
corepack enable
|
|
66
|
+
{pm} install # expect: {what a clean install ends with}
|
|
67
|
+
\`\`\`
|
|
68
|
+
|
|
69
|
+
## Environment files ← delete if none
|
|
70
|
+
|
|
71
|
+
| File | Copy from | Fill | Values come from | Required to boot |
|
|
72
|
+
| --- | --- | --- | --- | --- |
|
|
73
|
+
| `{path/.dev.vars}` | `{path/.dev.vars.example}` | {keys, or "every blank"} | {vault, the owner, a generated local value} | {yes / no} |
|
|
74
|
+
|
|
75
|
+
The contract is [`{example file or typed Env}`](../../{path}). Read it before concluding a value is missing. {Which of these files are gitignored.}
|
|
76
|
+
|
|
77
|
+
## Local services ← delete if none
|
|
78
|
+
|
|
79
|
+
| Service | Start | Port | Ready when |
|
|
80
|
+
| --- | --- | --- | --- |
|
|
81
|
+
| {local DB / emulator} | `{command}` | {port} | `{probe}` returns {expected} |
|
|
82
|
+
|
|
83
|
+
## First run
|
|
84
|
+
|
|
85
|
+
1. Prepare local state.
|
|
86
|
+
|
|
87
|
+
\`\`\`bash
|
|
88
|
+
{pm} --filter {unit} {migrate-and-seed} # expect: {output}
|
|
89
|
+
\`\`\`
|
|
90
|
+
|
|
91
|
+
2. Start the {backend}.
|
|
92
|
+
|
|
93
|
+
\`\`\`bash
|
|
94
|
+
{pm} --filter {unit} {dev:server} # expect: listening on :{port}
|
|
95
|
+
\`\`\`
|
|
96
|
+
|
|
97
|
+
3. Start the {frontend / CLI}.
|
|
98
|
+
|
|
99
|
+
\`\`\`bash
|
|
100
|
+
{pm} --filter {unit} {dev} # expect: {URL}
|
|
101
|
+
\`\`\`
|
|
102
|
+
|
|
103
|
+
4. Open `{http://localhost:port}` and {sign in as `{seeded user}` / reach `{first screen}`}.
|
|
104
|
+
|
|
105
|
+
## Verify
|
|
106
|
+
|
|
107
|
+
- `{curl -fsS http://localhost:{port}/{health}}` returns `200` {and `{body}`}.
|
|
108
|
+
- `{doctor or status command}` reports {expected}. ← keep whichever exists
|
|
109
|
+
- `{pm} {test}` passes from this cold shell ({expected tail}).
|
|
110
|
+
|
|
111
|
+
## Reset ← delete if none
|
|
112
|
+
|
|
113
|
+
| Command | Deletes | Prompts? |
|
|
114
|
+
| --- | --- | --- |
|
|
115
|
+
| `{pm} {reset-script}` | {local state at `{path}`} | {yes; `{FORCE=1}` skips / no} |
|
|
116
|
+
|
|
117
|
+
## Common failures
|
|
118
|
+
|
|
119
|
+
- **`{exact error text}`.** {Cause.} Fix: `{command or file edit}`.
|
|
120
|
+
|
|
121
|
+
## Next
|
|
122
|
+
|
|
123
|
+
The daily loop and its per-package traps: [`local-development.md`]({local-development}.md). Deploying: [`deployment.md`](deployment.md). Standing rules: [`CLAUDE.md`](../../CLAUDE.md).
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Baseline scaffolding behavior
|
|
127
|
+
|
|
128
|
+
The baseline scaffolds `docs/operations/setup.md` when it is missing and the repo has a lockfile and at least one runnable root script. It fills each section from the repo:
|
|
129
|
+
|
|
130
|
+
- **Stack:** from the workspace manifests, one row per layer.
|
|
131
|
+
- **Prerequisites:** from the pinning files.
|
|
132
|
+
- **Install and First run:** from the root README's getting-started block (if one exists) and the root scripts.
|
|
133
|
+
- **Environment files:** from every `*.example` / `.dev.vars.example` in the workspace.
|
|
134
|
+
- **Verify:** from a health route, a doctor command or the test script.
|
|
135
|
+
|
|
136
|
+
It leaves Common failures empty until a failure is root-caused, and it drops every section it cannot fill concretely.
|
|
137
|
+
|
|
138
|
+
**It never overwrites an existing `setup.md`.** If the repo already has a first-run procedure under another name, the baseline proposes the rename with a `note:` row and does not create a second file.
|