# posthog-foss - Doramagic AI Context Pack

> 定位：安装前体验与判断资产。它帮助宿主 AI 有一个好的开始，但不代表已经安装、执行或验证目标项目。

## 充分原则

- **充分原则，不是压缩原则**：AI Context Pack 应该充分到让宿主 AI 在开工前理解项目价值、能力边界、使用入口、风险和证据来源；它可以分层组织，但不以最短摘要为目标。
- **压缩策略**：只压缩噪声和重复内容，不压缩会影响判断和开工质量的上下文。

## 给宿主 AI 的使用方式

你正在读取 Doramagic 为 posthog-foss 编译的 AI Context Pack。请把它当作开工前上下文：帮助用户理解适合谁、能做什么、如何开始、哪些必须安装后验证、风险在哪里。不要声称你已经安装、运行或执行了目标项目。

## Claim 消费规则

- **事实来源**：Repo Evidence + Claim/Evidence Graph；Human Wiki 只提供显著性、术语和叙事结构。
- **事实最低状态**：`supported`
- `supported`：可以作为项目事实使用，但回答中必须引用 claim_id 和证据路径。
- `weak`：只能作为低置信度线索，必须要求用户继续核实。
- `inferred`：只能用于风险提示或待确认问题，不能包装成项目事实。
- `unverified`：不得作为事实使用，应明确说证据不足。
- `contradicted`：必须展示冲突来源，不得替用户强行选择一个版本。

## 它最适合谁

- **希望把专业流程带进宿主 AI 的用户**：仓库包含 Skill 文档。 证据：`.agents/skills/adding-ingestion-warnings/SKILL.md`, `.agents/skills/adding-personhog-rpc/SKILL.md`, `.agents/skills/adding-project-secret-api-key-auth/SKILL.md`, `.agents/skills/adopting-generated-api-types/SKILL.md` 等 Claim：`clm_0004` supported 0.86

## 它能做什么

- **AI Skill / Agent 指令资产库**（可做安装前预览）：项目包含可被宿主 AI 读取的 Skill 或 Agent 指令文件，可用于把专业流程带入 Claude、Codex、Cursor 等宿主。 证据：`.agents/skills/adding-ingestion-warnings/SKILL.md`, `.agents/skills/adding-personhog-rpc/SKILL.md`, `.agents/skills/adding-project-secret-api-key-auth/SKILL.md`, `.agents/skills/adopting-generated-api-types/SKILL.md` 等 Claim：`clm_0001` supported 0.86
- **多宿主安装与分发**（需要安装后验证）：项目包含插件或 marketplace 配置，说明它面向一个或多个 AI 宿主的安装和分发。 证据：`nodejs/src/cdp/legacy-plugins/_destinations/customerio/plugin.json`, `nodejs/src/cdp/legacy-plugins/_destinations/hubspot/plugin.json`, `nodejs/src/cdp/legacy-plugins/_destinations/intercom/plugin.json`, `nodejs/src/cdp/legacy-plugins/_destinations/pace-posthog-integration/plugin.json` 等 Claim：`clm_0002` unverified 0.25
- **命令行启动或安装流程**（需要安装后验证）：项目文档中存在可执行命令，真实使用需要在本地或宿主环境中运行这些命令。 证据：`packages/quill/README.md`, `packages/quill/packages/quill/README.md` Claim：`clm_0003` supported 0.86

## 怎么开始

- `pnpm add @posthog/quill` 证据：`packages/quill/packages/quill/README.md` Claim：`clm_0005` supported 0.86, `clm_0007` supported 0.86
- `pnpm add -D tailwindcss @tailwindcss/vite` 证据：`packages/quill/README.md` Claim：`clm_0006` supported 0.86
- `pnpm add @posthog/quill-tokens` 证据：`packages/quill/README.md` Claim：`clm_0007` supported 0.86

## 继续前判断卡

- **当前建议**：先做权限沙盒试用
- **为什么**：项目存在安装命令、宿主配置或本地写入线索，不建议直接进入主力环境，应先在隔离环境试装。

### 30 秒判断

- **现在怎么做**：先做权限沙盒试用
- **最小安全下一步**：先跑 Prompt Preview；若仍要安装，只在隔离环境试装
- **先别相信**：工具权限边界不能在安装前相信。
- **继续会触碰**：命令执行、宿主 AI 配置、本地环境或项目文件

### 现在可以相信

- **适合人群线索：希望把专业流程带进宿主 AI 的用户**（supported）：有 supported claim 或项目证据支撑，但仍不等于真实安装效果。 证据：`.agents/skills/adding-ingestion-warnings/SKILL.md`, `.agents/skills/adding-personhog-rpc/SKILL.md`, `.agents/skills/adding-project-secret-api-key-auth/SKILL.md`, `.agents/skills/adopting-generated-api-types/SKILL.md` 等 Claim：`clm_0004` supported 0.86
- **能力存在：AI Skill / Agent 指令资产库**（supported）：可以相信项目包含这类能力线索；是否适合你的具体任务仍要试用或安装后验证。 证据：`.agents/skills/adding-ingestion-warnings/SKILL.md`, `.agents/skills/adding-personhog-rpc/SKILL.md`, `.agents/skills/adding-project-secret-api-key-auth/SKILL.md`, `.agents/skills/adopting-generated-api-types/SKILL.md` 等 Claim：`clm_0001` supported 0.86
- **能力存在：命令行启动或安装流程**（supported）：可以相信项目包含这类能力线索；是否适合你的具体任务仍要试用或安装后验证。 证据：`packages/quill/README.md`, `packages/quill/packages/quill/README.md` Claim：`clm_0003` supported 0.86
- **存在 Quick Start / 安装命令线索**（supported）：可以相信项目文档出现过启动或安装入口；不要因此直接在主力环境运行。 证据：`packages/quill/packages/quill/README.md` Claim：`clm_0005` supported 0.86, `clm_0007` supported 0.86

### 现在还不能相信

- **工具权限边界不能在安装前相信。**（unverified）：MCP/tool 类项目通常会触碰文件、网络、浏览器或外部 API，必须真实检查权限和日志。
- **真实输出质量不能在安装前相信。**（unverified）：Prompt Preview 只能展示引导方式，不能证明真实项目中的结果质量。
- **宿主 AI 版本兼容性不能在安装前相信。**（unverified）：Claude、Cursor、Codex、Gemini 等宿主加载规则和版本差异必须在真实环境验证。
- **不会污染现有宿主 AI 行为，不能直接相信。**（inferred）：Skill、plugin、AGENTS/CLAUDE/GEMINI 指令可能改变宿主 AI 的默认行为。 证据：`.agents/skills/adding-ingestion-warnings/SKILL.md`, `.agents/skills/adding-personhog-rpc/SKILL.md`, `.agents/skills/adding-project-secret-api-key-auth/SKILL.md`, `.agents/skills/adopting-generated-api-types/SKILL.md` 等
- **可安全回滚不能默认相信。**（unverified）：除非项目明确提供卸载和恢复说明，否则必须先在隔离环境验证。
- **真实安装后是否与用户当前宿主 AI 版本兼容？**（unverified）：兼容性只能通过实际宿主环境验证。 证据：`nodejs/src/cdp/legacy-plugins/_destinations/customerio/plugin.json`, `nodejs/src/cdp/legacy-plugins/_destinations/hubspot/plugin.json`, `nodejs/src/cdp/legacy-plugins/_destinations/intercom/plugin.json`, `nodejs/src/cdp/legacy-plugins/_destinations/pace-posthog-integration/plugin.json` 等
- **项目输出质量是否满足用户具体任务？**（unverified）：安装前预览只能展示流程和边界，不能替代真实评测。
- **安装命令是否需要网络、权限或全局写入？**（unverified）：这影响企业环境和个人环境的安装风险。 证据：`packages/quill/packages/quill/README.md`

### 继续会触碰什么

