# querying-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.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 148 installs · ★ 101 repo stars
- Author: PostHog
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/PostHog/ai-plugin/tree/HEAD/skills/querying-canvas-data/SKILL.md
- Updated: 2026-10-24
- Security check: automated, 2026-11-17 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/querying-canvas-data

## What it 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`.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add PostHog/ai-plugin --skill querying-canvas-data -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/querying-canvas-data/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/querying-canvas-data/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add PostHog/ai-plugin --skill querying-canvas-data -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/querying-canvas-data/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add PostHog/ai-plugin --skill querying-canvas-data -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/querying-canvas-data/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install PostHog/ai-plugin skills/querying-canvas-data
```

2. **Manually: put the files in place**
- File: `.github/skills/querying-canvas-data/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add PostHog/ai-plugin --skill querying-canvas-data -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/PostHog/ai-plugin --path skills/querying-canvas-data
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/querying-canvas-data/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add PostHog/ai-plugin --skill querying-canvas-data -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/PostHog/ai-plugin/tree/HEAD/skills/querying-canvas-data/SKILL.md

## When to use it
- 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
- 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.

## Similar
- [querying-posthog-data](https://affpapa.org/en/nevibecode/skills/querying-posthog-data.md) — skill · 890 installs
- [analyzing-experiment-session-replays](https://affpapa.org/en/nevibecode/skills/analyzing-experiment-session-replays.md) — skill · 463 installs
- [seo-posthog](https://affpapa.org/en/nevibecode/skills/seo-posthog.md) — skill · 141 installs
- [posthog-webhooks-events](https://affpapa.org/en/nevibecode/skills/posthog-webhooks-events.md) — skill · 1 install
- [posthog](https://affpapa.org/en/nevibecode/skills/posthog.md) — skill · ★ 8052 repo stars
- [querying-data-lake](https://affpapa.org/en/nevibecode/skills/querying-data-lake.md) — skill · 7500 installs

From the same set: [posthog/ai-plugin](https://affpapa.org/en/nevibecode/by/posthog/ai-plugin.md) — 82 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
