@erclx/canon 5.24.0 → 5.26.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/README.md +2 -1
- package/claude/.claude-plugin/plugin.json +1 -1
- package/claude/skills/backlog-triage/REQUIREMENT.md +2 -2
- package/claude/skills/backlog-triage/SKILL.md +19 -6
- package/claude/skills/canvas/REQUIREMENT.md +49 -0
- package/claude/skills/canvas/SKILL.md +106 -0
- package/claude/skills/context-fold/REQUIREMENT.md +6 -2
- package/claude/skills/context-fold/SKILL.md +8 -6
- package/claude/skills/context-fold/references/anchor-sweep.md +2 -2
- package/claude/skills/design-extract/REQUIREMENT.md +1 -1
- package/claude/skills/design-taste/REQUIREMENT.md +1 -1
- package/claude/skills/design-taste/SKILL.md +4 -2
- package/claude/skills/design-taste/references/adopted.md +40 -0
- package/claude/skills/design-taste/references/kinds.md +1 -1
- package/claude/skills/design-taste/references/systems.md +1 -7
- package/claude/skills/design-taste/references/tells.md +2 -24
- package/claude/skills/docs-sync/REQUIREMENT.md +2 -1
- package/claude/skills/document-health/REQUIREMENT.md +2 -0
- package/claude/skills/document-health/SKILL.md +21 -0
- package/claude/skills/document-health/references/axes.md +12 -0
- package/claude/skills/draft-and-pick/SKILL.md +1 -1
- package/claude/skills/draft-doc/REQUIREMENT.md +1 -1
- package/claude/skills/draft-figure/REQUIREMENT.md +14 -3
- package/claude/skills/draft-figure/SKILL.md +24 -51
- package/claude/skills/draft-figure/references/architecture-set.md +35 -0
- package/claude/skills/draft-figure/references/hand-drawn.md +31 -0
- package/claude/skills/draft-figure/references/mermaid.md +55 -0
- package/claude/skills/draft-identity/SKILL.md +1 -1
- package/claude/skills/draft-screencast/SKILL.md +9 -7
- package/claude/skills/draft-slides/REQUIREMENT.md +17 -12
- package/claude/skills/draft-slides/SKILL.md +31 -20
- package/claude/skills/git-followup/SKILL.md +17 -6
- package/claude/skills/git-issue/references/issue.md +10 -0
- package/claude/skills/git-pr/references/evidence.md +12 -2
- package/claude/skills/git-pr/references/labels.md +12 -0
- package/claude/skills/git-split/SKILL.md +19 -8
- package/claude/skills/index-lookup/SKILL.md +2 -2
- package/claude/skills/markdown-propose/references/format.md +9 -0
- package/claude/skills/memory-review/references/later-phases.md +7 -0
- package/claude/skills/review-address/SKILL.md +6 -13
- package/claude/skills/review-address/references/rest-reads.md +43 -0
- package/claude/skills/review-craft/references/ui.md +7 -1
- package/claude/skills/review-pr/REQUIREMENT.md +1 -0
- package/claude/skills/review-pr/SKILL.md +9 -3
- package/claude/skills/review-pr/references/close-out.md +2 -2
- package/claude/skills/review-pr/references/post.md +17 -5
- package/claude/skills/review-pr/references/scope.md +10 -8
- package/claude/skills/review-ui/SKILL.md +12 -4
- package/claude/skills/review-ui/references/post.md +4 -2
- package/claude/skills/role-orchestrator/references/orchestrator-cloud-launch.md +38 -1
- package/claude/skills/role-orchestrator/references/orchestrator-dispatch.md +13 -0
- package/claude/skills/role-orchestrator/references/orchestrator-launch.md +4 -0
- package/claude/skills/role-orchestrator/references/orchestrator-poll.md +4 -4
- package/claude/skills/role-orchestrator/references/orchestrator-review-dispatch.md +6 -0
- package/claude/skills/role-orchestrator/scripts/poll.ts +90 -27
- package/claude/skills/role-orchestrator/scripts/repo.ts +3 -5
- package/claude/skills/role-orchestrator/scripts/watch.ts +4 -7
- package/claude/skills/search-craft/REQUIREMENT.md +1 -1
- package/claude/skills/search-craft/SKILL.md +3 -1
- package/claude/skills/search-craft/references/adopted.md +30 -0
- package/claude/skills/target-setup/references/detect.md +8 -0
- package/claude/skills/target-setup/references/indexes.md +13 -0
- package/claude/skills/target-setup/references/verify.md +8 -0
- package/claude/skills/test-first/SKILL.md +2 -0
- package/claude/skills/test-first/references/adopted.md +36 -0
- package/claude/skills/write-human/SKILL.md +1 -1
- package/claude/skills/write-human/references/machine-tells.md +13 -0
- package/docs/agents/canvas.md +4 -2
- package/docs/agents/capture.md +1 -1
- package/docs/agents/commands.md +47 -47
- package/docs/agents/context-audit-checks.md +2 -2
- package/docs/agents/index.md +2 -3
- package/docs/agents/key-changes.md +3 -3
- package/docs/agents/pr-evidence.md +11 -2
- package/docs/agents/pr-reads.md +5 -4
- package/docs/agents/records-stale.md +22 -9
- package/docs/agents/records.md +1 -1
- package/docs/agents/sandbox.md +1 -1
- package/docs/agents/skills-audit.md +10 -3
- package/docs/agents/slides.md +15 -3
- package/docs/target/projects.md +4 -4
- package/docs/workflow/ai-workflow.md +1 -2
- package/docs/workflow/index.md +1 -0
- package/docs/workflow/parallel-features.md +1 -1
- package/docs/workflow/skill-map-on-request.md +42 -0
- package/docs/workflow/skill-map.md +3 -36
- package/docs/workflow/visual-design-workflow.md +1 -0
- package/governance/renames.toml +0 -4
- package/governance/rules/standards/markdown.md +1 -0
- package/package.json +1 -2
- package/scripts/core/install-check.sh +1 -1
- package/scripts/lib/sandbox-dispatch.sh +1 -1
- package/scripts/lib/sandbox-git.sh +1 -9
- package/scripts/lib/sandbox-path.sh +1 -1
- package/scripts/sandbox-hook.sh +99 -0
- package/src/audits/catalog.ts +2 -2
- package/src/canvas/capture.ts +1 -9
- package/src/canvas/client/inspector/color-field.tsx +368 -0
- package/src/canvas/client/inspector/field.tsx +200 -0
- package/src/canvas/client/inspector/fields.css +292 -0
- package/src/canvas/client/inspector/section.tsx +27 -0
- package/src/canvas/client/inspector/values.ts +183 -0
- package/src/canvas/client/inspector.tsx +176 -160
- package/src/canvas/client/shell.css +0 -101
- package/src/capture/render.ts +45 -7
- package/src/capture/sources.ts +43 -0
- package/src/census/count.ts +1 -1
- package/src/claude/cases/misc.ts +5 -0
- package/src/claude/cases/workflow.ts +6 -1
- package/src/claude/seeds.ts +1 -2
- package/src/claude/skills-audit.ts +68 -14
- package/src/client-commands.ts +1 -1
- package/src/commands/claude.ts +27 -2
- package/src/commands/design.ts +2 -64
- package/src/commands/feedback.ts +3 -3
- package/src/commands/pr.ts +219 -202
- package/src/commands/records.ts +88 -6
- package/src/commands/sandbox.ts +50 -10
- package/src/commands/slides.ts +31 -77
- package/src/context/audit.ts +8 -7
- package/src/design/tokens.ts +2 -18
- package/src/docs/read.ts +1 -1
- package/src/{github.ts → feedback/github.ts} +1 -1
- package/src/gate/measures.ts +6 -4
- package/src/gov/citations.ts +1 -1
- package/src/gov/payload.ts +1 -1
- package/src/gov/superseded.ts +2 -2
- package/src/help.ts +2 -2
- package/src/markdown/ceiling.ts +1 -1
- package/src/migrate/skill-names.ts +7 -1
- package/src/pr/evidence.ts +25 -5
- package/src/pr/rest.ts +137 -0
- package/src/record-root.ts +1 -0
- package/src/records/backup.ts +1 -0
- package/src/records/push-guard.ts +1 -1
- package/src/records/stale-canonical.ts +146 -0
- package/src/records/stale.ts +1 -1
- package/src/sandbox/hooks.ts +128 -0
- package/src/sandbox/provision.ts +596 -0
- package/src/sandbox/tree.ts +103 -4
- package/src/secrets/marker.ts +2 -2
- package/src/secrets/scan.ts +1 -1
- package/src/shipped/references.ts +2 -2
- package/src/slides/convert/export.ts +2 -16
- package/src/slides/decks.ts +110 -0
- package/src/standards/read.ts +1 -1
- package/src/sync/seeds-report.ts +1 -1
- package/src/tasks/answers.ts +1 -1
- package/src/tasks/archive.ts +1 -1
- package/src/teach/nav.ts +1 -1
- package/src/tooling/inject.ts +1 -1
- package/src/web/readme-citations.ts +1 -1
- package/standards/architecture.md +1 -0
- package/standards/canvas.md +112 -0
- package/standards/context.md +2 -1
- package/standards/figures.md +0 -1
- package/standards/index.md +1 -1
- package/standards/markdown.md +1 -0
- package/standards/mermaid.md +1 -7
- package/standards/requirements.md +2 -0
- package/standards/skill-practice.md +2 -1
- package/standards/skill.md +1 -0
- package/tooling/claude/reference.md +0 -5
- package/claude/skills/draft-diagram/REQUIREMENT.md +0 -45
- package/claude/skills/draft-diagram/SKILL.md +0 -177
- package/docs/agents/design-board.md +0 -33
- package/governance/rules/standards/diagrams.md +0 -14
- package/governance/rules/standards/mermaid.md +0 -15
- package/scripts/core/check-gallery-exclusion.sh +0 -50
- package/scripts/manage-sandbox.sh +0 -472
- package/src/design/board.ts +0 -576
- package/src/slides/layouts.ts +0 -478
- package/src/slides/parse.ts +0 -84
- package/src/slides/render.ts +0 -110
- package/src/slides/styles.ts +0 -96
- package/standards/diagrams.md +0 -132
- package/tooling/claude/seeds/.claude/diagrams/index.md +0 -8
- /package/claude/skills/write-human/references/{source-material.md → adopted.md} +0 -0
- /package/src/{commands/feedback-format.ts → feedback/body.ts} +0 -0
- /package/src/{github-format.ts → feedback/github-format.ts} +0 -0
- /package/src/{frontmatter.ts → markdown/frontmatter.ts} +0 -0
- /package/src/{binary.ts → sweep/binary.ts} +0 -0
- /package/src/{exempt-marker.ts → sweep/exempt-marker.ts} +0 -0
- /package/src/{paths.ts → tasks/paths.ts} +0 -0
- /package/src/{seed-marker.ts → tooling/seed-marker.ts} +0 -0
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: draft-diagram
|
|
3
|
-
description: Writes per-kind Mermaid diagram entries into `.canon/diagrams/`, covering system context, components, request flow, data pipeline, and deployment. Reads `canon/ARCHITECTURE.md` and `REQUIREMENTS.md` when present, falls back to a code-structure scan. Use when asked to "draw the architecture", "diagram the system", "show the components", "give me a flow chart", "refresh the deploy diagram", or "visualize the project". Do NOT use for design tokens (use `design-extract`) or UI audits (use `ux-audit`).
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Draft diagram
|
|
7
|
-
|
|
8
|
-
Write one entry per diagram kind. Never rewrite the folder wholesale. A pass that refreshes the deploy view leaves the other four files byte-identical, which is the whole reason the surface is a folder.
|
|
9
|
-
|
|
10
|
-
## Guards
|
|
11
|
-
|
|
12
|
-
- If no `canon/ARCHITECTURE.md`, no `canon/REQUIREMENTS.md`, and no top-level folder structure to scan, stop: `❌ No source signal. Add canon/ARCHITECTURE.md or run inside a project folder.`
|
|
13
|
-
|
|
14
|
-
## Step 1: read sources and locate the surface
|
|
15
|
-
|
|
16
|
-
Read these from the project root in parallel, skipping any that do not exist:
|
|
17
|
-
|
|
18
|
-
- `.canon/diagrams/index.md` and every `.canon/diagrams/*.md`: which entries exist and what they already say
|
|
19
|
-
- `canon/REQUIREMENTS.md`: users, external dependencies, tech stack, MVP feature list
|
|
20
|
-
- `canon/ARCHITECTURE.md`: layered components, key technical decisions
|
|
21
|
-
- `CLAUDE.md`: project type, conventions
|
|
22
|
-
- `package.json`, `pyproject.toml`, `Cargo.toml`: language and framework markers
|
|
23
|
-
- Top-level folder layout and root config files via `ls`: deploy targets, infrastructure config, component boundaries
|
|
24
|
-
|
|
25
|
-
Do not recurse speculatively.
|
|
26
|
-
|
|
27
|
-
Follow `${CLAUDE_SKILL_DIR}/../../standards/diagrams.md` for frontmatter, entry kinds, and explanation rules. Follow `${CLAUDE_SKILL_DIR}/../../standards/mermaid.md` for what goes inside the fence: layout, budgets, accessibility, labels, and verification.
|
|
28
|
-
|
|
29
|
-
### Migrating a pre-split flat file
|
|
30
|
-
|
|
31
|
-
When `.canon/diagrams/` holds no entry and `.claude/DIAGRAMS.md` exists, this pass converts it. An entry is any `*.md` in the folder other than `index.md`. The seed ships `index.md` alone, so a folder holding only the catalog is an empty set and still converts.
|
|
32
|
-
|
|
33
|
-
Split each H2 section into the entry whose kind it matches, carry its mermaid body and explanation prose across unchanged, and add the frontmatter the standard requires. Leave `.claude/DIAGRAMS.md` on disk so the split can be compared against its source, and say in Step 7 that deleting it is the user's call.
|
|
34
|
-
|
|
35
|
-
Convert only. Do not redraw a diagram during a migration pass, since a rewrite and a move landing together leaves no way to tell which one broke a diagram.
|
|
36
|
-
|
|
37
|
-
## Step 2: pick which entries this pass writes
|
|
38
|
-
|
|
39
|
-
Write an entry only when its source signal exists, and only when this pass has a reason to touch it. Skip the rest and leave their files alone.
|
|
40
|
-
|
|
41
|
-
Count entries the way Step 1 does, excluding `index.md`. Counting the catalog as an entry sends a first pass down the compare branch with nothing to compare, and it writes nothing.
|
|
42
|
-
|
|
43
|
-
- The user named a kind: write that one.
|
|
44
|
-
- The user asked broadly and the folder holds no entry: write every kind whose signal exists.
|
|
45
|
-
- The user asked broadly and at least one entry exists: compare each entry against its source signal and write only the ones whose signal moved. Report the untouched ones as current.
|
|
46
|
-
|
|
47
|
-
The standard fixes one filename and one `category` value per kind. Use them verbatim rather than inventing a name, since a refresh finds its target by filename and a new name writes a duplicate entry beside the old one. Emit `system-context.md` whenever `canon/REQUIREMENTS.md` exists, since it is the entry a reader outside the team opens first and the set is incomplete without it.
|
|
48
|
-
|
|
49
|
-
Stay inside `flowchart` and `sequenceDiagram`. C4, state, ER, and class diagrams render inconsistently across viewers.
|
|
50
|
-
|
|
51
|
-
## Step 3: write the entries
|
|
52
|
-
|
|
53
|
-
One file per kind at `.canon/diagrams/<kind>.md`. Write only the files Step 2 selected.
|
|
54
|
-
|
|
55
|
-
````markdown
|
|
56
|
-
---
|
|
57
|
-
title: <what the entry answers, sentence case>
|
|
58
|
-
description: <the question it settles and the signal that drives it>
|
|
59
|
-
category: <the kind, matching the standard>
|
|
60
|
-
verified: 'TODO: never verified'
|
|
61
|
-
---
|
|
62
|
-
|
|
63
|
-
# <Same as title>
|
|
64
|
-
|
|
65
|
-
<one-line statement of what the diagram shows>
|
|
66
|
-
|
|
67
|
-
```mermaid
|
|
68
|
-
<diagram type>
|
|
69
|
-
accTitle: <what the diagram answers>
|
|
70
|
-
accDescr: <the structure in one sentence>
|
|
71
|
-
<body>
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
<one to three explanation paragraphs>
|
|
75
|
-
````
|
|
76
|
-
|
|
77
|
-
Write `verified` as the literal `TODO: never verified` here, quoted so the colon parses. Step 6 replaces it once a render has been read back, so a SHA written beside the diagram would assert a check that has not run yet. The placeholder is what keeps a render-less project conforming, since Step 5 sends a failed render past Step 6 and nothing stamps the entry. Carry an existing entry's current value across untouched when this pass is rewriting one, and let Step 6 replace that instead.
|
|
78
|
-
|
|
79
|
-
When sources came from a code scan rather than planning prose, lead the explanation with `Source: code.` and add `Fidelity is lower than prose-driven diagrams. Verify against the project's intent.`
|
|
80
|
-
|
|
81
|
-
A reader deciding whether the entry still holds starts from the code paths the explanation cites, so cite paths that exist and spell them exactly.
|
|
82
|
-
|
|
83
|
-
Quote node labels containing spaces or special characters with double quotes (`A["Web shell"]`). Avoid parentheses inside labels, they break some renderers. Use `<br/>` for line breaks inside labels.
|
|
84
|
-
|
|
85
|
-
Run the scan in `${CLAUDE_SKILL_DIR}/../../standards/publish.md` against the whole file, including inside mermaid `subgraph` labels and node text. The file lands in the repository rather than on a remote, so the scan's destination scoping leaves the character checks and not the phase-label one, and the `pull_request` check the git-pr surface carries reads only a pull request's own title and body, never a file the diff carries. A colon also works as a replacement inside a label. The pedagogical voice the diagram standard asks for is a yield on voice alone and buys no exemption from these bans.
|
|
86
|
-
|
|
87
|
-
Nothing enforces the ban inside the diagram. The standards-audit hook toggles on a fence and skips every line within it, so a label carrying an em dash passes silently while the same character in the explanation paragraph below is caught. Check the labels by reading them. This is the one place in the file where the author is the only gate.
|
|
88
|
-
|
|
89
|
-
## Step 4: regenerate the catalog
|
|
90
|
-
|
|
91
|
-
```bash
|
|
92
|
-
canon indexes regen
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
Run it after the last entry is written. It rebuilds `.canon/diagrams/index.md` from sibling frontmatter and groups entries under their `category`. Never hand-edit that file.
|
|
96
|
-
|
|
97
|
-
When `canon` is not on PATH, say so in Step 7 and name `.canon/diagrams/index.md` as stale rather than writing it by hand.
|
|
98
|
-
|
|
99
|
-
Scaffold `.canon/diagrams/index.md` with `title` and `subtitle` frontmatter before the first regen when the folder is new and the seed did not provide one. The subtitle routes a first-time reader to the system context entry, since the catalog sorts categories alphabetically rather than in narrative order.
|
|
100
|
-
|
|
101
|
-
## Step 5: render what this pass changed
|
|
102
|
-
|
|
103
|
-
A source that satisfies every rule in the standard can still render as a picture that asserts something false about the system. Verification runs on the image.
|
|
104
|
-
|
|
105
|
-
Render each entry this pass wrote. Skip every entry Step 2 left alone, since an untouched diagram cannot develop a new render defect.
|
|
106
|
-
|
|
107
|
-
Before the first render in a project, say what is about to block:
|
|
108
|
-
|
|
109
|
-
```plaintext
|
|
110
|
-
Rendering to verify layout. The first run downloads the Mermaid CLI and takes about 15 seconds.
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
Write each diagram's mermaid body to its own scratch file, then render it:
|
|
114
|
-
|
|
115
|
-
```bash
|
|
116
|
-
mkdir -p .canon/tmp/diagrams && bunx -y @mermaid-js/mermaid-cli -i .canon/tmp/diagrams/<kind>.mmd -o .canon/tmp/diagrams/<kind>.png
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
Render to PNG. An SVG export reads back as markup with no recoverable spatial meaning, so it cannot be verified. Use `bunx` when bun is available. Fall back to `npx -y @mermaid-js/mermaid-cli ...` otherwise.
|
|
120
|
-
|
|
121
|
-
Renders are verification artifacts, not deliverables. They stay in `.canon/tmp/diagrams/` and are never committed.
|
|
122
|
-
|
|
123
|
-
When the render fails for any reason (no browser engine, no network, no package manager), continue to Step 7 and name the skipped check in the chat output. A missing renderer degrades the loop, it does not fail it.
|
|
124
|
-
|
|
125
|
-
## Step 6: read the renders back
|
|
126
|
-
|
|
127
|
-
Read each PNG and judge the picture against what the entry means to say. Apply the verification properties in `${CLAUDE_SKILL_DIR}/../../standards/mermaid.md`.
|
|
128
|
-
|
|
129
|
-
Fix the source and re-render. Stop after two correction passes on an entry.
|
|
130
|
-
|
|
131
|
-
When a defect survives, keep the entry and name the defect in the chat output. A diagram whose author states the flaw is recoverable. A wrong diagram reported as verified is not.
|
|
132
|
-
|
|
133
|
-
### Stamp the marker
|
|
134
|
-
|
|
135
|
-
Stamp every entry that passed. Set `verified` to the short SHA of `HEAD` and today's ISO date, and delete any `stale` key the entry carries:
|
|
136
|
-
|
|
137
|
-
```bash
|
|
138
|
-
git rev-parse --short HEAD
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
The result is one line, `<sha> <date>`, as in `73e9a3f8 2026-08-02`. <!-- canon-allow-reference: illustrates the verified field's two-token format, which a qualified sha would misstate -->
|
|
142
|
-
|
|
143
|
-
Stamp nothing else. An entry Step 2 left alone was never re-checked, an entry whose defect survived is known wrong, and an entry whose render was skipped was never seen. All three keep the marker they already carry, and Step 7 names the last two. The field means a render was read back and judged correct, so stamping any of these spends the only signal a reader has on a diagram nobody confirmed.
|
|
144
|
-
|
|
145
|
-
A migration pass stamps on the same rule. Conversion writes entries, Step 5 renders them, and this step reads them back, so the marker records the commit the split was checked against rather than the commit the flat file was written at.
|
|
146
|
-
|
|
147
|
-
## Step 7: chat output
|
|
148
|
-
|
|
149
|
-
```plaintext
|
|
150
|
-
📝 Wrote N entries to .canon/diagrams/
|
|
151
|
-
.canon/diagrams/<kind>.md
|
|
152
|
-
<one line per entry written>
|
|
153
|
-
|
|
154
|
-
Left untouched: <kind, kind> <omitted when the folder was empty>
|
|
155
|
-
|
|
156
|
-
Verified N renders. <defect or skipped check, one line each, omitted when clean>
|
|
157
|
-
|
|
158
|
-
Open in any viewer with native Mermaid support (VS Code with `bierner.markdown-mermaid`, GitHub, Cursor) to render. Ask to export if you want SVG or PNG files.
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
Emit the full path for every file written. Do not echo the diagram bodies in chat. Never report a clean verification when a render was skipped or a defect survived. Never report an entry as written when this pass left it alone.
|
|
162
|
-
|
|
163
|
-
After a migration pass, add: `Converted .claude/DIAGRAMS.md into N entries. The original is untouched, delete it once you have compared the split against it.`
|
|
164
|
-
|
|
165
|
-
## Step 8: export on request
|
|
166
|
-
|
|
167
|
-
If the user asks to export the diagrams (`export to svg`, `give me images`, `render to png`), run:
|
|
168
|
-
|
|
169
|
-
```bash
|
|
170
|
-
mkdir -p .canon/tmp/render/diagrams && bunx -y @mermaid-js/mermaid-cli -i .canon/diagrams/<kind>.md -o .canon/tmp/render/diagrams/<kind>.png
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
Export PNG by default. Swap the extension for `.svg` only when the user asks for vector, and never for the Step 5 verification path. The CLI writes one file per `mermaid` block, suffixing when an entry holds more than one. Export every entry when the user names no kind. Output line:
|
|
174
|
-
|
|
175
|
-
```plaintext
|
|
176
|
-
📝 Wrote N files to .canon/tmp/render/diagrams/
|
|
177
|
-
```
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Design board
|
|
3
|
-
description: Generating a static index over a project's design surfaces, what each panel reads, and which two stay toolkit-checkout-only
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Design board
|
|
7
|
-
|
|
8
|
-
`canon design board [--out <path>] [--root <path>]` generates a static page set indexing six design surfaces and reports the path a reader opens with `canon serve`. `--root` defaults to the main worktree the same way `canon teach`'s verbs resolve their own root. The surfaces panel's landing-page half and the whole components panel render only when that root is this toolkit's own checkout, since both read this repository's own build output rather than anything a target project produces. Running the installed CLI from inside a checkout of this project prints a mismatch warning when the caller's working directory disagrees with the root it resolved.
|
|
9
|
-
|
|
10
|
-
Each panel reads what is already on disk and reports its own missing source rather than failing the run, so an absent build, an empty corpus, or a toolkit-only gate renders an empty-state message instead of a broken frame.
|
|
11
|
-
|
|
12
|
-
```bash
|
|
13
|
-
canon design board
|
|
14
|
-
canon serve .canon/tmp/render/board
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
| Option | Default | Behavior |
|
|
18
|
-
| ------------------ | ------------------------- | --------------------------------------------- |
|
|
19
|
-
| `-o, --out <path>` | `.canon/tmp/render/board` | Output directory |
|
|
20
|
-
| `--root <path>` | The main worktree | Project root the board reads its sources from |
|
|
21
|
-
|
|
22
|
-
## Panels
|
|
23
|
-
|
|
24
|
-
- **Tokens** renders `DESIGN.md` through the same renderer `canon design render` uses, rather than a second one, reading `<root>/canon/DESIGN.md` or `<root>/.claude/DESIGN.md` for a target that has not run `canon migrate surface-roots`.
|
|
25
|
-
- **Surfaces** iframes the built landing page from `<root>/web/dist/` and a teach workspace from `<root>/.canon/teach/`, copying each whole into the board's own tree. The landing-page half reports a toolkit-only notice outside this toolkit's own checkout, and either half reports its own missing build or absent workspace rather than rendering a broken frame.
|
|
26
|
-
- **Wireframes** reads every `**/*.md` under `<root>/canon/wireframes/` or `<root>/.claude/wireframes/`, excluding `index.md` at any depth, and renders each file as-is inside a `<pre>`, labeled from its own `description` frontmatter field. Reports the whole panel empty rather than per file when the directory is absent or holds nothing to render.
|
|
27
|
-
- **Past candidates** lists an arm capture image per folder under `<root>/.canon/picks/`, skipping `references/`, and states the corpus carries none rather than rendering an empty grid.
|
|
28
|
-
- **Components** iframes the gallery built by `bun run web:gallery`, a second Astro config at `web/gallery.config.mjs` reading `web/gallery-src/` and writing `web/gallery-dist/`. That config's `srcDir` is never read by `web:build`'s own config, so the gallery never reaches the published `web/dist/`. The gallery page renders every component under `web/src/components/` except two whose props carry no defaults, which it names rather than filling with invented data. Reports a toolkit-only notice outside this toolkit's own checkout, and a missing gallery build otherwise.
|
|
29
|
-
- **References** lists whatever image an operator has dropped flat under `<root>/.canon/picks/references/`, with no fetching and no second token source: a reference is an image, nothing more. Reports the folder as absent or as present but carrying no image rather than rendering an empty grid.
|
|
30
|
-
|
|
31
|
-
## What it does not do
|
|
32
|
-
|
|
33
|
-
The board never writes outside its own output directory and never builds `web/dist/` on a caller's behalf. `web/dist/` and `.canon/teach/` are read, not written, and copied into the board's tree only for that run: the generator clears and recreates its output directory on every call, so a caller relying on it to persist between runs is relying on an accident. It refuses rather than clearing a directory that is or contains the project root or the caller's own working directory, which is what an `--out .` typo would otherwise do, including when a global install resolves the project root to a different checkout than the one the caller stands in.
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
# Generated by `canon gov regen` from standards/diagrams.md. Edit that frontmatter, not this file.
|
|
3
|
-
description: Shape and content rules for .canon/diagrams/<kind>.md files
|
|
4
|
-
paths:
|
|
5
|
-
- '.canon/diagrams/**'
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Diagram standards
|
|
9
|
-
|
|
10
|
-
## Authority
|
|
11
|
-
|
|
12
|
-
- Follow the diagrams standard for shape and content rules for .canon/diagrams/<kind>.md files. It is the single source. Read it with `canon standards diagrams`.
|
|
13
|
-
- Layout, budgets, accessibility, labels, and render verification inside the fence are a separate topic. The mermaid standard routes them.
|
|
14
|
-
- A diagram entry carries structure and flow, not implementation. Read the standard before adding or revising a kind.
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
# Generated by `canon gov regen` from standards/mermaid.md. Edit that frontmatter, not this file.
|
|
3
|
-
description: Direction and layout, node and edge budgets, accessibility fields, label punctuation, and render verification for a Mermaid diagram
|
|
4
|
-
paths:
|
|
5
|
-
- '**/*.md'
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Mermaid standards
|
|
9
|
-
|
|
10
|
-
## Authority
|
|
11
|
-
|
|
12
|
-
- Follow the mermaid standard for direction and layout, node and edge budgets, accessibility fields, label punctuation, and render verification for a Mermaid diagram. It is the single source. Read it with `canon standards mermaid`.
|
|
13
|
-
- Apply this rule only when the edit drafts or revises a Mermaid fence. Skip it on a markdown edit carrying no diagram.
|
|
14
|
-
- Read it before drafting the fence. Do not work the layout or the budgets from memory.
|
|
15
|
-
- Which diagram a document carries and what question it answers is a separate topic. The diagrams standard routes it.
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
set -e
|
|
3
|
-
set -o pipefail
|
|
4
|
-
|
|
5
|
-
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
6
|
-
PROJECT_ROOT="${PROJECT_ROOT:-$(cd "$SCRIPT_DIR/../.." && pwd)}"
|
|
7
|
-
|
|
8
|
-
WEB_DIST="$PROJECT_ROOT/web/dist"
|
|
9
|
-
GALLERY_DIST="$PROJECT_ROOT/web/gallery-dist"
|
|
10
|
-
MARKER='name="canon-gallery-marker"'
|
|
11
|
-
|
|
12
|
-
# Nothing to grep without a build. Callers run this after `bun run web:build`
|
|
13
|
-
# and `bun run web:gallery`, so an absent dist here means a build step itself
|
|
14
|
-
# failed rather than something this check can verify.
|
|
15
|
-
if [ ! -d "$WEB_DIST" ]; then
|
|
16
|
-
echo "No $WEB_DIST. Run bun run web:build first." >&2
|
|
17
|
-
exit 1
|
|
18
|
-
fi
|
|
19
|
-
|
|
20
|
-
if [ ! -d "$GALLERY_DIST" ]; then
|
|
21
|
-
echo "No $GALLERY_DIST. Run bun run web:gallery first." >&2
|
|
22
|
-
exit 1
|
|
23
|
-
fi
|
|
24
|
-
|
|
25
|
-
# A prose notice is not load-bearing: rewording it silently retires the leak
|
|
26
|
-
# check it backed with every workflow still green. The marker is a fixed
|
|
27
|
-
# `<meta>` tag `web/gallery-src/pages/index.astro` carries for exactly this,
|
|
28
|
-
# so asserting it survives in the gallery's own build is what turns a dropped
|
|
29
|
-
# marker into a loud failure here rather than a blind spot in the check below.
|
|
30
|
-
if ! grep -rl "$MARKER" "$GALLERY_DIST" >/dev/null 2>&1; then
|
|
31
|
-
echo "The gallery build at $GALLERY_DIST carries no $MARKER. The gallery page dropped its own marker, which is what the leak check below reads for." >&2
|
|
32
|
-
exit 1
|
|
33
|
-
fi
|
|
34
|
-
|
|
35
|
-
# `web/gallery.config.mjs` keeps the components-panel gallery out of the
|
|
36
|
-
# published build by never pointing its srcDir at it. A later config change
|
|
37
|
-
# that widens srcDir, or a gallery file moving under web/src/, would publish
|
|
38
|
-
# this repository's component internals to a live domain with every other
|
|
39
|
-
# check still green, which is what this guards against.
|
|
40
|
-
if find "$WEB_DIST" -iname '*gallery*' | grep -q .; then
|
|
41
|
-
echo "A file named for the gallery reached $WEB_DIST. See web/gallery.config.mjs's srcDir." >&2
|
|
42
|
-
exit 1
|
|
43
|
-
fi
|
|
44
|
-
|
|
45
|
-
if grep -rl "$MARKER" "$WEB_DIST" >/dev/null 2>&1; then
|
|
46
|
-
echo "The gallery's own marker ($MARKER) reached $WEB_DIST. See web/gallery.config.mjs's srcDir." >&2
|
|
47
|
-
exit 1
|
|
48
|
-
fi
|
|
49
|
-
|
|
50
|
-
echo "check-gallery-exclusion: gallery marker present in $GALLERY_DIST, absent from $WEB_DIST"
|