Skip to content

feat(visualization): reusable templates for the Excalidraw file target #17128

Description

@kyle-sexton

What is wanted

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.

Activity

  1. added
    needs-triage
    on Nov 18, 2026
  2. github-actions commented on Nov 18, 2026

    @github-actions
    Contributor

    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.

    Automated triage. A maintainer reviews it.

  3. added
    needs-owner-decision
    on Nov 18, 2026
  4. melodic-automation-lanes commented on Nov 18, 2026

    @melodic-automation-lanes
    Contributor

    The latest triage verdict holds nothing: the issue is at status: ready.

  5. melodic-automation-lanes commented on Nov 18, 2026

    @melodic-automation-lanes
    Contributor

    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

    1. 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
    2. 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
    3. 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
    4. 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.**.

  6. kyle-sexton commented on Nov 21, 2026

    @kyle-sexton
    MemberAuthor

    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.
    • https://plus.excalidraw.com/docs/sdk/codebase/json-schema ("Last updated on 11/3/2026", fetched 2026-11-20) defines the .excalidraw scene: type "excalidraw", a numeric version, elements, appState and files. It lists "insert from a library" as a separate operation.
    • https://github.com/excalidraw/excalidraw/blob/master/packages/excalidraw/data/json.ts (read 2026-11-20). isValidLibrary requires type excalidrawLibrary and version 1 or 2, and saveLibraryAsJSON writes a .excalidrawlib file with libraryItems. 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 .excalidrawlib library.

  7. removed
    needs-owner-decision
    on Nov 21, 2026
  8. removed
    needs-triage
    on Nov 21, 2026
  9. melodic-automation-lanes commented on Nov 21, 2026

    @melodic-automation-lanes
    Contributor

    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).

  10. kyle-sexton commented on Nov 21, 2026

    @kyle-sexton
    MemberAuthor

    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:

    1. 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.

    2. 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".

    3. 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.

    4. 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.
  11. melodic-automation-lanes commented on Nov 21, 2026

    @melodic-automation-lanes
    Contributor

    {"v":1,"actor_id":337595936,"title_sha256":"3a34dfbf098db34ae33c0e7118c8cd4841c8fd3ee506f3ee84c8c71c5c835bc5","body_sha256":"556e3ab1eb86a544ce28a3f566b99e373164ee05e619e8ac6dbd490569c4a754"}

  12. melodic-automation-lanes commented on Nov 21, 2026

    @melodic-automation-lanes
    Contributor

    {"v":1,"actor_id":337595936,"title_sha256":"3a34dfbf098db34ae33c0e7118c8cd4841c8fd3ee506f3ee84c8c71c5c835bc5","body_sha256":"556e3ab1eb86a544ce28a3f566b99e373164ee05e619e8ac6dbd490569c4a754"}

  13. github-actions commented on Nov 21, 2026

    @github-actions
    Contributor
    No description provided.
  14. github-actions commented on Nov 21, 2026

    @github-actions
    Contributor
    No description provided.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Fields

    Work status

    needs-triage

    Priority

    medium

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions