Repository files navigation

Welcome to the PostHog context mill

This repo assembles PostHog context for AI agents and LLMs into Agent Skills-compliant packages. Check out /context for details.

Need output in a different format? No problem. Let us know in #team-docs-and-wizard, or fire up a PR to augment the /context and /scripts directories with your preferred transformation.

Have a skill you want to make sure is maintained and distributed via the wizard?

We'd love your pull request!

The context mill gathers up-to-date content from multiple sources, packaging PostHog developer docs, prompts, and working example code into a versioned manifest which can be shipped anywhere as a zip file.

The PostHog MCP server currently fetches the examples repo manifest and exposes it to any MCP-compatible client as resources and slash commands. This is what currently powers the PostHog wizard.

Context engine

context engine diagram

The examples repo effectively acts as a context engine, an assembly line for turning disparate PostHog knowledge into something portable, something AI systems can reliably consume.

You can break its context engineering flow into three main stages.

1. Context sourcing: The examples repo pulls from the entire PostHog developer docs, with pages delivered from posthog.com as raw Markdown. It also includes curated, hand-crafted prompts and working example apps.

2. Context assembly: The examples repo transforms and packages the sourced context into a zip file manifest, which is meant to be portable and self-contained. We can structure and shape the manifest however we need.

3. Context delivery: The examples repo creates a versioned release for the manifest, which can be consumed by any agent or MCP server as a skill or resource.

Example apps

We've got live, working example code that demonstrates PostHog in action. You can run these yourself to see events flow into your PostHog project.

Example apps are not production-grade

These are more like model airplanes. They're dramatically simplified to make it easy to see PostHog in action. You shouldn't use these as starter projects or put them into production. The authentication is fake!

But the leanness makes these useful for agent-driven development. Use these as context to help your agent make better integration decisions about PostHog.

examples/
├── basics/
│ ├── next-app-router/ # Next.js 15 with App Router
│ ├── next-pages-router/ # Next.js 15 with Pages Router
│ ├── react-react-router/ # React with React Router
│ ├── react-tanstack-router-file-based/ # React with TanStack Router (file-based)
│ ├── react-tanstack-router-code-based/ # React with TanStack Router (code-based)
│ ├── tanstack-start/ # TanStack Start
│ └── django/ # Django
├── mcp-commands/ # MCP command prompts (`/command` in agents)
└── scripts/ # Build scripts

Build outputs

Run npm run build to generate the release artifacts:

OutputDescription
dist/skills/<id>.zipPer-skill bundles (SKILL.md + references + shared docs)
dist/skills/manifest.jsonVersioned manifest of every bundled skill and its download URL
dist/skills/skill-menu.jsonCategory groupings and cliEntries — the wizard's command lookup table

Releases are cut as GitHub releases. Consumers (the wizard, the MCP server, anything else) fetch manifest.json / skill-menu.json from the latest release and download the per-skill ZIPs on demand.

Manifest structure

The manifest describes the built skills — one resource per skill, with id, name, description, tags, uri, and a downloadUrl pointing at the GitHub release asset. Each bundled skill contains a SKILL.md, references/ step files, and any shared docs pulled from posthog.com at build time.

Adding a new skill

Add numbered step files to context/skills/<skill>/references/ using the convention <n>-<name>.md with next_step: frontmatter pointing to the next file. The build script discovers, orders, and bundles them automatically.

Wizard CLI commands

Skills in this repo declare how they surface as wizard commands via a cli: block in their config.yaml. That mechanism — role, parentCommand, command, flat vs. family — is documented in CONTRIBUTING.md.

The CLI was overhauled to consolidate commands into a smaller, extensible surface. If you (or your agent) knew an older command, here's where it went:

Old commandNew commandWhat changed
wizard integratewizard (default flow)Command removed; the default flow runs the integration
wizard events-auditwizard audit eventsNow an audit-family subcommand
wizard audit (single audit)wizard audit <subcommand>Now a family — see the audit subcommands below
wizard audit-3000removedRetired
wizard revenuewizard revenue-analyticsRenamed (old revenue removed)
wizard upload-sourcemapswizard upload-source-mapsRenamed; upload-sourcemaps still works as an alias

Audit subcommands (and the skills behind them)

audit is the one family today whose subcommands are skills from this repo:

SubcommandBacking skill
wizard audit eventsaudit-events (the default leaf)
wizard audit allaudit
wizard audit autocaptureaudit-autocapture
wizard audit feature-flagsaudit-feature-flags
wizard audit identifyaudit-identify
wizard audit session-replayaudit-session-replay
wizard audit web-analytics(wizard-native, not a skill in this repo)

Commands vs. skills: those audit subcommands are skills, promoted to commands via cli: role: command. A skill with role: skill is reachable only through wizard skill <id>. Same machinery, two surfaces — so wizard audit <subcommand> picks an audit area, it does not take a skill name.

Commands vs. programs:integrate was the command; the program behind it is posthog-integration, which still exists and powers the default flow. The program id is internal — it was never a command you typed.

Context mill skill owners

Reviews are auto-requested via .github/CODEOWNERS — the file is the source of truth; this table just mirrors it for readability. team-wizard-docs is the default reviewer; the team-owned skills below route review to their owning team instead.

PathOwning team
* (everything else, including all other skills)@PostHog/team-wizard-docs
context/skills/integration/@PostHog/team-wizard-docs
context/skills/error-tracking-upload-source-maps/@PostHog/team-error-tracking
context/skills/mcp-analytics/@PostHog/team-mcp-analytics
context/skills/revenue-analytics/@PostHog/team-web-analytics
context/skills/self-driving/@PostHog/team-self-driving
context/skills/data-warehouse-source/@PostHog/team-warehouse-sources
context/skills/web-analytics/@PostHog/team-web-analytics

Ownership is by directory. Skills not listed above (audit, audit-*, cost-cutting, creating-product-tours, error-tracking, events-audit, feature-flags, llm-analytics, logs, migrate, omnibus, posthog-best-practices, quack, tools-and-features) fall through the default and are owned by team-wizard-docs. Today CODEOWNERS only auto-requests review — approval is not a merge gate.

Security scanning

Before we ship any skills, we run them through the warlock, PostHog's security scanner for agentic flows. It reads the built skill bundles and looks for prompt-injection attempts and other risky content that could trick an agent downstream. An LLM triage pass then sorts the real threats from the false positives, so we're not chasing noise.

CI runs this automatically on every build and release, so most of the time you don't have to think about it. But if you want to check something locally:

pnpm security-scan:skills # scan all built skill ZIPs (this is what CI runs)
pnpm security-scan path/to/file.md # scan a specific file

Heads up, the skills scan reads from dist/, so run pnpm build first. If a scan flags something, fix the flagged content before releasing :)

About

PostHog context and skill assembly for AI agents and LLM tasks

Resources

Code of conduct

Contributing

Security policy

Stars

