@zigrivers/scaffold 3.29.0 → 3.31.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 (86) hide show
  1. package/content/guides/AUTHORING.md +146 -0
  2. package/content/guides/cli/index.html +1855 -0
  3. package/content/guides/cli/index.md +206 -0
  4. package/content/guides/concepts/index.html +1970 -0
  5. package/content/guides/concepts/index.md +347 -0
  6. package/content/guides/dashboard/index.html +1913 -0
  7. package/content/guides/dashboard/index.md +264 -0
  8. package/content/guides/index.html +368 -15
  9. package/content/guides/install/.diagrams/diagram-0.svg +1 -0
  10. package/content/guides/install/.diagrams/manifest.json +3 -0
  11. package/content/guides/install/index.html +1653 -0
  12. package/content/guides/install/index.md +186 -0
  13. package/content/guides/knowledge/.diagrams/diagram-0.svg +1 -0
  14. package/content/guides/knowledge/.diagrams/manifest.json +3 -0
  15. package/content/guides/knowledge/index.html +1765 -0
  16. package/content/guides/knowledge/index.md +209 -0
  17. package/content/guides/knowledge-freshness/.diagrams/diagram-0.svg +1 -0
  18. package/content/guides/knowledge-freshness/.diagrams/manifest.json +3 -0
  19. package/content/guides/knowledge-freshness/index.html +2795 -0
  20. package/content/guides/knowledge-freshness/index.md +893 -0
  21. package/content/guides/mmr/index.html +407 -36
  22. package/content/guides/mmr/index.md +39 -16
  23. package/content/guides/multi-agent/.diagrams/diagram-0.svg +1 -0
  24. package/content/guides/multi-agent/.diagrams/manifest.json +3 -0
  25. package/content/guides/multi-agent/index.html +1715 -0
  26. package/content/guides/multi-agent/index.md +243 -0
  27. package/content/guides/observability/.diagrams/diagram-0.svg +1 -0
  28. package/content/guides/observability/.diagrams/diagram-1.svg +1 -0
  29. package/content/guides/observability/.diagrams/diagram-2.svg +1 -0
  30. package/content/guides/observability/.diagrams/diagram-3.svg +1 -0
  31. package/content/guides/observability/.diagrams/manifest.json +6 -0
  32. package/content/guides/observability/index.html +3257 -0
  33. package/content/guides/observability/index.md +1097 -0
  34. package/content/guides/pipeline/.diagrams/diagram-0.svg +1 -0
  35. package/content/guides/pipeline/.diagrams/diagram-1.svg +1 -0
  36. package/content/guides/pipeline/.diagrams/manifest.json +4 -0
  37. package/content/guides/pipeline/index.html +1973 -0
  38. package/content/guides/pipeline/index.md +387 -0
  39. package/content/guides/review-workflow/.diagrams/diagram-0.svg +1 -0
  40. package/content/guides/review-workflow/.diagrams/diagram-1.svg +1 -0
  41. package/content/guides/review-workflow/.diagrams/manifest.json +4 -0
  42. package/content/guides/review-workflow/index.html +1790 -0
  43. package/content/guides/review-workflow/index.md +248 -0
  44. package/dist/guides/build.d.ts +1 -1
  45. package/dist/guides/build.d.ts.map +1 -1
  46. package/dist/guides/build.js +21 -9
  47. package/dist/guides/build.js.map +1 -1
  48. package/dist/guides/build.test.js +47 -0
  49. package/dist/guides/build.test.js.map +1 -1
  50. package/dist/guides/chrome.d.ts.map +1 -1
  51. package/dist/guides/chrome.js +83 -12
  52. package/dist/guides/chrome.js.map +1 -1
  53. package/dist/guides/dashboard-theme.css +8 -0
  54. package/dist/guides/directives-cite.test.d.ts +2 -0
  55. package/dist/guides/directives-cite.test.d.ts.map +1 -0
  56. package/dist/guides/directives-cite.test.js +26 -0
  57. package/dist/guides/directives-cite.test.js.map +1 -0
  58. package/dist/guides/directives-tabs.test.js +47 -0
  59. package/dist/guides/directives-tabs.test.js.map +1 -1
  60. package/dist/guides/directives.d.ts +1 -0
  61. package/dist/guides/directives.d.ts.map +1 -1
  62. package/dist/guides/directives.js +38 -0
  63. package/dist/guides/directives.js.map +1 -1
  64. package/dist/guides/guides.css +268 -0
  65. package/dist/guides/index-page.d.ts.map +1 -1
  66. package/dist/guides/index-page.js +41 -8
  67. package/dist/guides/index-page.js.map +1 -1
  68. package/dist/guides/links.d.ts +14 -0
  69. package/dist/guides/links.d.ts.map +1 -0
  70. package/dist/guides/links.js +56 -0
  71. package/dist/guides/links.js.map +1 -0
  72. package/dist/guides/links.test.d.ts +2 -0
  73. package/dist/guides/links.test.d.ts.map +1 -0
  74. package/dist/guides/links.test.js +72 -0
  75. package/dist/guides/links.test.js.map +1 -0
  76. package/dist/guides/render.d.ts +1 -0
  77. package/dist/guides/render.d.ts.map +1 -1
  78. package/dist/guides/render.js +1 -1
  79. package/dist/guides/render.js.map +1 -1
  80. package/dist/guides/sanitize.d.ts.map +1 -1
  81. package/dist/guides/sanitize.js +5 -0
  82. package/dist/guides/sanitize.js.map +1 -1
  83. package/dist/guides/template.d.ts.map +1 -1
  84. package/dist/guides/template.js +7 -2
  85. package/dist/guides/template.js.map +1 -1
  86. package/package.json +2 -2
