with-canvas

with-canvas is a skill for Claude Code, Codex from robcsaszar/frontend-kit. It costs 160 tokens per session (1,988 once invoked), scanned A, original, MIT.

A set of implementation and review guidelines for HTML canvas, a browser drawing surface, and related JavaScript graphics tools. It covers choosing the right rendering approach for animation, charts, games, and interactive scenes.

In plain words
What is it for?
Use it when building, optimizing, debugging, or reviewing canvas work with JavaScript, TypeScript, WebGL, workers, or graphics libraries.
Why use it?
It helps avoid graphics that are slow, hard to maintain, or inaccessible by choosing an appropriate architecture first.

Skill for Claude CodeCodex

Part of the robcsaszar-frontend-kit plugin — 4 skills shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/robcsaszar/frontend-kit/with-canvas
Any agent
npx skills add robcsaszar/frontend-kit --skill with-canvas
Clone the repo
git clone --depth 1 https://github.com/robcsaszar/frontend-kit

Made for: Claude Code, Codex.

Or install robcsaszar-frontend-kit, the plugin that ships this one along with the rest of its 4 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for with-canvas

README.md
[![agentmods](https://agentmods.dev/badge/skills/robcsaszar/frontend-kit/with-canvas.svg)](https://agentmods.dev/skills/robcsaszar/frontend-kit/with-canvas)
Your own site
<a href="https://agentmods.dev/skills/robcsaszar/frontend-kit/with-canvas"><img src="https://agentmods.dev/badge/skills/robcsaszar/frontend-kit/with-canvas.svg" alt="Measured on agentmods" height="20"></a>
Per session 160 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,988 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00160 $0.01988
Opus 5 $0.00080 $0.00994
Sonnet 5 $0.00032 $0.00398
Haiku 4.5 $0.00016 $0.00199

Measured 3d ago against content hash 5b49949b9312, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

with-canvas scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/with-canvas/SKILL.md · 118 lines

How it starts

The opening of the file, as written. The whole thing — 118 lines — stays where its author put it; the contents beside it link to each section on GitHub.

with-canvas

Canvas work fails in two different ways: visual code that is pretty but janky, and optimized code that is unmaintainable or inaccessible. Treat every task as a rendering architecture decision before writing draw calls. Load only the reference named by the current phase; do not preload all references.

Phase 1 - Classify the Canvas Job

Identify the dominant workload before choosing APIs:

  • Reject canvas: prefer DOM/CSS/SVG/video when the scene is mostly text, accessible controls, document layout, simple iconography, CSS animation, media playback, or a small number of scalable vector shapes.
  • Decorative animation: non-interactive ambience, background particles, stars, birds, procedural loops.
  • Data rendering: charts, maps, heatmaps, large point clouds, frequently updated measurements.
  • Generative art: seeded/random drawing, creative sketches, procedural systems, exportable images.
  • Interactive tool: pointer/keyboard input, selection, drag, editable objects, hit testing.
  • Game/simulation: fixed update loop, dynamic entities, collision/physics, layered scene.
  • WebGL/engine canvas: Three.js/Babylon.js/other renderer owning GPU resources.

MANDATORY READ: if the workload is decorative animation or generative art, read references/visual-quality.md — for those two jobs, looking good is the task, and perf/a11y hygiene alone ships generic output. Do NOT load it for data rendering, tools, games, or engine canvases.

Exit condition: state the workload, why canvas is the right primitive, target frame rate, expected object count, interaction model, and whether the canvas is decorative or semantically meaningful.

Phase 2 - Pick the Rendering Model

Use raw Canvas 2D when the scene is mostly immediate-mode drawing, pixel work, sprites, simple animation, or bundle size matters.

Use a retained-mode library when the app needs editable objects, selection, drag/drop, layered scene graph, event delegation, or serialization.

Use p5.js for sketches, generative art, teaching/prototyping, or creative coding where setup/draw ergonomics matter more than framework integration.

Read the full file on GitHub · 118 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 118 lines · 160 tokens per session scan A 5b49949b9312

Subscribe to this mod's changes

with-canvas is a skill published in the GitHub repository robcsaszar/frontend-kit (1 stars, last pushed 4d ago), licensed MIT. It adds 160 tokens to every session and 1,988 once invoked, about $0.0008 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.