58 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

Repository files navigation

Welcome to the PostHog context mill

This repo assembles PostHog context for AI agents and LLMs into Agent Skills-compliant packages. Check out /context for details.

Need output in a different format? No problem. Let us know in #team-docs-and-wizard, or fire up a PR to augment the /context and /scripts directories with your preferred transformation.

Have a skill you want to make sure is maintained and distributed via the wizard?

We'd love your pull request!

The context mill gathers up-to-date content from multiple sources, packaging PostHog developer docs, prompts, and working example code into a versioned manifest which can be shipped anywhere as a zip file.

The PostHog MCP server currently fetches the examples repo manifest and exposes it to any MCP-compatible client as resources and slash commands. This is what currently powers the PostHog wizard.

Context engine

context engine diagram

The examples repo effectively acts as a context engine, an assembly line for turning disparate PostHog knowledge into something portable, something AI systems can reliably consume.

You can break its context engineering flow into three main stages.

1. Context sourcing: The examples repo pulls from the entire PostHog developer docs, with pages delivered from posthog.com as raw Markdown. It also includes curated, hand-crafted prompts and working example apps.

2. Context assembly: The examples repo transforms and packages the sourced context into a zip file manifest, which is meant to be portable and self-contained. We can structure and shape the manifest however we need.

3. Context delivery: The examples repo creates a versioned release for the manifest, which can be consumed by any agent or MCP server as a skill or resource.

Example apps

We've got live, working example code that demonstrates PostHog in action. You can run these yourself to see events flow into your PostHog project.

Example apps are not production-grade

These are more like model airplanes. They're dramatically simplified to make it easy to see PostHog in action. You shouldn't use these as starter projects or put them into production. The authentication is fake!

But the leanness makes these useful for agent-driven development. Use these as context to help your agent make better integration decisions about PostHog.

examples/
├── basics/
│ ├── next-app-router/ # Next.js 15 with App Router
│ ├── next-pages-router/ # Next.js 15 with Pages Router
│ ├── react-react-router/ # React with React Router
│ ├── react-tanstack-router-file-based/ # React with TanStack Router (file-based)
│ ├── react-tanstack-router-code-based/ # React with TanStack Router (code-based)
│ ├── tanstack-start/ # TanStack Start
│ └── django/ # Django
├── mcp-commands/ # MCP command prompts (`/command` in agents)
└── scripts/ # Build scripts

Build outputs

Run npm run build to generate the release artifacts:

OutputDescription
dist/skills/<id>.zipPer-skill bundles (SKILL.md + references + shared docs)
dist/skills/manifest.jsonVersioned manifest of every bundled skill and its download URL
dist/skills/skill-menu.jsonCategory groupings and cliEntries — the wizard's command lookup table

Releases are cut as GitHub releases. Consumers (the wizard, the MCP server, anything else) fetch manifest.json / skill-menu.json from the latest release and download the per-skill ZIPs on demand.

Manifest structure

The manifest describes the built skills — one resource per skill, with id, name, description, tags, uri, and a downloadUrl pointing at the GitHub release asset. Each bundled skill contains a SKILL.md, references/ step files, and any shared docs pulled from posthog.com at build time.

Adding a new skill

Add numbered step files to context/skills/<skill>/references/ using the convention <n>-<name>.md with next_step: frontmatter pointing to the next file. The build script discovers, orders, and bundles them automatically.

Wizard CLI commands

Skills in this repo declare how they surface as wizard commands via a cli: block in their config.yaml. That mechanism — role, parentCommand, command, flat vs. family — is documented in CONTRIBUTING.md.

The CLI was overhauled to consolidate commands into a smaller, extensible surface. If you (or your agent) knew an older command, here's where it went:

Old commandNew commandWhat changed
wizard integratewizard (default flow)Command removed; the default flow runs the integration
wizard events-auditwizard audit eventsNow an audit-family subcommand
wizard audit (single audit)wizard audit <subcommand>Now a family — see the audit subcommands below
wizard audit-3000removedRetired
wizard revenuewizard revenue-analyticsRenamed (old revenue removed)
wizard upload-sourcemapswizard upload-source-mapsRenamed; upload-sourcemaps still works as an alias

Audit subcommands (and the skills behind them)

audit is the one family today whose subcommands are skills from this repo:

SubcommandBacking skill
wizard audit eventsaudit-events (the default leaf)
wizard audit allaudit
wizard audit autocaptureaudit-autocapture
wizard audit feature-flagsaudit-feature-flags
wizard audit identifyaudit-identify
wizard audit session-replayaudit-session-replay
wizard audit web-analytics(wizard-native, not a skill in this repo)

Commands vs. skills: those audit subcommands are skills, promoted to commands via cli: role: command. A skill with role: skill is reachable only through wizard skill <id>. Same machinery, two surfaces — so wizard audit <subcommand> picks an audit area, it does not take a skill name.

Commands vs. programs:integrate was the command; the program behind it is posthog-integration, which still exists and powers the default flow. The program id is internal — it was never a command you typed.

Context mill skill owners

Reviews are auto-requested via .github/CODEOWNERS — the file is the source of truth; this table just mirrors it for readability. team-wizard-docs is the default reviewer; the team-owned skills below route review to their owning team instead.

PathOwning team
* (everything else, including all other skills)@PostHog/team-wizard-docs
context/skills/integration/@PostHog/team-wizard-docs
context/skills/error-tracking-upload-source-maps/@PostHog/team-error-tracking
context/skills/mcp-analytics/@PostHog/team-mcp-analytics
context/skills/revenue-analytics/@PostHog/team-web-analytics
context/skills/self-driving/@PostHog/team-self-driving
context/skills/data-warehouse-source/@PostHog/team-warehouse-sources
context/skills/web-analytics/@PostHog/team-web-analytics

Ownership is by directory. Skills not listed above (audit, audit-*, cost-cutting, creating-product-tours, error-tracking, events-audit, feature-flags, llm-analytics, logs, migrate, omnibus, posthog-best-practices, quack, tools-and-features) fall through the default and are owned by team-wizard-docs. Today CODEOWNERS only auto-requests review — approval is not a merge gate.

Security scanning

Before we ship any skills, we run them through the warlock, PostHog's security scanner for agentic flows. It reads the built skill bundles and looks for prompt-injection attempts and other risky content that could trick an agent downstream. An LLM triage pass then sorts the real threats from the false positives, so we're not chasing noise.

CI runs this automatically on every build and release, so most of the time you don't have to think about it. But if you want to check something locally:

pnpm security-scan:skills # scan all built skill ZIPs (this is what CI runs)
pnpm security-scan path/to/file.md # scan a specific file

Heads up, the skills scan reads from dist/, so run pnpm build first. If a scan flags something, fix the flagged content before releasing :)

About

PostHog context and skill assembly for AI agents and LLM tasks

Resources

Code of conduct

Contributing

Security policy

