querying-canvas-data — Claude Code skill for canvas data
The querying-canvas-data Claude Code skill helps put PostHog data into a canvas and make its metrics traceable to their source. It applies when a canvas needs charts, tables, analytics events, or data from GitHub or an MCP server.
no license 148 installs ★ 101 updated 2026-10-24
npx skills add PostHog/ai-plugin --skill querying-canvas-data -a claude-codeWhat querying-canvas-data does
The skill describes how to fetch PostHog data in a canvas through the ph SDK: load saved insights, run typed queries, and use HogQL when those options do not fit. It covers result formats and rendering sections as their own queries finish.
Metrics from saved insights need a link to the matching PostHog insight; other queries should expose the query that ran. Calls to ph.loadInsight, ph.query, and ph.capture must be declared in the project’s capabilities, or the host rejects them. For GitHub or MCP server data, it describes using the viewer’s connections through ph.connectors.
What it helps with
- show PostHog metrics in a canvas
- link a metric to its saved insight
- display the query behind a result
- render canvas sections as their data arrives
- send analytics events from a canvas
Example prompts for the agent
- Add PostHog metrics to this canvas and link each one to its saved insight.
- Build a chart from a PostHog query and show the query text beside it.
- Send an analytics event when someone clicks this canvas button.
How to install querying-canvas-data
1Skills CLI (Vercel)
npx skills add PostHog/ai-plugin --skill querying-canvas-data -a claude-code2Manually: put the files in place
~/.claude/skills/querying-canvas-data/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/querying-canvas-data/
1Skills CLI (Vercel)
npx skills add PostHog/ai-plugin --skill querying-canvas-data -a codex2Manually: put the files in place
.agents/skills/querying-canvas-data/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add PostHog/ai-plugin --skill querying-canvas-data -a cursor2Manually: put the files in place
.cursor/skills/querying-canvas-data/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install PostHog/ai-plugin skills/querying-canvas-data2Manually: put the files in place
.github/skills/querying-canvas-data/SKILL.md1Skills CLI (Vercel)
npx skills add PostHog/ai-plugin --skill querying-canvas-data -a gemini-cli2Platform CLI
gemini skills install https://github.com/PostHog/ai-plugin --path skills/querying-canvas-dataManually: put the files in place
.devin/skills/querying-canvas-data/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add PostHog/ai-plugin --skill querying-canvas-data -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about querying-canvas-data
How do I install querying-canvas-data in Claude Code?
Run npx skills add PostHog/ai-plugin --skill querying-canvas-data -a claude-code. The skill file is placed at ~/.claude/skills/querying-canvas-data/SKILL.md.
What does querying-canvas-data do?
It explains how to fetch PostHog data into a canvas, choose a query method, and render its results. It also covers linking saved-insight metrics and exposing ad-hoc queries.
What does querying-canvas-data require?
The canvas SDK provides ph, imported from @posthog/canvas-sdk. Calls used by the canvas must be declared in the project’s capabilities.