- **命令执行**：包管理器、网络下载、本地插件目录、项目配置或用户主目录。 原因：运行第一条命令就可能产生环境改动；必须先判断是否值得跑。 证据：`packages/quill/README.md`, `packages/quill/packages/quill/README.md`
- **宿主 AI 配置**：Claude/Codex/Cursor/Gemini/OpenCode 等宿主的 plugin、Skill 或规则加载配置。 原因：宿主配置会改变 AI 后续工作方式，可能和用户已有规则冲突。 证据：`.agents/skills/adding-ingestion-warnings/SKILL.md`, `.agents/skills/adding-personhog-rpc/SKILL.md`, `.agents/skills/adding-project-secret-api-key-auth/SKILL.md`, `.agents/skills/adopting-generated-api-types/SKILL.md` 等
- **本地环境或项目文件**：安装结果、插件缓存、项目配置或本地依赖目录。 原因：安装前无法证明写入范围和回滚方式，需要隔离验证。 证据：`nodejs/src/cdp/legacy-plugins/_destinations/customerio/plugin.json`, `nodejs/src/cdp/legacy-plugins/_destinations/hubspot/plugin.json`, `nodejs/src/cdp/legacy-plugins/_destinations/intercom/plugin.json`, `nodejs/src/cdp/legacy-plugins/_destinations/pace-posthog-integration/plugin.json` 等
- **宿主 AI 上下文**：AI Context Pack、Prompt Preview、Skill 路由、风险规则和项目事实。 原因：导入上下文会影响宿主 AI 后续判断，必须避免把未验证项包装成事实。

### 最小安全下一步

- **先跑 Prompt Preview**：用安装前交互式试用判断工作方式是否匹配，不需要授权或改环境。（适用：任何项目都适用，尤其是输出质量未知时。）
- **只在隔离目录或测试账号试装**：避免安装命令污染主力宿主 AI、真实项目或用户主目录。（适用：存在命令执行、插件配置或本地写入线索时。）
- **先备份宿主 AI 配置**：Skill、plugin、规则文件可能改变 Claude/Cursor/Codex 的默认行为。（适用：存在插件 manifest、Skill 或宿主规则入口时。）
- **安装后只验证一个最小任务**：先验证加载、兼容、输出质量和回滚，再决定是否深用。（适用：准备从试用进入真实工作流时。）

### 退出方式

- **保留安装前状态**：记录原始宿主配置和项目状态，后续才能判断是否可恢复。
- **准备移除宿主 plugin / Skill / 规则入口**：如果试装后行为异常，可以把宿主 AI 恢复到试装前状态。
- **记录安装命令和写入路径**：没有明确卸载说明时，至少要知道哪些目录或配置需要手动清理。
- **如果没有回滚路径，不进入主力环境**：不可回滚是继续前阻断项，不应靠信任或运气继续。

## 哪些只能预览

- 解释项目适合谁和能做什么
- 基于项目文档演示典型对话流程
- 帮助用户判断是否值得安装或继续研究

## 哪些必须安装后验证

- 真实安装 Skill、插件或 CLI
- 执行脚本、修改本地文件或访问外部服务
- 验证真实输出质量、性能和兼容性

## 边界与风险判断卡

- **把安装前预览误认为真实运行**：用户可能高估项目已经完成的配置、权限和兼容性验证。 处理方式：明确区分 prompt_preview_can_do 与 runtime_required。 Claim：`clm_0008` inferred 0.45
- **宿主 AI 插件或 Skill 规则冲突**：新规则可能改变用户现有宿主 AI 的工作方式。 处理方式：安装前先检查插件 manifest 和 Skill 文件，必要时隔离测试。 证据：`nodejs/src/cdp/legacy-plugins/_destinations/customerio/plugin.json`, `nodejs/src/cdp/legacy-plugins/_destinations/hubspot/plugin.json`, `nodejs/src/cdp/legacy-plugins/_destinations/intercom/plugin.json`, `nodejs/src/cdp/legacy-plugins/_destinations/pace-posthog-integration/plugin.json` 等 Claim：`clm_0009` inferred 0.45
- **命令执行会修改本地环境**：安装命令可能写入用户主目录、宿主插件目录或项目配置。 处理方式：先在隔离环境或测试账号中运行。 证据：`packages/quill/README.md`, `packages/quill/packages/quill/README.md` Claim：`clm_0010` supported 0.86
- **待确认**：真实安装后是否与用户当前宿主 AI 版本兼容？。原因：兼容性只能通过实际宿主环境验证。
- **待确认**：项目输出质量是否满足用户具体任务？。原因：安装前预览只能展示流程和边界，不能替代真实评测。
- **待确认**：安装命令是否需要网络、权限或全局写入？。原因：这影响企业环境和个人环境的安装风险。

## 开工前工作上下文

### 加载顺序

- 先读取 how_to_use.host_ai_instruction，建立安装前判断资产的边界。
- 读取 claim_graph_summary，确认事实来自 Claim/Evidence Graph，而不是 Human Wiki 叙事。
- 再读取 intended_users、capabilities 和 quick_start_candidates，判断用户是否匹配。
- 需要执行具体任务时，优先查 role_skill_index，再查 evidence_index。
- 遇到真实安装、文件修改、网络访问、性能或兼容性问题时，转入 risk_card 和 boundaries.runtime_required。

### 任务路由

- **AI Skill / Agent 指令资产库**：先基于 role_skill_index / evidence_index 帮用户挑选可用角色、Skill 或工作流。 边界：可做安装前 Prompt 体验。 证据：`.agents/skills/adding-ingestion-warnings/SKILL.md`, `.agents/skills/adding-personhog-rpc/SKILL.md`, `.agents/skills/adding-project-secret-api-key-auth/SKILL.md`, `.agents/skills/adopting-generated-api-types/SKILL.md` 等 Claim：`clm_0001` supported 0.86
- **多宿主安装与分发**：先说明这是安装后验证能力，再给出安装前检查清单。 边界：必须真实安装或运行后验证。 证据：`nodejs/src/cdp/legacy-plugins/_destinations/customerio/plugin.json`, `nodejs/src/cdp/legacy-plugins/_destinations/hubspot/plugin.json`, `nodejs/src/cdp/legacy-plugins/_destinations/intercom/plugin.json`, `nodejs/src/cdp/legacy-plugins/_destinations/pace-posthog-integration/plugin.json` 等
- **命令行启动或安装流程**：先说明这是安装后验证能力，再给出安装前检查清单。 边界：必须真实安装或运行后验证。 证据：`packages/quill/README.md`, `packages/quill/packages/quill/README.md` Claim：`clm_0003` supported 0.86

### 上下文规模

- 文件总数：28195
- 重要文件覆盖：40/28195
- 证据索引条目：180
- 角色 / Skill 条目：191

### 证据不足时的处理

- **missing_evidence**：说明证据不足，要求用户提供目标文件、README 段落或安装后验证记录；不要补全事实。
- **out_of_scope_request**：说明该任务超出当前 AI Context Pack 证据范围，并建议用户先查看 Human Manual 或真实安装后验证。
- **runtime_request**：给出安装前检查清单和命令来源，但不要替用户执行命令或声称已执行。
- **source_conflict**：同时展示冲突来源，标记为待核实，不要强行选择一个版本。

## Prompt Recipes

### 适配判断

- 目标：判断这个项目是否适合用户当前任务。
- 预期输出：适配结论、关键理由、证据引用、安装前可预览内容、必须安装后验证内容、下一步建议。

```text
请基于 posthog-foss 的 AI Context Pack，先问我 3 个必要问题，然后判断它是否适合我的任务。回答必须包含：适合谁、能做什么、不能做什么、是否值得安装、证据来自哪里。所有项目事实必须引用 evidence_refs、source_paths 或 claim_id。
```

### 安装前体验

- 目标：让用户在安装前感受核心工作流，同时避免把预览包装成真实能力或营销承诺。
- 预期输出：一段带边界标签的体验剧本、安装后验证清单和谨慎建议；不含真实运行承诺或强营销表述。

```text
请把 posthog-foss 当作安装前体验资产，而不是已安装工具或真实运行环境。

请严格输出四段：
1. 先问我 3 个必要问题。
2. 给出一段“体验剧本”：用 [安装前可预览]、[必须安装后验证]、[证据不足] 三种标签展示它可能如何引导工作流。
3. 给出安装后验证清单：列出哪些能力只有真实安装、真实宿主加载、真实项目运行后才能确认。
4. 给出谨慎建议：只能说“值得继续研究/试装”“先补充信息后再判断”或“不建议继续”，不得替项目背书。

硬性边界：
- 不要声称已经安装、运行、执行测试、修改文件或产生真实结果。
- 不要写“自动适配”“确保通过”“完美适配”“强烈建议安装”等承诺性表达。
- 如果描述安装后的工作方式，必须使用“如果安装成功且宿主正确加载 Skill，它可能会……”这种条件句。
- 体验剧本只能写成“示例台词/假设流程”：使用“可能会询问/可能会建议/可能会展示”，不要写“已写入、已生成、已通过、正在运行、正在生成”。
- Prompt Preview 不负责给安装命令；如用户准备试装，只能提示先阅读 Quick Start 和 Risk Card，并在隔离环境验证。
- 所有项目事实必须来自 supported claim、evidence_refs 或 source_paths；inferred/unverified 只能作风险或待确认项。

```

### 角色 / Skill 选择

- 目标：从项目里的角色或 Skill 中挑选最匹配的资产。
- 预期输出：候选角色或 Skill 列表，每项包含适用场景、证据路径、风险边界和是否需要安装后验证。

```text
请读取 role_skill_index，根据我的目标任务推荐 3-5 个最相关的角色或 Skill。每个推荐都要说明适用场景、可能输出、风险边界和 evidence_refs。
```

### 风险预检

- 目标：安装或引入前识别环境、权限、规则冲突和质量风险。
- 预期输出：环境、权限、依赖、许可、宿主冲突、质量风险和未知项的检查清单。

```text
请基于 risk_card、boundaries 和 quick_start_candidates，给我一份安装前风险预检清单。不要替我执行命令，只说明我应该检查什么、为什么检查、失败会有什么影响。
```

### 宿主 AI 开工指令

- 目标：把项目上下文转成一次对话开始前的宿主 AI 指令。
- 预期输出：一段边界明确、证据引用明确、适合复制给宿主 AI 的开工前指令。

```text
请基于 posthog-foss 的 AI Context Pack，生成一段我可以粘贴给宿主 AI 的开工前指令。这段指令必须遵守 not_runtime=true，不能声称项目已经安装、运行或产生真实结果。
```

## 角色 / Skill 索引

- 共索引 191 个角色 / Skill / 项目文档条目。