Stars

58 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

Welcome to the PostHog context mill

This repo assembles PostHog context for AI agents and LLMs into Agent Skills-compliant packages. Check out /context for details.

Need output in a different format? No problem. Let us know in #team-docs-and-wizard, or fire up a PR to augment the /context and /scripts directories with your preferred transformation.

Have a skill you want to make sure is maintained and distributed via the wizard?

We'd love your pull request!

The context mill gathers up-to-date content from multiple sources, packaging PostHog developer docs, prompts, and working example code into a versioned manifest which can be shipped anywhere as a zip file.

The PostHog MCP server currently fetches the examples repo manifest and exposes it to any MCP-compatible client as resources and slash commands. This is what currently powers the PostHog wizard.

Context engine

context engine diagram

The examples repo effectively acts as a context engine, an assembly line for turning disparate PostHog knowledge into something portable, something AI systems can reliably consume.

You can break its context engineering flow into three main stages.

1. Context sourcing: The examples repo pulls from the entire PostHog developer docs, with pages delivered from posthog.com as raw Markdown. It also includes curated, hand-crafted prompts and working example apps.

2. Context assembly: The examples repo transforms and packages the sourced context into a zip file manifest, which is meant to be portable and self-contained. We can structure and shape the manifest however we need.

3. Context delivery: The examples repo creates a versioned release for the manifest, which can be consumed by any agent or MCP server as a skill or resource.

Example apps

We've got live, working example code that demonstrates PostHog in action. You can run these yourself to see events flow into your PostHog project.

Example apps are not production-grade

These are more like model airplanes. They're dramatically simplified to make it easy to see PostHog in action. You shouldn't use these as starter projects or put them into production. The authentication is fake!

But the leanness makes these useful for agent-driven development. Use these as context to help your agent make better integration decisions about PostHog.

examples/
├── basics/
│ ├── next-app-router/ # Next.js 15 with App Router
│ ├── next-pages-router/ # Next.js 15 with Pages Router
│ ├── react-react-router/ # React with React Router
│ ├── react-tanstack-router-file-based/ # React with TanStack Router (file-based)
│ ├── react-tanstack-router-code-based/ # React with TanStack Router (code-based)
│ ├── tanstack-start/ # TanStack Start
│ └── django/ # Django
├── mcp-commands/ # MCP command prompts (`/command` in agents)
└── scripts/ # Build scripts

Build outputs

Run npm run build to generate the release artifacts:

OutputDescription
dist/skills/<id>.zipPer-skill bundles (SKILL.md + references + shared docs)
dist/skills/manifest.jsonVersioned manifest of every bundled skill and its download URL
dist/skills/skill-menu.jsonCategory groupings and cliEntries — the wizard's command lookup table

Releases are cut as GitHub releases. Consumers (the wizard, the MCP server, anything else) fetch manifest.json / skill-menu.json from the latest release and download the per-skill ZIPs on demand.

Manifest structure

The manifest describes the built skills — one resource per skill, with id, name, description, tags, uri, and a downloadUrl pointing at the GitHub release asset. Each bundled skill contains a SKILL.md, references/ step files, and any shared docs pulled from posthog.com at build time.

Adding a new skill

Add numbered step files to context/skills/<skill>/references/ using the convention <n>-<name>.md with next_step: frontmatter pointing to the next file. The build script discovers, orders, and bundles them automatically.

Wizard CLI commands

Skills in this repo declare how they surface as wizard commands via a cli: block in their config.yaml. That mechanism — role, parentCommand, command, flat vs. family — is documented in CONTRIBUTING.md.

The CLI was overhauled to consolidate commands into a smaller, extensible surface. If you (or your agent) knew an older command, here's where it went:

Old commandNew commandWhat changed
wizard integratewizard (default flow)Command removed; the default flow runs the integration
wizard events-auditwizard audit eventsNow an audit-family subcommand
wizard audit (single audit)wizard audit <subcommand>Now a family — see the audit subcommands below
wizard audit-3000removedRetired
wizard revenuewizard revenue-analyticsRenamed (old revenue removed)
wizard upload-sourcemapswizard upload-source-mapsRenamed; upload-sourcemaps still works as an alias

Audit subcommands (and the skills behind them)

audit is the one family today whose subcommands are skills from this repo:

SubcommandBacking skill
wizard audit eventsaudit-events (the default leaf)
wizard audit allaudit
wizard audit autocaptureaudit-autocapture
wizard audit feature-flagsaudit-feature-flags
wizard audit identifyaudit-identify
wizard audit session-replayaudit-session-replay
wizard audit web-analytics(wizard-native, not a skill in this repo)

Commands vs. skills: those audit subcommands are skills, promoted to commands via cli: role: command. A skill with role: skill is reachable only through wizard skill <id>. Same machinery, two surfaces — so wizard audit <subcommand> picks an audit area, it does not take a skill name.

Commands vs. programs:integrate was the command; the program behind it is posthog-integration, which still exists and powers the default flow. The program id is internal — it was never a command you typed.

Context mill skill owners

Reviews are auto-requested via .github/CODEOWNERS — the file is the source of truth; this table just mirrors it for readability. team-wizard-docs is the default reviewer; the team-owned skills below route review to their owning team instead.

PathOwning team
* (everything else, including all other skills)@PostHog/team-wizard-docs
context/skills/integration/@PostHog/team-wizard-docs
context/skills/error-tracking-upload-source-maps/@PostHog/team-error-tracking
context/skills/mcp-analytics/@PostHog/team-mcp-analytics
context/skills/revenue-analytics/@PostHog/team-web-analytics
context/skills/self-driving/@PostHog/team-self-driving
context/skills/data-warehouse-source/@PostHog/team-warehouse-sources
context/skills/web-analytics/@PostHog/team-web-analytics

Ownership is by directory. Skills not listed above (audit, audit-*, cost-cutting, creating-product-tours, error-tracking, events-audit, feature-flags, llm-analytics, logs, migrate, omnibus, posthog-best-practices, quack, tools-and-features) fall through the default and are owned by team-wizard-docs. Today CODEOWNERS only auto-requests review — approval is not a merge gate.

Security scanning

Before we ship any skills, we run them through the warlock, PostHog's security scanner for agentic flows. It reads the built skill bundles and looks for prompt-injection attempts and other risky content that could trick an agent downstream. An LLM triage pass then sorts the real threats from the false positives, so we're not chasing noise.

CI runs this automatically on every build and release, so most of the time you don't have to think about it. But if you want to check something locally:

pnpm security-scan:skills # scan all built skill ZIPs (this is what CI runs)
pnpm security-scan path/to/file.md # scan a specific file

Heads up, the skills scan reads from dist/, so run pnpm build first. If a scan flags something, fix the flagged content before releasing :)

About

PostHog context and skill assembly for AI agents and LLM tasks

Resources

Code of conduct

Contributing

Security policy

Stars

58 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

Welcome to the PostHog context mill

This repo assembles PostHog context for AI agents and LLMs into Agent Skills-compliant packages. Check out /context for details.

Need output in a different format? No problem. Let us know in #team-docs-and-wizard, or fire up a PR to augment the /context and /scripts directories with your preferred transformation.

Have a skill you want to make sure is maintained and distributed via the wizard?

We'd love your pull request!

The context mill gathers up-to-date content from multiple sources, packaging PostHog developer docs, prompts, and working example code into a versioned manifest which can be shipped anywhere as a zip file.

The PostHog MCP server currently fetches the examples repo manifest and exposes it to any MCP-compatible client as resources and slash commands. This is what currently powers the PostHog wizard.

Context engine

context engine diagram

The examples repo effectively acts as a context engine, an assembly line for turning disparate PostHog knowledge into something portable, something AI systems can reliably consume.

You can break its context engineering flow into three main stages.

1. Context sourcing: The examples repo pulls from the entire PostHog developer docs, with pages delivered from posthog.com as raw Markdown. It also includes curated, hand-crafted prompts and working example apps.

2. Context assembly: The examples repo transforms and packages the sourced context into a zip file manifest, which is meant to be portable and self-contained. We can structure and shape the manifest however we need.

3. Context delivery: The examples repo creates a versioned release for the manifest, which can be consumed by any agent or MCP server as a skill or resource.

Example apps

We've got live, working example code that demonstrates PostHog in action. You can run these yourself to see events flow into your PostHog project.

Example apps are not production-grade

These are more like model airplanes. They're dramatically simplified to make it easy to see PostHog in action. You shouldn't use these as starter projects or put them into production. The authentication is fake!

But the leanness makes these useful for agent-driven development. Use these as context to help your agent make better integration decisions about PostHog.

examples/
├── basics/
│ ├── next-app-router/ # Next.js 15 with App Router
│ ├── next-pages-router/ # Next.js 15 with Pages Router
│ ├── react-react-router/ # React with React Router
│ ├── react-tanstack-router-file-based/ # React with TanStack Router (file-based)
│ ├── react-tanstack-router-code-based/ # React with TanStack Router (code-based)
│ ├── tanstack-start/ # TanStack Start
│ └── django/ # Django
├── mcp-commands/ # MCP command prompts (`/command` in agents)
└── scripts/ # Build scripts

Build outputs

Run npm run build to generate the release artifacts:

OutputDescription
dist/skills/<id>.zipPer-skill bundles (SKILL.md + references + shared docs)
dist/skills/manifest.jsonVersioned manifest of every bundled skill and its download URL
dist/skills/skill-menu.jsonCategory groupings and cliEntries — the wizard's command lookup table

Releases are cut as GitHub releases. Consumers (the wizard, the MCP server, anything else) fetch manifest.json / skill-menu.json from the latest release and download the per-skill ZIPs on demand.

Manifest structure

The manifest describes the built skills — one resource per skill, with id, name, description, tags, uri, and a downloadUrl pointing at the GitHub release asset. Each bundled skill contains a SKILL.md, references/ step files, and any shared docs pulled from posthog.com at build time.

Adding a new skill

Add numbered step files to context/skills/<skill>/references/ using the convention <n>-<name>.md with next_step: frontmatter pointing to the next file. The build script discovers, orders, and bundles them automatically.

Wizard CLI commands

Skills in this repo declare how they surface as wizard commands via a cli: block in their config.yaml. That mechanism — role, parentCommand, command, flat vs. family — is documented in CONTRIBUTING.md.

The CLI was overhauled to consolidate commands into a smaller, extensible surface. If you (or your agent) knew an older command, here's where it went:

Old commandNew commandWhat changed
wizard integratewizard (default flow)Command removed; the default flow runs the integration
wizard events-auditwizard audit eventsNow an audit-family subcommand
wizard audit (single audit)wizard audit <subcommand>Now a family — see the audit subcommands below
wizard audit-3000removedRetired
wizard revenuewizard revenue-analyticsRenamed (old revenue removed)
wizard upload-sourcemapswizard upload-source-mapsRenamed; upload-sourcemaps still works as an alias

Audit subcommands (and the skills behind them)

audit is the one family today whose subcommands are skills from this repo:

SubcommandBacking skill
wizard audit eventsaudit-events (the default leaf)
wizard audit allaudit
wizard audit autocaptureaudit-autocapture
wizard audit feature-flagsaudit-feature-flags
wizard audit identifyaudit-identify
wizard audit session-replayaudit-session-replay
wizard audit web-analytics(wizard-native, not a skill in this repo)

Commands vs. skills: those audit subcommands are skills, promoted to commands via cli: role: command. A skill with role: skill is reachable only through wizard skill <id>. Same machinery, two surfaces — so wizard audit <subcommand> picks an audit area, it does not take a skill name.

Commands vs. programs:integrate was the command; the program behind it is posthog-integration, which still exists and powers the default flow. The program id is internal — it was never a command you typed.

Context mill skill owners

Reviews are auto-requested via .github/CODEOWNERS — the file is the source of truth; this table just mirrors it for readability. team-wizard-docs is the default reviewer; the team-owned skills below route review to their owning team instead.

PathOwning team
* (everything else, including all other skills)@PostHog/team-wizard-docs
context/skills/integration/@PostHog/team-wizard-docs
context/skills/error-tracking-upload-source-maps/@PostHog/team-error-tracking
context/skills/mcp-analytics/@PostHog/team-mcp-analytics
context/skills/revenue-analytics/@PostHog/team-web-analytics
context/skills/self-driving/@PostHog/team-self-driving
context/skills/data-warehouse-source/@PostHog/team-warehouse-sources
context/skills/web-analytics/@PostHog/team-web-analytics

Ownership is by directory. Skills not listed above (audit, audit-*, cost-cutting, creating-product-tours, error-tracking, events-audit, feature-flags, llm-analytics, logs, migrate, omnibus, posthog-best-practices, quack, tools-and-features) fall through the default and are owned by team-wizard-docs. Today CODEOWNERS only auto-requests review — approval is not a merge gate.

Security scanning

Before we ship any skills, we run them through the warlock, PostHog's security scanner for agentic flows. It reads the built skill bundles and looks for prompt-injection attempts and other risky content that could trick an agent downstream. An LLM triage pass then sorts the real threats from the false positives, so we're not chasing noise.

CI runs this automatically on every build and release, so most of the time you don't have to think about it. But if you want to check something locally:

pnpm security-scan:skills # scan all built skill ZIPs (this is what CI runs)
pnpm security-scan path/to/file.md # scan a specific file

Heads up, the skills scan reads from dist/, so run pnpm build first. If a scan flags something, fix the flagged content before releasing :)

About

PostHog context and skill assembly for AI agents and LLM tasks

Resources

Code of conduct

Contributing

Security policy

Stars

58 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

