wizard AGENTS.md

Repository instructions for working on PostHog Wizard, a command-line tool that adds PostHog analytics to a project and helps set up its first dashboard.

In plain words
What is it for?
Use them when changing the wizard's runner, terminal interface, framework detection, integration skills, security scanning, or command-line behavior.
Why use it?
They define where framework, integration, and security knowledge belongs, helping contributors make structural changes without mixing product details into shared infrastructure.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/posthog/wizard/agents-md
Clone the repo
git clone --depth 1 https://github.com/PostHog/wizard

Made for: Codex, OpenCode.

Per session 2,353 This file is loaded in full into every session.
When invoked 2,353 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.02353 $0.02353
Opus 5 $0.01177 $0.01177
Sonnet 5 $0.00471 $0.00471
Haiku 4.5 $0.00235 $0.00235

Measured 2d ago against content hash 31101ad0e0b8, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

wizard AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 170 lines

How it starts

The opening of the file, as written. The whole thing — 170 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AGENTS.md — PostHog Wizard

Instructions for all agents (and humans) working in this repo. This is the single source of truth; CLAUDE.md just points here. User-facing docs: https://posthog.com/docs/ai-engineering/ai-wizard

The PostHog wizard (npx @posthog/wizard) is a CLI that adds PostHog to a user's project using an AI agent. It authenticates the user, detects their framework, runs an agent that integrates the SDK and instruments events, and walks the user through their first dashboard. All from the terminal.

Design discipline

This codebase follows a specific design discipline: product knowledge never enters infrastructure code. The runner pipeline, the TUI store, the detection loop, and the prompt assembler are machinery. They don't know what PostHog is. They don't know what a framework is. They execute a pipeline driven by typed configuration surfaces.

Each domain has a dedicated boundary:

  • FrameworksFrameworkConfig in src/frameworks/<name>/
  • Integration knowledge → markdown skills in the context-mill repo
  • Security policy → YARA-X rules in the warlock sibling repo. The wizard wires the scanner via PostToolUse/PreToolUse hooks (src/lib/yara-hooks.ts); the rule content itself lives in warlock. To disable scanning in the field without a release, see the kill-switch runbook: docs/runbooks/warlock-kill-switch.md. ONLY USE THIS IF ABSOLUTELY NECESSARY.
  • Programs → step arrays in src/lib/programs/
  • TUI → screen components and primitives in src/ui/tui/

Adding a new concern means finding the narrowest existing surface, not adding logic to the runner. The wizard is small (~20K lines) because boundaries prevent damage from propagating between concerns.

Before making structural changes

Read .claude/skills/wizard-development/SKILL.md first. It covers the design discipline, a decision framework for new extensions, and warning signs that a change is drifting off-pattern. Two reference files extend it:

Read the full file on GitHub · 170 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 170 lines · 2,353 tokens per session scan A 31101ad0e0b8

Subscribe to this mod's changes

wizard AGENTS.md is an instructions file published in the GitHub repository PostHog/wizard (190 stars, last pushed 2d ago), licensed MIT. It adds 2,353 tokens to every session, about $0.0118 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other instructions, from other repositories