documenting-warehouse-sources
Skill727 starsChanged yesterdayMITView on GitHub
Write or update the user-facing posthog.com documentation for a PostHog Data warehouse import source. Use when adding a new source doc, fixing an inconsistent or stub source doc, or standardizing the docs at contents/docs/cdp/sources. Covers the canonical template, shared snippets, the auto-rendered <SourceParameters /> and <SourceTables /> components, frontmatter, and the docsUrl/slug rule that prevents 404s.
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 136
Use kebab-case for multi-word slugs (active-campaign, not activecampaign).
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Documenting Data warehouse sources
User-facing source docs live in the posthog.com repo (not this one) at
contents/docs/cdp/sources/<slug>.md, served at both /docs/cdp/sources/<slug> and
/docs/data-warehouse/sources/<slug>. This skill defines the one consistent shape every source doc
must follow. Pair it with /implementing-warehouse-sources when shipping a new source.
Assume a sibling posthog.com checkout (e.g. ../posthog.com).
The two things the website renders for you
You do not hand-write connection fields or the table list — both come from the
public_source_configs API the site fetches at build time, mirrored into the doc via MDX components:
<SourceParameters />renders the connection/config form fields fromget_source_config.fields.<SourceTables />renders the Supported tables reference (table name, description, sync method, incremental field, primary key) from the source'sget_documented_tables().
<SourceTables /> only has data when the source opts in by setting
lists_tables_without_credentials = True on its source class (only valid when get_schemas iterates a
static endpoint catalog with no I/O — see /implementing-warehouse-sources). Otherwise it renders a
generic "discovered from your account" note. If a table is missing or its description is thin, fix the
source code (settings.py endpoints + canonical_descriptions.py), not the doc — the doc just renders
what the API returns, so the code stays the single source of truth.
Frontmatter
---
title: Linking <Source> as a source
sidebar: Docs
showTitle: true
availability: { free: full, selfServe: full, enterprise: full }
sourceId: <EnumValue> # MUST equal the ExternalDataSourceType value, e.g. ActiveCampaign, Stripe
---sourceId is what links the doc to its API config (icon, fields, tables). Get it wrong and the doc
renders with no <SourceParameters /> / <SourceTables /> data. It must be a real
ExternalDataSourceType value (PascalCase, e.g. ActiveCampaign, not Active Campaign).
sourceId also drives the release-status callout and the nav badge: posthog.com reads the source's
releaseStatus from the API and renders them itself. Don't add a status snippet, a status callout, or
"this source is in beta" text, and don't set beta: in frontmatter — posthog.com CI rejects all of them.
Canonical template
---
title: Linking <Source> as a source
sidebar: Docs
showTitle: true
availability: { free: full, selfServe: full, enterprise: full }
sourceId: <EnumValue>
---
import SourceSetupIntro from "../_snippets/source-setup-intro.mdx"
import SyncModes from "../_snippets/sync-modes.mdx"
import TroubleshootingLink from "../_snippets/dw-troubleshooting-link.mdx"
One or two sentences: what this connector syncs and the typical use case.
## Prerequisites
Account tier / admin rights / API access the user needs before they can connect.
## Adding a data source
<SourceSetupIntro />
List the specific credentials this source needs and exactly where to get them (link to the provider's
dashboard). For sources with more than one auth method, use `###` subsections (mirror Stripe's
"Option 1 / Option 2").
## Sync modes
<SyncModes />
Add any source-specific recommendation here (e.g. "use webhooks for Stripe").
## Configuration
<SourceParameters />
## Supported tables
<SourceTables />
## Troubleshooting
Source-specific errors and fixes (optional but encouraged), then:
<TroubleshootingLink />Essential sections (every source)
Intro → Prerequisites → Adding a data source → Sync modes → Configuration → Supported tables → Troubleshooting.
Optional sections (when applicable)
Webhooks (real-time sync), CDC (databases), Column selection, Row filters, Inbound IP addresses
(<InboundIpAddresses />), data-type handling, known limitations, ERD/relationships. Reference
implementations already in the repo: Stripe (SaaS + webhooks), Postgres (database + CDC),
ClickHouse (database). Don't invent sections the source doesn't need.
Shared snippets
Reuse these instead of re-writing the same prose (they live in contents/docs/cdp/_snippets/):
source-setup-intro.mdx— the standard "Adding a data source" steps.sync-modes.mdx— sync-mode summary linking to the canonical explanation.dw-troubleshooting-link.mdx— the troubleshooting/support footer.inbound-ip-addresses.mdx— IP allowlist table for DB sources.feedback-questions.mdx— feedback/FAQ footer.
.md source docs support MDX import (e.g. convex.md, mongodb.md), so you don't need to rename to
.mdx to use snippets — but .mdx is fine too. CalloutBox, ProductScreenshot, SourceParameters,
and SourceTables are global components — no import needed.
docsUrl / slug rule (prevents 404s)
The website derives the doc slug from the source's docsUrl (its last /docs/cdp/sources/<slug>
segment), so these three must agree:
- The doc filename:
<slug>.md. - The source's
docsUrlinget_source_config:https://posthog.com/docs/cdp/sources/<slug>. - (implicitly) the listing link — now derived from
docsUrl, so it follows automatically.
Use kebab-case for multi-word slugs (active-campaign, not activecampaign). After writing or renaming
a doc, run the audit from this (posthog) repo:
python manage.py audit_source_docs --docs-dir ../posthog.com/contents/docs/cdp/sourcesIt fails if any source docsUrl points at a missing file or any doc's sourceId isn't a real source.
Renaming a published doc also needs a 301 in posthog.com/vercel.json for both
/docs/cdp/sources/* and /docs/data-warehouse/sources/*.
Checklist
- Frontmatter
sourceIdmatches theExternalDataSourceTypevalue exactly - Intro, Prerequisites, Adding a data source, Sync modes, Configuration, Supported tables, Troubleshooting
- No status snippet, callout, or
beta:frontmatter (posthog.com renders them fromreleaseStatus) - Shared snippets used instead of bespoke prose
<SourceParameters />and<SourceTables />present (don't hand-write fields or the table list)- If the rendered table list is empty/thin and the source is fixed-schema, enrich its code
(
lists_tables_without_credentials,settings.py,canonical_descriptions.py) — see/implementing-warehouse-sources - Filename,
docsUrl, and slug all agree (kebab-case) audit_source_docspasses
Other versions1 project uses a version of this.
Word for word · 1
- PostHog/posthog★ 40k100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository124 other files it gives its agents.
- AGENTS.mdAGENTS.md
- common/AGENTS.mdAGENTS.md
- hog/AGENTS.mdAGENTS.md
- proto/AGENTS.mdAGENTS.md
- rust/AGENTS.mdAGENTS.md
- .cursor/rules/django-python.mdcCursor rule
- .cursor/rules/react-typescript.mdcCursor rule
- .cursor/rules/rust.mdcCursor rule
- adding-activity-loggingSkill
- adding-api-scopesSkill
- adding-inbound-webhooksSkill
- adding-inbox-sourcesSkill
- adding-ingestion-warningsSkill
- adding-mcp-store-serversSkill
- adding-personhog-rpcSkill
- adding-product-alertingSkill
- adding-project-secret-api-key-authSkill
- adding-today-highlightsSkill
- adopting-generated-api-typesSkill
- analyzing-experiment-precompute-canarySkill
- analyzing-experiment-query-performanceSkill
- analyzing-insights-across-teamsSkill
- announcing-behavior-changesSkill
- auditing-llm-gateway-paritySkill
- auditing-warehouse-source-coverageSkill
- authenticating-to-clickhouseSkill
- authoring-ci-workflowsSkill
- building-product-empty-statesSkill
- building-the-toolbarSkill
- clickhouse-migrationsSkill
- debugging-ci-failuresSkill
- debugging-local-replaySkill
- debugging-local-task-agent-runsSkill
- debugging-mcp-analyticsSkill
- debugging-signals-pipelineSkill
- debugging-table-access-deniedSkill
- depot-ciSkill
- depot-container-buildsSkill
- depot-github-runnersSkill
- developing-subscriptionsSkill
- django-migrationsSkill
- django-startup-timeSkill
- editing-agents-mdSkill
- establishing-code-ownershipSkill
- extending-hobby-smoke-testsSkill
- extending-personhog-test-harnessSkill
- finding-llm-gateway-migration-candidatesSkill
- fixing-flaky-testsSkill
- formatting-slack-messagesSkill
- gating-production-deploysSkill
- gating-sensitive-actionsSkill
- generating-clickhouse-query-performance-reportsSkill
- hogliSkill
- implementing-mcp-toolsSkill
- implementing-mcp-ui-appsSkill
- implementing-warehouse-sourcesSkill
- improving-drf-endpointsSkill
- improving-mcp-toolsSkill
- ingestion-pipeline-doctor-nodejsSkill
- instrumenting-first-party-metricsSkill
- The first 60 shown.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

