napkin-sketchdocs 1.0.0 GitHub

The AI helpers: cheatsheet#

On this page

API hub · Reference · Quickstart · Cheatsheet

Reminders for the helpers, which are experimental, and for an agent reading these pages: the commands, the files, the brand keys, and what a diagnostic asks of you.

Getting the helper#

WantRun
The plugin, from a clone/plugin marketplace add . then /plugin install graphic-designer@napkin-sketch
The files, into .claudenpm run ai-helper -- --helper graphic-designer
The files, into .githubnpm run ai-helper -- --helper graphic-designer --to github
The scripting helper/plugin install scripting@napkin-sketch, or npm run ai-helper -- --helper scripting
Every target and helpernpm run ai-helper -- --list

Commands#

WantRun
A language and a skill from an assetnode ai-helper/graphic-designer/skills/design-language/scripts/generate-skill.mjs asset.svg --to .claude/skills
An asset's palette and sharesnode .../design-language/scripts/analyze-media.mjs asset.svg --colors 12
The same, as Markdownnode .../design-language/scripts/analyze-media.mjs asset.svg --markdown
The default drawingnode .claude/skills/<stem>/scripts/make-<stem>.mjs --out ./out
New words, the same languagemake-<stem>.mjs --title "Acme Corp" --heading "Quarterly Summary" --out ./out
Something structurally newmake-<stem>.mjs --cheatsheet --out ./out
What the brand resolved tonode .claude/skills/<stem>/scripts/brand-resources.mjs --print
What a request turns intonode .../design-language/scripts/brand-resources.mjs --registration
The whole tournpm run test:graphic-design-api

Drawing from a request#

WantRun
A script from a sentence, drawnnapkin-sketch draw --prompt "a three-box flowchart with arrows" --to svg
Another AI tool--helper "<command>", or NAPKIN_SCRIPT_HELPER
The script in the report--json, then script.text
The script inside an AI tool/scripting:draw a three-box flowchart with arrows
The same drawing againnapkin-sketch draw <name>.napkin: the script was kept
File or codeIs
_temp/script-form.txtThe form the tool reads: the request, the rules, what is handed over
_temp/script-out.napkinWhere the tool saves the script
<name>.napkinThe script, kept beside the drawings
Exit 4No script came back: error.reason is missing-tool, auth, no-script or other

The files a skill holds#

FileHolds
SKILL.mdWhen to reach for it, and the language in brief
DESIGN_LANGUAGE.mdEvery measurement, and every reading, marked which is which
references/resources.mdThe brand: paths to draw and text to print
references/graphic-design-api.jsonWhich script a bare request runs, with what, and where to
scripts/make-<stem>.mjsDraws new work; the constants at its top are the language
scripts/brand-resources.mjsResolves resources.md into placeable assets

resources.md#

LineIs
- logo: assets/logo.svgA path: it has a folder or a media extension
- GLOBAL_ASSETS: assets/brand/A folder whose file names are the slots they fill
- brand name: Acme Corp.Text to draw
- domain: example.comText: no folder, no media extension
- tag line: This or ThatText

Reading these pages as an agent#

StepRead or run
1docs/api/INDEX.json: every page, its kind, its first paragraph and its size
2A cheatsheet, then a quickstart, then a reference page only if those do not answer
3napkin-sketch verbs --json: every verb's grammar, the shapes and the codes
4docs/api/schema/instructions.schema.json, for a script built as JSON
5napkin-sketch check - --json < card.napkin before drawing

What a diagnostic asks of you#

CodeDo
unknown-verb, unexpected-token, expected-*, missing-argumentRewrite the line
unknown-variableSet the name with let or repeat ... as first
unknown-asset, unknown-documentHave the host pass it: --asset, --use, assets, documents
budget-exceededDraw less, or raise the limit deliberately
version-unsupportedWrite for the version the build names
Any warningIt drew; --strict still fails it

Common mistakes#

WrongRightWhy
Editing a color in the layoutEdit the constant at the top of make-<stem>.mjsThe constants are the language.
An SVG logo that is missing from the PNGPlace it through placeBrandAn SVG placed as an image is a hole in the PNG.
Trusting a reading in DESIGN_LANGUAGE.mdCheck what was measuredReadings are guesses the file marks as such.