building-canvases
Что он делает
Этот скилл создаёт и обновляет canvas, небольшие интерактивные приложения, которые живут внутри PostHog и работают в защищённом фрейме. Он предназначен для тех, кому нужна собственная доска, документ, форма или мини-инструмент в PostHog без отдельного проекта кода.
Когда использовать
- ✓Когда вы хотите собственную доску, форму или документ, который живёт внутри PostHog.
- ✓Когда нужно изменить или исправить существующее приложение canvas.
- ✓Когда вы хотите небольшой визуальный инструмент, построенный на ваших данных PostHog.
Ссылка на скилл
https://github.com/PostHog/posthog/blob/master/products/canvas/skills/building-canvases/SKILL.mdСкопируйте и вставьте её в ваш ИИ (Claude, ChatGPT или Cursor) с просьбой следовать инструкциям.
Как использовать
Самый простой способ: скопируйте сообщение и вставьте его в свой ИИ. Он прочитает скилл и выполнит инструкции.
Готовое сообщение для вставки
Для Claude Code, Codex или Cursor: запустите в папке проекта, и скилл установится.
Скачайте SKILL.md и положите его в папку скиллов вашего агента.
Пример запроса к вашему ИИ
“Сделай canvas, который показывает наши цифры регистраций и позволяет выбрать диапазон дат.”
5 новых скиллов в неделю. 1 минута чтения.
Как это работает
ИИ пишет исходный код canvas внутри PostHog, проверяет, что он использует только разрешённые библиотеки и объявленные источники данных, и публикует его. PostHog собирает canvas, и до готовности новой сборки показывается последняя успешная.
Технический текст (оригинальный SKILL.md)
Оригинальный текст автора на английском, прямо с GitHub.
Building canvases
A canvas is a client-side browser application that runs in a sandboxed iframe inside PostHog.
Its source lives in PostHog — not in a repository — and you read and write it through the
canvas-* tools. Never write a canvas to a local file; publishing through the tool is what
saves it.
Canvas work can start from any ordinary task. A dedicated canvas mode or pre-created canvas is not required. When the user asks for a board, document, form, visualization, or small app that should live in PostHog, treat that as a canvas request and follow this skill.
This skill owns freeform canvases (standalone apps). Two other canvas kinds exist: grid
canvases (widget grids, including the user's home canvas) and component canvases (reusable
widgets grids place). When the target is a grid or home canvas, a placement, or a reusable
widget/component, load composing-grid-canvases instead — it owns the store search → configure →
fork → build ladder and the layout patch loop. Authoring a component's source still uses the
implementation companions below.
Resolve the target canvas
- If the task names a canvas id (canvas-initiated tasks do), that is the target. Do not create another.
- Otherwise the target channel is the one the task was created in — named in the task's context
(the
channel_contextblock or the generation instructions). List that channel's canvases withcanvas-list(scope withchannel). If one is clearly what the request refers to — an earlier iteration of the same board or tool — build on it instead of creating a near-duplicate, and say so in your reply so the user knows where the result landed. - Only when nothing existing fits, create one with
canvas-createin that same channel, named with a short descriptive title drawn from the request — never "Untitled canvas". - Never survey channels to choose a target yourself: use
channel-listonly to resolve a channel the USER named to its id. Its listing puts the personal #me channel first, and #me is never a default — a canvas filed there is invisible to everyone else. If the task names neither a canvas nor a channel, ask which channel to use instead of guessing.
Load the companion skills for the implementation
This skill owns canvas selection and the authoring lifecycle. The companion skills hold the implementation contracts. Load every companion that applies before writing source:
building-react-quill-canvasesfor dashboards, data boards, forms, tools, application-like state, or anything that should look native to PostHog. It owns allowed imports, Quill composition, theming, charts, loading and error states, and the date picker.building-html-canvasesfor documents, articles, focused experiments, generative graphics,<canvas>, or WebGL work where application components add no useful structure. It owns semantic markup, direct browser APIs, animation cleanup, and non-Quill theming.querying-canvas-datawhenever the canvas reads PostHog data, captures events, or navigates. It owns thephSDK, saved-insight preference, result shapes, variables, date ranges, progressive per-query loading, and declared data capabilities. Load it alongside either implementation skill when data is involved.validating-and-publishing-canvasesfor every canvas. It owns project shape, capability declarations, validation diagnostics, guarded publishes, drafts, builds, and conflict recovery.
Mix implementation approaches when appropriate: React can own application chrome while browser graphics code owns a canvas element, or a mostly static page can mount one interactive island.
This is a judgment call, not a persisted mode — ask the user only when the choice changes a user-visible requirement you cannot infer.
Blocks
A canvas can contain premade blocks: numbers, goals, trends, top lists, funnels, retention, saved insights, live event feeds, SQL tables, filters, compare and refresh controls, and callouts.
They are React components in src/blocks/ that people drag into the canvas in the desktop app, so they are part of your source.
Read references/blocks.md before you change a canvas that has src/blocks/runtime.tsx.
Params
Expose the values a person may want to change as params. They can then change them in the desktop editor without a new task. Params are optional, but add them to each panel, card, or tool that has values worth changing: titles, copy, ev
Частые вопросы
Нужно ли мне самому размещать приложение?
Нет. Исходный код canvas хранится в PostHog и отображается там.
Может ли canvas загружать мои данные PostHog?
Да. Он читает данные PostHog через встроенный мост и должен объявить, какие insights и события использует.
Может ли он перезаписать чужие изменения?
PostHog отклоняет публикацию, которая перезаписала бы более новую работу, поэтому ИИ должен сначала прочитать последнюю версию.
Подробности
Оригинальное описание автора
Create or edit a PostHog freeform canvas — a sandboxed browser application (data board, document, form, small tool, graphics experiment) stored in PostHog and rendered by the desktop/web app. Use when a task asks to build, generate, update, or fix a standalone canvas app, or when a freeform canvas id is given as the publish target. For grid/home canvases, widget placements, or reusable components, use composing-grid-canvases instead. Covers resolving or creating the target canvas, choosing an implementation approach (React + Quill vs plain HTML/browser APIs), the read → edit → validate → publi
repo: PostHog/posthog
Популярность
- Звёзды на GitHub
- 41k
- Место в рейтинге
- #6838
- Лицензия
- —
- Обновлён
- 02.11.2026
Комментарии
- …
Другие скиллы из этого репозитория
depot-ci
41kПомогает агенту настроить и запускать workflow в Depot CI, альтернативе GitHub Actions, включая перенос существующих workflow и чтение логов запусков.
depot-container-builds
41kПомогает агенту собирать Docker-образы на удалённых сборщиках Depot, включая мультиплатформенные образы, отправку в реестры и исправление ошибок сборки.
depot-github-runners
41kПомогает агенту переносить задачи GitHub Actions на раннеры Depot: выбирать размер и метки раннера и устранять проблемы настройки.
editing-agents-md
41kПомогает агенту решить, нужно ли правило в файле AGENTS.md или CLAUDE.md, и записать его так, чтобы оно работало, не раздувая файл.
Похожие скиллы
angular-developer
280kПомогает агенту писать код на Angular и советовать по структуре проекта. Полезен для новых проектов, создания частей кода и улучшения производительности.
frontend-a11y
280kПомогает агенту делать веб-интерфейсы доступными для всех, чтобы сайты и приложения работали с программами чтения с экрана и клавиатурой.
frontend-patterns
280kАгент применяет современные паттерны фронтенд-разработки: оптимизирует производительность, управляет состоянием и следует практикам React и Next.js.