@naswerks/engineering-loop 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/.claude-plugin/marketplace.json +2 -6
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/CHANGELOG.md +78 -0
  4. package/README.md +29 -4
  5. package/package.json +1 -1
  6. package/references/docs-workflow.md +103 -10
  7. package/references/engineering-loop.md +27 -2
  8. package/skills/docs-audit-feature/SKILL.md +24 -20
  9. package/skills/docs-audit-full/SKILL.md +13 -8
  10. package/skills/docs-backlog/SKILL.md +6 -3
  11. package/skills/docs-process/SKILL.md +62 -65
  12. package/skills/docs-status/SKILL.md +21 -15
  13. package/skills/docs-write/SKILL.md +9 -6
  14. package/skills/init/SKILL.md +74 -17
  15. package/skills/init/scripts/doctor.mjs +73 -11
  16. package/skills/init/scripts/owned.mjs +96 -0
  17. package/skills/init/scripts/refresh.mjs +129 -0
  18. package/skills/spec-child/SKILL.md +1 -1
  19. package/skills/spec-parent/SKILL.md +20 -9
  20. package/skills/spec-pipeline/SKILL.md +23 -13
  21. package/skills/spec-retro/SKILL.md +5 -2
  22. package/skills/spec-review/SKILL.md +10 -6
  23. package/skills/spec-seat/SKILL.md +13 -6
  24. package/templates/docs/_meta/doc-index.md +1 -1
  25. package/templates/docs/infrastructure/background-work.md +1 -1
  26. package/templates/docs/infrastructure/realtime-events.md +1 -1
  27. package/templates/docs/patterns/backend-patterns.md +1 -1
  28. package/templates/docs/patterns/code-organization.md +1 -1
  29. package/templates/docs/patterns/codegen.md +1 -1
  30. package/templates/docs/patterns/design-tokens.md +1 -1
  31. package/templates/docs/patterns/frontend-patterns.md +1 -1
  32. package/templates/docs/patterns/long-running-workflows.md +1 -1
  33. package/templates/docs/patterns/state-management.md +1 -1
  34. package/templates/docs/patterns/testing.md +1 -1
  35. package/templates/docs/patterns/ui-style-guide.md +1 -1
@@ -10,12 +10,8 @@
10
10
  {
11
11
  "name": "naswerks",
12
12
  "description": "The engineering loop: docs-* knowledge loop, spec-* execution loop, and init for a fresh repository.",
13
- "version": "0.2.0",
14
- "source": {
15
- "source": "npm",
16
- "package": "@naswerks/engineering-loop",
17
- "version": "0.2.0"
18
- }
13
+ "version": "0.4.0",
14
+ "source": "./"
19
15
  }
20
16
  ]
21
17
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "naswerks",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "description": "The engineering loop: a knowledge loop (docs-*) and an execution loop (spec-*) for repositories driven by hosted agent sessions, plus init to make a repository ready for both.",
5
5
  "author": { "name": "naswerks" },
6
6
  "license": "MIT",