Repository files navigation

Welcome to the PostHog context mill

This repo assembles PostHog context for AI agents and LLMs into Agent Skills-compliant packages. Check out /context for details.

Need output in a different format? No problem. Let us know in #team-docs-and-wizard, or fire up a PR to augment the /context and /scripts directories with your preferred transformation.

Have a skill you want to make sure is maintained and distributed via the wizard?

We'd love your pull request!

The context mill gathers up-to-date content from multiple sources, packaging PostHog developer docs, prompts, and working example code into a versioned manifest which can be shipped anywhere as a zip file.

The PostHog MCP server currently fetches the examples repo manifest and exposes it to any MCP-compatible client as resources and slash commands. This is what currently powers the PostHog wizard.

Context engine

context engine diagram

The examples repo effectively acts as a context engine, an assembly line for turning disparate PostHog knowledge into something portable, something AI systems can reliably consume.

You can break its context engineering flow into three main stages.

1. Context sourcing: The examples repo pulls from the entire PostHog developer docs, with pages delivered from posthog.com as raw Markdown. It also includes curated, hand-crafted prompts and working example apps.

2. Context assembly: The examples repo transforms and packages the sourced context into a zip file manifest, which is meant to be portable and self-contained. We can structure and shape the manifest however we need.

3. Context delivery: The examples repo creates a versioned release for the manifest, which can be consumed by any agent or MCP server as a skill or resource.

Example apps

We've got live, working example code that demonstrates PostHog in action. You can run these yourself to see events flow into your PostHog project.

Example apps are not production-grade

These are more like model airplanes. They're dramatically simplified to make it easy to see PostHog in action. You shouldn't use these as starter projects or put them into production. The authentication is fake!

But the leanness makes these useful for agent-driven development. Use these as context to help your agent make better integration decisions about PostHog.

examples/
├── basics/
│ ├── next-app-router/ # Next.js 15 with App Router
│ ├── next-pages-router/ # Next.js 15 with Pages Router
│ ├── react-react-router/ # React with React Router
│ ├── react-tanstack-router-file-based/ # React with TanStack Router (file-based)
│ ├── react-tanstack-router-code-based/ # React with TanStack Router (code-based)
│ ├── tanstack-start/ # TanStack Start
│ └── django/ # Django
├── mcp-commands/ # MCP command prompts (`/command` in agents)
└── scripts/ # Build scripts

Build outputs

Run npm run build to generate the release artifacts:

OutputDescription
dist/skills/<id>.zipPer-skill bundles (SKILL.md + references + shared docs)
dist/skills/manifest.jsonVersioned manifest of every bundled skill and its download URL
dist/skills/skill-menu.jsonCategory groupings and cliEntries — the wizard's command lookup table

Releases are cut as GitHub releases. Consumers (the wizard, the MCP server, anything else) fetch manifest.json / skill-menu.json from the latest release and download the per-skill ZIPs on demand.

Manifest structure

The manifest describes the built skills — one resource per skill, with id, name, description, tags, uri, and a downloadUrl pointing at the GitHub release asset. Each bundled skill contains a SKILL.md, references/ step files, and any shared docs pulled from posthog.com at build time.

Adding a new skill

Add numbered step files to context/skills/<skill>/references/ using the convention <n>-<name>.md with next_step: frontmatter pointing to the next file. The build script discovers, orders, and bundles them automatically.

Wizard CLI commands

Skills in this repo declare how they surface as wizard commands via a cli: block in their config.yaml. That mechanism — role, parentCommand, command, flat vs. family — is documented in CONTRIBUTING.md.

The CLI was overhauled to consolidate commands into a smaller, extensible surface. If you (or your agent) knew an older command, here's where it went:

Old commandNew commandWhat changed
wizard integratewizard (default flow)Command removed; the default flow runs the integration
wizard events-auditwizard audit eventsNow an audit-family subcommand
wizard audit (single audit)wizard audit <subcommand>Now a family — see the audit subcommands below
wizard audit-3000removedRetired
wizard revenuewizard revenue-analyticsRenamed (old revenue removed)
wizard upload-sourcemapswizard upload-source-mapsRenamed; upload-sourcemaps still works as an alias

Audit subcommands (and the skills behind them)

audit is the one family today whose subcommands are skills from this repo:

SubcommandBacking skill
wizard audit eventsaudit-events (the default leaf)
wizard audit allaudit
wizard audit autocaptureaudit-autocapture
wizard audit feature-flagsaudit-feature-flags
wizard audit identifyaudit-identify
wizard audit session-replayaudit-session-replay
wizard audit web-analytics(wizard-native, not a skill in this repo)

Commands vs. skills: those audit subcommands are skills, promoted to commands via cli: role: command. A skill with role: skill is reachable only through wizard skill <id>. Same machinery, two surfaces — so wizard audit <subcommand> picks an audit area, it does not take a skill name.

Commands vs. programs:integrate was the command; the program behind it is posthog-integration, which still exists and powers the default flow. The program id is internal — it was never a command you typed.

Context mill skill owners

Reviews are auto-requested via .github/CODEOWNERS — the file is the source of truth; this table just mirrors it for readability. team-wizard-docs is the default reviewer; the team-owned skills below route review to their owning team instead.

PathOwning team
* (everything else, including all other skills)@PostHog/team-wizard-docs
context/skills/integration/@PostHog/team-wizard-docs
context/skills/error-tracking-upload-source-maps/@PostHog/team-error-tracking
context/skills/mcp-analytics/@PostHog/team-mcp-analytics
context/skills/revenue-analytics/@PostHog/team-web-analytics
context/skills/self-driving/@PostHog/team-self-driving
context/skills/data-warehouse-source/@PostHog/team-warehouse-sources
context/skills/web-analytics/@PostHog/team-web-analytics

Ownership is by directory. Skills not listed above (audit, audit-*, cost-cutting, creating-product-tours, error-tracking, events-audit, feature-flags, llm-analytics, logs, migrate, omnibus, posthog-best-practices, quack, tools-and-features) fall through the default and are owned by team-wizard-docs. Today CODEOWNERS only auto-requests review — approval is not a merge gate.

Security scanning

Before we ship any skills, we run them through the warlock, PostHog's security scanner for agentic flows. It reads the built skill bundles and looks for prompt-injection attempts and other risky content that could trick an agent downstream. An LLM triage pass then sorts the real threats from the false positives, so we're not chasing noise.

CI runs this automatically on every build and release, so most of the time you don't have to think about it. But if you want to check something locally:

pnpm security-scan:skills # scan all built skill ZIPs (this is what CI runs)
pnpm security-scan path/to/file.md # scan a specific file

Heads up, the skills scan reads from dist/, so run pnpm build first. If a scan flags something, fix the flagged content before releasing :)

About

PostHog context and skill assembly for AI agents and LLM tasks

Resources

Code of conduct

Contributing

Security policy

Stars

58 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

Welcome to the PostHog context mill

This repo assembles PostHog context for AI agents and LLMs into Agent Skills-compliant packages. Check out /context for details.

Need output in a different format? No problem. Let us know in #team-docs-and-wizard, or fire up a PR to augment the /context and /scripts directories with your preferred transformation.

Have a skill you want to make sure is maintained and distributed via the wizard?

We'd love your pull request!

The context mill gathers up-to-date content from multiple sources, packaging PostHog developer docs, prompts, and working example code into a versioned manifest which can be shipped anywhere as a zip file.

The PostHog MCP server currently fetches the examples repo manifest and exposes it to any MCP-compatible client as resources and slash commands. This is what currently powers the PostHog wizard.

Context engine

context engine diagram

The examples repo effectively acts as a context engine, an assembly line for turning disparate PostHog knowledge into something portable, something AI systems can reliably consume.

You can break its context engineering flow into three main stages.

1. Context sourcing: The examples repo pulls from the entire PostHog developer docs, with pages delivered from posthog.com as raw Markdown. It also includes curated, hand-crafted prompts and working example apps.

2. Context assembly: The examples repo transforms and packages the sourced context into a zip file manifest, which is meant to be portable and self-contained. We can structure and shape the manifest however we need.

3. Context delivery: The examples repo creates a versioned release for the manifest, which can be consumed by any agent or MCP server as a skill or resource.

Example apps

We've got live, working example code that demonstrates PostHog in action. You can run these yourself to see events flow into your PostHog project.

Example apps are not production-grade

These are more like model airplanes. They're dramatically simplified to make it easy to see PostHog in action. You shouldn't use these as starter projects or put them into production. The authentication is fake!

But the leanness makes these useful for agent-driven development. Use these as context to help your agent make better integration decisions about PostHog.

examples/
├── basics/
│ ├── next-app-router/ # Next.js 15 with App Router
│ ├── next-pages-router/ # Next.js 15 with Pages Router
│ ├── react-react-router/ # React with React Router
│ ├── react-tanstack-router-file-based/ # React with TanStack Router (file-based)
│ ├── react-tanstack-router-code-based/ # React with TanStack Router (code-based)
│ ├── tanstack-start/ # TanStack Start
│ └── django/ # Django
├── mcp-commands/ # MCP command prompts (`/command` in agents)
└── scripts/ # Build scripts

Build outputs

Run npm run build to generate the release artifacts:

OutputDescription
dist/skills/<id>.zipPer-skill bundles (SKILL.md + references + shared docs)
dist/skills/manifest.jsonVersioned manifest of every bundled skill and its download URL
dist/skills/skill-menu.jsonCategory groupings and cliEntries — the wizard's command lookup table

Releases are cut as GitHub releases. Consumers (the wizard, the MCP server, anything else) fetch manifest.json / skill-menu.json from the latest release and download the per-skill ZIPs on demand.

Manifest structure

The manifest describes the built skills — one resource per skill, with id, name, description, tags, uri, and a downloadUrl pointing at the GitHub release asset. Each bundled skill contains a SKILL.md, references/ step files, and any shared docs pulled from posthog.com at build time.

Adding a new skill

Add numbered step files to context/skills/<skill>/references/ using the convention <n>-<name>.md with next_step: frontmatter pointing to the next file. The build script discovers, orders, and bundles them automatically.

Wizard CLI commands

Skills in this repo declare how they surface as wizard commands via a cli: block in their config.yaml. That mechanism — role, parentCommand, command, flat vs. family — is documented in CONTRIBUTING.md.

The CLI was overhauled to consolidate commands into a smaller, extensible surface. If you (or your agent) knew an older command, here's where it went:

Old commandNew commandWhat changed
wizard integratewizard (default flow)Command removed; the default flow runs the integration
wizard events-auditwizard audit eventsNow an audit-family subcommand
wizard audit (single audit)wizard audit <subcommand>Now a family — see the audit subcommands below
wizard audit-3000removedRetired
wizard revenuewizard revenue-analyticsRenamed (old revenue removed)
wizard upload-sourcemapswizard upload-source-mapsRenamed; upload-sourcemaps still works as an alias

Audit subcommands (and the skills behind them)

audit is the one family today whose subcommands are skills from this repo:

SubcommandBacking skill
wizard audit eventsaudit-events (the default leaf)
wizard audit allaudit
wizard audit autocaptureaudit-autocapture
wizard audit feature-flagsaudit-feature-flags
wizard audit identifyaudit-identify
wizard audit session-replayaudit-session-replay
wizard audit web-analytics(wizard-native, not a skill in this repo)

Commands vs. skills: those audit subcommands are skills, promoted to commands via cli: role: command. A skill with role: skill is reachable only through wizard skill <id>. Same machinery, two surfaces — so wizard audit <subcommand> picks an audit area, it does not take a skill name.

Commands vs. programs:integrate was the command; the program behind it is posthog-integration, which still exists and powers the default flow. The program id is internal — it was never a command you typed.

Context mill skill owners

Reviews are auto-requested via .github/CODEOWNERS — the file is the source of truth; this table just mirrors it for readability. team-wizard-docs is the default reviewer; the team-owned skills below route review to their owning team instead.

PathOwning team
* (everything else, including all other skills)@PostHog/team-wizard-docs
context/skills/integration/@PostHog/team-wizard-docs
context/skills/error-tracking-upload-source-maps/@PostHog/team-error-tracking
context/skills/mcp-analytics/@PostHog/team-mcp-analytics
context/skills/revenue-analytics/@PostHog/team-web-analytics
context/skills/self-driving/@PostHog/team-self-driving
context/skills/data-warehouse-source/@PostHog/team-warehouse-sources
context/skills/web-analytics/@PostHog/team-web-analytics

Ownership is by directory. Skills not listed above (audit, audit-*, cost-cutting, creating-product-tours, error-tracking, events-audit, feature-flags, llm-analytics, logs, migrate, omnibus, posthog-best-practices, quack, tools-and-features) fall through the default and are owned by team-wizard-docs. Today CODEOWNERS only auto-requests review — approval is not a merge gate.

Security scanning

Before we ship any skills, we run them through the warlock, PostHog's security scanner for agentic flows. It reads the built skill bundles and looks for prompt-injection attempts and other risky content that could trick an agent downstream. An LLM triage pass then sorts the real threats from the false positives, so we're not chasing noise.

CI runs this automatically on every build and release, so most of the time you don't have to think about it. But if you want to check something locally:

pnpm security-scan:skills # scan all built skill ZIPs (this is what CI runs)
pnpm security-scan path/to/file.md # scan a specific file

Heads up, the skills scan reads from dist/, so run pnpm build first. If a scan flags something, fix the flagged content before releasing :)

About

PostHog context and skill assembly for AI agents and LLM tasks

Resources

Code of conduct

Contributing

Security policy

Stars

58 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

