wizard: Instructions file for Codex

AGENTS.md

wizard AGENTS.md is an instructions file for Codex, OpenCode from PostHog/wizard. It costs 4,676 tokens per session, scanned A, original, MIT.

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

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions AGENTS.md.

This is PostHog/wizard's own configuration. It tells Codex and OpenCode how to work on wizard itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything wizard configures →

Reuse

Borrowing it

Nothing to install: this file belongs to PostHog/wizard. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/PostHog/wizard/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/PostHog/wizard

Made for: Codex, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for wizard AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/posthog/wizard/agents-md/github.svg)](https://agentmods.dev/instructions/posthog/wizard/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/posthog/wizard/agents-md"><img src="https://agentmods.dev/badge/instructions/posthog/wizard/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for wizard AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/posthog/wizard/agents-md"><img src="https://agentmods.dev/badge/instructions/posthog/wizard/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 4,676 This file is loaded in full into every session.
When invoked 4,676 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.04676 $0.04676
Opus 5.5 $0.01870 $0.01870
Sonnet 5.5 $0.00935 $0.00935
Haiku 4.5 $0.00468 $0.00468

Measured 14d ago against content hash 48d6f61dde40, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 14d 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 · 315 lines

How it starts

The opening of the file, as written. The whole thing — 315 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:

  • Frameworks → FrameworkConfig in src/services/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 through SDK hooks and Pi tool events; see security boundaries. Gateway admission and required safety prompts live in ai-gateway. 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.
  • Agent → src/agent/. Layer source outside it imports it only through @agent (values) and @agent/types (types); see src/agent/README.md
  • Shared → src/shared/, library code with no upward imports. It also holds process-global state: the log file, the analytics client, the exit cleanup list and the process's one OAuth login session (@shared/oauth-session); see src/shared/README.md
  • Host → src/host/ (@host/*), how the hosts end a run: startHostExit, wizardAbort and registerShutdown. Every wizardAbort call passes the presenter that shows its outro. A host resolves an exit code and only the CLI calls process.exit. It imports env and shared only. Headless, the TUI, the CLI and the e2e harness may import it. The agent and the programs may not; see src/host/README.md
  • Services → src/services/, part of the program layer: what programs consume, such as the session store, detection, the framework configs, the codebase scan and the tool catalog. It imports env, shared, the agent and the program contract (@programs/program-contract, in src/programs/program-contract/), which sits below it and imports no service. Code outside it imports a service through its entry, @services/<service>; see src/services/README.md
  • Programs → one folder per program in src/programs/<id>/, which other layer source enters only through its index.ts, plus runProgram. A program is an agent run; see src/programs/README.md and the developer interfaces
  • Tools → src/tools/ (@tools, one entry), the commands that run no agent: mcp add, mcp remove, mcp tutorial, slack, doctor, provision, cli add and skill list. A tool may import env, shared and the @agent entry (the MCP tutorial's prompt stream only), never the programs, host, TUI, headless or CLI, and no program imports it. Its screens live in src/tui/tools/<id>/, run by runTuiTool; every tool runner resolves an exit code. See src/tools/README.md
  • TUI → the interactive host (runTui), screens, primitives and the screen store in src/tui/, which other layers enter only through its one entry, @tui (src/tui/index.ts); see src/tui/README.md. Each program's flow, deck and screens live in src/tui/programs/<id>/, and each tool's in src/tui/tools/<id>/, entered through its index module; the TUI core reaches them only through the TUI program and tool registries. A program's flow uses a step a tool also shows, such as the MCP install, by its core screen id
  • Headless → the host with no screens (runHeadless) and LoggingUI in src/headless/, which other layers enter only through its one entry, @headless (src/headless/index.ts); see src/headless/README.md. The two hosts share only the kind of session store they build, SessionStore in @programs, and the host layer; neither loads the other's code, and each calls runProgram; see what calls what
  • CLI → commands, runners and the choice of host in src/cli/, the only layer that imports both the TUI and headless, each through its entry. bin.ts checks the Node version and loads main.ts, which imports the CLI through its entry, @cli (src/cli/index.ts); see src/cli/README.md
  • Layers → one tsconfig project per layer folder, on TypeScript project references, and pnpm typecheck is tsc -b. A project's references name the layers it may import, so importing a file of any other fails with TS6307. Outside the TUI, ink, react, @inkjs/ui and ink-testing-library resolve to a fence that fails every import form. ESLint rules in pnpm lint close the paths the compiler can't see: a relative import that leaves its layer's folder and a deep alias outside its own layer; a .tsbuild/ or node_modules/ path in an import, re-export, import() or typeof import(); any import of module or node:module; a bare require; and triple-slash path references; see layer boundaries and import aliases. Code outside a layer imports it only through its public entries. Each layer's tests sit in its project, so a test deep-imports only its own layer and mocks another through its entry, except that it may mock a service's internal module by its @services/* path.

Read the full file on GitHub · 315 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. 14d ago Changed · +8 lines · +141 tokens per session 48d6f61dde40
  2. 1mo ago Changed · +1 tokens per session 4b51ccb6bc8a
  3. 1mo ago Changed · +67 lines · +1,361 tokens per session be4356f2558c
  4. 1mo ago Changed a720cdae7521
  5. 1mo ago Changed · +3 lines · +63 tokens per session 4048f3beb659
  6. 1mo ago Changed · +9 lines · +173 tokens per session d68f02741436
  7. 1mo ago Changed · -3 tokens per session 1911ab16c1d0
  8. 1mo ago Changed · +9 lines · +110 tokens per session dfaa98ad0826
  9. 1mo ago Changed · +49 lines · +477 tokens per session 417ebd359dbe
  10. 2mo 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 (201 stars, last pushed yesterday), licensed MIT. It adds 4,676 tokens to every session, about $0.0187 per session on Opus 5.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

wizard AGENTS.md compared with instructions from other repositories

wizard AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
wizard AGENTS.mdPostHog/wizardInstructions file201yesterdayMITA4,676Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode