> allowed imports, Quill (PostHog's design system) component and composition rules, theme-aware design tokens, loading skeletons, and the in-canvas date picker. Use after building-canvases has routed a canvas request to a React implementation — dashboards, data boards, forms, tools, or any canvas that should look native to PostHog.
npx skills add https://github.com/PostHog/posthog --skill building-react-quill-canvases
The whole application is one React/TSX file (src/canvas.tsx in the source project). It must
export default a single React component that takes no props — the host mounts it. Do not import
react-dom or call createRoot.
Start from the working scaffold in references/starter-scaffold.md
on a first build: it already wires the date picker, theme tokens, per-card skeletons, and correct
typed-node result reading. Keep that wiring; replace the sample metric and layout.
Import only from: react, react-dom, react-dom/client, @posthog/quill, recharts,
lucide-react, dayjs. Anything else — including dynamic import(), require(), fetch(),
<script> tags, or remote code — fails validation. Use @posthog/quill for UI, recharts for
charts, lucide-react for icons, dayjs for dates.
A PostHog data board must be built entirely from @posthog/quill components — never a native
control or a styled <div> standing in for one:
Select (never a native <select>); button → Button (never <button>);text field → Input/Textarea; checkbox → Checkbox; label → Label.
Table (TableHeader > TableRow > TableHead, then TableBody > TableRow > TableCell);panel → Card (CardHeader + CardTitle + CardContent); pill → Badge; titles → Heading; body → Text.
<div>s and recharts elements.Select + SelectTrigger/SelectContent/SelectItem),use controlled value + onValueChange, and swap a part's element with the render prop
(e.g. <PopoverTrigger render={<Button …/>} />) instead of wrapping it.
style;use their variant/size props. Put layout utilities (flex, grid, gap-4, p-4) on your own
wrapper <div>s.
variant="outline"; variant="primary" for the one main action only.style for genuinely dynamicruntime values (fixed sizes use arbitrary-value utilities like h-[280px]).
.dark class on the document root flips at runtime.Color only from the design-token utilities — surfaces `bg-background bg-card bg-muted bg-primary
bg-success bg-warning bg-info bg-destructive; text text-foreground text-muted-foreground
text-card-foreground; borders border-border`. Never a hardcoded hex or light-only color.
bg-success) is a pale background filland -foreground (text-success-foreground) is the strong readable color. Colored text or icons
always use the -foreground utility; a filled pill pairs bg-success text-success-foreground.
Prefer the Quill Badge (variant="success"/"destructive") for deltas so you don't hand-pick.
bg-secondary, text-secondary, bg-accent, and bg-popover are not defined in the canvas — avoid them.stroke="var(--primary)", grid/axes invar(--border)/var(--muted-foreground)).
\uXXXX escapes render verbatim in JSX text.
Every data point renders a skeleton in its own Card while loading or refreshing: SkeletonText
(matching lines and text-size className) for text/number values, Skeleton for blocks/charts.
Drive isLoading off the data calls and set it true again on refresh; never show a blank or a
jumping layout, and handle the empty/error case.
A data board owns its own date control — render Quill's DateTimePicker (never a custom Select or
native date input) inside a Popover whose trigger is a Quill Button. PopoverContent gets
exactly className="w-auto p-0" and nothing is added to DateTimePicker beyond
value/onApply/onCancel (it self-sizes; don't pass compact or widths). Re-run every query
when the window changes — see the querying-canvas-data skill for feeding it into dateRange.
Use Expo DOM components to run web code in a webview on native and as-is on web. Migrate web code to native incrementally.
Frontend development guidelines for React/TypeScript applications. Modern patterns including Suspense, lazy loading, useSuspenseQuery, file organization with features directory, MUI v7 styling, TanStack Router, performance optimization, and TypeScript best practices. Use when creating components, pages, features, fetching data, styling, routing, or working with frontend code.
Next.js 16 Cache Components - PPR, use cache directive, cacheLife, cacheTag, updateTag
| Build Shopify apps, extensions, themes using GraphQL Admin API, Shopify CLI, Polaris UI, and Liquid. "shopify theme", "liquid template", "polaris", "shopify graphql", "shopify webhook", "shopify billing", "app subscription", "metafields", "shopify functions"
Build Gradio web UIs and demos in Python. Use when creating or editing Gradio apps, components, event listeners, layouts, or chatbots.
MANDATORY prerequisite — load this skill BEFORE every `generate_diagram` tool call. NEVER call `generate_diagram` directly without loading this skill first. Trigger whenever the user asks to create, generate, draw, render, sketch, or build a diagram — flowchart, architecture diagram, sequence diagram, ERD or entity-relationship diagram, state diagram or state machine, gantt chart, or timeline. Also trigger when the user mentions Mermaid syntax or wants a system architecture, decision tree, dependency graph, API call flow, auth handshake, schema, or pipeline visualized in FigJam. Routes to type-specific guidance, sets universal Mermaid constraints, and tells you when to use a different diagram type or skip the tool entirely (mindmaps, pie charts, class diagrams, etc.).
Analyzes web performance using Chrome DevTools MCP. Measures Core Web Vitals (LCP, INP, CLS) and supplementary metrics (FCP, TBT, Speed Index), identifies render-blocking resources, network dependency chains, layout shifts, caching issues, and accessibility gaps. Use when asked to audit, profile, debug, or optimize page load performance, Lighthouse scores, or site speed. Biases towards retrieval from current documentation over pre-trained knowledge.
Algorithmic philosophies are computational aesthetic movements that are then expressed through code. Output .md files (philosophy), .html files (interactive viewer), and .js files (generative algorithms).
Take posthog/building-react-quill-canvases from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.