package/CHANGELOG.md CHANGED
@@ -5,6 +5,84 @@ version is the one in `package.json` and `.claude-plugin/plugin.json`, which mus
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [0.4.0] - 2026-09-23
9
+
10
+ ### Changed
11
+
12
+ - **The two method documents state one way of running the loop, opinionated on purpose, and name the four
13
+ places a repository replaces with its own.** Each is a whole section whose heading ends
14
+ `(repository-owned)`: in `docs-workflow.md`, The archive convention, Doc metadata and Templates; in
15
+ `engineering-loop.md`, This repository's rails. One grep lists them and nothing else:
16
+ `rg -n '^#+ .*\(repository-owned\)' docs/_meta/`. The heading is the contract: a repository keeps it and
17
+ replaces the body in its `docs/_meta/` copy, in its own words. The loop's own preferences stay stated
18
+ concretely in the references: the `<!-- meta -->` header and its Obsidian interop, `## Lineage`, the
19
+ topic folders under `archive/{topic}/`, flat and split.
20
+ - `docs-workflow.md` gains § The repository-owned sections: what the skills read from each section, where
21
+ the two documents echo it in passing, the loop's four states (`draft`, `wip`, `current`, `shipped`) and
22
+ who writes each, what silence in a section means, how to replace one (filing a pipeline as one package
23
+ into a home the repository already has among the examples), and what the version stamp means.
24
+ - `engineering-loop.md` § This repository's rails is six items, each an absent-line until the repository
25
+ fills it: Policy, Gates a commit passes, Before a PR, Where a PR goes, Staging, Skills a seat meets here.
26
+ They add to the Hard rules and never subtract. The POLICY row of where-a-rule-lives points at the rails'
27
+ policy document, and in hosted mode at the control plane's suffix.
28
+ - **The skills name the section and the concept, never the value.** A header is written at the word for a
29
+ loop state, "the verified date" is wherever § Doc metadata keeps it, an effort files into "the archive
30
+ home" § The archive convention names, and the base branch and the PR route come from the rails. Every
31
+ skill that needs a format carries the same line near its top, "Find the format first", with the grep.
32
+ `docs-process` holds the filing procedure only; the shapes and the link repairs are the archive
33
+ convention's. `spec-review` and `spec-pipeline` diff against the rails' base branch; `spec-parent` and
34
+ `spec-retro` open the PR where and how the rails say.
35
+ - The templates keep the loop's own header; their init instruction drops the blockquote date where
36
+ § Doc metadata keeps none. `init` writes the Start-here stanza's and the folder READMEs' echo lines in the
37
+ copy's words when the copy has replaced the section they echo, and drafts § This repository's rails from
38
+ the scan.
39
+ - `init doctor` reads a doc's status from either header form unaided, the loop's meta line or a
40
+ frontmatter `status:` key, needing only the word `draft`; reads the version stamp after a leading
41
+ frontmatter block; and reports each repository-owned heading (unmarked or missing: DEGRADE) and each
42
+ rails item (missing, or still its absent-line: DEGRADE). It never grades the loop text or the content of
43
+ a repository-owned section.
44
+ - The marketplace entry sources the plugin from this repository (`./`) instead of the npm package at a
45
+ pinned version. `claude plugin install naswerks@engineering-loop` no longer depends on a registry that
46
+ can lag a tag; npm remains the runner lane (`npm i -g @naswerks/engineering-loop`). A pin keeps it so.
47
+ - The release workflow names the remedy when a publish is refused: the package has no trusted publisher
48
+ linked on npmjs.com for this repository and `release.yml`.
49
+
50
+ ### Added
51
+
52
+ - `init refresh` (`skills/init/scripts/refresh.mjs`): brings a repository's copies of the method documents
53
+ up to this pack by writing only their repository-owned sections and the stamp. A dry run by default, one
54
+ row per section (kept, heading marked, added, item added, stamp); `--write` applies exactly those rows. It
55
+ never touches the loop text, never deletes, never reorders, keeps every line's own ending, and a second
56
+ run writes nothing.
57
+ - `skills/init/scripts/owned.mjs`: the one list of repository-owned sections the doctor, refresh and the
58
+ pins share.
59
+ - Pins: a census that no skill spells the loop's own header or archive destination; the one-grep pin
60
+ (exactly four marked headings, equal to `owned.mjs`, no partial marker); section citations by exact
61
+ heading only; the loop states a skill names; the find-format line; `pins/preferences.test.mjs`, which
62
+ keeps the loop's own preferences in the references; `pins/refresh.test.mjs`.
63
+
64
+ ### Fixed
65
+
66
+ - `docs-audit-full` named `docs-write` as the skill that files a finished working doc; it is
67
+ `docs-process`.
68
+ - `spec-review` wrote its report at a status no loop state names; it writes the word for `shipped`.
69
+
70
+ ## [0.2.2] - 2026-09-21
71
+
72
+ ### Changed
73
+
74
+ - `spec-child`'s `mixed` row names where its reading list lives — the rows for those surfaces in
75
+ `docs/_meta/doc-index.md` § Role reading lists — so the default role is no longer the one role told to
76
+ read "the adds for the surfaces your spec touches" without a path to them.
77
+
78
+ ## [0.2.1] - 2026-09-20
79
+
80
+ ### Changed
81
+
82
+ - `spec-seat`'s fallback for a `verify-staged` that is not on PATH names the pack root as `${CLAUDE_PLUGIN_ROOT}`
83
+ (substituted under Claude Code), with the folder two levels above the skill as the reading elsewhere — a
84
+ seat in a fresh worktree no longer has to locate the pack before it can take a staging receipt.
85
+
8
86
  ## [0.2.0] - 2026-09-20
9
87
 
10
88
  ### Changed
package/README.md CHANGED
@@ -5,8 +5,9 @@ living documentation true, and an **execution loop** (`spec-*`) that turns an ap
5
5
  pipeline of agent sessions with a coordinator, build seats, a review seat and a retrospective. `init`
6
6
  makes a fresh repository ready for both.
7
7
 
8
- The package root is the plugin root: `.claude-plugin/` and `skills/` sit at the top, so one artifact serves
9
- a person's CLI, a hosted runner, and a repository's pin.
8
+ The package root is the plugin root: `.claude-plugin/` and `skills/` sit at the top, so the same tree serves
9
+ a person's CLI (through the marketplace, from this repository), a hosted runner (through npm), and a
10
+ repository's pin.
10
11
 
11
12
  ## Install
12
13
 
@@ -17,6 +18,10 @@ claude plugin marketplace add naswerks/engineering-loop
17
18
  claude plugin install naswerks@engineering-loop