Welcome to the PostHog context mill

This repo assembles PostHog context for AI agents and LLMs into Agent Skills-compliant packages. Check out /context for details.

Need output in a different format? No problem. Let us know in #team-docs-and-wizard, or fire up a PR to augment the /context and /scripts directories with your preferred transformation.

Have a skill you want to make sure is maintained and distributed via the wizard?

We'd love your pull request!

The context mill gathers up-to-date content from multiple sources, packaging PostHog developer docs, prompts, and working example code into a versioned manifest which can be shipped anywhere as a zip file.

The PostHog MCP server currently fetches the examples repo manifest and exposes it to any MCP-compatible client as resources and slash commands. This is what currently powers the PostHog wizard.

Context engine

context engine diagram

The examples repo effectively acts as a context engine, an assembly line for turning disparate PostHog knowledge into something portable, something AI systems can reliably consume.

You can break its context engineering flow into three main stages.

1. Context sourcing: The examples repo pulls from the entire PostHog developer docs, with pages delivered from posthog.com as raw Markdown. It also includes curated, hand-crafted prompts and working example apps.

2. Context assembly: The examples repo transforms and packages the sourced context into a zip file manifest, which is meant to be portable and self-contained. We can structure and shape the manifest however we need.

3. Context delivery: The examples repo creates a versioned release for the manifest, which can be consumed by any agent or MCP server as a skill or resource.

Example apps

We've got live, working example code that demonstrates PostHog in action. You can run these yourself to see events flow into your PostHog project.

Example apps are not production-grade

These are more like model airplanes. They're dramatically simplified to make it easy to see PostHog in action. You shouldn't use these as starter projects or put them into production. The authentication is fake!

But the leanness makes these useful for agent-driven development. Use these as context to help your agent make better integration decisions about PostHog.

examples/
├── basics/
│ ├── next-app-router/ # Next.js 15 with App Router
│ ├── next-pages-router/ # Next.js 15 with Pages Router
│ ├── react-react-router/ # React with React Router
│ ├── react-tanstack-router-file-based/ # React with TanStack Router (file-based)
│ ├── react-tanstack-router-code-based/ # React with TanStack Router (code-based)
│ ├── tanstack-start/ # TanStack Start
│ └── django/ # Django
├── mcp-commands/ # MCP command prompts (`/command` in agents)
└── scripts/ # Build scripts

Build outputs

Run npm run build to generate the release artifacts:

OutputDescription
dist/skills/<id>.zipPer-skill bundles (SKILL.md + references + shared docs)
dist/skills/manifest.jsonVersioned manifest of every bundled skill and its download URL
dist/skills/skill-menu.jsonCategory groupings and cliEntries — the wizard's command lookup table

Releases are cut as GitHub releases. Consumers (the wizard, the MCP server, anything else) fetch manifest.json / skill-menu.json from the latest release and download the per-skill ZIPs on demand.

Manifest structure

The manifest describes the built skills — one resource per skill, with id, name, description, tags, uri, and a downloadUrl pointing at the GitHub release asset. Each bundled skill contains a SKILL.md, references/ step files, and any shared docs pulled from posthog.com at build time.

Adding a new skill

Add numbered step files to context/skills/<skill>/references/ using the convention <n>-<name>.md with next_step: frontmatter pointing to the next file. The build script discovers, orders, and bundles them automatically.

Wizard CLI commands

Skills in this repo declare how they surface as wizard commands via a cli: block in their config.yaml. That mechanism — role, parentCommand, command, flat vs. family — is documented in CONTRIBUTING.md.

The CLI was overhauled to consolidate commands into a smaller, extensible surface. If you (or your agent) knew an older command, here's where it went:

Old commandNew commandWhat changed
wizard integratewizard (default flow)Command removed; the default flow runs the integration
wizard events-auditwizard audit eventsNow an audit-family subcommand
wizard audit (single audit)wizard audit <subcommand>Now a family — see the audit subcommands below
wizard audit-3000removedRetired
wizard revenuewizard revenue-analyticsRenamed (old revenue removed)
wizard upload-sourcemapswizard upload-source-mapsRenamed; upload-sourcemaps still works as an alias

Audit subcommands (and the skills behind them)

audit is the one family today whose subcommands are skills from this repo:

SubcommandBacking skill
wizard audit eventsaudit-events (the default leaf)
wizard audit allaudit
wizard audit autocaptureaudit-autocapture
wizard audit feature-flagsaudit-feature-flags
wizard audit identifyaudit-identify
wizard audit session-replayaudit-session-replay
wizard audit web-analytics(wizard-native, not a skill in this repo)

Commands vs. skills: those audit subcommands are skills, promoted to commands via cli: role: command. A skill with role: skill is reachable only through wizard skill <id>. Same machinery, two surfaces — so wizard audit <subcommand> picks an audit area, it does not take a skill name.

Commands vs. programs:integrate was the command; the program behind it is posthog-integration, which still exists and powers the default flow. The program id is internal — it was never a command you typed.

Context mill skill owners

Reviews are auto-requested via .github/CODEOWNERS — the file is the source of truth; this table just mirrors it for readability. team-wizard-docs is the default reviewer; the team-owned skills below route review to their owning team instead.

PathOwning team
* (everything else, including all other skills)@PostHog/team-wizard-docs
context/skills/integration/@PostHog/team-wizard-docs
context/skills/error-tracking-upload-source-maps/@PostHog/team-error-tracking
context/skills/mcp-analytics/@PostHog/team-mcp-analytics
context/skills/revenue-analytics/@PostHog/team-web-analytics
context/skills/self-driving/@PostHog/team-self-driving
context/skills/data-warehouse-source/@PostHog/team-warehouse-sources
context/skills/web-analytics/@PostHog/team-web-analytics

Ownership is by directory. Skills not listed above (audit, audit-*, cost-cutting, creating-product-tours, error-tracking, events-audit, feature-flags, llm-analytics, logs, migrate, omnibus, posthog-best-practices, quack, tools-and-features) fall through the default and are owned by team-wizard-docs. Today CODEOWNERS only auto-requests review — approval is not a merge gate.

Security scanning

Before we ship any skills, we run them through the warlock, PostHog's security scanner for agentic flows. It reads the built skill bundles and looks for prompt-injection attempts and other risky content that could trick an agent downstream. An LLM triage pass then sorts the real threats from the false positives, so we're not chasing noise.

CI runs this automatically on every build and release, so most of the time you don't have to think about it. But if you want to check something locally:

pnpm security-scan:skills # scan all built skill ZIPs (this is what CI runs)
pnpm security-scan path/to/file.md # scan a specific file

Heads up, the skills scan reads from dist/, so run pnpm build first. If a scan flags something, fix the flagged content before releasing :)

About

PostHog context and skill assembly for AI agents and LLM tasks

Resources

Code of conduct

Contributing

Security policy

Stars

58 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

Repository files navigation

