# AGENTS.md

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

## Setup

```
pnpm install
```

## Commands

```
pnpm start                 # run the app
pnpm lint                  # lint
pnpm format                # format
pnpm prepare
pnpm schema:build
pnpm openapi:build
pnpm schema:build:python
pnpm taxonomy:build
```

## Layout

- `products/` 20341 source files
- `frontend/` 5376 source files
- `posthog/`  3291 source files
- `nodejs/`   1570 source files
- `rust/`     1393 source files
- `ee/`       820 source files

## Conventions

- Tests live alongside the code they cover, following `.depot/actions/paths-filter/__tests__/csv-escape.test.ts`.
- TypeScript runs in strict mode. Type errors are the fastest feedback available, so do not weaken it.
- CI defines what passing means. See `.github/workflows/_rust-build-images.yml`, and keep it green.
- TODO: add the two or three conventions a newcomer always gets wrong here.

## Gotchas

- `services/mcp/src/api/generated.ts` is 3766KB. It will not fit comfortably in context, so read it in parts.
- Copy `.env.example` before running anything that needs configuration.

---

Drafted by agentreadme.com from what is in this repository. Everything marked TODO
needs a human. Check it in as AGENTS.md at the root.
