building-html-canvases

building-html-canvases is a skill for Claude Code, Codex from PostHog/posthog-foss. It costs 99 tokens per session (1,207 once invoked), scanned A, original, MIT.

A guide to building PostHog canvases with standard HTML, CSS, and browser APIs. It covers documents, articles, diagrams, generative graphics, 2D drawings, and WebGL scenes.

In plain words
What is it for?
Use it to create reports, diagrams, interactive drawings, generative art, and WebGL experiences.
Why use it?
It helps when the result is mainly a document or visual experience rather than a full application with complex interface state.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to create reports, diagrams, interactive drawings, generative art, and WebGL experiences.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/posthog/posthog-foss/building-html-canvases
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.

Any agent
npx skills add PostHog/posthog-foss --skill building-html-canvases
Clone the repo
git clone --depth 1 https://github.com/PostHog/posthog-foss

Made for: Claude Code, Codex.

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 building-html-canvases

README.md
[![agentmods](https://agentmods.dev/badge/skills/posthog/posthog-foss/building-html-canvases/github.svg)](https://agentmods.dev/skills/posthog/posthog-foss/building-html-canvases)
Your own site
<a href="https://agentmods.dev/skills/posthog/posthog-foss/building-html-canvases"><img src="https://agentmods.dev/badge/skills/posthog/posthog-foss/building-html-canvases/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for building-html-canvases

Your own site · 80×15
<a href="https://agentmods.dev/skills/posthog/posthog-foss/building-html-canvases"><img src="https://agentmods.dev/badge/skills/posthog/posthog-foss/building-html-canvases.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 99 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,207 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.1 $0.00099 $0.01207
Opus 5.5 $0.00040 $0.00483
Sonnet 5.5 $0.00020 $0.00241
Haiku 4.5 $0.00010 $0.00121

Measured today against content hash a864997c0cc3, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

building-html-canvases 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 today.

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.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

products/canvas/skills/building-html-canvases/SKILL.md · 75 lines

How it starts

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

Building HTML canvases

Some canvases are documents or graphics programs, not applications: a written report, a diagram, a generative-art piece, a WebGL scene. For these, semantic HTML, CSS, and direct browser APIs are the right tools — don't force Quill components or React state onto a static page.

The wrapper the current runtime requires

Every canvas keeps src/canvas.tsx as its mounted React entry component (default export, no props). Keep the React layer as a thin shell and write the experience in HTML/CSS/browser APIs inside it:

  • A document is JSX that is effectively semantic HTML — <article>, headings, lists, tables, figures — with a <style> block for typography and layout. Write real, specific copy.
  • A drawing/WebGL program renders a <canvas> element and drives it imperatively from a useEffect via a ref: get the 2D/WebGL context, run the setup and render loop there.
  • Clean up in the effect's return: cancel requestAnimationFrame loops, remove listeners, and release contexts, so theme switches and remounts don't leak or double-run.
  • Mixing tiers is fine: a mostly static page can mount one interactive island, and a data board can hand a chart's <canvas> to imperative code while React owns the chrome.

The import allowlist still applies (react, react-dom, @posthog/quill, recharts, lucide-react, dayjs) — browser globals (document, CanvasRenderingContext2D, WebGLRenderingContext, requestAnimationFrame, IntersectionObserver, Web Audio, etc.) need no import. Three.js and other npm graphics libraries are not yet loadable; write against raw WebGL or 2D canvas until the build pipeline's dependency admission ships.

Styling and theme without Quill

  • Size the outermost JSX/HTML element to the iframe viewport with min-h-screen or min-height: 100vh, so it fills the viewport and grows past it as content demands. Do not use h-screen or height: 100vh there: a fixed viewport height caps a flex column, so tall children shrink and clip instead of scrolling. Do not use h-full or height: 100% on that root either: a published canvas's artifact shell gives its html, body, and #root elements no explicit height, so percentage height collapses to the content height. A min-height root is not a definite height, so a descendant's percentage height still collapses; give an intermediate wrapper an explicit height when a child must fill a box.
  • Use Tailwind utilities and/or a <style> block (keyframes and complex selectors are fine).
  • The host toggles a .dark class on the document root when the user's PostHog theme changes. Define your colors as CSS variables under :root { … } with overrides under html.dark { … }, or use theme token utilities (bg-background, text-foreground, border-border) — never a light-only hardcoded color.
  • Give your own CSS variables a prefix (--doc-bg, --doc-muted). Never reuse a platform token name: the bundled Quill stylesheet sets --background, --border, --card, --chrome, --input, --muted, --primary, and --fill-* on every element, so a :root or html.dark value with one of those names never reaches any element. A page that colors its text with its own --muted then renders unreadable (pale text on a pale page). Validation rejects such a declaration with platform_token_redeclared.
  • For canvas/WebGL drawing colors, read the resolved token at runtime (getComputedStyle(document.documentElement).getPropertyValue("--primary")) or your own CSS variables, and re-read on theme change if the scene is long-lived.

Read the full file on GitHub · 75 lines

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. today Changed · +3 lines a864997c0cc3
  2. 2mo ago Changed · -1 lines 7762cfbe7292
  3. 2mo ago Changed · +6 lines 522fff4ffbc0
  4. 2mo ago First seen · 67 lines · 99 tokens per session scan A 546014299e23

Subscribe to this mod's changes

building-html-canvases is a skill published in the GitHub repository PostHog/posthog-foss (734 stars, last pushed today), licensed MIT. It adds 99 tokens to every session and 1,207 once invoked, about $0.0004 per session on Opus 5.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-09-03.

Related

building-html-canvases compared with skills from other repositories

building-html-canvases next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
building-html-canvasesPostHog/posthog-fossSkill734todayMITA99Claude Code, Codex
anti-slop-designsickn33/agentic-awesome-skillsSkill51ktodayMITA34Claude Code
chakra-ui-builderchakra-ui/chakra-uiSkill41kyesterdayMITA214Claude Code, Codex
visual-ralphYeachan-Heo/oh-my-codexSkill34ktodayMITA52Codex
prototype-webnexu-io/html-anythingSkill17k2d agoApache-2.0A24Claude Code, Codex
open-design-setupcompozy/compozySkill2.9ktodayMITA67Claude Code, Codex
edit-sitemicrosoft/power-platform-skillsSkill1.2ktodayMITA104Claude Code