PostHog Handbook Library / Wizard And Docs

599 words. Estimated reading time: 3 min.

🌾 Context mill

The context mill packages PostHog knowledge for AI agents. It turns docs, prompts, and example apps into skills that the wizard, the PostHog MCP server, and the AI plugin load.

<ProductScreenshot imageLight="https://res.cloudinary.com/dmukukwp6/image/upload/q_auto,f_auto/context_mill_5b0f0323b7.png" alt="Context mill" />

What goes in the context mill

Knowledge about PostHog goes in the context mill. Code that runs the agent goes in the wizard.

| Repo | What goes there | |---|---| | Context mill | Skills, agent prompts, example apps, and the cli: blocks that make skills into commands | | Wizard | The agent, programs, TUI, CLI, and any new top-level command | | Warlock | Security rules that scan what the agent writes |

If a change touches both repos, ship the context mill PR first.

How a skill gets built

  1. Sourcing. A skill pulls docs from posthog.com as Markdown, plus hand-written prompts and example apps.
  2. Assembly. The build packages each skill into a ZIP, and writes menus that list every skill and command.
  3. Delivery. A release publishes the ZIPs and menus to GitHub, with a mirror at context-mill.posthog.com.

A skill can be docs only. Some docs pages already hold everything an agent needs, so the skill just points at them, like the logs skill.

Each skill is a folder in context/skills/ with a config.yaml. Expect to iterate on a skill until the wizard's output looks right.

Orchestrator flows

Some programs run as an orchestrator flow instead of one long conversation. Each flow is a folder in context/agents/. Every file in it is one task, with the model and effort it runs at, and a dependsOn field that says which tasks must finish first. A planner, the seed, starts the flow. Tasks with nothing left to wait on run in parallel, each as a focused conversation with only the skills and tools it needs.

This is the replay vision flow:

<ProductScreenshot imageLight="/images/handbook/wizard-and-docs/replay-vision-dag.png" alt="The replay vision orchestrator flow: a planner, then install and init in parallel, then enable replay, then three scanners in parallel, then the report" />

To see every flow, run this in the context mill repo. It writes the page to your temp folder and opens it in a browser.

npm run visual-dags

Releases reach users right away

The wizard always loads the latest context mill release. When a release merges, every wizard run uses it right away. Test a skill change in the workbench before you merge it.

Who owns which skill

Each product team owns the skills for its product. The owns the build and every skill without a product owner.

| Skills in context/skills/ | Owner | |---|---| | integration, integration-v2 | | | migrate, audit, audit-*, events-audit | | | error-tracking, error-tracking-upload-source-maps, error-tracking-link-releases | | | revenue-analytics, web-analytics | | | data-warehouse-source | | | self-driving | | | mcp-analytics | | | metrics | | | replay-vision, replay-vision-* | | | ai-observability, llm-analytics | | | Every other skill, like feature-flags, logs, and tracing | |

CODEOWNERS requests reviews from these owners.

Future work

The context mill is a band-aid. We built it when it was unclear where skills should live, and what context would still be useful for humans if everyone codes with agents. The goal is to retire it, so the docs themselves package cleanly into skills.

Go deeper

Canonical URL: https://posthog.com/handbook/wizard-and-docs/context-mill

GitHub source: contents/handbook/wizard-and-docs/context-mill.mdx

Content hash: 4b9c231d2ac978c8

Static reader notes
  • MDX_COMPONENT_STATIC_ADAPTER: Adapted interactive MDX components for static reading: CalloutBox, ProductScreenshot, SmallTeam.