18
19
  ```
19
20
 
21
+ The marketplace is this repository, and the plugin is sourced from it: no registry sits between you and a
22
+ release. Plugins load at session start, so start a new session (or run `/reload-plugins`) after installing.
23
+ To pick up a new release later: `claude plugin marketplace update engineering-loop`, then the install line again.
24
+
20
25
  Skills are namespaced by the plugin: `/naswerks:docs-write`, `/naswerks:spec-pipeline`, `/naswerks:init`.
21
26
 
22
27
  **On a runner** (sessions started through the Agent SDK load a plugin only from a local path):
@@ -32,6 +37,22 @@ then point the runner at `$(npm root -g)/@naswerks/engineering-loop` — with pe
32
37
  structure the skills read, the two method documents, a `CLAUDE.md` pointer and the plugin pin in
33
38
  `.claude/settings.json`. A team member still installs the plugin once per machine; the pin enables it.
34
39
 
40
+ **In a repository that already has a docs convention** (frontmatter on every file, a pre-commit
41
+ validator, an indexer): the two method documents state one way of running the loop, opinionated on
42
+ purpose, and mark the four sections that are yours to replace — the header every doc carries, where a
43
+ finished effort is filed, the templates' header lines, the rails a commit passes. Keep each heading and
44
+ rewrite its body in your `docs/_meta/` copies, in your own words; `docs-workflow.md` § The repository-owned
45
+ sections lists what each must answer. One grep lists the four:
46
+
47
+ ```
48
+ rg -n '^#+ .*\(repository-owned\)' docs/_meta/
49
+ ```
50
+
51
+ Every skill names the section it needs and never states the format itself, so the pack stays generic and
52
+ your conventions live in your repository. **Taking a newer pack:** `/naswerks:init refresh` writes only
53
+ those four sections and the version stamp into your copies — a dry run first, then `--write` on your word —
54
+ and never touches the rest of the text.
55
+
35
56
  ## What is in the box
36
57
 
37
58
  | Skill | Loop | One line |
@@ -51,7 +72,8 @@ structure the skills read, the two method documents, a `CLAUDE.md` pointer and t
51
72
  | `spec-ignite` | spec | the ignition copilot for a hosted run |
52
73
  | `init` | — | make a repository ready for both loops |
53
74
 
54
- `references/` carries the two method documents a repository copies into `docs/_meta/`;
75
+ `references/` carries the two method documents a repository copies into `docs/_meta/` and then
76
+ rewrites where they say (repository-owned);
55
77
  `bin/verify-staged` is the staging receipt the seats run between `git add` and `git commit`. A
56
78
  marketplace install puts nothing on PATH: `npm i -g @naswerks/engineering-loop` does, and the skills
57
79
  carry the fallback `node <pack root>/bin/verify-staged.mjs`.
@@ -71,7 +93,10 @@ method documents carry the version stamp; the vocabulary censuses. `node bin/ver
71
93
 
72
94
  The version lives in `package.json` and `.claude-plugin/plugin.json` (they must agree). A `v*` tag
73
95
  runs the pins and publishes to npm through trusted publishing; the GitHub release notes are the
74
- CHANGELOG section for that version.
96
+ CHANGELOG section for that version. The marketplace serves the plugin from this repository at whatever
97
+ `main` holds, so a CLI install never waits on npm; npm is the runner lane, and a refused publish leaves
98
+ runners one version behind until the trusted publisher on npmjs.com matches this repository and
99
+ `release.yml` (the workflow prints that remedy when it happens).
75
100
 
76
101
  ## License
77
102
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naswerks/engineering-loop",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "description": "The engineering loop as a Claude Code plugin: a knowledge loop (docs-*), an execution loop (spec-*), and init for a fresh repository. The package root is the plugin root.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,4 +1,4 @@
1
- <!-- naswerks-loop: version=0.2.0 -->
1
+ <!-- naswerks-loop: version=0.4.0 -->
2
2
  # Docs Workflow
3
3
 
4
4
  > How knowledge flows through `docs/`: the loop, the folder rules, the templates, and the `docs-*` skills.
@@ -40,10 +40,10 @@ narrative. That's also why it's a separate session, not the tail of the implemen
40
40
 
41
41
  | Folder | What it holds | Lifecycle |
42
42
  |--------|---------------|-----------|
43
- | `_meta/` | This system — `doc-index` (the menu) + `docs-workflow` (this file) | Maintained as the system evolves |
43
+ | `_meta/` | This system — `doc-index` (the menu) + `docs-workflow` (this file) + `engineering-loop` (the seats and the ceremony) | Maintained as the system evolves; the sections marked **(repository-owned)** are rewritten by each repository to its own conventions |
44
44
  | `research/` | The running tab of ideas to do, not yet built. The folder is the queue. | Created by `docs-backlog`; stays through the build, then **archived with its working doc(s)** by `docs-process` |
45
45
  | `working/` | Active + finished-but-unprocessed session docs (one effort may chain several). The folder is the queue. | **Leaves via `docs-process`** — research + the whole chain archived together once the living docs are patched |
46
- | `archive/` | Completed/abandoned session docs, grouped into **topic** folders | Write-once. Frozen history — never edit archived docs |
46
+ | `archive/` | Completed/abandoned session docs, grouped into **topic** folders (or the home "The archive convention" below names for them) | Write-once. Frozen history — never edit archived docs |
47
47
  | `guides/` | How to ADD a new thing — step-by-step walkthroughs | Living — patched by `docs-process` |
48
48
  | `patterns/` | Conventions to FOLLOW when writing code | Living — patched by `docs-process` |
49
49
  | `infrastructure/` | What runs under the hood (technologies/plumbing) | Living — patched by `docs-process` |
