本文へスキップ
Skillpedia
WebサイトとUI(フロントエンド)41k · #6838

building-canvases

できること

このスキルは、PostHogの中に存在し、安全なフレーム内で動く小さな対話型アプリであるキャンバスを作成・更新します。別のコードプロジェクトを使わず、PostHog内にカスタムのボード、文書、フォーム、小さなツールがほしい人向けです。

使う場面

  • ✓PostHogの中で動く、カスタムのボード、フォーム、文書がほしいとき。
  • ✓既存のキャンバスアプリを変更または修正する必要があるとき。
  • ✓PostHogのデータから作る小さな視覚的ツールがほしいとき。

スキルのリンク

https://github.com/PostHog/posthog/blob/master/products/canvas/skills/building-canvases/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/PostHog/posthog/blob/master/products/canvas/skills/building-canvases/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“新規登録の数字を表示し、日付範囲を選べるキャンバスを作ってください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

AIはキャンバスのソースをPostHog内に書き、許可されたライブラリと宣言されたデータソースだけを使っているか確認し、その後公開します。PostHogがキャンバスをビルドし、新しいビルドの準備ができるまでは、最後に成功したビルドを表示します。

技術的な内容(元の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_context block or the generation instructions). List that channel's canvases with canvas-list (scope with channel). 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-create in 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-list only 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-canvases for 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-canvases for 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-data whenever the canvas reads PostHog data, captures events, or navigates. It owns the ph SDK, 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-canvases for 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

よくある質問

アプリを自分でホストする必要がありますか?

いいえ。キャンバスのソースはPostHogに保存され、そこで描画されます。

キャンバスはPostHogのデータを読み込めますか?

はい。PostHogの組み込みのブリッジを通じて読み込みます。使うインサイトとイベントを宣言する必要があります。

他の人の変更を上書きしてしまいますか?

PostHogは、より新しい作業を上書きする公開を拒否します。そのため、AIは再度公開する前に最新版を読む必要があります。

詳細

作者による元の説明

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
ライセンス
—
更新日
2026/11/2

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル