You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(visualization): reusable templates for the Excalidraw file target #17128
An agent can build reusable components and templates, such as a shape palette, for Excalidraw file diagrams, so later diagrams can start from them instead of drawing each shape again.
Why now
The Excalidraw file target from #17052 exists to hold them. Templates need that target first, and it has now shipped.
Scope
This is separate from the file target in #17052: that work is complete and this item does not change it.
Size: Small
Complexity: Low
Uncertainty: Known
Flags: none
Blocked by: none
Blast radius: one new template file, one test file and one added step in the visualization skill's excalidraw-file block. Agents using that skill read it.
Reversible: yes; revert the added files and the one SKILL.md step.
Open questions: none
I understood this as a request for a bundled, reusable shape-palette template for the Excalidraw file target from #17052, which stays unchanged.
The owner's recorded decision, quoted from the decision comment (#17128 (comment)):
Decision recorded. Owner, 2026-11-20, typed in the owning session (verbatim): "I want to make sure that the recommendations are grounded in facts, data, metrics, and research from the latest consensus-based research from official, authoritative, and trusted sources, and just go with the recommendations there." The recommendation was checked against the code at origin/main and current official sources before this record; the decision below is the grounded one.
[quote truncated; the full decision is at the link]
That decision settles the open questions from the refinement comment: one bundled .excalidraw scene template, for the excalidraw-file target only, with no consumer config key. The amendment comment lists the done-when checks.
Related: #17052 (shipped file target), #16803 (may touch the same SKILL.md text). I found no merged pull request that already does this.
Refinement. A read-only run explored this repository, searched its issues and pull requests, and read the allowed docs to draft what follows. On an issue a listed human filed, it counts as the issue's spec once posted, while unedited; it is still model text, so check it.
Intended outcome: Ship a small bundled library of Excalidraw template files (a shape palette) in the visualization plugin, plus a documented step in the excalidraw-file target for starting a new diagram from one.
What is the exact deliverable and its check? The issue names only a shape palette as an example.
RECOMMENDED: A bundled shape-palette template as a valid .excalidraw file, plus a SKILL.md step for starting a diagram from it, checked by lib/diagram-file-check.mjs passing on the template and by a test or eval that builds one diagram from it. Basis: plugins/visualization/lib/diagram-file-check.mjs
Where do templates live and who supplies them: bundled in the plugin, or read from a consumer directory?
RECOMMENDED: Bundle a small library under plugins/visualization, and read consumer templates from a directory set by a new config key, defaulting to none, so v1 stays additive. Basis: judgment
May the work edit the excalidraw-file section of SKILL.md and the config schema, given the issue says the file target is not changed?
RECOMMENDED: Yes, only by adding a separate templates step and an optional config key, leaving the existing target steps untouched. Basis: .base/plugins/visualization/skills/visualize/SKILL.md:218
Should templates also be usable with the canvas targets (excalidraw MCP, tldraw), or only with the excalidraw-file target?
RECOMMENDED: Only the excalidraw-file target in this issue, since it is the one the issue says holds the templates. Basis: judgment
Sources read
plugins/visualization/skills/visualize/SKILL.md:218: defines the excalidraw-file target, which writes <root>/docs/diagrams/<name>.excalidraw and never stages or commits it
plugins/visualization/skills/visualize/SKILL.md:86: the excalidraw-file target is the one exception to the diagram-as-text rule
plugins/visualization/lib/diagram-file-check.mjs: existing validator for diagram files; a template check could reuse it
plugins/visualization/tests/diagram-file-check.test.mjs: existing tests for that validator
context.json: no maintainer decision comment; triage lists two open questions
To answer, post a comment that starts with this line:
**Decision recorded.** <answer>
Automated refinement by the lanes App. Answer with a comment whose first line is **Decision recorded.**.
Decision recorded. Owner, 2026-11-20, typed in the owning session (verbatim): "I want to make sure that the recommendations are grounded in facts, data, metrics, and research from the latest consensus-based research from official, authoritative, and trusted sources, and just go with the recommendations there." The recommendation was checked against the code at origin/main and current official sources before this record; the decision below is the grounded one.
Q125 (CONFIRMED A)
Option A, v1, for the excalidraw-file target only.
Ship one bundled shape-palette template under plugins/visualization, as a .excalidraw scene file (type: "excalidraw"), not a .excalidrawlib library. The agent is the consumer: it copies elements from the template into a new docs/diagrams/<name>.excalidraw. lib/diagram-file-check.mjs rejects a library file.
Add a separate SKILL.md step to the excalidraw-file block (SKILL.md:218-252) that starts a diagram from the template. The draft still goes through the existing check and write steps unchanged.
One test asserts the bundled template passes diagram-file-check.mjs; one eval or test builds a diagram from it.
Out of scope: the consumer-template config key, canvas targets, and an .excalidrawlib export. Each can follow if a person asks.
Basis
I ran the check on a 7-element palette scene (a frame, a rectangle with a bound text label, a diamond, an ellipse, an arrow and a text note) written to .work/github-work/g4-palette.excalidraw. node plugins/visualization/lib/diagram-file-check.mjs printed {"ok":true,"elements":7,"problems":[]}. The local checker is identical to origin/main (git diff HEAD origin/main on the file is empty). The recommendation's UNVERIFIED claim is now verified.
plugins/visualization/lib/diagram-file-check.mjs:13 sets FILE_TYPE = "excalidraw", and :88 makes the CLI accept only a .excalidraw path. plugins/visualization/tests/diagram-file-check.test.mjs:45 asserts that type: "excalidrawlib" fails. So a library-format template cannot pass the check.
Not admitted to the issue lane: no trusted-human acceptance criteria: a listed human must put the confirmed - [ ] criteria in the body or post them as their own comment, or, on an issue a listed human filed, intake's newest refinement comment must hold them unedited. Admission takes the issue once each of those is met, when intake triages it again (.github/actions/resolve-config/admission-rules.json).
Amendment to the decision above, from the research re-check (owner direction of 2026-11-20 recorded there).
Amendment
Q125 stays option A, v1, for the excalidraw-file target only. The plugin ships one bundled shape-palette template as a .excalidraw scene file (type: "excalidraw"), not a .excalidrawlib library, plus a separate SKILL.md step that starts a diagram from it. The checker evidence still settles the choice. F6: "The repository checker plugins/visualization/lib/diagram-file-check.mjs sets FILE_TYPE to excalidraw at line 13 and accepts a CLI path ending in .excalidraw at line 88, and its test at line 45 asserts that a file with type set to excalidrawlib fails" (diagram-file-check.mjs).
Corrections to the basis:
The library type string is excalidrawlib. The decision said isValidLibrary requires type excalidrawLibrary. That is the constant's key, not the string a library file carries.
F2: "excalidraw data/json.ts at master accepts a library only when type equals EXPORT_DATA_TYPES.excalidrawLibrary and version is 1 or 2, and serializeLibraryAsJSON writes type, version, source and libraryItems" (json.ts).
F3: "excalidraw sets EXPORT_DATA_TYPES.excalidraw to excalidraw, EXPORT_DATA_TYPES.excalidrawLibrary to excalidrawlib, and both VERSIONS entries to 2 in packages/excalidraw/constants.ts at the v0.18.1 tag" (constants.ts at v0.18.1).
The function that writes a library is serializeLibraryAsJSON (F2), not saveLibraryAsJSON.
The docs page date. The research dates the JSON schema page 2026-09-08, by its in-repo source commit. The "Last updated on 11/3/2026" the decision quoted shows only in a JS-rendered fetch, so it is not used. F1: "The Excalidraw JSON schema docs page defines a .excalidraw scene file as JSON with type set to excalidraw, a numeric version, source, elements, appState and files".
The template follows the release, not master. The page's Element creation time section, which holds the "insert from a library" row, documents an element-level created field.
F5: "excalidraw data/restore.ts at master restores an element-level created field, and the docs page's Element creation time section describes that field" (restore.ts). Qualifier: that is master code, not a release.
F10: "excalidraw data/restore.ts at the v0.18.1 tag sets created on library items alone" (restore.ts at v0.18.1).
F9: v0.18.1 is the latest release, published 2026-04-21 (release). The checker pins its rules to that release.
The template therefore carries no element-level created.
Caveat on the checker. The checker checks a fixed subset of fields: the file's type, version, appState, files and elements, and per element its id, type, position, size or points, text fields and references. It does not say whether an element-level created is valid. The research lists the checker's behavior on such a field as open. The template must pass the checker as shipped, with no change to the checker.
The loader still keeps the two formats apart. F4: "excalidraw data/blob.ts at master loads data passing isValidExcalidrawData as a scene and data passing isValidLibrary as a library, and parseLibraryJSON throws Invalid library on data that fails isValidLibrary" (blob.ts). Qualifier: this was read as source text, with no live editor run. The dissent stands as recorded: for a person reusing shapes in the editor, a .excalidrawlib library fits better.
The research's verifier failed two rows: row 7, which checks that each accepted claim's confidence grade is earned, and row 12, which checks that each claim follows jointly from its cited sources with its qualifiers kept. Its per-row reasons are not part of the research record. Each claim quoted above is quoted with the qualifiers its record carries.
Done when
One shape-palette template file ending in .excalidraw, with top-level type set to excalidraw, is added under plugins/visualization/, and no file ending in .excalidrawlib is added.
node plugins/visualization/lib/diagram-file-check.mjs <template path> exits 0 and prints "ok":true for the bundled template, and the change leaves plugins/visualization/lib/diagram-file-check.mjs unchanged.
No element in the bundled template carries a created key.
A test under plugins/visualization/tests/ asserts that the bundled template passes checkExcalidraw.
A test builds a diagram by copying elements from the template into a new scene and asserts that checkExcalidraw passes on the result.
The excalidraw-file block of plugins/visualization/skills/visualize/SKILL.md gains one step that starts a diagram from the template, and the block's existing check and write steps are unchanged.
Activity
docs(upstream): defer agent-built templates to their own issue
github-actions commentedon Nov 18, 2026
Size: Small
Complexity: Low
Uncertainty: Known
Flags: none
Blocked by: none
Blast radius: one new template file, one test file and one added step in the visualization skill's excalidraw-file block. Agents using that skill read it.
Reversible: yes; revert the added files and the one SKILL.md step.
Open questions: none
I understood this as a request for a bundled, reusable shape-palette template for the Excalidraw file target from #17052, which stays unchanged.
The owner's recorded decision, quoted from the decision comment (#17128 (comment)):
Automated triage. A maintainer reviews it.
melodic-automation-lanes commentedon Nov 18, 2026
The latest triage verdict holds nothing: the issue is at
status: ready.melodic-automation-lanes commentedon Nov 18, 2026
Refinement. A read-only run explored this repository, searched its issues and pull requests, and read the allowed docs to draft what follows. On an issue a listed human filed, it counts as the issue's spec once posted, while unedited; it is still model text, so check it.
Intended outcome: Ship a small bundled library of Excalidraw template files (a shape palette) in the visualization plugin, plus a documented step in the excalidraw-file target for starting a new diagram from one.
Related work
Open questions
RECOMMENDED: A bundled shape-palette template as a valid .excalidraw file, plus a SKILL.md step for starting a diagram from it, checked by lib/diagram-file-check.mjs passing on the template and by a test or eval that builds one diagram from it. Basis: plugins/visualization/lib/diagram-file-check.mjs
RECOMMENDED: Bundle a small library under plugins/visualization, and read consumer templates from a directory set by a new config key, defaulting to none, so v1 stays additive. Basis: judgment
RECOMMENDED: Yes, only by adding a separate templates step and an optional config key, leaving the existing target steps untouched. Basis: .base/plugins/visualization/skills/visualize/SKILL.md:218
RECOMMENDED: Only the excalidraw-file target in this issue, since it is the one the issue says holds the templates. Basis: judgment
Sources read
To answer, post a comment that starts with this line:
Automated refinement by the lanes App. Answer with a comment whose first line is
**Decision recorded.**.kyle-sexton commentedon Nov 21, 2026
Decision recorded. Owner, 2026-11-20, typed in the owning session (verbatim): "I want to make sure that the recommendations are grounded in facts, data, metrics, and research from the latest consensus-based research from official, authoritative, and trusted sources, and just go with the recommendations there." The recommendation was checked against the code at origin/main and current official sources before this record; the decision below is the grounded one.
Q125 (CONFIRMED A)
Option A, v1, for the
excalidraw-filetarget only..excalidrawscene file (type: "excalidraw"), not a.excalidrawliblibrary. The agent is the consumer: it copies elements from the template into a newdocs/diagrams/<name>.excalidraw.lib/diagram-file-check.mjsrejects a library file.diagram-file-check.mjs; one eval or test builds a diagram from it..excalidrawlibexport. Each can follow if a person asks.Basis
node plugins/visualization/lib/diagram-file-check.mjsprinted{"ok":true,"elements":7,"problems":[]}. The local checker is identical to origin/main (git diff HEAD origin/mainon the file is empty). The recommendation's UNVERIFIED claim is now verified.FILE_TYPE = "excalidraw", and :88 makes the CLI accept only a.excalidrawpath. plugins/visualization/tests/diagram-file-check.test.mjs:45 asserts thattype: "excalidrawlib"fails. So a library-format template cannot pass the check..excalidrawscene:type"excalidraw", a numericversion,elements,appStateandfiles. It lists "insert from a library" as a separate operation.isValidLibraryrequires typeexcalidrawLibraryand version 1 or 2, andsaveLibraryAsJSONwrites a.excalidrawlibfile withlibraryItems. The library is the editor's native reusable-shape mechanism. Latest release v0.18.1 (2026-04-21) is the version the checker pins.Dissent considered
For a person, the native way to reuse shapes is a
.excalidrawliblibrary.excalidraw.workspaceLibraryPath(https://github.com/excalidraw/excalidraw-vscode README, read 2026-11-20).melodic-automation-lanes commentedon Nov 21, 2026
Not admitted to the issue lane: no trusted-human acceptance criteria: a listed human must put the confirmed
- [ ]criteria in the body or post them as their own comment, or, on an issue a listed human filed, intake's newest refinement comment must hold them unedited. Admission takes the issue once each of those is met, when intake triages it again (.github/actions/resolve-config/admission-rules.json).kyle-sexton commentedon Nov 21, 2026
Amendment to the decision above, from the research re-check (owner direction of 2026-11-20 recorded there).
Amendment
Q125 stays option A, v1, for the
excalidraw-filetarget only. The plugin ships one bundled shape-palette template as a.excalidrawscene file (type: "excalidraw"), not a.excalidrawliblibrary, plus a separate SKILL.md step that starts a diagram from it. The checker evidence still settles the choice. F6: "The repository checkerplugins/visualization/lib/diagram-file-check.mjssetsFILE_TYPEtoexcalidrawat line 13 and accepts a CLI path ending in.excalidrawat line 88, and its test at line 45 asserts that a file withtypeset toexcalidrawlibfails" (diagram-file-check.mjs).Corrections to the basis:
The library type string is
excalidrawlib. The decision saidisValidLibraryrequires typeexcalidrawLibrary. That is the constant's key, not the string a library file carries.data/json.tsat master accepts a library only whentypeequalsEXPORT_DATA_TYPES.excalidrawLibraryandversionis 1 or 2, andserializeLibraryAsJSONwritestype,version,sourceandlibraryItems" (json.ts).EXPORT_DATA_TYPES.excalidrawtoexcalidraw,EXPORT_DATA_TYPES.excalidrawLibrarytoexcalidrawlib, and bothVERSIONSentries to 2 inpackages/excalidraw/constants.tsat the v0.18.1 tag" (constants.ts at v0.18.1).The function that writes a library is
serializeLibraryAsJSON(F2), notsaveLibraryAsJSON.The docs page date. The research dates the JSON schema page 2026-09-08, by its in-repo source commit. The "Last updated on 11/3/2026" the decision quoted shows only in a JS-rendered fetch, so it is not used. F1: "The Excalidraw JSON schema docs page defines a
.excalidrawscene file as JSON withtypeset toexcalidraw, a numericversion,source,elements,appStateandfiles".The template follows the release, not master. The page's Element creation time section, which holds the "insert from a library" row, documents an element-level
createdfield.data/restore.tsat master restores an element-levelcreatedfield, and the docs page's Element creation time section describes that field" (restore.ts). Qualifier: that is master code, not a release.data/restore.tsat the v0.18.1 tag setscreatedon library items alone" (restore.ts at v0.18.1).The template therefore carries no element-level
created.Caveat on the checker. The checker checks a fixed subset of fields: the file's
type,version,appState,filesandelements, and per element its id, type, position, size or points, text fields and references. It does not say whether an element-levelcreatedis valid. The research lists the checker's behavior on such a field as open. The template must pass the checker as shipped, with no change to the checker.The loader still keeps the two formats apart. F4: "excalidraw
data/blob.tsat master loads data passingisValidExcalidrawDataas a scene and data passingisValidLibraryas a library, andparseLibraryJSONthrowsInvalid libraryon data that failsisValidLibrary" (blob.ts). Qualifier: this was read as source text, with no live editor run. The dissent stands as recorded: for a person reusing shapes in the editor, a.excalidrawliblibrary fits better.The research's verifier failed two rows: row 7, which checks that each accepted claim's confidence grade is earned, and row 12, which checks that each claim follows jointly from its cited sources with its qualifiers kept. Its per-row reasons are not part of the research record. Each claim quoted above is quoted with the qualifiers its record carries.
Done when
.excalidraw, with top-leveltypeset toexcalidraw, is added underplugins/visualization/, and no file ending in.excalidrawlibis added.node plugins/visualization/lib/diagram-file-check.mjs <template path>exits 0 and prints"ok":truefor the bundled template, and the change leavesplugins/visualization/lib/diagram-file-check.mjsunchanged.createdkey.plugins/visualization/tests/asserts that the bundled template passescheckExcalidraw.checkExcalidrawpasses on the result.plugins/visualization/skills/visualize/SKILL.mdgains one step that starts a diagram from the template, and the block's existing check and write steps are unchanged.melodic-automation-lanes commentedon Nov 21, 2026
{"v":1,"actor_id":337595936,"title_sha256":"3a34dfbf098db34ae33c0e7118c8cd4841c8fd3ee506f3ee84c8c71c5c835bc5","body_sha256":"556e3ab1eb86a544ce28a3f566b99e373164ee05e619e8ac6dbd490569c4a754"}
melodic-automation-lanes commentedon Nov 21, 2026
{"v":1,"actor_id":337595936,"title_sha256":"3a34dfbf098db34ae33c0e7118c8cd4841c8fd3ee506f3ee84c8c71c5c835bc5","body_sha256":"556e3ab1eb86a544ce28a3f566b99e373164ee05e619e8ac6dbd490569c4a754"}
github-actions commentedon Nov 21, 2026
github-actions commentedon Nov 21, 2026