@@ -62,7 +62,89 @@ is usually a code problem to flag, not a doc to rewrite (unless the rule itself
62
62
 
63
63
  ---
64
64
 
65
- ## The archive convention
65
+ ## The repository-owned sections
66
+
67
+ This file and [engineering-loop](engineering-loop.md) state one way of running the loop, and they are
68
+ opinionated on purpose. Where a repository's conventions differ, they differ in four places only — the
69
+ sections whose heading ends **(repository-owned)**. Each one declares this repository's preference for one
70
+ thing; another repository **keeps the heading and replaces the body** in its `docs/_meta/` copy, in its own
71
+ words. Every other section is the loop and reads the same everywhere. One grep lists the four, with their
72
+ line numbers; each runs to the next `## ` heading:
73
+
74
+ ```
75
+ rg -n '^#+ .*\(repository-owned\)' docs/_meta/
76
+ ```
77
+
78
+ **The skills read these sections and never restate them.** A skill names the section and the thing it
79
+ needs from it — *the header § Doc metadata prescribes*, *the archive home § The archive convention names*,
80
+ *the base branch § This repository's rails names* — and takes the value from this repository's copy. What
81
+ each section answers, and where the two method docs echo the preference in passing (the lines a repository
82
+ that replaces the section rewrites alongside it):
83
+
84
+ | Section | What the skills read from it | Also echoed in |
85
+ |---------|------------------------------|----------------|
86
+ | **The archive convention** (this file) | the archive home for each kind of effort (hand-cranked, spec pipeline, follow-on round) and for audit reports · the shape inside it · what a working doc's `## Archive` line says, and whether an umbrella carries an `Archive:` line · the links a move repairs · what is frozen once filed | The Loop (the diagram and its prose) · Folders (`research/`, `working/`, `archive/`) · "Living docs vs session docs" · the skills table (`docs-process`) · Conventions (incident receipts, archived docs) · `engineering-loop.md` "The loop at a glance" |
87
+ | **Doc metadata** (this file) | the header — its form and its place · the sweep: one command, one line per doc · the word for each loop state (below) · where the verified date lives, and the rule that moves it · whether `## Lineage` stays · the gates a doc passes, and the folders they exempt · whether `doc-index.md` is kept by hand or generated | the skills table (`docs-status`) · Conventions (the machine layer; dates in the header) · `engineering-loop.md`'s own header line and its `## Lineage` |
88
+ | **Templates** (this file) | each template's header lines, at the state its writer names | — |
89
+ | **This repository's rails** (`engineering-loop.md`) | the policy document, and how a seat reaches it · the gates a commit passes · the suite before a PR · the base branch, the PR target, the branch names and how a PR is opened · the staging rule · the repository's own skills a seat meets | the POLICY row of "Where a rule lives" · the Hard rules, which the rails add to and never subtract from |
90
+
91
+ **The loop's states.** The skills speak in four states, and § Doc metadata says which word this repository
92
+ writes for each. Here the words are the states themselves.
93
+
94
+ | State | Written by | Means |
95
+ |-------|------------|-------|
96
+ | `draft` | `init`, `spec-pipeline`, `docs-backlog` | scanned or authored, not yet decided or verified |
97
+ | `wip` | `docs-write` mid-effort, the pipeline's tracker | in progress |
98
+ | `current` | `docs-process` for a doc it creates, `docs-audit-feature` | describes the code as it is |
99
+ | `shipped` | `docs-write` for an effort's last session, `spec-review`'s report | finished — frozen once filed |
100
+
101
+ *Stale* is a date, not a state: `docs-status` computes it from the verified date, and no seat writes it.
102
+
103
+ **Silence.** A section that says nothing about an item leaves the loop's default: the menu is kept by hand
104
+ (`docs-process` adds a row for a new feature doc), no gate runs on a commit, the base branch is the remote's
105
+ default (`git symbolic-ref refs/remotes/origin/HEAD`), and a seat with no PR route asks the human once and
106
+ suggests recording the answer in the rails. Any other unanswered item is a question for the human, never a
107
+ guess.
108
+
109
+ ### Replacing a section
110
+
111
+ Keep what the skills need to find, change the words to yours:
112
+ - **The header and how to sweep it.** Name the fields (a status, a verified date, a type) and where they
113
+ live, and give the one command `docs-status` runs to list every doc's status in one line each. For the
114
+ loop's own header that command is `rg -o '<!-- meta:.*-->' docs/`; for a frontmatter convention it is a
115
+ grep over the keys.
116
+ - **The status words.** Say which word of yours a seat writes for each loop state above, in one line — *"a
117
+ seat that would write `current` or `shipped` writes `stable`; `wip` and `draft` are `draft`"*. `draft` is
118
+ the one word `init doctor` looks for, in either header form.
119
+ - **What the verified date means.** It moves only when a doc is checked against code in that run, whatever
120
+ it is called; state the rule in your words so the anti-fabrication rule survives the rename.
121
+ - **Whether `## Lineage` stays.** It is the footer that carries Idea, Spec, Built and Related; a repository
122
+ whose own tooling derives that graph may drop it and say so.
123
+ - **Your gates.** Name the validator or index a commit must pass, and which of the loop's folders it
124
+ exempts. The loop's session folders (`research/`, `working/`, `archive/`) hold breadcrumbs, not living
125
+ docs, and are the usual exemption.
126
+ - **Your archive home.** A repository whose living docs already have a home for an effort's history (a
127
+ feature's own folder, say) may file a spec pipeline **as one package** into that home: nothing is
128
+ re-sorted, every file keeps its name and its place, `sessions/` rides along untouched, and the effort's
129
+ working docs join the package under `implementation/`, with the tracker still the "read me first" at its
130
+ root. When where a pipeline files depends on something only its authoring session knows, say so —
131
+ `spec-pipeline` then records the resolved path in the umbrella's blockquote as an `Archive:` line.
132
+ - **Your rails.** Fill each item of `engineering-loop.md` § This repository's rails from what the
133
+ repository already wrote down — a policy document, hooks, CI, a pull-request template.
134
+
135
+ **The version stamp** on line 1 names the pack version whose repository-owned sections this copy carries.
136
+ The loop text around them is this repository's copy from whenever it was taken: `init doctor` never grades
137
+ it, and `init refresh` never touches it — refresh adds a section or a rails item a newer pack reads, and
138
+ restamps.
139
+
140
+ ---
141
+
142
+ ## The archive convention (repository-owned)
143
+
144
+ > **Repository-owned.** This section says where a finished effort is filed and in what shape. A
145
+ > repository whose living docs already have a home for an effort's history rewrites it in its
146
+ > `docs/_meta/` copy; every skill that files a doc reads this copy, never its own text.
147
+ > [The repository-owned sections](#the-repository-owned-sections) lists what it must answer.
66
148
 
67
149
  A multi-session effort becomes a **topic folder** under `archive/` (e.g. `archive/{topic}/`).
68
150
  Docs are **not numbered** — they use descriptive names and chain via a header link:
@@ -113,8 +195,7 @@ one** (via `spec-pipeline`). The trigger for the layout is simply *"does this ef
113
195
  record, not the convention.
114
196
  ```
115
197
 
116
- **Follow-on pipelines (multi-round families).** *(Renamed at the v2 cutover — this section was
117
- `Follow-on chains`; skills citing the old heading mean this one.)* A second (third, …) spec pipeline that continues an
198
+ **Follow-on pipelines (multi-round families).** A second (third, …) spec pipeline that continues an
118
199
  already-archived effort gets its **own sibling topic folder**, never filed inside the frozen one.
119
200
  Rules: (a) name the new topic `{family-prefix}-{subtopic}` so the family groups
120
201
  alphabetically; (b) each folder keeps the full split shape (own `project-status.md` at root); (c) the
@@ -137,7 +218,14 @@ report sits beside the docs it audits. The cross-cutting `health-report-{date}.m
137
218
 
138
219
  ---
139
220
 
140
- ## Doc metadata (header + lineage)
221
+ ## Doc metadata (repository-owned)
222
+
223
+ > **Repository-owned.** This section prescribes the machine header every doc the loop writes carries.
224
+ > What follows is the loop's own header. A repository whose docs already carry a metadata convention
225
+ > (YAML frontmatter with its own keys and status words, a validator, an indexer) rewrites this section
226
+ > and the templates below in its `docs/_meta/` copy to say that convention, in one voice; every skill
227
+ > that writes a doc takes the header from this copy. [The repository-owned sections](#the-repository-owned-sections)
228
+ > lists what it must answer.
141
229
 
142
230
  Two additive machine layers wrap a doc's unchanged human content: an invisible **header meta-comment**
143
231
  (greppable status/identity) and a visible **`## Lineage` footer** (the clickable provenance breadcrumb).
@@ -219,7 +307,10 @@ Obsidian; don't imitate it.
219
307
 
220
308
  ---
221
309
 
222
- ## Templates
310
+ ## Templates (repository-owned)
311
+
312
+ > **Repository-owned.** A repository that rewrote "Doc metadata" rewrites each template's header lines
313
+ > here to match; the sections beneath them are the loop's and stay.
223
314
 
224
315
  ### Session / working doc (created during a session, archived by `docs-write`)
225
316
 
@@ -355,7 +446,9 @@ spec set *is* the design history.
355
446
  **`spec-*` = the execution loop** (how big work gets built: graduate a plan, a coordinator seat,
356
447
  build seats). They hand off at both ends: research docs feed `spec-pipeline`; every build session
357
448
  closes with `docs-write`; `docs-process` compiles the results back into living docs. A seat prompt
358
- never restates a rule a skill holds — the prompt points, the skill holds it.
449
+ never restates a rule a skill holds — the prompt points, the skill holds it. And a skill never restates
450
+ what this file's repository-owned sections hold: the header a doc carries and where an effort is filed
451
+ come from this copy, so a repository changes them once, here.
359
452
 
360
453
  | Skill | When | What it does |
361
454
  |-------|------|-------------|
@@ -411,7 +504,7 @@ never restates a rule a skill holds — the prompt points, the skill holds it.
411
504
  the actual source. For prescriptive docs (`patterns/`, `guides/`) the doc is the decided rule — check
412
505
  that code conforms to it instead (see "Two kinds of living doc" above).
413
506
  - **Every living / spec / working doc carries the machine layer** — a one-line `<!-- meta: … -->` header
414
- below the blockquote + a `## Lineage` footer (see "Doc metadata (header + lineage)" above). The meta
507
+ below the blockquote + a `## Lineage` footer (see "Doc metadata (repository-owned)" above). The meta
415
508
  `verified` date moves with the blockquote's `Last verified` and obeys the same anti-fabrication rule:
416
509
  only stamp it for a doc actually checked against code this run.
417
510
  - **Don't edit archived docs** — stale references there are historical record.
@@ -1,4 +1,4 @@
1
- <!-- naswerks-loop: version=0.2.0 -->
1
+ <!-- naswerks-loop: version=0.4.0 -->
2
2
  # The Engineering Loop — flow, seats, skills, and the ceremony
3
3
 
4
4
  > The quick intro to how work gets built with this loop: the two loops (`docs-*` knowledge, `spec-*`
@@ -77,6 +77,31 @@ effort wants a review row and a docs-process row, and writes them into the row t
77
77
  learns the shape by reading its own sequence, and nothing needs a toggle. A pipeline can be plain,
78
78
  `+review`, `+review +process`, or `+process`.
79
79
 
80
+ **Sections marked (repository-owned), here and in `docs-workflow.md`, are this repository's.** They say
81
+ how a doc's header is written, where a finished effort is filed, and which rails a commit passes here.
82
+ Every other section is the loop and reads the same in every repository. The coordinator and every seat
83
+ read both documents at Step 0, so a repository's conventions reach them without a line in any prompt,
84
+ and a skill that writes or files a doc takes those two facts from `docs-workflow.md`, never from its
85
+ own text. One grep lists every such section — `rg -n '^#+ .*\(repository-owned\)' docs/_meta/` — and
86
+ `docs-workflow.md` § The repository-owned sections lists what each answers and where it is echoed.
87
+
88
+ ## This repository's rails (repository-owned)
89
+
90
+ What a commit and a PR pass here, beyond the loop. These add to the Hard rules below; they never subtract.
91
+
92
+ - **Policy.** No policy document recorded — fill this in: the document every seat is bound by, and how a
93
+ seat reaches it.
94
+ - **Gates a commit passes.** No commit gates recorded — fill this in: the hooks and checks a commit must
95
+ pass, and what each validates.
96
+ - **Before a PR.** No pre-PR suite recorded — fill this in: the suite that runs before a PR, and where its
97
+ commands live.
98
+ - **Where a PR goes.** No PR route recorded — fill this in: the base branch, the host, the branch names,
99
+ and how a PR is opened.
100
+ - **Staging.** No staging rule recorded — fill this in: anything stricter than the Hard rules' explicit
101
+ paths and `verify-staged`.
102
+ - **Skills a seat meets here.** No repository skills recorded — fill this in: the repository's own skills
103
+ a seat invokes by name, and when.
104
+
80
105
  ## Two loops — both hand-crankable
81
106
 
82
107
  - **`docs-*` is the knowledge loop** and runs standalone, forever: small/everyday efforts are
@@ -128,7 +153,7 @@ The thing that keeps prompts and skills from drifting apart:
128
153
 
129
154
  | Kind | Home | Why there |
130
155
  |---|---|---|
131
- | **POLICY** | the un-skippable system-prompt suffix the control plane supplies at open | cannot be skipped, present on every turn |
156
+ | **POLICY** | the policy document § This repository's rails names — and, hosted, the un-skippable system-prompt suffix the control plane supplies at open | cannot be skipped, present on every turn |
132
157
  | **PROCEDURE — shared** | `spec-seat` | the contract for ANY seat the coordinator arms: blackboard, question lane, parked-call discriminator, verdicts, BELIEFS sha, git shapes, six-section FINAL TLDR, close-out order |
133
158
  | **PROCEDURE — per job** | `spec-child` · `spec-review` · `docs-process` | what THIS seat does. The job skill **refines** the seat contract and never contradicts it; a genuine conflict is a finding, not a fork |
134
159
  | **TASK** | the seed prompt + the pipeline's `00-ignition-brief.md` | per-run; dies with the run |
@@ -10,6 +10,8 @@ docs, or a whole folder — in `docs/features/`, `docs/infrastructure/`, or `doc
10
10
  the one audit skill for "does this doc still match the code"; it produces both the **audit report**
11
11
  and the **corrected living doc**.
12
12
 
13
+ **Find the format first.** This repository writes its formats (the doc header and status words, where an effort is filed, its rails) in the sections `rg -n '^#+ .*\(repository-owned\)' docs/_meta/` lists; read the one a step names before that step writes. This skill names the section, never the format.
14
+
13
15
  > **The system:** `docs/_meta/doc-index.md` (the menu of living docs) + `docs/_meta/docs-workflow.md`
14
16
  > (the loop, folders, templates) explain how the docs are organized. Skim them if you need to place a
15
17
  > doc or find its siblings.
@@ -30,28 +32,29 @@ writes across docs. End with a one-line-per-doc summary (stale-count / added-cou
30
32
  1. **Read the living doc** (`docs/features/{x}.md`, `docs/infrastructure/{x}.md`, or
31
33
  `docs/patterns/{x}.md`).
32
34
 
33
- 2. **Read the corresponding code** — the backend `Features/{Feature}/` slice and matching frontend
34
- feature folder for feature docs; the relevant subsystem for infrastructure/pattern docs. Confirm
35
- entities, endpoints, stores, routes, services, config, key files.
35
+ 2. **Read the corresponding code** — the feature's code on each side, wherever
36
+ `docs/patterns/code-organization.md` says a feature lives, for feature docs; the relevant subsystem for
37
+ infrastructure/pattern docs. Confirm entities, endpoints, stores, routes, services, config, key files.
36
38
 
37
39
  3. **Check against conventions** — cross-check the doc's claims against `docs/patterns/` (and
38
40
  `docs/infrastructure/` where relevant) so the doc matches how things are actually built.
39
41
 
40
- 4. **Report findings** — write a short audit report to `docs/archive/audit/{group}/{doc-name}-audit.md`,
41
- where `{group}` mirrors the living doc's folder (`guides/`, `patterns/`, `infrastructure/`, or
42
- `features/`; create the subfolder if absent). Date in header: what was accurate, what was stale,
42
+ 4. **Report findings** — write a short audit report where `docs/_meta/docs-workflow.md` § The archive
43
+ convention (repository-owned) files audit reports, named for the doc it audits and grouped the way that
44
+ section groups them (create the folder if absent). Date in header: what was accurate, what was stale,
43
45
  what's undocumented, and any **code risks / bugs / tech-debt** you noticed against the source.
44
- (The master `health-report-*.md` from `docs-audit-full` stays at the `audit/` root — it's cross-cutting.)
45
-
46
- 5. **Update the living doc** with the corrections and bump its "Last verified" date — **and refresh the
47
- `<!-- meta: … -->` line in lockstep** (`verified` = today, update `status`, recompute `lineage=N`). This is
48
- allowed here only because you just did the full doc-vs-code pass; the meta `verified` obeys the same
49
- anti-fabrication rule as the blockquote date (the two always move together). **Verify the `## Lineage`
50
- footer** — check every link resolves; flag any dead breadcrumb into `## Open Issues` (or the audit report)
51
- and recompute `lineage=N` to match. **Soft-check `Spec` / `Built` symmetry** — for a spec-driven feature, a
46
+ (The master health report from `docs-audit-full` sits where that section puts it — it's cross-cutting.)
47
+
48
+ 5. **Update the living doc** with the corrections and set its verified date to today — **every place
49
+ `docs/_meta/docs-workflow.md` § Doc metadata (repository-owned) keeps that date moves in lockstep**, along
50
+ with its status and any field the header derives. This is allowed here only because you just did the full
51
+ doc-vs-code pass; the verified date obeys the anti-fabrication rule below. **Verify the `## Lineage`
52
+ footer** (where that section keeps it) — check every link resolves; flag any dead breadcrumb into
53
+ `## Open Issues` (or the audit report) and recompute any field the header derives from it. **Soft-check
54
+ `Spec` / `Built` symmetry** — for a spec-driven feature, a
52
55
  `Built` session whose per-slice spec is absent from `Spec` (or vice-versa) is usually an under-scoped row;
53
56
  note it and complete it *unless* the doc is deliberately scoped tighter than the effort (judgment, not a hard
54
- fail — see the Lineage rules in `docs-workflow.md`). **Reconcile its `## Open Issues` section** — add any real, code-verified
57
+ fail — the `## Lineage` rules § Doc metadata (repository-owned) gives). **Reconcile its `## Open Issues` section** — add any real, code-verified
55
58
  risk/bug/tech-debt you found (dated, with `file:line`), and remove any listed issue the code now resolves.
56
59
  (The archived report is the history; `## Open Issues` is the live signal `docs-status` reads.)
57
60
 
@@ -65,8 +68,8 @@ is missed:
65
68
  - **Both exist**: run the per-doc audit above.
66
69
 
67
70
  For `docs/features/`, the folder (one doc per feature) IS the inventory — there is no separate
68
- catalog. Build the real list from `Features/` + the frontend feature folders/routes via actual
69
- `ls`/`find` output in this run, then diff.
71
+ catalog. Build the real list from where `docs/patterns/code-organization.md` says features live — each
72
+ side, routes included — via actual `ls`/`find` output in this run, then diff.
70
73
 
71
74
  ## Anti-fabrication rule
72
75
 
@@ -76,10 +79,11 @@ catalog. Build the real list from `Features/` + the frontend feature folders/rou
76
79
  - **Every claim traces to a file you opened in this run** — entity names, endpoints, routes, key
77
80
  files, line references. No identifiers or dates from memory. When listing a folder, build the
78
81
  feature/doc lists from real `ls`/`find` output, not memory.
79
- - Only stamp **"Last verified: <today>"** on a doc you actually checked against code in this run.
82
+ - Only stamp **the verified date** (today) on a doc you actually checked against code in this run.
80
83
  Stamping a date you didn't verify is the exact failure this rule exists to prevent.
81
- - The `<!-- meta: verified=… -->` date is bound by the **same** rule and always equals the blockquote's
82
- `Last verified` — refresh `verified` / `status` / `lineage=N` only after the full doc-vs-code pass this run.
84
+ - Every place § Doc metadata (repository-owned) keeps that date, whatever it calls it, is bound by the
85
+ **same** rule and moves together — refresh it, the status and any derived field only after the full
86
+ doc-vs-code pass this run.
83
87
 
84
88
  ## Notes
85
89
  - **Descriptive docs (`infrastructure/`, `features/`):** code is truth — where doc and code disagree,
@@ -8,10 +8,14 @@ description: Master health check across all docs — staleness/age scan, convent
8
8
  A deep-clean sweep. Does NOT re-audit every feature in depth — it produces the prioritized plan of
9
9
  what to audit next.
10
10
 
11
+ **Find the format first.** This repository writes its formats (the doc header and status words, where an effort is filed, its rails) in the sections `rg -n '^#+ .*\(repository-owned\)' docs/_meta/` lists; read the one a step names before that step writes. This skill names the section, never the format.
12
+
11
13
  ## Steps
12
14
 
13
- 1. **Freshness scan** — read "Last verified" dates across all living docs (`guides/ patterns/
14
- infrastructure/ features/`). Flag anything older than ~14 days; sort oldest-first.
15
+ 1. **Freshness scan** — read the verified dates across all living docs (`guides/ patterns/
16
+ infrastructure/ features/`), wherever `docs/_meta/docs-workflow.md` § Doc metadata (repository-owned)
17
+ says that date lives (its sweep command reads them all at once). Flag anything older than ~14 days; sort
18
+ oldest-first.
15
19
 
16
20
  2. **Feature completeness** — quick `docs/features/` folder pass (per `docs-audit-feature`'s
17
21
  folder mode): any features in code with no doc, or docs whose feature is gone.
@@ -23,14 +27,15 @@ what to audit next.
23
27
  graduated/removed) and ideas worth surfacing.
24
28
 
25
29
  5. **Working/archive sanity** — note any docs lingering in `docs/working/` that look done (should be
26
- filed via `docs-write`), and confirm `archive/` topic folders are intact.
30
+ filed via `docs-process`), and confirm the filed efforts are intact where § The archive convention
31
+ (repository-owned) puts them.
27
32
 
28
- 6. **Read the previous report first.** Before writing anything, find the most recent
29
- `docs/archive/audit/health-report-*.md` and read it in full. The new report continues from it:
30
- note what was flagged last time and is now fixed, what's still outstanding, and anything that
31
- regressed. If there is **no** prior report, say so — this run is the baseline.
33
+ 6. **Read the previous report first.** Before writing anything, find the most recent health report —
34
+ where § The archive convention (repository-owned) files audit reports — and read it in full. The new
35
+ report continues from it: note what was flagged last time and is now fixed, what's still outstanding,
36
+ and anything that regressed. If there is **no** prior report, say so — this run is the baseline.
32
37
 
33
- 7. **Produce a health report** at `docs/archive/audit/health-report-{date}.md` with a prioritized,
38
+ 7. **Produce a health report** — `health-report-{date}.md`, beside the previous one — with a prioritized,
34
39
  actionable list (which `docs-audit-feature` runs, which docs to re-verify, which research to clear).
35
40
  Open with a **"Since last report"** section that diffs against the report from step 6 (or marks this
36
41
  as the baseline if none existed).
@@ -7,6 +7,8 @@ description: Capture an idea, improvement, or future-state design as a research
7
7
 
8
8
  Capture ideas as research docs. `docs/research/` is the idea inbox — the folder itself is the queue.
9
9
 
10
+ **Find the format first.** This repository writes its formats (the doc header and status words, where an effort is filed, its rails) in the sections `rg -n '^#+ .*\(repository-owned\)' docs/_meta/` lists; read the one a step names before that step writes. This skill names the section, never the format.
11
+
10
12
  ## Steps
11
13
 
12
14
  1. **Scan existing research titles** in `docs/research/` — quick check for an obvious duplicate or a
@@ -14,7 +16,8 @@ Capture ideas as research docs. `docs/research/` is the idea inbox — the folde
14
16
 
15
17
  2. **For each idea, create a research doc** at `docs/research/{topic}.md` using the research-doc
16
18
  template in `docs/_meta/docs-workflow.md`: Current State, Desired End State, Design Options /
17
- Recommendation, Open Questions. Capture the idea while it's fresh — verify "Current State" against
19
+ Recommendation, Open Questions. Its header is the one that file's § Doc metadata (repository-owned)
20
+ prescribes, at the word for `draft`. Capture the idea while it's fresh — verify "Current State" against
18
21
  code if quick, otherwise note it's unverified.
19
22
 
20
23
  **The research doc must be self-contained.** It's the durable jump-off point; assume everything else
@@ -37,5 +40,5 @@ Capture ideas as research docs. `docs/research/` is the idea inbox — the folde
37
40
  - When an idea is later picked up and built, link it via the session doc's **Source** field. The
38
41
  research doc **stays in `research/` through the build** (it's the running tab, and a build may span
39
42
  several sessions / working docs). When the effort finishes, `docs-process` archives the research doc
40
- **alongside its working doc(s)** in the same `archive/{topic}/` folder — research and the work that
41
- delivered it are filed together, not deleted.
43
+ **alongside its working doc(s)** in the same archive home (`docs-workflow.md` § The archive convention
44
+ (repository-owned)) — research and the work that delivered it are filed together, not deleted.