@@ -0,0 +1,146 @@
1
+ # Authoring Scaffold Guides
2
+
3
+ This is the single source of truth for the **guides markdown dialect** — the
4
+ frontmatter, directives, and citation syntax used by every guide under
5
+ `content/guides/<topic>/index.md`. Markdown is the source of truth; the HTML is
6
+ generated. Agents read the markdown, so everything here must degrade to readable
7
+ prose.
8
+
9
+ > **Where guides live.** A guide is a directory `content/guides/<topic>/` with an
10
+ > `index.md`. The directory name **must** equal the frontmatter `topic`. This
11
+ > file (`content/guides/AUTHORING.md`) is not a guide and is not rendered or
12
+ > gated — its examples below are illustrative only.
13
+
14
+ ## Build & check
15
+
16
+ | Command | What it does |
17
+ |---|---|
18
+ | `scaffold guides --build` | Render every `index.md` → self-contained `index.html` + the index page. |
19
+ | `scaffold guides --list --format json` | Discovery (for agents). |
20
+ | `make check-all` | Runs `guides-check` (lint + build freshness) **and** `check-reference-citations` (citation drift, incl. all guides). |
21
+
22
+ Regenerate and commit `index.html` after editing any `index.md` — the drift gate
23
+ enforces freshness.
24
+
25
+ ## Frontmatter (required)
26
+
27
+ ```yaml
28
+ ---
29
+ title: Build Observability # display title
30
+ topic: observability # MUST equal the directory name
31
+ description: One-line scope shown in the guide index
32
+ category: tools # concepts | reference | workflows | tools
33
+ order: 40 # sort order in the index (lower first)
34
+ ---
35
+ ```
36
+
37
+ Optional: `escape_scripts: [name.js]` — allowlist of script files an `:::embed`
38
+ may reference.
39
+
40
+ ## Citations — `:cite` (the provenance contract)
41
+
42
+ Cite the code that backs a claim so the **citation-drift gate**
43
+ (`scripts/check-reference-citations.mjs`) can verify the file:line still exists.
44
+ Guides are discovered by the gate automatically — no registration needed.
45
+
46
+ | Syntax | Renders | Gate behavior |
47
+ |---|---|---|
48
+ | `:cite[src/observability/engine/api.ts:42]` | `<span class="fp" data-path="…">src/observability/engine/api.ts:42</span>` | **Blocking** — drift fails `make check-all` |
49
+ | `:cite[src/foo.ts:42-58]` | range citation | **Blocking** |
50
+ | `:cite[docs/git-workflow.md:120]{mode=advisory}` | `<span class="cite-advisory" …>` | **Advisory** — warns, never blocks |
51
+
52
+ **P0-a — when to use which:**
53
+ - Use **`:cite[…]`** (blocking) for a citation that **backs a normative claim**
54
+ ("the worker transitions to `PAGED_PASSED` — `:cite[…]`"). If the line moves or
55
+ the file shrinks, the gate fails so you re-anchor it.
56
+ - Use **`:cite[…]{mode=advisory}`** for "see also" pointers where exact-line
57
+ drift shouldn't break CI.
58
+
59
+ The gate verifies the **line exists**, not that it still points at the right
60
+ symbol — semantic drift needs human review.
61
+
62
+ ## Directives
63
+
64
+ All directives are first-class (parsed, rendered, sanitized). Prefer them over
65
+ raw HTML.
66
+
67
+ ### `:::callout{type=…}`
68
+ Types: `note` (default), `tip`, `warning`, `danger`, `info`. Unknown → `note`.
69
+ ```
70
+ :::callout{type=warning}
71
+ Teardown harvests the ledger **before** `git worktree remove`.
72
+ :::
73
+ ```
74
+
75
+ ### `::::tabs` / `:::tab{title="…"}`
76
+ Use a **4-colon** outer fence wrapping 3-colon tabs. **Always quote the title** —
77
+ an unquoted title with parentheses, slashes, or other punctuation (e.g.
78
+ `{title=mvp (depth 1)}` or `{title=CLI / library}`) fails to parse and leaks the
79
+ raw `:::tab{…}` text into the page:
80
+ ```
81
+ ::::tabs
82
+ :::tab{title="npm"}
83
+ `npm install -g @zigrivers/scaffold`
84
+ :::
85
+ :::tab{title="CLI / library"}
86
+
87
+ :::
88
+ ::::
89
+ ```
90
+
91
+ ### `:::filter-table`
92
+ Wraps a GFM table and prepends a client-side filter box. Body is a normal GFM
93
+ table.
94
+
95
+ ### `:::chart{type=bar}`
96
+ Renders proportional bars **from a GFM table** and keeps the table. The **label**
97
+ is the first column; the **value** is the **last column and must be numeric**.
98
+ This is the stable, non-HTML target a generator emits for baked numeric data
99
+ (e.g. live host counts):
100
+ ```
101
+ :::chart{type=bar}
102
+
103
+ | Host | Citations |
104
+ |---|---|
105
+ | github.com | 40 |
106
+ | npmjs.com | 10 |
107
+ :::
108
+ ```
109
+ **Error:** a `:::chart` without a GFM table fails the build.
110
+
111
+ ### `:sev[label]{level=…}`
112
+ Inline severity chip. Levels: `p0`, `p1`, `p2` (default), `p3`, `pass`. Unknown → `p2`.
113
+ `A :sev[P0]{level=p0} finding.`
114
+
115
+ ### Mermaid
116
+ Fenced ```` ```mermaid ```` blocks render to inline SVG for humans and stay
117
+ readable as text for agents. Default to mermaid for diagrams.
118
+
119
+ ## Escape hatch — `:::embed{…}` (narrow, discouraged)
120
+
121
+ For genuinely one-off interactivity a first-class directive can't express. Every
122
+ `:::embed` **must contain a text-equivalent** (the word "text-equivalent" in the
123
+ body) or the build **errors** — agents must still understand the content. Using
124
+ **more than 3** embeds in a guide emits a warning: prefer first-class directives.
125
+
126
+ ## Proposing a new directive
127
+
128
+ A new directive is warranted only when content recurs across guides and the
129
+ escape hatch can't serve it without losing agent-readability. To propose one:
130
+ 1. Add a `remark<Name>` transform in `src/guides/directives.ts` (mirror the
131
+ existing `textDirective`/`containerDirective` patterns).
132
+ 2. Allow any new attributes/elements in `src/guides/sanitize.ts`.
133
+ 3. Register it in the plugin list in `src/guides/build.ts`.
134
+ 4. TDD: add `src/guides/directives-<name>.test.ts` (render via `renderGuideBody`).
135
+ 5. Document it here.
136
+
137
+ ## Authoring checklist (required reading for Phase 3 authors)
138
+
139
+ - [ ] Frontmatter complete; `topic` == directory name.
140
+ - [ ] Code-backed claims carry a blocking `:cite`; "see also" links use
141
+ `{mode=advisory}` or relative markdown links.
142
+ - [ ] Inter-guide links are relative and resolve (the relative-link validator runs in `guides-check`).
143
+ - [ ] Diagrams use mermaid; data uses `:::chart`/GFM/`:::filter-table`; no raw HTML.
144
+ - [ ] `:::embed` only where unavoidable, with a text-equivalent.
145
+ - [ ] `scaffold guides --build` run and `index.html` committed.
146
+ - [ ] `make check-all` green (citations resolve; build clean).