# posthog-wasp-drone

posthog-wasp-drone integrates PostHog into SvelteKit codebases, covering client and server tracking, feature flags, experiments, and Vercel proxies.

- subagent · `type=agent` · Claude Code, Codex, Cursor · ★ 96 repo stars
- Author: Legion Code Inc.
- License: AGPL-3.0-or-later · policy=link-only · description only; the file stays with the author
- Source: https://github.com/legioncodeinc/vibe-coding-tools/tree/HEAD/plugins/platform-and-release-tools/agents/posthog-wasp-drone.md
- Updated: 2026-10-18
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/agents/posthog-wasp-drone

## What it does

This subagent implements PostHog capabilities across SvelteKit applications. Because client and server environments remain distinct in SvelteKit, it installs both `posthog-js` and `posthog-node`. The agent wires pageview signals directly into SvelteKit's client router, defines event property naming rules, and configures identity stitching using `identify()` and `alias()`. It also bootstraps feature flags to prevent layout flicker during experiment runs.

When tracking events fail silently, an unconfigured Content Security Policy blocking `https://*.posthog.com` or your proxy URL is usually the cause. The drone prioritizes user-behavior session replays with privacy masking rather than exception debugging. System-level error tracing, underlying session token mechanics, and full deployment pipelines remain outside this subagent's scope.

## Install

### Claude Code (native platform)

1. **Plugin marketplace**
In the agent chat (not a shell):
```text
/plugin marketplace add legioncodeinc/vibe-coding-tools
```
In the agent chat (not a shell):
```text
/plugin install platform-and-release-tools@wasp-nest
```

2. **Manually: put the files in place**
- File: `.claude/agents/posthog-wasp-drone.md` — For all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention

### Codex

**Manually: put the files in place**
- File: `.codex/agents/posthog-wasp-drone.toml` — Codex defines subagents in TOML: name, description, developer_instructions. Move the Markdown text into developer_instructions by hand. For all projects use ~/.codex/agents/

### Cursor

**Manually: put the files in place**
- File: `.cursor/agents/posthog-wasp-drone.md` — Cursor also reads .claude/agents/

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/legioncodeinc/vibe-coding-tools/tree/HEAD/plugins/platform-and-release-tools/agents/posthog-wasp-drone.md

## When to use it
- install client and server PostHog packages in SvelteKit
- track page transitions within SvelteKit's client router
- bootstrap feature flags to eliminate visual UI flicker
- route analytics traffic through rewrites in `vercel.json`
- configure privacy masking for user session recordings

## Example prompts
- Set up PostHog in our SvelteKit app and capture client router pageviews
- Add a feature flag with bootstrapping to avoid layout flicker
- Configure a PostHog reverse proxy in vercel.json

## Similar
- [posthog-analytics](https://affpapa.org/en/nevibecode/skills/posthog-analytics.md) — skill · 827 installs
- [PostHog MCP Server](https://affpapa.org/en/nevibecode/mcp/posthog-mcp-server.md) — MCP server · ★ 41008 repo stars
- [posthog](https://affpapa.org/en/nevibecode/plugins/posthog-inc-posthog.md) — plugin · ★ 8052 repo stars
- [posthog-automation](https://affpapa.org/en/nevibecode/skills/posthog-automation.md) — skill · 121 installs
- [vercel-flags](https://affpapa.org/en/nevibecode/skills/vercel-flags.md) — skill · 4 installs
- [integration-tanstack-start](https://affpapa.org/en/nevibecode/skills/integration-tanstack-start.md) — skill · 268 installs

From the same set: [legioncodeinc/vibe-coding-tools](https://affpapa.org/en/nevibecode/by/legioncodeinc/vibe-coding-tools.md) — 172 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
