@naswerks/engineering-loop 0.2.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +2 -6
- package/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +94 -0
- package/README.md +49 -11
- package/package.json +1 -1
- package/references/docs-workflow.md +119 -10
- package/references/engineering-loop.md +27 -2
- package/skills/docs-audit-feature/SKILL.md +24 -20
- package/skills/docs-audit-full/SKILL.md +17 -9
- package/skills/docs-backlog/SKILL.md +6 -3
- package/skills/docs-process/SKILL.md +67 -66
- package/skills/docs-status/SKILL.md +25 -15
- package/skills/docs-write/SKILL.md +9 -6
- package/skills/init/SKILL.md +88 -22
- package/skills/init/scripts/doctor.mjs +131 -18
- package/skills/init/scripts/owned.mjs +96 -0
- package/skills/init/scripts/refresh.mjs +129 -0
- package/skills/spec-child/SKILL.md +1 -1
- package/skills/spec-parent/SKILL.md +20 -9
- package/skills/spec-pipeline/SKILL.md +23 -13
- package/skills/spec-retro/SKILL.md +5 -2
- package/skills/spec-review/SKILL.md +10 -6
- package/skills/spec-seat/SKILL.md +11 -6
- package/templates/docs/_meta/doc-index.md +7 -1
- package/templates/docs/infrastructure/background-work.md +1 -1
- package/templates/docs/infrastructure/realtime-events.md +1 -1
- package/templates/docs/patterns/backend-patterns.md +1 -1
- package/templates/docs/patterns/code-organization.md +1 -1
- package/templates/docs/patterns/codegen.md +1 -1
- package/templates/docs/patterns/design-tokens.md +1 -1
- package/templates/docs/patterns/frontend-patterns.md +1 -1
- package/templates/docs/patterns/long-running-workflows.md +1 -1
- package/templates/docs/patterns/state-management.md +1 -1
- package/templates/docs/patterns/testing.md +1 -1
- package/templates/docs/patterns/ui-style-guide.md +1 -1
|
@@ -5,8 +5,10 @@ description: Patch the living docs from a session doc's "Living Docs to Update"
|
|
|
5
5
|
|
|
6
6
|
# docs-process
|
|
7
7
|
|
|
8
|
-
The **second** half of the bookend. Take a finished session doc (in `docs/working
|
|
9
|
-
|
|
8
|
+
The **second** half of the bookend. Take a finished session doc (in `docs/working/`, or already filed
|
|
9
|
+
in its archive home) and bring the living docs up to current state.
|
|
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.
|
|
10
12
|
|
|
11
13
|
## Running as a pipeline row (`docs-process` seat)
|
|
12
14
|
|
|
@@ -31,8 +33,8 @@ branch, which is the truth for that PR, and you say so at close.
|
|
|
31
33
|
1. **Read the session doc(s) for the effort** from `docs/working/` — that's where `docs-write` leaves
|
|
32
34
|
them (it does not archive). A folder's `README.md` is never a queue entry. One effort may be a **SEQUENCE of working docs** across sessions (each
|
|
33
35
|
`Builds on` the prior, all sharing one `Source:` research doc); treat the sequence as one unit. The
|
|
34
|
-
combined **Living Docs to Update** sections are your checklist; the `## Archive` line names the
|
|
35
|
-
|
|
36
|
+
combined **Living Docs to Update** sections are your checklist; the `## Archive` line names the archive
|
|
37
|
+
home you'll file everything into in the last step. Run this when the effort is done (it's the
|
|
36
38
|
finalizer) — mid-effort, just keep adding working docs and continue.
|
|
37
39
|
|
|
38
40
|
**`docs/working/` is a SHARED QUEUE — it may hold other efforts' docs.** Invoked by hand you scope
|
|
@@ -58,28 +60,31 @@ branch, which is the truth for that PR, and you say so at close.
|
|
|
58
60
|
- Read the living doc and the session doc's description of what changed.
|
|
59
61
|
- **Patch the stale sections** — don't rewrite. Preserve everything still accurate.
|
|
60
62
|
- **Verify against code** — open the actual source file for each claimed change. Code is truth.
|
|
61
|
-
- **Leave the
|
|
62
|
-
code — but you did NOT re-read the whole doc against the whole codebase, and
|
|
63
|
-
*whole-doc* claim. Stamping it for a targeted patch
|
|
64
|
-
hides real staleness in the untouched sections from the next
|
|
65
|
-
`docs-audit-feature`'s to set (it does the full doc-vs-code pass — see
|
|
66
|
-
**Exception:** a doc you *create from scratch* here by reading the code is
|
|
67
|
-
definition — set its date.
|
|
63
|
+
- **Leave the verified date alone.** You verified the *specific* checklist changes against
|
|
64
|
+
code — but you did NOT re-read the whole doc against the whole codebase, and the verified date (wherever
|
|
65
|
+
§ Doc metadata (repository-owned) says it lives) is a *whole-doc* claim. Stamping it for a targeted patch
|
|
66
|
+
(rename or substantive alike) overclaims and hides real staleness in the untouched sections from the next
|
|
67
|
+
`docs-status` scan. That date is `docs-audit-feature`'s to set (it does the full doc-vs-code pass — see
|
|
68
|
+
its anti-fabrication rule). **Exception:** a doc you *create from scratch* here by reading the code is
|
|
69
|
+
verified-today by definition — set its date.
|
|
68
70
|
- **Update the Key Files table** if files were renamed, created, or deleted.
|
|
69
|
-
- **Write / update the
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
71
|
+
- **Write / update the header + `## Lineage`** — the header is the one `docs/_meta/docs-workflow.md`
|
|
72
|
+
§ Doc metadata (repository-owned) prescribes, in its words, and `## Lineage` is written where that
|
|
73
|
+
section keeps it:
|
|
74
|
+
- *Creating a doc from scratch* here: write the header at the word for `current`, its verified date
|
|
75
|
+
today, **and** a `## Lineage` footer. You already know the `Source:` research doc (the `Idea` row), any
|
|
76
|
+
spec pipeline (the `Spec` row), and the working-doc sequence / `## Archive` target (the `Built` row);
|
|
77
|
+
derive `Related` from existing peer links. Compute any field the header derives from those links the
|
|
78
|
+
way the section says. **Keep `Spec` and `Built` symmetric** — list **every per-slice spec that a
|
|
79
|
+
`Built` session implemented** (the umbrella + `00-operating-frame` go in `Idea`, not `Spec`); a `Built`
|
|
80
|
+
session whose spec is missing from `Spec` is the smell (the `## Lineage` rules § Doc metadata
|
|
81
|
+
(repository-owned) gives).
|
|
82
|
+
- *Patching an existing doc*: update the status if it changed and recompute any field the header
|
|
83
|
+
derives; append any new `Built`/`Spec` rows for this effort. **Do NOT restamp the verified date** — same
|
|
84
|
+
anti-fabrication rule as above (a targeted patch is not a whole-doc re-verify).
|
|
85
|
+
- **Migrate `## Related Docs`.** If the doc still carries a `## Related Docs` section and the section
|
|
86
|
+
keeps `## Lineage`, fold its links into the `## Lineage` `Related` row and remove the old section (the
|
|
87
|
+
convention supersedes it).
|
|
83
88
|
- **Flag code risks you spot.** If you notice a genuine bug / risk / tech-debt *outside* what you're
|
|
84
89
|
documenting — while verifying against code, or as a still-unresolved item in the working doc's
|
|
85
90
|
**Watch-Outs** — add a dated one-line bullet (with `file:line`) to that doc's `## Open Issues`
|
|
@@ -87,53 +92,49 @@ branch, which is the truth for that PR, and you say so at close.
|
|
|
87
92
|
speculation. A sizable design idea goes to `docs-backlog` (research/) instead. `docs-status`
|
|
88
93
|
surfaces these so they aren't lost.
|
|
89
94
|
|
|
90
|
-
3. **
|
|
91
|
-
feature)
|
|
95
|
+
3. **A new living doc?** If the work added a feature, ensure it has a doc in `docs/features/` (one doc per
|
|
96
|
+
feature). Then register every living doc this run created where the menu's shape line says
|
|
97
|
+
(`rg -n 'naswerks-loop: menu=' docs/_meta/doc-index.md`; `docs/_meta/docs-workflow.md` § The
|
|
98
|
+
repository-owned sections explains the two shapes). **`menu=all`, or no shape line:** add its row to the
|
|
99
|
+
menu in `docs/_meta/doc-index.md`. **`menu=curated; index={path}`:** add it to `{path}` the way that
|
|
100
|
+
index is kept — a generated index is never edited by hand — and add a menu row only when the doc meets
|
|
101
|
+
the loop's standard and a seat should read it; say which you did in the summary.
|
|
92
102
|
|
|
93
103
|
4. **Closing grep** — if the session doc notes deletions or renames, grep all living
|
|
94
104
|
docs (`guides/ patterns/ infrastructure/ features/ _meta/`) for stale references and fix them. Do
|
|
95
|
-
NOT touch
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
105
|
+
NOT touch a filed doc — wherever § The archive convention (repository-owned) files them, they are frozen
|
|
106
|
+
history.
|
|
107
|
+
|
|
108
|
+
5. **File the effort — research/spec docs AND working doc(s), together.** Now that the living docs are
|
|
109
|
+
patched and verified, file the whole effort where `docs/_meta/docs-workflow.md` § The archive convention
|
|
110
|
+
(repository-owned) says, in the shape it gives for this kind of effort (a small effort, a spec pipeline,
|
|
111
|
+
a follow-on round). That section holds the destination, the shape and the links a move repairs; this
|
|
112
|
+
step holds the procedure, which is the same everywhere. A pipeline whose umbrella carries an `Archive:`
|
|
113
|
+
line files there.
|
|
114
|
+
|
|
115
|
+
**FIRST, RECONCILE THE DESTINATIONS — `rg -A1 '^## Archive' <every working doc in the effort>`, plus
|
|
116
|
+
the umbrella's `Archive:` line when there is a pipeline.**
|
|
117
|
+
This step says *"one archive home"* and *"use the `## Archive` line"* — a singular read over a PLURAL
|
|
104
118
|
source, so the set is checked before any move. **If the docs disagree, STOP and ask.** Do not pick the
|
|
105
119
|
majority, do not pick the first, and do not pick the one you happen to be reading. The failure is not
|
|
106
|
-
recoverable by you: one working doc naming a different, populated effort's
|
|
107
|
-
this effort's docs into a neighbour's
|
|
120
|
+
recoverable by you: one working doc naming a different, populated effort's home is enough to sweep
|
|
121
|
+
this effort's docs into a neighbour's, and a filed effort is frozen history. No seat can see it
|
|
108
122
|
alone — each wrote one working doc and each line is individually plausible; the divergence exists only
|
|
109
123
|
in the SET, which is why the check belongs here and not upstream.
|
|
110
|
-
- Move **every working doc** in the effort from `docs/working/` into the
|
|
111
|
-
- Move the **`Source:`** research/spec docs from `docs/research/` into the **same**
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
announce the staged state before yielding the tree.
|
|
125
|
-
- **Follow-on round** (the effort continues an already-archived family — e.g. a round-2 pipeline for
|
|
126
|
-
a shipped feature): its own **sibling** topic folder with the full split shape, named
|
|
127
|
-
`{family-prefix}-{subtopic}` — **never file into the frozen prior-round folder**. The family
|
|
128
|
-
index is the living feature doc's `## Lineage` (append this round's Idea/Spec/Built rows beside
|
|
129
|
-
the prior round's); the new round's back-links to the old archive stay as-is (historical
|
|
130
|
-
cross-effort links). See the section named `Follow-on pipelines` in `docs-workflow.md`.
|
|
131
|
-
- **Repair the intra-effort links the move breaks** (relative depths change). On a split, fix: each
|
|
132
|
-
working doc's `Source:` becomes `../specs/NN-*.md`; the spec / `project-status` links; and the **live feature
|
|
133
|
-
doc's `## Lineage`** rows (`Spec` to `…/specs/…`, `Built` to `…/implementation/…`). On a flat archive, a
|
|
134
|
-
working doc's `Source: ../research/{topic}/x.md` becomes the now-sibling `x.md`. **Leave pre-existing
|
|
135
|
-
cross-effort links** (to *other* topic folders / research folders) as historical record. Verify with a
|
|
136
|
-
link-resolution pass before finishing.
|
|
124
|
+
- Move **every working doc** in the effort from `docs/working/` into that home, in the section's shape.
|
|
125
|
+
- Move the **`Source:`** research/spec docs from `docs/research/` into the **same** home — the idea and
|
|
126
|
+
the work that delivered it are filed together. Do NOT delete and do NOT leave in `research/` (that's
|
|
127
|
+
what kept shipped ideas cluttering the running tab).
|
|
128
|
+
- **`git mv` STAGES immediately** — in a shared working tree, another session's commit can silently sweep
|
|
129
|
+
your staged renames. Commit promptly after the moves, or announce the staged state before yielding
|
|
130
|
+
the tree.
|
|
131
|
+
- **A `sessions/` folder moves wholesale and byte-untouched** — it is testimony, and no link repair
|
|
132
|
+
reaches into it.
|
|
133
|
+
- **Never file into a frozen effort.** An effort that continues one already filed (a follow-on round)
|
|
134
|
+
goes where the section puts a follow-on — never inside the earlier round's home.
|
|
135
|
+
- **Repair the links the move breaks** — the ones the section names (relative depths change), inside the
|
|
136
|
+
effort and in the live feature doc that points at it. **Leave pre-existing cross-effort links** as
|
|
137
|
+
historical record. Verify with a link-resolution pass before finishing.
|
|
137
138
|
This clears both the `working/` queue and the research idea. After this the docs are frozen history.
|
|
138
139
|
|
|
139
140
|
6. **Summary** — list which living docs were updated, what changed in each, which source files you read
|
|
@@ -141,6 +142,6 @@ branch, which is the truth for that PR, and you say so at close.
|
|
|
141
142
|
|
|
142
143
|
## Notes
|
|
143
144
|
- Skip doc updates for pure bug fixes that restored behavior the doc already described correctly.
|
|
144
|
-
- `docs-write` leaves the doc in `working/`; **this skill is what
|
|
145
|
+
- `docs-write` leaves the doc in `working/`; **this skill is what files it** (step 5) — only after the
|
|
145
146
|
living docs are current. That keeps `working/` an honest queue of unprocessed sessions.
|
|
146
147
|
- No releases/changelog step — git history covers that.
|
|
@@ -8,6 +8,8 @@ description: Read-only orientation at session start — what's recently archived
|
|
|
8
8
|
A quick, read-only pulse of the docs pipeline. No files created. Report by name with context, not
|
|
9
9
|
just counts.
|
|
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
15
|
1. **`working/` — in flight.** List each doc in `docs/working/` with a one-line "what it's about /
|
|
@@ -16,20 +18,28 @@ just counts.
|
|
|
16
18
|
2. **`research/` — waiting ideas.** List each doc in `docs/research/` (and topic subfolders) by name
|
|
17
19
|
with a one-line hook. This is the backlog of things to pick up next.
|
|
18
20
|
|
|
19
|
-
3.
|
|
20
|
-
`docs/archive
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
- **
|
|
32
|
-
|
|
21
|
+
3. **Recently done.** List the most recently modified filed efforts in the archive home
|
|
22
|
+
`docs/_meta/docs-workflow.md` § The archive convention (repository-owned) names (a handful, newest first)
|
|
23
|
+
so the user can see what just shipped.
|
|
24
|
+
|
|
25
|
+
4. **Meta sweep — the condensed status table.** Run the sweep command `docs/_meta/docs-workflow.md` § Doc
|
|
26
|
+
metadata (repository-owned) gives — it is spelled there for whichever header this repository writes.
|
|
27
|
+
Parse each doc's status and verified date (and any other field that header carries) into a compact
|
|
28
|
+
one-line-per-doc table (group by folder), in that section's status words. This is the headline pulse —
|
|
29
|
+
richer than the old date-only scan. Read-only; do not write anything. Flag, in order of concern:
|
|
30
|
+
- **missing header** — a living doc (`guides/ patterns/ infrastructure/ features/`) the sweep does not
|
|
31
|
+
list. Read its verified date from wherever else the section says it may live, **prefer the header**,
|
|
32
|
+
and list it as a gap to fill.
|
|
33
|
+
- **stale** — a verified date older than ~14 days, a candidate for `docs-audit-feature` (the existing
|
|
34
|
+
nudge; note the harder 90-day line the future `docs_freshness` tool will use).
|
|
35
|
+
- **dead lineage** — where the section keeps `## Lineage`: a link whose target file no longer exists (a
|
|
36
|
+
broken breadcrumb).
|
|
37
|
+
- **low-lineage feature** — where the section keeps `## Lineage`: a feature doc with no Lineage rows =
|
|
38
|
+
ungrounded; worth wiring its lineage.
|
|
39
|
+
- **menu drift** — read the menu's shape line (`rg -n 'naswerks-loop: menu=' docs/_meta/doc-index.md`;
|
|
40
|
+
none means `menu=all`). On `menu=all`: a living doc the menu does not name. On `menu=curated`: a doc the
|
|
41
|
+
menu names that falls short of the loop's standard (`docs/_meta/docs-workflow.md` § The
|
|
42
|
+
repository-owned sections — a header at a decided status and a `## Key Files` section).
|
|
33
43
|
|
|
34
44
|
5. **Open issues.** Grep living docs for an `## Open Issues` section; list which docs/features carry
|
|
35
45
|
unresolved, code-verified problems (and how many) so known risks surface at orientation instead of
|
|
@@ -44,4 +54,4 @@ just counts.
|
|
|
44
54
|
|
|
45
55
|
## Notes
|
|
46
56
|
- Output is a conversational summary only. There is no backlog doc and no release doc to read —
|
|
47
|
-
`working/`, `research/`, and
|
|
57
|
+
`working/`, `research/`, and the archive home ARE the status.
|
|
@@ -11,13 +11,15 @@ does NOT archive. Both happen in `docs-process`, once the living docs are patche
|
|
|
11
11
|
code. Leaving the doc in `working/` is what makes `working/` a real queue (`docs-status` reads it) and
|
|
12
12
|
keeps the doc editable until its living-doc obligations are discharged.
|
|
13
13
|
|
|
14
|
+
**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.
|
|
15
|
+
|
|
14
16
|
## Steps
|
|
15
17
|
|
|
16
18
|
1. **Review what happened** — prefer conversation memory (you just did the work). Use `git diff --stat` only as a fallback to confirm file paths.
|
|
17
19
|
|
|
18
20
|
2. **Write/finish the working doc.** If a doc for this effort already exists in `docs/working/`, finish it; otherwise create `docs/working/{topic}-{description}.md`. Use the session-doc template in `docs/_meta/docs-workflow.md`. Required sections:
|
|
19
21
|
- Title + one-line summary; completion date; branch
|
|
20
|
-
- **
|
|
22
|
+
- **Header** — the machine header `docs/_meta/docs-workflow.md` § Doc metadata (repository-owned) prescribes, in that section's own words: the doc's type is working, its status the word for `wip` while the effort continues or the word for `shipped` on its last session, its verified date today, and any field that section derives (a count of the doc's provenance links, say) computed the way it says.
|
|
21
23
|
- **Session-comment** — next line: `<!-- session: claude-session-id={the harness's session id} -->` (Claude Code: `$CLAUDE_CODE_SESSION_ID` / `$env:CLAUDE_CODE_SESSION_ID`). Applies to EVERY session that writes a working doc — solo sessions with no pipeline, no coordinator, and no research doc included; the id alone is the point. Append `; name={...}` only when the session actually has a human-given window name (pipeline seats do; most solo sessions won't — omit it, never invent one). The harness's transcript store is ephemeral (a retention window, and the format moves between releases); this line is the durable link from the work to its conversation, so audit-grade sessions can be found later.
|
|
22
24
|
- **Builds on** — if this continues prior work, link the prior doc: `Builds on [prior](prior.md)`
|
|
23
25
|
- **Source** — if idea-driven, link the `research/` doc
|
|
@@ -29,15 +31,16 @@ keeps the doc editable until its living-doc obligations are discharged.
|
|
|
29
31
|
- **Watch-Outs** — edge cases, gotchas
|
|
30
32
|
- **Living Docs to Update** — the bridge to `docs-process`. For each stale living doc, name it and say what changed and in what form. Be specific ("references `OldEntity`, should be `NewEntity`"), not vague.
|
|
31
33
|
|
|
32
|
-
3. **Record the archive target — don't move the file.** Add an `## Archive` line to the doc
|
|
34
|
+
3. **Record the archive target — don't move the file.** Add an `## Archive` line to the doc, in the form the session template gives it (`docs/_meta/docs-workflow.md` § Templates (repository-owned)), naming where § The archive convention (repository-owned) files this effort — reuse what that section says to reuse, and name it the way that section names things. When the effort has a spec pipeline whose umbrella carries an `Archive:` line, that path is the target. `docs-process` files it there later. The doc itself **stays in `docs/working/`**.
|
|
33
35
|
|
|
34
|
-
4. **Stop.** The finished doc sits in `docs/working/` as the queue. Do NOT patch living docs, do NOT grep for stale references, do NOT
|
|
36
|
+
4. **Stop.** The finished doc sits in `docs/working/` as the queue. Do NOT patch living docs, do NOT grep for stale references, do NOT file it — all of that is `docs-process`.
|
|
35
37
|
|
|
36
38
|
## Notes
|
|
37
39
|
- **Provenance carries into the living docs.** The `Source:` (research) and `Builds on` (prior working) links
|
|
38
40
|
in the blockquote already *are* lineage edges — at `docs-process` time they populate the living doc's
|
|
39
|
-
`## Lineage` (`Idea` / `Built` rows)
|
|
40
|
-
for symmetry, but the blockquote links are the
|
|
41
|
+
`## Lineage` (`Idea` / `Built` rows), where § Doc metadata (repository-owned) keeps that footer. Optionally
|
|
42
|
+
also render a `## Lineage` block in the working doc itself for symmetry, but the blockquote links are the
|
|
43
|
+
load-bearing record.
|
|
41
44
|
- **Write for future us, not for review.** Record **what we did vs. what we thought we were going to do**, **what we tried that didn't work**, and **the decisions we made (and why)**. Those three are the load-bearing content — the commit already captures the final file state; the doc captures the reasoning, the reversals, and the dead-ends so the next session doesn't repeat them.
|
|
42
|
-
- The doc becomes frozen history only when `docs-process` files it into
|
|
45
|
+
- The doc becomes frozen history only when `docs-process` files it into its archive home (after the living docs are patched). Until then it's editable in `working/`.
|
|
43
46
|
- If the work was pure research/exploration with no code change, use `docs-backlog` instead.
|
package/skills/init/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: init
|
|
3
|
-
description: Make a repository able to run the loop — create the docs/ shape, the two method docs, a scanned first draft of every doc the loop's skills read, the doc-index menu with the repo's own slots, the Start-here stanza and the plugin pin; then say what is still missing. Run init in a repository that has none of this; run init doctor to check one that does. A second init writes nothing and prints the doctor report.
|
|
3
|
+
description: Make a repository able to run the loop — create the docs/ shape, the two method docs, a scanned first draft of every doc the loop's skills read, the doc-index menu with the repo's own slots, the Start-here stanza and the plugin pin; then say what is still missing. Run init in a repository that has none of this; run init doctor to check one that does; run init refresh to bring a repository's copies of the method docs up to a newer pack (it writes only their repository-owned sections and the stamp). A second init writes nothing and prints the doctor report.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# init
|
|
@@ -11,8 +11,11 @@ control plane admits a spec folder only when the repository carries `docs/_meta/
|
|
|
11
11
|
`init` creates all of that in a repository that has none of it — as REAL first drafts scanned off the
|
|
12
12
|
repo, never as empty headings — and `init doctor` says, per path, whether the loop can run.
|
|
13
13
|
|
|
14
|
-
**
|
|
15
|
-
|
|
14
|
+
**Three invocations:** `init` (create what is missing, then the report) · `init doctor` (the report only) ·
|
|
15
|
+
`init refresh` (a newer pack's repository-owned sections into the copies that exist — see § refresh). A
|
|
16
|
+
second `init` writes nothing and IS the doctor report.
|
|
17
|
+
|
|
18
|
+
**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.
|
|
16
19
|
|
|
17
20
|
**The law of the draft:** a section is filled only from files the scan opened, and every drafted doc
|
|
18
21
|
names them in its provenance line. Stack, trees, commands, config keys and Key Files are copied verbatim.
|
|
@@ -32,9 +35,11 @@ block read, never the exit code alone; a pin must be able to fail.
|
|
|
32
35
|
|
|
33
36
|
```
|
|
34
37
|
docs/
|
|
35
|
-
_meta/docs-workflow.md a
|
|
36
|
-
|
|
37
|
-
_meta/
|
|
38
|
+
_meta/docs-workflow.md a copy of the pack's references/docs-workflow.md (stamped); its sections marked
|
|
39
|
+
(repository-owned) are the repository's to rewrite to its own conventions
|
|
40
|
+
_meta/engineering-loop.md a copy of references/engineering-loop.md (stamped), under the same rule
|
|
41
|
+
_meta/doc-index.md the menu, written LAST — its shape line (menu=all: every doc that exists;
|
|
42
|
+
menu=curated: the docs init drafted, when the repository indexes its own) + three repo slots:
|
|
38
43
|
## Role reading lists · ## Apps and their build commands · ## The evidence tools
|
|
39
44
|
research/ working/ archive/ guides/ patterns/ infrastructure/ features/ each with a README.md
|
|
40
45
|
patterns/code-organization.md patterns/backend-patterns.md
|
|
@@ -90,7 +95,8 @@ what it says` — and cite from it. A draft written mid-scan is a draft written
|
|
|
90
95
|
`.gitlab-ci.yml`) — the jobs are the lanes · app roots (`angular.json` projects, `apps/*`,
|
|
91
96
|
`packages/*`, `web/*` and `services/*` under `src/`, `cmd/*`, an executable `*.csproj`) · `generated/` folders
|
|
92
97
|
and codegen configs (`codegen.ts`, `codegen.yml`, `openapi*`, `*.proto`, `tgconfig.json`, `prisma/`) ·
|
|
93
|
-
the folder layout two deep · `git log --oneline -20` (the message convention) ·
|
|
98
|
+
the folder layout two deep · `git log --oneline -20` (the message convention) · the remote's default
|
|
99
|
+
branch (`git symbolic-ref refs/remotes/origin/HEAD`) · a realtime library
|
|
94
100
|
(signalr, socket.io, ws, sse, pusher, ably) · a state library (ngxs, ngrx, redux, zustand, pinia,
|
|
95
101
|
mobx) · a UI library or tokens file (tailwind, daisyui, mui, chakra, bootstrap, shadcn) · a queue,
|
|
96
102
|
worker or scheduler (a service bus, RabbitMQ, SQS, BullMQ, Hangfire, Quartz, Celery, sidekiq).
|
|
@@ -99,7 +105,9 @@ what it says` — and cite from it. A draft written mid-scan is a draft written
|
|
|
99
105
|
analyzer configs (`.stylecop`, `.globalconfig`, `Directory.Build.props` rules such as
|
|
100
106
|
`TreatWarningsAsErrors`, `Nullable`, banned-API lists) · `tsconfig*.json` strictness ·
|
|
101
107
|
`BannedSymbols.txt`, `FLAKY-TESTS.md` · CODEOWNERS · `.husky/`, `.githooks/` · PR templates · the
|
|
102
|
-
existing `docs/` tree · `.claude/settings.json
|
|
108
|
+
existing `docs/` tree · `.claude/settings.json` · an index the repository already keeps of every doc (a
|
|
109
|
+
`docs/INDEX.md` or `docs/index.md` that lists them, a `docs/SUMMARY.md`, a `mkdocs.yml` nav, a
|
|
110
|
+
docusaurus or vitepress sidebar).
|
|
103
111
|
|
|
104
112
|
## The write order — create-if-missing at every step
|
|
105
113
|
|
|
@@ -108,8 +116,20 @@ not. `init` never overwrites, never reorders, never deletes.
|
|
|
108
116
|
|
|
109
117
|
1. The seven folders, each with its `README.md` from `templates/docs/readme-{folder}.md` — the README is
|
|
110
118
|
the only file init writes into a folder that already exists.
|
|
111
|
-
2. `docs/_meta/docs-workflow.md` and `docs/_meta/engineering-loop.md` —
|
|
112
|
-
`references/*` (their first line is the version stamp; copy it with the file).
|
|
119
|
+
2. `docs/_meta/docs-workflow.md` and `docs/_meta/engineering-loop.md` — copies of the pack's
|
|
120
|
+
`references/*` (their first line is the version stamp; copy it with the file). **If the repository
|
|
121
|
+
already carries a copy, read its repository-owned sections before writing any draft:** the header every
|
|
122
|
+
draft below carries is the one that copy's § Doc metadata (repository-owned) prescribes, not the
|
|
123
|
+
templates' own line. An existing copy is never rewritten by `init`; `init refresh` is the one path that
|
|
124
|
+
writes into a copy, and only into its repository-owned sections. When the repository's own gate requires
|
|
125
|
+
frontmatter on every file under `docs/`, the block may sit above the stamp; the doctor reads the stamp
|
|
126
|
+
after it.
|
|
127
|
+
|
|
128
|
+
**When `init` writes the copies itself, it drafts § This repository's rails (repository-owned)** in the
|
|
129
|
+
new `engineering-loop.md` from the scan, under the law of the draft: each item carries only what a file
|
|
130
|
+
the scan opened states — CONTRIBUTING, `CLAUDE.md` / `AGENTS.md`, `.husky/` / `.githooks/`, the CI
|
|
131
|
+
workflows, a pull-request template, CODEOWNERS, the remote's default branch — and cites it, or keeps
|
|
132
|
+
its absent-line.
|
|
113
133
|
3. The four floor drafts (`code-organization`, `backend-patterns`, `frontend-patterns`, `testing`) from
|
|
114
134
|
`templates/docs/patterns/*.md`, filled as below.
|
|
115
135
|
4. The standard-set drafts — `codegen`, `state-management`, `ui-style-guide`, `design-tokens`,
|
|
@@ -117,8 +137,12 @@ not. `init` never overwrites, never reorders, never deletes.
|
|
|
117
137
|
Evidence per concern: a `generated/` folder or codegen config; a state library; a UI library; a tokens
|
|
118
138
|
file or token layer; a saga / workflow / state-machine mechanism; a realtime library on either side; a
|
|
119
139
|
queue, worker or scheduler.
|
|
120
|
-
5. `docs/_meta/doc-index.md` from its template, LAST,
|
|
121
|
-
|
|
140
|
+
5. `docs/_meta/doc-index.md` from its template, LAST, with its shape line (`docs/_meta/docs-workflow.md`
|
|
141
|
+
§ The repository-owned sections, the menu). **`menu=all`** when the repository keeps no other index: the
|
|
142
|
+
menu lists every doc that now exists under the four living folders (drafted or repo-owned). **`menu=curated;
|
|
143
|
+
index={path}`** when pass 4 found an index the repository already keeps of every doc: the menu lists only
|
|
144
|
+
the docs `init` drafted, and the report says the owner adds each further doc that meets the loop's
|
|
145
|
+
standard. Either way, the three repo slots are filled from the scan.
|
|
122
146
|
6. The Start-here stanza (`templates/claude-md-stanza.md`) appended to `CLAUDE.md` (created if absent)
|
|
123
147
|
and to `AGENTS.md` (only if present); skipped when the opening marker
|
|
124
148
|
`<!-- naswerks-loop:start-here -->` is already there.
|
|
@@ -139,14 +163,21 @@ the scan opened for that doc.
|
|
|
139
163
|
|
|
140
164
|
The shape every drafted doc keeps — because it is the shape the seats know how to read:
|
|
141
165
|
|
|
142
|
-
1. the H1, the one-line blockquote
|
|
143
|
-
|
|
166
|
+
1. the H1, the one-line blockquote, the machine header `docs/_meta/docs-workflow.md` § Doc metadata
|
|
167
|
+
(repository-owned) prescribes at the word for `draft` — placed and spelled as that section says, the
|
|
168
|
+
verified date included wherever it keeps one (the templates carry the loop's own header, and each
|
|
169
|
+
template's init instruction says what to drop when this repository's differs) — then the
|
|
170
|
+
`<!-- naswerks-loop: draft; scanned=… -->` line;
|
|
144
171
|
2. Overview, then Stack, then the shape (a tree copied from a REAL folder), then one section per
|
|
145
172
|
concept in the micro-grammar *prose rule, a REAL example, `### Rules`, `### Gotcha:`*;
|
|
146
173
|
3. decision tables that decide, checklists whose items are real paths, a `Legacy (never use)` column
|
|
147
174
|
where the repo has one;
|
|
148
175
|
4. exact commands in fenced blocks; identifiers in backticks;
|
|
149
|
-
5. `## Key Files`, `## Lineage
|
|
176
|
+
5. `## Key Files`, and `## Lineage` where § Doc metadata (repository-owned) keeps it.
|
|
177
|
+
|
|
178
|
+
**The templates speak the loop's own formats** — the header, the status words in the Start-here stanza and
|
|
179
|
+
the folder READMEs, the archive home in the `archive/` and `working/` READMEs and in the doc-index. When
|
|
180
|
+
this repository's copy has replaced the section a line echoes, write that line in the copy's words instead.
|
|
150
181
|
|
|
151
182
|
A section the scan can only half-fill says which half. A rule with no cited source is not written.
|
|
152
183
|
|
|
@@ -159,11 +190,15 @@ FAIL, so a CI job or a control plane can call it.
|
|
|
159
190
|
| Row | FAIL | DEGRADE | ok |
|
|
160
191
|
|---|---|---|---|
|
|
161
192
|
| each of the eight folders | missing | README missing | present |
|
|
162
|
-
| `_meta/docs-workflow.md`, `_meta/engineering-loop.md` | missing, or no stamp on line 1 | stamp behind the pack's version | stamp equals it |
|
|
193
|
+
| `_meta/docs-workflow.md`, `_meta/engineering-loop.md` | missing, or no stamp on line 1 (or on the first line after a frontmatter block) | stamp behind the pack's version (`init refresh` restamps) | stamp equals it |
|
|
194
|
+
| each repository-owned heading, in its file | — | unmarked (an earlier spelling) or missing — `init refresh` marks or adds it | present |
|
|
195
|
+
| each item of § This repository's rails (repository-owned) | — | missing, or still its absent-line | recorded |
|
|
163
196
|
| `_meta/doc-index.md` and its three slot sections | missing | a slot carries only the absent-line | filled |
|
|
164
|
-
| the
|
|
165
|
-
|
|
|
166
|
-
| every
|
|
197
|
+
| the menu's shape line | an unknown shape | a curated menu names no index, or an index that does not exist | `menu=all` (also a menu with no shape line), or `menu=curated` with its index |
|
|
198
|
+
| every living doc a `menu=all` menu should list | — | a doc under the four living folders the menu does not name | named |
|
|
199
|
+
| every doc a menu names | the path does not exist (a row saying `not detected` is exempt) | on a curated menu: no status in either header form, the word `draft`, or no `## Key Files` | meets the loop's standard |
|
|
200
|
+
| the four floor docs | missing | the word `draft` (read from either header form), or an `<!-- init: -->` left in | a decided status |
|
|
201
|
+
| the seven standard docs | absent AND no doc-index row saying `not detected` | the word `draft` when present; absent with its row | present and decided, or absent with its row |
|
|
167
202
|
| `CLAUDE.md` / `AGENTS.md` stanza · `.claude/settings.json` pin | — | missing | present |
|
|
168
203
|
| `verify-staged` | — | not on PATH (the row carries the fallback) | resolvable |
|
|
169
204
|
| every `docs/research/*/00-ignition-brief.md` | the five problems the control plane's parser emits (no `## The kick`; the kick has no blockquote; no `## The sequence`; the sequence holds no table; a row names no kind from `coordinator build fixit review retro witness docs-process`), or a spec a row names is missing from disk | — | clean |
|
|
@@ -171,11 +206,42 @@ FAIL, so a CI job or a control plane can call it.
|
|
|
171
206
|
| anything else under `docs/` | — | — | "outside the loop's shape — not touched" |
|
|
172
207
|
|
|
173
208
|
**If `node` is absent**, walk the same rows by hand with your file tools, in that order, and print the
|
|
174
|
-
same table: the checks are file existence, a first-line stamp, a heading grep, a `status
|
|
175
|
-
brief's two sections.
|
|
209
|
+
same table: the checks are file existence, a first-line stamp, a heading grep, a `status` read in either
|
|
210
|
+
header form, and the brief's two sections.
|
|
176
211
|
|
|
177
212
|
A repository fresh from `init` reads DEGRADE on every draft and ok on the shape. That is the intended
|
|
178
|
-
state: the owner promotes each draft to `
|
|
213
|
+
state: the owner promotes each draft to the word for `current` as they confirm it, section by section.
|
|
214
|
+
|
|
215
|
+
The doctor never grades the loop text of the two method docs, and never their repository-owned sections'
|
|
216
|
+
content: a repository rewrites both as it sees fit. It reads the stamp, the owned headings, and the rails
|
|
217
|
+
items' absent-lines.
|
|
218
|
+
|
|
219
|
+
## refresh
|
|
220
|
+
|
|
221
|
+
`node ${CLAUDE_SKILL_DIR}/scripts/refresh.mjs [repo-root]` is a dry run; add `--write` to apply it. Node 22
|
|
222
|
+
or later, no dependencies. **What it does, in the line it prints first: it writes only the repository-owned
|
|
223
|
+
sections and the stamp; every other line is left as it is.** A repository updating the pack is taking new
|
|
224
|
+
skills, not new prose — the loop text in its copies is its own, whatever it has done to it, and refresh
|
|
225
|
+
never touches it.
|
|
226
|
+
|
|
227
|
+
It reads the pack's `references/` for what each repository-owned section is, and prints one row per section:
|
|
228
|
+
|
|
229
|
+
| Row | When | What `--write` does |
|
|
230
|
+
|---|---|---|
|
|
231
|
+
| **kept** | the copy has the section under its exact heading | nothing — the section is the repository's, byte for byte |
|
|
232
|
+
| **heading marked** | the copy has it under an earlier spelling (`## The archive convention`, `## Doc metadata (header + lineage)`, `## Templates`) | rewrites that one heading line and nothing else |
|
|
233
|
+
| **added** | the copy lacks the section | inserts the pack's default before the first following section the copy also has |
|
|
234
|
+
| **item added** | § This repository's rails (repository-owned) lacks an item this pack names | appends that item's absent-line to the end of the section |
|
|
235
|
+
| **stamp** | the stamp is behind the pack | restamps (after any frontmatter the stamp sits under) |
|
|
236
|
+
|
|
237
|
+
Then, for each section, what this pack's skills read from it and which loop passages echo it (from the
|
|
238
|
+
pack's § The repository-owned sections), so the owner can check that a rewritten section still answers each
|
|
239
|
+
item. It never deletes, never reorders, keeps every line's own ending, and a second run writes nothing.
|
|
240
|
+
|
|
241
|
+
**Run it this way:** the dry run first; show the human its table; `--write` only on their word. After the
|
|
242
|
+
write, offer — and ask before doing either — to fill each new absent-line from the scan as `init` would
|
|
243
|
+
(the law of the draft), and to move into its new item any fact the repository had parked in its loop text
|
|
244
|
+
(a paragraph naming its own skills, say). Then run `init doctor`.
|
|
179
245
|
|
|
180
246
|
## Notes
|
|
181
247
|
|