analyzing-insights-across-teams

bởi posthog

Phân tích insights, dashboard hoặc nhóm PostHog ngoài dự án hiện tại bằng cách truy vấn các bản sao Postgres production được đồng bộ vào kho dữ liệu dogfood (US…

npx skills add https://github.com/posthog/posthog --skill analyzing-insights-across-teams

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

EntityUS (prod-us)EU (prod-eu)
Insightspostgres.posthog_dashboarditemeu_postgres_posthog_dashboarditem
Dashboardspostgres.posthog_dashboardeu_postgres_posthog_dashboard
Teams / projectspostgres.posthog_teameu_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_dashboarditem backs the Insight model), so rows span every team; team_id is 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

  1. 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'
    
  2. Query with posthog:execute-sql, filtering or grouping by team_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 20
    

    Join postgres.posthog_team on id = team_id for team names only when the output stays on an internal surface (see below).

  3. 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-metabase skill instead.

Thêm skills từ posthog

error-tracking-hono
posthog
Theo dõi lỗi PostHog cho Hono
tuning-incremental-sync-config
posthog
Cấu hình của một đồng bộ nằm trên ExternalDataSchema và có thể được thay đổi bất kỳ lúc nào qua external-data-schemas-partial-update. Hầu hết các thay đổi đều không phá hủy (có hiệu lực vào lần đồng bộ tiếp theo), nhưng một số thay đổi (chuyển đổi sync_type, thay đổi khóa chính) yêu cầu xử lý cẩn thận để tránh làm hỏng dữ liệu đã đồng bộ.
playwright-test
posthog
Viết một bài kiểm tra playwright, đảm bảo nó chạy được và không bị lỗi không ổn định.
error-tracking-ruby
posthog
PostHog theo dõi lỗi cho Ruby
authoring-log-alerts
posthog
Tạo cảnh báo log hữu ích, ít nhiễu trên các dịch vụ trong một dự án PostHog. Sử dụng khi người dùng yêu cầu thiết lập cảnh báo cho log của họ, đề xuất các cảnh báo họ nên thêm,…
making-scenes-tab-aware
posthog
Guides converting PostHog frontend scenes to be tab aware for internal scene tabs. Use when adding or refactoring a `SceneExport` scene, fixing state leaking…
posthog-survey-creator
posthog
Tạo và cấu hình khảo sát trong PostHog thông qua hội thoại có hướng dẫn. Sử dụng kỹ năng này khi người dùng muốn tạo khảo sát, thu thập phản hồi người dùng, chạy…
authoring-scouts
posthog
Cách tạo, chỉnh sửa và điều chỉnh các scout PostHog Signals — các tác nhân theo lịch trình quét một dự án và viết báo cáo vào hộp thư đến Signals. Sử dụng khi người dùng…