Welcome to the PostHog context mill

This repo assembles PostHog context for AI agents and LLMs into Agent Skills-compliant packages. Check out /context for details.

Need output in a different format? No problem. Let us know in #team-docs-and-wizard, or fire up a PR to augment the /context and /scripts directories with your preferred transformation.

Have a skill you want to make sure is maintained and distributed via the wizard?

We'd love your pull request!

The context mill gathers up-to-date content from multiple sources, packaging PostHog developer docs, prompts, and working example code into a versioned manifest which can be shipped anywhere as a zip file.

The PostHog MCP server currently fetches the examples repo manifest and exposes it to any MCP-compatible client as resources and slash commands. This is what currently powers the PostHog wizard.

Context engine

context engine diagram

The examples repo effectively acts as a context engine, an assembly line for turning disparate PostHog knowledge into something portable, something AI systems can reliably consume.

You can break its context engineering flow into three main stages.

1. Context sourcing: The examples repo pulls from the entire PostHog developer docs, with pages delivered from posthog.com as raw Markdown. It also includes curated, hand-crafted prompts and working example apps.

2. Context assembly: The examples repo transforms and packages the sourced context into a zip file manifest, which is meant to be portable and self-contained. We can structure and shape the manifest however we need.

3. Context delivery: The examples repo creates a versioned release for the manifest, which can be consumed by any agent or MCP server as a skill or resource.

Example apps

We've got live, working example code that demonstrates PostHog in action. You can run these yourself to see events flow into your PostHog project.

Example apps are not production-grade

These are more like model airplanes. They're dramatically simplified to make it easy to see PostHog in action. You shouldn't use these as starter projects or put them into production. The authentication is fake!

But the leanness makes these useful for agent-driven development. Use these as context to help your agent make better integration decisions about PostHog.

examples/
├── basics/
│ ├── next-app-router/ # Next.js 15 with App Router
│ ├── next-pages-router/ # Next.js 15 with Pages Router
│ ├── react-react-router/ # React with React Router
│ ├── react-tanstack-router-file-based/ # React with TanStack Router (file-based)
│ ├── react-tanstack-router-code-based/ # React with TanStack Router (code-based)
│ ├── tanstack-start/ # TanStack Start
│ └── django/ # Django
├── mcp-commands/ # MCP command prompts (`/command` in agents)
└── scripts/ # Build scripts

Build outputs

Run npm run build to generate the release artifacts:

OutputDescription
dist/skills/<id>.zipPer-skill bundles (SKILL.md + references + shared docs)
dist/skills/manifest.jsonVersioned manifest of every bundled skill and its download URL
dist/skills/skill-menu.jsonCategory groupings and cliEntries — the wizard's command lookup table

Releases are cut as GitHub releases. Consumers (the wizard, the MCP server, anything else) fetch manifest.json / skill-menu.json from the latest release and download the per-skill ZIPs on demand.

Manifest structure

The manifest describes the built skills — one resource per skill, with id, name, description, tags, uri, and a downloadUrl pointing at the GitHub release asset. Each bundled skill contains a SKILL.md, references/ step files, and any shared docs pulled from posthog.com at build time.

Adding a new skill

Add numbered step files to context/skills/<skill>/references/ using the convention <n>-<name>.md with next_step: frontmatter pointing to the next file. The build script discovers, orders, and bundles them automatically.

Wizard CLI commands

Skills in this repo declare how they surface as wizard commands via a cli: block in their config.yaml. That mechanism — role, parentCommand, command, flat vs. family — is documented in CONTRIBUTING.md.

The CLI was overhauled to consolidate commands into a smaller, extensible surface. If you (or your agent) knew an older command, here's where it went:

Old commandNew commandWhat changed
wizard integratewizard (default flow)Command removed; the default flow runs the integration
wizard events-auditwizard audit eventsNow an audit-family subcommand
wizard audit (single audit)wizard audit <subcommand>Now a family — see the audit subcommands below
wizard audit-3000removedRetired
wizard revenuewizard revenue-analyticsRenamed (old revenue removed)
wizard upload-sourcemapswizard upload-source-mapsRenamed; upload-sourcemaps still works as an alias

Audit subcommands (and the skills behind them)

audit is the one family today whose subcommands are skills from this repo:

SubcommandBacking skill
wizard audit eventsaudit-events (the default leaf)
wizard audit allaudit
wizard audit autocaptureaudit-autocapture
wizard audit feature-flagsaudit-feature-flags
wizard audit identifyaudit-identify
wizard audit session-replayaudit-session-replay
wizard audit web-analytics(wizard-native, not a skill in this repo)

Commands vs. skills: those audit subcommands are skills, promoted to commands via cli: role: command. A skill with role: skill is reachable only through wizard skill <id>. Same machinery, two surfaces — so wizard audit <subcommand> picks an audit area, it does not take a skill name.

Commands vs. programs:integrate was the command; the program behind it is posthog-integration, which still exists and powers the default flow. The program id is internal — it was never a command you typed.

Context mill skill owners

Reviews are auto-requested via .github/CODEOWNERS — the file is the source of truth; this table just mirrors it for readability. team-wizard-docs is the default reviewer; the team-owned skills below route review to their owning team instead.

PathOwning team
* (everything else, including all other skills)@PostHog/team-wizard-docs
context/skills/integration/@PostHog/team-wizard-docs
context/skills/error-tracking-upload-source-maps/@PostHog/team-error-tracking
context/skills/mcp-analytics/@PostHog/team-mcp-analytics
context/skills/revenue-analytics/@PostHog/team-web-analytics
context/skills/self-driving/@PostHog/team-self-driving
context/skills/data-warehouse-source/@PostHog/team-warehouse-sources
context/skills/web-analytics/@PostHog/team-web-analytics

Ownership is by directory. Skills not listed above (audit, audit-*, cost-cutting, creating-product-tours, error-tracking, events-audit, feature-flags, llm-analytics, logs, migrate, omnibus, posthog-best-practices, quack, tools-and-features) fall through the default and are owned by team-wizard-docs. Today CODEOWNERS only auto-requests review — approval is not a merge gate.

Security scanning

Before we ship any skills, we run them through the warlock, PostHog's security scanner for agentic flows. It reads the built skill bundles and looks for prompt-injection attempts and other risky content that could trick an agent downstream. An LLM triage pass then sorts the real threats from the false positives, so we're not chasing noise.

CI runs this automatically on every build and release, so most of the time you don't have to think about it. But if you want to check something locally:

pnpm security-scan:skills # scan all built skill ZIPs (this is what CI runs)
pnpm security-scan path/to/file.md # scan a specific file

Heads up, the skills scan reads from dist/, so run pnpm build first. If a scan flags something, fix the flagged content before releasing :)

About

PostHog context and skill assembly for AI agents and LLM tasks

Resources

Code of conduct

Contributing

Security policy

Stars

58 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages