analyzing-insights-across-teams
Skill721 starsChanged 2 months agoMITView on GitHub
Analyze PostHog insights, dashboards, or teams beyond the current project by querying the prod Postgres replicas synced into the dogfood data warehouse (US project 2, "PostHog App + Website"). Use when asked to analyze insights across all teams or projects, another team's insights, or fleet-wide insight/dashboard usage — cases where `system.insights` only returns the current project's rows and the agent would otherwise report the data as inaccessible. Covers the synced table names for US and EU and the column-verification workflow.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- PostHog/posthogword for word, first seen Oct 4, 2026
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 repository119 other files it gives its agents.
- AGENTS.mdAGENTS.md
- common/AGENTS.mdAGENTS.md
- proto/AGENTS.mdAGENTS.md
- rust/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- common/CLAUDE.mdCLAUDE.md
- proto/CLAUDE.mdCLAUDE.md
- rust/CLAUDE.mdCLAUDE.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
- adopting-generated-api-typesSkill
- analyzing-experiment-precompute-canarySkill
- analyzing-experiment-query-performanceSkill
- announcing-behavior-changesSkill
- auditing-llm-gateway-paritySkill
- auditing-warehouse-source-coverageSkill
- authenticating-to-clickhouseSkill
- authoring-ci-workflowsSkill
- autoresolving-pr-conflictsSkill
- building-product-empty-statesSkill
- 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
- documenting-warehouse-sourcesSkill
- editing-agents-mdSkill
- establishing-code-ownershipSkill
- extending-hobby-smoke-testsSkill
- extending-personhog-test-harnessSkill
- finding-llm-gateway-migration-candidatesSkill
- fixing-flaky-testsSkill
- 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
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
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 21
Do not stop at system.insights when the question spans teams.
- Distinctive: line 73
Never put customer team names, insight titles, or other row-level metadata on public surfaces — PR titles/descriptions, commit messages, …
- Distinctive: line 74
Keep named results in the private conversation, internal docs, or auth-gated links.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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
Analyzing insights across teams
system.* entity tables (e.g. system.insights) are scoped to the current project,
and the generic execute-sql guidance says other teams' data is inaccessible.
For the dogfood project (US project 2) that is not the whole story:
production Postgres tables are replicated into the project's data warehouse,
so cross-team entity metadata is queryable with posthog:execute-sql.
Do not stop at system.insights when the question spans teams.
This skill is deliberately repo-local (.agents/skills/): it documents PostHog's internal dogfood setup,
applies only to agents working in this repo, and must not move into the packaged products/*/skills/ bundle that ships to every team.
Synced tables
| Entity | US (prod-us) | EU (prod-eu) |
| Insights | postgres.posthog_dashboarditem | eu_postgres_posthog_dashboarditem |
| Dashboards | postgres.posthog_dashboard | eu_postgres_posthog_dashboard |
| Teams / projects | postgres.posthog_team | eu_postgres_posthog_team |
- Underscore aliases (e.g.
postgres_posthog_dashboarditem) point at the same synced data. - These are replicas of the Django tables in this repo (
posthog_dashboarditembacks theInsightmodel), so rows span every team;team_idis the scoping column. More prod tables than these are synced. Before concluding cross-team data is inaccessible, check the catalog:
SELECT table_name, description FROM system.information_schema.tables WHERE table_type = 'data_warehouse' AND table_name ILIKE '%postgres%'
Workflow
Confirm columns before projecting — synced schemas drift with the Django models:
SELECT column_name, data_type FROM system.information_schema.columns WHERE table_name = 'postgres.posthog_dashboarditem'Query with
posthog:execute-sql, filtering or grouping byteam_id. Example — most active teams by insights created in the last 30 days:SELECT team_id, count() AS insights_created FROM postgres.posthog_dashboarditem WHERE NOT deleted AND saved AND created_at >= now() - INTERVAL 30 DAY GROUP BY team_id ORDER BY insights_created DESC LIMIT 20Join
postgres.posthog_teamonid = team_idfor team names only when the output stays on an internal surface (see below).- Remember the sync lag: these are periodic replicas, not live reads — fine for analysis, not for "right now" state.
Output handling (required)
Rows in these tables are customer data: team names, insight names, descriptions, and queries.
- Never put customer team names, insight titles, or other row-level metadata on public surfaces — PR titles/descriptions, commit messages, issues, code comments, or uploaded screenshots. Aggregates and
team_id-level figures without names are the ceiling for public copy. - Keep named results in the private conversation, internal docs, or auth-gated links.
- Access is gated by membership in the internal dogfood project. If a query fails with a permissions error, report it and stop — do not look for another route to cross-team data.
Related
- For cross-team event/analytics data (not entity metadata), see the
querying-production-databases-via-metabaseskill instead.
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.