- **adding-ingestion-warnings**（skill）： 激活提示：当用户任务与“adding-ingestion-warnings”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.agents/skills/adding-ingestion-warnings/SKILL.md`
- **adding-personhog-rpc**（skill）： 激活提示：当用户任务与“adding-personhog-rpc”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.agents/skills/adding-personhog-rpc/SKILL.md`
- **adding-project-secret-api-key-auth**（skill）：How to gate a PostHog API endpoint with project secret API key PSAK auth — a project-scoped, user-less service credential. Use when adding PSAK support to a viewset action, allowing a new scope for PSAKs, handling synthetic users ProjectSecretAPIKeyUser , or choosing PSAK-aware rate throttles. Trigger terms: PSAK, ProjectSecretAPIKey, project secret API key, phs token, service auth, programmatic endpoint auth. 激活提示：当用户任务与“adding-project-secret-api-key-auth”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.agents/skills/adding-project-secret-api-key-auth/SKILL.md`
- **adopting-generated-api-types**（skill）：Use when migrating frontend code from manual API client calls api.get , api.create , api.surveys.get , api.dashboards.list , new ApiRequest and handwritten TypeScript interfaces to generated API functions and types. Triggers on files importing from lib/api , files with api.get . , manual interface definitions that duplicate backend serializers, or any frontend file that constructs API URLs by hand. Covers the full r… 激活提示：当用户任务与“adopting-generated-api-types”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.agents/skills/adopting-generated-api-types/SKILL.md`
- **clickhouse-migrations**（skill）：ClickHouse migration patterns and rules. Use when creating or modifying ClickHouse migrations. 激活提示：当用户任务与“clickhouse-migrations”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.agents/skills/clickhouse-migrations/SKILL.md`
- **debugging-ci-failures**（skill）： 激活提示：当用户任务与“debugging-ci-failures”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.agents/skills/debugging-ci-failures/SKILL.md`
- **debugging-local-task-agent-runs**（skill）：Debug the output of local PostHog task runs — the wizard cloud-run path that executes inside a Docker sandbox under the local Temporal process-task workflow the wizard that integrates PostHog, then the coding agent that commits and opens the PR . Use when a local run looks stuck, failed, or silent, or when you need to read the wizard or agent logs. Covers the .env.local keys + ai features intent required for cloud r… 激活提示：当用户任务与“debugging-local-task-agent-runs”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.agents/skills/debugging-local-task-agent-runs/SKILL.md`
- **depot-container-builds**（skill）： 激活提示：当用户任务与“depot-container-builds”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.agents/skills/depot-container-builds/SKILL.md`
- **depot-github-runners**（skill）： 激活提示：当用户任务与“depot-github-runners”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.agents/skills/depot-github-runners/SKILL.md`
- **django-migrations**（skill）：Django migration patterns and safety workflow for PostHog. Use when creating, adjusting, or reviewing Django/Postgres migrations, including non-blocking index/constraint changes, multi-phase schema changes, data backfills, migration conflict rebasing, and product model moves that require SeparateDatabaseAndState. Also use for any deletion or removal of a model, table, column, product, or app — including deleting mig… 激活提示：当用户任务与“django-migrations”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.agents/skills/django-migrations/SKILL.md`
- **django-startup-time**（skill）： 激活提示：当用户任务与“django-startup-time”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.agents/skills/django-startup-time/SKILL.md`
- **documenting-warehouse-sources**（skill）：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 and components, frontmatter, and the docsUrl/slug rule that prevents 404s. 激活提示：当用户任务与“documenting-warehouse-sources”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.agents/skills/documenting-warehouse-sources/SKILL.md`
- **establishing-code-ownership**（skill）：Determine which PostHog team owns a file, directory, or code path, or enumerate all code a team owns via products/ /product.yaml and .github/CODEOWNERS -soft ? . Use when assigning a reviewer, attributing a bug or slow query to a team, routing work, scoping a team-wide audit, or answering "who owns X" / "what does team Y own". 激活提示：当用户任务与“establishing-code-ownership”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.agents/skills/establishing-code-ownership/SKILL.md`
- **fixing-flaky-tests**（skill）： 激活提示：当用户任务与“fixing-flaky-tests”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.agents/skills/fixing-flaky-tests/SKILL.md`
- **gating-production-deploys**（skill）： 激活提示：当用户任务与“gating-production-deploys”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.agents/skills/gating-production-deploys/SKILL.md`
- **generating-clickhouse-query-performance-reports**（skill）： 激活提示：当用户任务与“generating-clickhouse-query-performance-reports”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.agents/skills/generating-clickhouse-query-performance-reports/SKILL.md`
- **hogli**（skill）： 激活提示：当用户任务与“hogli”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.agents/skills/hogli/SKILL.md`
- **implementing-agent-modes**（skill）：Guidelines to create/update a new mode for PostHog AI agent. Modes are a way to limit what tools, prompts, and prompt injections are applied and under what conditions. Achieve better results using your plan mode. 激活提示：当用户任务与“implementing-agent-modes”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.agents/skills/implementing-agent-modes/SKILL.md`
- **implementing-mcp-tools**（skill）：Guide for exposing PostHog product endpoints as MCP tools. Use when creating new or updating API endpoints, adding MCP tool definitions, scaffolding YAML configs, or writing serializers with good descriptions. Covers the full pipeline from Django serializer to generated TypeScript tool handler. 激活提示：当用户任务与“implementing-mcp-tools”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.agents/skills/implementing-mcp-tools/SKILL.md`
- **implementing-mcp-ui-apps**（skill）：Guide for adding MCP UI apps — interactive visualizations that render tool results in MCP clients like Claude Desktop. Use when adding a new detail or list view for an MCP tool, creating view components in products/ /mcp/apps/, or linking tools to UI apps via YAML. 激活提示：当用户任务与“implementing-mcp-ui-apps”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.agents/skills/implementing-mcp-ui-apps/SKILL.md`
- **implementing-warehouse-sources**（skill）：Implement and extend PostHog Data warehouse import sources. Use when adding a new source under products/warehouse sources/backend/temporal/data imports/sources, adding datasets/endpoints to an existing source, or adding incremental sync, resumable imports, webhook ingestion, pagination, credentials validation, and source tests. 激活提示：当用户任务与“implementing-warehouse-sources”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.agents/skills/implementing-warehouse-sources/SKILL.md`
- **improving-drf-endpoints**（skill）：Use when editing, reviewing, or auditing DRF viewsets and serializers in PostHog. Triggers on files in posthog/api/, products/ /backend/api/, products/ /backend/presentation/, or any file importing rest framework. Covers field typing, schema annotations, enum collision fixes, and OpenAPI spec quality — everything that flows downstream into generated TypeScript types and MCP tools. 激活提示：当用户任务与“improving-drf-endpoints”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.agents/skills/improving-drf-endpoints/SKILL.md`
- **ingestion-pipeline-doctor-nodejs**（skill）： 激活提示：当用户任务与“ingestion-pipeline-doctor-nodejs”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.agents/skills/ingestion-pipeline-doctor-nodejs/SKILL.md`
- **isolating-product-facade-contracts**（skill）：Plan and execute product isolation migrations to a facade plus contract layer in PostHog, following the Visual review architecture. Use when a product still exposes internals models/logic/views across boundaries and needs migration toward contracts.py + facade/api.py + presentation separation, with a PR strategy that minimizes review latency and conflicts with parallel work. 激活提示：当用户任务与“isolating-product-facade-contracts”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.agents/skills/isolating-product-facade-contracts/SKILL.md`
- **manage-dashboard-widgets**（skill）： 激活提示：当用户任务与“manage-dashboard-widgets”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.agents/skills/manage-dashboard-widgets/SKILL.md`
- **managing-github-actions-secrets**（skill）： 激活提示：当用户任务与“managing-github-actions-secrets”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.agents/skills/managing-github-actions-secrets/SKILL.md`
- **modifying-taxonomic-filter**（skill）：Guides safe modification of the TaxonomicFilter — PostHog's multi-tab picker for events, actions, properties, cohorts, and more. Front-loads the empirical product reality what users actually pick and search for plus the three live variants legacy-control, legacy-pill behind TAXONOMIC FILTER CATEGORY DROPDOWN, and the opt-in rebuild menu behind TAXONOMIC FILTER MENU REBUILD so changes are judged against real behavior… 激活提示：当用户任务与“modifying-taxonomic-filter”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.agents/skills/modifying-taxonomic-filter/SKILL.md`
- **monitoring-capture-service**（skill）： 激活提示：当用户任务与“monitoring-capture-service”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.agents/skills/monitoring-capture-service/SKILL.md`
- **monitoring-ingestion-pipeline**（skill）： 激活提示：当用户任务与“monitoring-ingestion-pipeline”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.agents/skills/monitoring-ingestion-pipeline/SKILL.md`
- **optimizing-clickhouse-and-hogql-queries**（skill）：Workflow for optimizing ClickHouse and HogQL queries. Use when a HogQL query, query runner, insight, or report is too slow; when a hand-written ClickHouse query via sync execute or in a migration is too slow; when ClickHouse times out or hits memory limits; when investigating a slow system.query log row; or when reviewing a proposed HogQL printer change for performance. Covers extracting the ClickHouse SQL, common s… 激活提示：当用户任务与“optimizing-clickhouse-and-hogql-queries”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.agents/skills/optimizing-clickhouse-and-hogql-queries/SKILL.md`
- **playwright-test**（skill）：Write a playwright test, make sure it runs, and is not flaky. 激活提示：当用户任务与“playwright-test”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.agents/skills/playwright-test/SKILL.md`
- **qa-team**（skill）： 激活提示：当用户任务与“qa-team”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.agents/skills/qa-team/SKILL.md`
- **query-clickhouse-via-metabase**（skill）： 激活提示：当用户任务与“query-clickhouse-via-metabase”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.agents/skills/query-clickhouse-via-metabase/SKILL.md`
- **querying-tophog**（skill）： 激活提示：当用户任务与“querying-tophog”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.agents/skills/querying-tophog/SKILL.md`
- **react-doctor**（skill）：Diagnose and fix React codebase health issues. Use when reviewing React code, fixing performance problems, auditing security, or improving code quality. 激活提示：当用户任务与“react-doctor”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.agents/skills/react-doctor/SKILL.md`
- **run-posthog**（skill）：Start, inspect, and drive the PostHog dev stack. Use for /run and /verify on this repo — when asked to launch PostHog, check whether the stack is healthy, inspect a running process, or verify a UI change against the live app. 激活提示：当用户任务与“run-posthog”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.agents/skills/run-posthog/SKILL.md`
- **running-ci-preflight**（skill）： 激活提示：当用户任务与“running-ci-preflight”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.agents/skills/running-ci-preflight/SKILL.md`
- **scene-menu-bar**（skill）：Conventions for adding or editing the SceneMenuBar above a scene's . Use when adding new menu items, moving items between menus, gating behind feature flags, building a new scene's menubar, or wiring rich inputs tags, combobox into the bar. 激活提示：当用户任务与“scene-menu-bar”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.agents/skills/scene-menu-bar/SKILL.md`
- **security-audit**（skill）： 激活提示：当用户任务与“security-audit”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.agents/skills/security-audit/SKILL.md`
- **sending-notifications**（skill）：How to send real-time in-app notifications from PostHog backend code. Use when integrating notifications into a new feature, wiring up a notification source alerts, comments, approvals, pipelines, issues , or choosing the right target type and priority for a notification. 激活提示：当用户任务与“sending-notifications”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.agents/skills/sending-notifications/SKILL.md`
- **setting-feature-flags-in-storybook**（skill）：Use when writing a Storybook story for a component gated on a feature flag — boolean flags or multivariate/experiment-arm variants. Covers the featureFlags story parameter and why imperatively setting flags renders the flag-off branch in visual-regression snapshots while passing in jest. 激活提示：当用户任务与“setting-feature-flags-in-storybook”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.agents/skills/setting-feature-flags-in-storybook/SKILL.md`
- **setting-up-devbox**（skill）：Guide a PostHog engineer through spinning up, connecting to, running commands on, and mirroring local code to a remote devbox a Coder workspace running the full PostHog stack . Use when asked to set up a devbox, start or connect to a devbox, configure remote dev, get gh CLI / Claude Code authed on a devbox, run a command on a devbox, sync a local checkout so you can edit locally while the stack runs remotely devbox:… 激活提示：当用户任务与“setting-up-devbox”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.agents/skills/setting-up-devbox/SKILL.md`
- **setup-web-tests**（skill）：Set up Python test environment in Claude Code for web where flox is unavailable. Use when you need to run backend tests and uv sync fails due to Python version mismatch. 激活提示：当用户任务与“setup-web-tests”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.agents/skills/setup-web-tests/SKILL.md`
- **survey-sdk-audit**（skill）：Audit PostHog survey SDK features and version requirements 激活提示：当用户任务与“survey-sdk-audit”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.agents/skills/survey-sdk-audit/SKILL.md`
- **using-kea-disposables**（skill）：Use when adding timers setInterval , setTimeout , event listeners window.addEventListener , document.addEventListener , MediaQueryList.addEventListener , or any other resource that needs cleanup inside a kea logic. Every logic has cache.disposables.add setup, key?, options? and cache.disposables.dispose key available via the globally registered disposablesPlugin frontend/src/kea-disposables.ts . Replaces the bare ca… 激活提示：当用户任务与“using-kea-disposables”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.agents/skills/using-kea-disposables/SKILL.md`
- **visualizing-change-over-time**（skill）： 激活提示：当用户任务与“visualizing-change-over-time”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.agents/skills/visualizing-change-over-time/SKILL.md`
- **writing-clickhouse-queries**（skill）：Guide for writing performant ClickHouse queries in PostHog product code. Use when writing HogQL query runners, designing a ClickHouse table for a new product, adding materialized columns or skip indexes, or choosing a row ID format. For optimizing an existing query that is already too slow, use /optimizing-clickhouse-and-hogql-queries instead. 激活提示：当用户任务与“writing-clickhouse-queries”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.agents/skills/writing-clickhouse-queries/SKILL.md`
- **writing-kea-logics**（skill）：Guide for writing or reviewing PostHog kea logic files Logic.ts / Logic.tsx . Use when creating a new logic, adding actions/reducers/selectors/listeners/loaders/forms/router bindings, choosing between reducer vs selector vs cache, deciding between listeners and kea-subscriptions , wiring React with useValues / useActions / BindLogic , or onboarding to kea conventions. Read keajs.org for upstream API; this skill capt… 激活提示：当用户任务与“writing-kea-logics”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.agents/skills/writing-kea-logics/SKILL.md`
- **writing-skills**（skill）：Guide for writing PostHog agent skills — job-to-be-done templates that teach agents how to use MCP tools to achieve a goal. Use when adding new product functionality that agents should know how to work with, creating a new skill, or updating existing skills in products/ /skills/. 激活提示：当用户任务与“writing-skills”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.agents/skills/writing-skills/SKILL.md`
- **writing-tests**（skill）： 激活提示：当用户任务与“writing-tests”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.agents/skills/writing-tests/SKILL.md`
- **auditing-the-fleet**（skill）：The fleet-wide audit — sweep every agent, mine recent sessions for failures/anomalies, classify root causes, and branch a DRAFT proposal per fix never freeze/promote ; write a report to memory. Load when asked to audit all agents or what's underperforming. 激活提示：当用户任务与“auditing-the-fleet”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`products/agent_platform/backend/kernel_skills/auditing-the-fleet/SKILL.md`
- **safety-and-boundaries**（skill）：Hard rules — what the Agent Builder MUST NOT do regardless of user request. Load IMMEDIATELY if a request feels like it crosses into raw-secret handling, unprompted promotion, irreversible deletion, or impersonation of another user. 激活提示：当用户任务与“safety-and-boundaries”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`products/agent_platform/backend/kernel_skills/safety-and-boundaries/SKILL.md`
- **using-the-console-ui**（skill）：How to drive PostHog Code's read panel as the user works with you — focus etiquette, when to call toast, how to handle 'follow mode' being off. Load when the session client kind is posthog-code . 激活提示：当用户任务与“using-the-console-ui”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`products/agent_platform/backend/kernel_skills/using-the-console-ui/SKILL.md`
- **working-outside-the-console**（skill）：Operating without a UI — MCP / IDE / Slack mode. How to compensate for missing client tools, how to be useful in a text-only chat. Load when the session client kind is NOT posthog-code . 激活提示：当用户任务与“working-outside-the-console”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`products/agent_platform/backend/kernel_skills/working-outside-the-console/SKILL.md`
- **Proposing changes through an approval gate**（skill）：Proposing changes through an approval gate 激活提示：当用户任务与“Proposing changes through an approval gate”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`products/agent_platform/services/agent-tests/src/examples/agent-approval-demo/skills/proposing-changes/SKILL.md`
- **Capturing a kudos**（skill）：How to read a kudos out of a message — pull the recipient handle s , the praise, and themes; decide when to ask ONE clarifying question vs record straight away. Load at the start of every capture. 激活提示：当用户任务与“Capturing a kudos”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`products/agent_platform/services/agent-tests/src/examples/kudos-bot/skills/capturing-kudos/SKILL.md`
- **Kudos storage**（skill）：The data model — the kudos table columns, the kudos id dedupe/idempotency scheme, and the per-recipient people/ .md profile memory. Load before any table-append or memory-write. 激活提示：当用户任务与“Kudos storage”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`products/agent_platform/services/agent-tests/src/examples/kudos-bot/skills/kudos-storage/SKILL.md`
- **Weekly kudos summary**（skill）：The Monday digest — how to query last week's kudos, group by recipient, format the celebratory mrkdwn post, and what to do on a quiet week. Load when the weekly cron fires or someone asks for a summary. 激活提示：当用户任务与“Weekly kudos summary”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`products/agent_platform/services/agent-tests/src/examples/kudos-bot/skills/weekly-summary/SKILL.md`
- **incident-io-playbook**（skill）：How to work incident.io through its connected MCP — list active incidents, fetch context for an incoming webhook, post triage updates, and rare open a new incident. Load when an incident.io webhook fires the agent, when an alert correlates to an active incident, or when recording a resolved outcome. 激活提示：当用户任务与“incident-io-playbook”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`products/agent_platform/services/agent-tests/src/examples/sre-slack-bot/skills/incident-io-playbook/SKILL.md`
- **Runbook memory — read, curate, propose**（skill）：Runbook memory — read, curate, propose 激活提示：当用户任务与“Runbook memory — read, curate, propose”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`products/agent_platform/services/agent-tests/src/examples/sre-slack-bot/skills/runbook-memory/SKILL.md`
- **slack-thread-protocol**（skill）：Conventions for replying in Slack — TL;DR first, evidence next, who to tag, when to start a new top-level message. Load before posting any reply. 激活提示：当用户任务与“slack-thread-protocol”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`products/agent_platform/services/agent-tests/src/examples/sre-slack-bot/skills/slack-thread-protocol/SKILL.md`
- **triage-playbook**（skill）：Structured triage flow — phases for context gathering, hypothesis, and reporting. Load when starting an investigation. 激活提示：当用户任务与“triage-playbook”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`products/agent_platform/services/agent-tests/src/examples/sre-slack-bot/skills/triage-playbook/SKILL.md`
- **Briefing template**（skill）： 激活提示：当用户任务与“Briefing template”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`products/agent_platform/services/agent-tests/src/examples/wake-me-up/skills/briefing-template/SKILL.md`
- **Carry-over**（skill）： 激活提示：当用户任务与“Carry-over”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`products/agent_platform/services/agent-tests/src/examples/wake-me-up/skills/carry-over/SKILL.md`
- **Slack post format**（skill）： 激活提示：当用户任务与“Slack post format”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`products/agent_platform/services/agent-tests/src/examples/wake-me-up/skills/slack-post-format/SKILL.md`
- **analyzing-expensive-users**（skill）： 激活提示：当用户任务与“analyzing-expensive-users”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`products/ai_observability/skills/analyzing-expensive-users/SKILL.md`
- **creating-online-evaluations**（skill）： 激活提示：当用户任务与“creating-online-evaluations”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`products/ai_observability/skills/creating-online-evaluations/SKILL.md`
- **exploring-ai-failures**（skill）： 激活提示：当用户任务与“exploring-ai-failures”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`products/ai_observability/skills/exploring-ai-failures/SKILL.md`
- **exploring-llm-clusters**（skill）：Investigate AI observability clusters — understand usage patterns in AI/LLM traffic, compare cluster behavior, compute cost/latency metrics, and drill into individual traces within clusters. 激活提示：当用户任务与“exploring-llm-clusters”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`products/ai_observability/skills/exploring-llm-clusters/SKILL.md`
- **exploring-llm-costs**（skill）： 激活提示：当用户任务与“exploring-llm-costs”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`products/ai_observability/skills/exploring-llm-costs/SKILL.md`
- **exploring-llm-evaluations**（skill）： 激活提示：当用户任务与“exploring-llm-evaluations”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`products/ai_observability/skills/exploring-llm-evaluations/SKILL.md`
- **exploring-llm-traces**（skill）： 激活提示：当用户任务与“exploring-llm-traces”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`products/ai_observability/skills/exploring-llm-traces/SKILL.md`
- **feature-usage-feed**（skill）： 激活提示：当用户任务与“feature-usage-feed”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`products/ai_observability/skills/feature-usage-feed/SKILL.md`
- **downloading-batch-export-files**（skill）： 激活提示：当用户任务与“downloading-batch-export-files”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`products/batch_exports/skills/downloading-batch-export-files/SKILL.md`
- **auditing-warehouse-view-health**（skill）： 激活提示：当用户任务与“auditing-warehouse-view-health”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`products/data_warehouse/skills/auditing-warehouse-view-health/SKILL.md`
- **auditing-endpoints**（skill）： 激活提示：当用户任务与“auditing-endpoints”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`products/endpoints/skills/auditing-endpoints/SKILL.md`
- **consuming-endpoints-from-client-code**（skill）： 激活提示：当用户任务与“consuming-endpoints-from-client-code”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`products/endpoints/skills/consuming-endpoints-from-client-code/SKILL.md`
- **creating-an-endpoint**（skill）： 激活提示：当用户任务与“creating-an-endpoint”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`products/endpoints/skills/creating-an-endpoint/SKILL.md`
- **diagnosing-endpoint-performance**（skill）： 激活提示：当用户任务与“diagnosing-endpoint-performance”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`products/endpoints/skills/diagnosing-endpoint-performance/SKILL.md`
- **exploring-endpoint-execution-logs**（skill）： 激活提示：当用户任务与“exploring-endpoint-execution-logs”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`products/endpoints/skills/exploring-endpoint-execution-logs/SKILL.md`
- 其余 111 个条目见 `AI_CONTEXT_PACK.json`。

## 证据索引

- 共索引 180 条证据。

- **PostHog Documentation**（documentation）：Developer-focused documentation alongside code. Update docs in the same PR as your code changes. 证据：`docs/README.md`
- **Dashboard scene troubleshooting**（documentation）：Symptom-driven notes for the dashboard scene frontend/src/scenes/dashboard/ . 证据：`frontend/src/scenes/dashboard/docs/troubleshooting/README.md`
- **Agent platform docs**（documentation）：Concise, diagram-led docs for the v2 agent platform. Want the 30-second map? Start with overview.md overview.md — one diagram of the whole platform. Want the whole picture on one page? Read full-overview.md full-overview.md — an annotated single-page tour of both planes, the request lifecycle, identity, and tool dispatch. Then read the targeted docs in this order: 证据：`products/agent_platform/docs/README.md`
- **.pi/ — pi coding agent config**（documentation）：Project-local config for the pi coding agent https://github.com/badlogic/pi-mono/tree/main/packages/coding-agent . Anything here is auto-loaded when a PostHog dev runs pi from the repo root. 证据：`.pi/README.md`
- **.stamphog**（documentation）：Declarative policy for the stamphog PR-approval merge gate tools/pr-approval-agent/ . The engine loads these files from the checked-out working tree at run time. Engine and policy are vendored into other repos see the note in tools/pr-approval-agent/README.md , so format changes here need those copies re-synced too. 证据：`.stamphog/README.md`
- **PostHog Development Guide**（documentation）：- Key entry points: posthog/api/ init .py API URL routing skeleton; products register their own routes in products/ /backend/routes.py via register routes routers , posthog/settings/web.py Django settings, INSTALLED APPS , products/ product apps - Monorepo layout docs/internal/monorepo-layout.md - high-level directory structure products, services, common, tools - Products README products/README.md - how to create and structure products - Products architecture products/architecture.md - DTOs, facades, isolated testing 证据：`AGENTS.md`
- **PostHog is an all-in-one, open source platform for building successful products**（documentation）：Docs - Community - Roadmap - Why PostHog? - Changelog - Bug reports 证据：`README.md`
- **The Posthog CLI**（documentation）：bash posthog-cli --help The command line interface for PostHog 🦔 证据：`cli/README.md`
- **common/ — read before adding code here**（documentation）：common/ — read before adding code here 证据：`common/AGENTS.md`
- **Common**（documentation）：Shared libraries, tools, and utilities that predate a better home. 证据：`common/README.md`
- **Developer Environment**（documentation）：Configuration for the local developer environment, driving hogli dev:setup and the phrocs-based process manager. 证据：`devenv/README.md`
- **Funnel UDFs**（documentation）：- Building the binaries: - Exit flox: exit - Switch to the subfolder: cd funnel-udf - Execute the build script: ./build.sh - Restart the clickhouse docker container 证据：`funnel-udf/README.md`
- **RealTime Hog 3000**（documentation）：Hog 3000 powers live event stream on PostHog: https://us.posthog.com/project/0/activity/live 证据：`livestream/README.md`
- **PostHog Node.js services**（documentation）：Node.js services for PostHog: ingestion pipeline, CDP, session recording, and more. 证据：`nodejs/README.md`
- **Products**（documentation）：Each product in PostHog is a vertical slice : it contains its backend Django app , frontend React/TypeScript , and optionally shared code. This structure ensures product features are self-contained and can evolve independently. 证据：`products/README.md`
- **Proto definitions**（documentation）：When you add or modify an RPC or message type in personhog/ protos, you must update all downstream consumers before considering the change complete: 证据：`proto/AGENTS.md`
- **Proto Definitions**（documentation）：Language-agnostic protobuf definitions for PostHog services. 证据：`proto/README.md`
- **Rust crates**（documentation）：When emitting metrics via the metrics crate histogram! , counter! , gauge! , dynamic label values method names, client names, etc. must use Arc , never String or .to string . 证据：`rust/AGENTS.md`
- **PostHog Rust Workspace**（documentation）：The posthog/rust directory serves as PostHog's "Rust monorepo" hosting Rust libraries and service implementations. This is not the Rust client library for PostHog. 证据：`rust/README.md`
- **Services**（documentation）：Independently deployed services with their own domain logic. 证据：`services/README.md`
- **Share folder**（documentation）：Put here any resources that should be shared across all projects events, web, worker, plugins, etc. . Most likely this will be things like small static databases or other resources. 证据：`share/README.md`
- **Devex semgrep rules**（documentation）：Devex / hygiene rules for the PostHog codebase. Run by the semgrep-devex job in ci-security.yaml in two passes: 证据：`.semgrep/rules/devex/README.md`
- **PostHog Hobby Installer**（documentation）：A TUI Terminal User Interface and CI-compatible installer for PostHog self-hosted hobby deployments. Built with Go using Bubbletea https://github.com/charmbracelet/bubbletea . 证据：`bin/hobby-installer/README.md`
- **Sampo**（documentation）：This directory stores pending release changesets for posthog-cli . 证据：`cli/.sampo/README.md`
- **HogQL Parser**（documentation）：ANTLR4-based parser for HogQL https://posthog.com/docs/hogql and Hog https://posthog.com/docs/hog , available as both a Python C++ extension and a WebAssembly module for JavaScript/TypeScript. 证据：`common/hogql_parser/README.md`
- **HogVM**（documentation）：A HogVM is a 🦔 that runs Hog bytecode. It's purpose is to locally evaluate Hog/QL expressions against any object. 证据：`common/hogvm/README.md`
- **Plugin Transpiler**（documentation）：This project transpiles frontend plugins and site apps. 证据：`common/plugin_transpiler/README.md`
- **Storybook**（documentation）：Tailwind is compiled by @tailwindcss/postcss on the initial build. Webpack's HMR does not re-run PostCSS when story content changes, so a newly used Tailwind utility e.g. bg- rebeccapurple won't appear until you restart Storybook. Classes already present in the codebase hot-reload fine. 证据：`common/storybook/.storybook/README.md`
- **Readme**（documentation）：Use docker.yaml file to override the default dynamic config value they are specified when creating the service config . 证据：`docker/temporal/dynamicconfig/README.md`
- **PostHog Lemon UI**（documentation）：! npm package https://img.shields.io/npm/v/@posthog/lemon-ui?style=flat-square https://www.npmjs.com/package/@posthog/lemon-ui ! MIT License https://img.shields.io/badge/License-MIT-red.svg?style=flat-square https://opensource.org/licenses/MIT 证据：`frontend/@posthog/lemon-ui/README.md`
- **Frontend agent guide frontend/src**（documentation）：Applies to any change under frontend/src . This is a discovery + cadence guide: the rules below exist because agents tend to generate before they look. The root AGENTS.md and the quill package guides remain authoritative — this file does not repeat them, it points at them. 证据：`frontend/src/AGENTS.md`
- **Scene chrome agent guide frontend/src/layout/scenes**（documentation）：Scene chrome agent guide frontend/src/layout/scenes 证据：`frontend/src/layout/scenes/AGENTS.md`
- **Domain Connect**（documentation）：Automates DNS configuration for PostHog features that require users to add DNS records email sending, managed reverse proxy . Instead of manually copy-pasting records at their DNS provider, users click a button and get redirected to approve pre-filled records. 证据：`frontend/src/lib/components/DomainConnect/README.md`
- **MarkdownNotebook**（documentation）：A notebook editor that uses markdown as its storage format. The document model is parsed from and serialized back to markdown on every edit, so the markdown string is always the source of truth. 证据：`frontend/src/lib/components/MarkdownNotebook/README.md`
- **Queries**（documentation）：- Query/ - Generic component that routes internally to the right node. - - QueryEditor/ - Generic JSON editor - - nodes/ - The folders in this directory EventsNode/ , DataTable/ , etc contain React components that display queries of that specific kind . - Basically everything in nodes/DataTable/ expects your query to be of kind DataTable . - The top level component, DataTable.tsx , always exports the component DataTable { query, setQuery } - There are various sub-components as needed, e.g. , . Some of them depend on a logic, likely dataNodeLogic , being in a BindLogic context, so read the source. - examples.ts - Various examples used in storybook - query.ts - make API calls to fetch data fo… 证据：`frontend/src/queries/README.md`
- **PostHog AI scene — agent guide**（documentation）：This is the scene for PostHog AI , PostHog's agent. It hosts two coexisting runtimes , chosen per conversation by conversation.agent runtime 'langgraph' 'sandbox' : 证据：`frontend/src/scenes/max/AGENTS.md`
- **Max Context**（documentation）：Scene logics can expose a maxContext selector to provide relevant context to MaxAI. 证据：`frontend/src/scenes/max/README.md`
- **Cyclotron Node**（documentation）：TypeScript job queue backed by PostgreSQL, using pg directly. 证据：`nodejs/src/cdp/services/cyclotron-v2/README.md`
- **Ingestion Outputs**（documentation）：Ingestion pipelines need to produce messages to Kafka — events, heatmaps, ingestion warnings, etc. Each of these destinations is an output . An output has one or more targets each a topic + producer pair , all configurable at deploy time without code changes. 证据：`nodejs/src/common/outputs/README.md`
- **Pipeline Doctor**（documentation）：Convention-checking agents for the PostHog ingestion pipeline. The agents use the doc-test chapters in framework/docs/ as their source of truth and review code for adherence to framework patterns. 证据：`nodejs/src/ingestion/doctor/README.md`
- **TopHog**（documentation）：TopHog is an in-process metric aggregation system that tracks the top contributors for named metrics across pipeline steps. It accumulates counts and timings keyed by arbitrary dimensions e.g. team id , keeps only the top N entries per metric, and periodically flushes results to Kafka. 证据：`nodejs/src/ingestion/framework/tophog/README.md`
- **Session Recording Ingestion**（documentation）：This module handles ingestion of session recording data, processing it, and storing it for later playback. 证据：`nodejs/src/ingestion/pipelines/sessionreplay/README.md`
- **Replay Vision ML Mirror Image Scrub Sidecar**（documentation）：Replay Vision ML Mirror Image Scrub Sidecar 证据：`nodejs/src/ingestion/pipelines/sessionreplay/ml-mirror-image-scrub-sidecar/README.md`
- **Recording API**（documentation）：This module provides the HTTP API for serving session recording playback data and handling recording deletions. 证据：`nodejs/src/session-replay/recording-api/README.md`
- **Session replay rasterizer**（documentation）：Temporal worker that converts session replays into MP4 videos using puppeteer-capture's HeadlessExperimental.beginFrame for deterministic virtual-time frame capture. Runs on a dedicated rasterization-task-queue . 证据：`nodejs/src/session-replay/recording-rasterizer/README.md`
- **Quill Primitives — Agent Guide**（documentation）：Quill is PostHog's design system built on React, TypeScript, Base UI, and Tailwind v4. It follows a layered architecture: tokens primitives components blocks . 证据：`packages/quill/AGENTS.md`
- **Quill — PostHog's unified design system**（documentation）：Quill — PostHog's unified design system 证据：`packages/quill/README.md`
- **Quill story screenshots**（documentation）：Visual regression baseline for the quill refactor Tailwind → CSS/BEM migration . 证据：`packages/quill/apps/storybook/__screenshots__/README.md`
- **Blocks — Agent Reference**（documentation）：@posthog/quill-blocks is the product-level patterns layer of quill tokens primitives components blocks . It is currently an empty placeholder — src/index.ts exports nothing so downstream export re-exports keep working while the layer is unimplemented. 证据：`packages/quill/packages/blocks/AGENTS.md`
- **Charts — Agent Reference**（documentation）：Quick-reference for AI agents using @posthog/quill-charts . Canvas-rendered charts, themed via quill design tokens. Ships no CSS — colors come from CSS variables at runtime. 证据：`packages/quill/packages/charts/AGENTS.md`
- **hog-charts**（documentation）：PostHog's canvas-based charting library, used for trends, dashboards, and any in-app chart that needs to render thousands of points smoothly. D3 powers the scales; the canvas does the drawing; React handles overlays. 证据：`packages/quill/packages/charts/src/README.md`
- **Components — Agent Reference**（documentation）：Quick-reference for AI agents using @posthog/quill-components — composed components built on quill primitives. For primitive-level guidance choosing a component, spacing, the render prop , read ../primitives/AGENTS.md first. 证据：`packages/quill/packages/components/AGENTS.md`
- **Primitives — Agent Reference**（documentation）：Quick-reference for AI agents using @posthog/quill-primitives . Show composition, not API docs. 证据：`packages/quill/packages/primitives/AGENTS.md`
- **@posthog/quill**（documentation）：PostHog's UI primitives, components, and design tokens, bundled as one publishable package. Built on base-ui https://base-ui.com/ , Tailwind v4 https://tailwindcss.com/ , and a shared token layer. 证据：`packages/quill/packages/quill/README.md`
- **Quill Tokens — Agent Guide**（documentation）：@posthog/quill-tokens is the source of truth for quill's design tokens. Tokens are authored in TypeScript under src/ and generated into CSS in dist/ . Never hand-edit dist/ .css — every file is stamped Auto-generated by @posthog/quill-tokens — do not edit manually . 证据：`packages/quill/packages/tokens/AGENTS.md`
- **GitHub integration setup**（documentation）：How the GitHub App integration works and what you need to configure to get it running — both the GitHub App side and your local env . This package posthog/api/github callback/ handles the install/OAuth callbacks that create the integration records. 证据：`posthog/api/github_callback/README.md`
- **OAuth API**（documentation）：2. Run migrations and start the server: 证据：`posthog/api/oauth/README.md`
- **CDP Hog Function Templates**（documentation）：Hog function templates are the main way that people will get started with the CDP V2. Templates are ephemeral configurations of HogFunctions. They are purposefully ephemeral for a few reasons: 证据：`posthog/cdp/templates/README.md`
- **Declarative ClickHouse schema HCL**（documentation）：Source of truth for satellite ClickHouse clusters, managed declaratively with hclexp ../../../../python-clickhouse-schema instead of hand-written migrations. Schemas are written in HCL, composed per node env, role , verified against captured cluster dumps, and used to generate the migration that applies a change. 证据：`posthog/clickhouse/hcl/README.md`
- **OPS HCL → migration codegen**（documentation）：Turns a declarative-HCL change into a ClickHouse migration the existing infi.clickhouse orm runner executes. The HCL is the source of truth for what the schema is; this produces the run sql with exceptions ... operations for applying it — with the cluster targeting derived from composition , not a side-table. 证据：`posthog/clickhouse/hcl/codegen/README.md`
- 其余 120 条证据见 `AI_CONTEXT_PACK.json` 或 `EVIDENCE_INDEX.json`。

## 宿主 AI 必须遵守的规则

- **把本资产当作开工前上下文，而不是运行环境。**：AI Context Pack 只包含证据化项目理解，不包含目标项目的可执行状态。 证据：`docs/README.md`, `frontend/src/scenes/dashboard/docs/troubleshooting/README.md`, `products/agent_platform/docs/README.md`
- **回答用户时区分可预览内容与必须安装后才能验证的内容。**：安装前体验的消费者价值来自降低误装和误判，而不是伪装成真实运行。 证据：`docs/README.md`, `frontend/src/scenes/dashboard/docs/troubleshooting/README.md`, `products/agent_platform/docs/README.md`

## 用户开工前应该回答的问题

- 你准备在哪个宿主 AI 或本地环境中使用它？
- 你只是想先体验工作流，还是准备真实安装？
- 你最在意的是安装成本、输出质量、还是和现有规则的冲突？

## 验收标准

- 所有能力声明都能回指到 evidence_refs 中的文件路径。
- AI_CONTEXT_PACK.md 没有把预览包装成真实运行。
- 用户能在 3 分钟内看懂适合谁、能做什么、如何开始和风险边界。

---

## Doramagic Context Augmentation

下面内容用于强化 Repomix/AI Context Pack 主体。Human Manual 只提供阅读骨架；踩坑日志会被转成宿主 AI 必须遵守的工作约束。

## Human Manual 骨架

使用规则：这里只是项目阅读路线和显著性信号，不是事实权威。具体事实仍必须回到 repo evidence / Claim Graph。

宿主 AI 硬性规则：
- 不得把页标题、章节顺序、摘要或 importance 当作项目事实证据。
- 解释 Human Manual 骨架时，必须明确说它只是阅读路线/显著性信号。
- 能力、安装、兼容性、运行状态和风险判断必须引用 repo evidence、source path 或 Claim Graph。

- **项目概览**：importance `high`
  - source_paths: .pi/README.md, .semgrep/rules/devex/README.md, .stamphog/README.md, README.md, bin/hobby-installer/README.md
- **Frontend 模块**：importance `medium`
  - source_paths: frontend/@posthog/lemon-ui/.gitignore, frontend/@posthog/lemon-ui/README.md, frontend/@posthog/lemon-ui/build.mjs, frontend/@posthog/lemon-ui/package.json, frontend/@posthog/lemon-ui/src/index.ts
- **Src 模块**：importance `medium`
  - source_paths: frontend/src/@types/chartjs.d.ts, frontend/src/@types/memlab-lens.d.ts, frontend/src/@types/surveys-preview.d.ts, frontend/src/AGENTS.md, frontend/src/CLAUDE.md
- **Lib 模块**：importance `medium`
  - source_paths: frontend/src/lib/Chart.ts, frontend/src/lib/KeaDevTools.tsx, frontend/src/lib/agentScopes.generated.ts, frontend/src/lib/api-error.ts, frontend/src/lib/api-orval-mutator.ts

## Repo Inspection Evidence / 源码检查证据

- repo_clone_verified: true
- repo_inspection_verified: true
- repo_commit: `ae70e0bd600730dd7da9e47d969f6061b9bdeaf6`
- inspected_files: `Dockerfile`, `README.md`, `package.json`, `pnpm-lock.yaml`, `pyproject.toml`, `uv.lock`, `docs/README.md`, `docs/internal/coder-workspaces.md`, `docs/internal/dev-env-vars.md`, `docs/internal/django-startup-time.md`, `docs/internal/feature-flags/billing.md`, `docs/internal/feature-flags/database-interaction-patterns.md`, `docs/internal/feature-flags/django-api-endpoints.md`, `docs/internal/feature-flags/evaluation-threading-architecture.md`, `docs/internal/feature-flags/experience-continuity.md`, `docs/internal/feature-flags/flag-evaluation-engine.md`, `docs/internal/feature-flags/holdout-groups.md`, `docs/internal/feature-flags/hypercache-system.md`, `docs/internal/feature-flags/rate-limiting.md`, `docs/internal/feature-flags/rust-service-overview.md`

宿主 AI 硬性规则：
- 没有 repo_clone_verified=true 时，不得声称已经读过源码。
- 没有 repo_inspection_verified=true 时，不得把 README/docs/package 文件判断写成事实。
- 没有 quick_start_verified=true 时，不得声称 Quick Start 已跑通。

## Doramagic Pitfall Constraints / 踩坑约束

这些规则来自 Doramagic 发现、验证或编译过程中的项目专属坑点。宿主 AI 必须把它们当作工作约束，而不是普通说明文字。

### Constraint 1: 仓库名和安装名不一致

- Trigger: 仓库名 `posthog-foss` 与安装入口 `posthog` 不完全一致。
- Host AI rule: 在 npm/PyPI/GitHub 上确认包名映射和官方 README 说明。
- Why it matters: 用户照着仓库名搜索包或照着包名找仓库时容易走错入口。
- Evidence: identity.distribution | https://news.ycombinator.com/item?id=48846293 | repo=posthog-foss; install=posthog
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 2: 能力判断依赖假设

- Trigger: README/documentation is current enough for a first validation pass.
- Host AI rule: 将假设转成下游验证清单。
- Why it matters: 假设不成立时，用户拿不到承诺的能力。
- Evidence: capability.assumptions | https://news.ycombinator.com/item?id=48846293 | README/documentation is current enough for a first validation pass.
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 3: 维护活跃度未知

- Trigger: 未记录 last_activity_observed。
- Host AI rule: 补 GitHub 最近 commit、release、issue/PR 响应信号。
- Why it matters: 新项目、停更项目和活跃项目会被混在一起，推荐信任度下降。
- Evidence: evidence.maintainer_signals | https://news.ycombinator.com/item?id=48846293 | last_activity_observed missing
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

- Trigger: no_demo
- Evidence: downstream_validation.risk_items | https://news.ycombinator.com/item?id=48846293 | no_demo; severity=medium
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 5: 存在评分风险

- Trigger: no_demo
- Why it matters: 风险会影响是否适合普通用户安装。
- Evidence: risks.scoring_risks | https://news.ycombinator.com/item?id=48846293 | no_demo; severity=medium
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 6: issue/PR 响应质量未知

- Trigger: issue_or_pr_quality=unknown。
- Host AI rule: 抽样最近 issue/PR，判断是否长期无人处理。
- Why it matters: 用户无法判断遇到问题后是否有人维护。
- Evidence: evidence.maintainer_signals | https://news.ycombinator.com/item?id=48846293 | issue_or_pr_quality=unknown
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 7: 发布节奏不明确

- Trigger: release_recency=unknown。
- Host AI rule: 确认最近 release/tag 和 README 安装命令是否一致。
- Why it matters: 安装命令和文档可能落后于代码，用户踩坑概率升高。
- Evidence: evidence.maintainer_signals | https://news.ycombinator.com/item?id=48846293 | release_recency=unknown
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。
