: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.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
docs(skills): tighten frontend QA evidence and devbox reuse (#83175)
Pawel Cebulaffdc2f4f0505
diff --git a/.agents/skills/qa-frontend/references/browser-mcp-patterns.md b/.agents/skills/qa-frontend/references/browser-mcp-patterns.mdindex f935504e6482..c936c641c674 100644--- a/.agents/skills/qa-frontend/references/browser-mcp-patterns.md+++ b/.agents/skills/qa-frontend/references/browser-mcp-patterns.md@@ -56,6 +56,14 @@ Start with the default snapshot. Deepen or scroll only when:Do not declare an element absent until you have checked the plausible scroll or tab state.+## Proof-First Screenshots++Every screenshot should visibly prove the coverage row it supports. Before capturing, identify the exact text, control, table row, chart, toast, or form state that makes the target pass or fail. Wait for that proof element, scroll it into view when needed, and capture with enough surrounding context for a reviewer to understand the route and state.++For long pages, landing pages, pricing pages, docs, and other hero-led layouts, assume the first viewport is setup context rather than proof. A screenshot of the hero only is not useful evidence for a lower-page gate, form, warning, or CTA state. Scroll to the changed region before capture, or use a full-page screenshot only when the resulting image remains readable and the proof area is easy to find.++After each candidate screenshot, inspect the saved file before annotating or uploading it. Recapture if the proof is cropped away, hidden behind a banner or caption, too small to read, or if the frame mostly shows navigation, debug chrome, or unrelated page setup. If the screenshot needs a caption to explain a term of art, add a short note in the report rather than relying on the image alone.+## Console And Network SignalsCollect a baseline console snapshot after initial page load, then compare after the changed action. Treat a new error as relevant only if it appears after the target interaction or clearly belongs to the exercised endpoint.diff --git a/.agents/skills/qa-frontend/references/evidence-and-output.md b/.agents/skills/qa-frontend/references/evidence-and-output.mdindex 15a6ef39c441..69c18b6f4a3a 100644--- a/.agents/skills/qa-frontend/references/evidence-and-output.md+++ b/.agents/skills/qa-frontend/references/evidence-and-output.md@@ -15,6 +15,10 @@ Uploads are PUBLIC and PERMANENT: URLs are SHA-pinned and keep serving even afteDo not upload `.md` snapshots, `console.log`, or every numbered screenshot. If the demo pass produced an MP4, include it in the same approved upload set through `hogli pr:upload-video` (mp4/webm, same 10 MB cap and `--yes` gate) - it prints a plain `[label](url)` link line, which is a click-to-download link: GitHub renders no player for raw-hosted video, so an inline player still requires the developer to drag the file into the comment editor by hand. If the reel is less clear than the annotated stills, omit it from the upload set and use the PNGs instead.+Before asking for upload approval, inspect the final evidence exactly as it will be posted. Each image must make the claimed PASS, FAIL, SKIP, or NEEDS INTENT row understandable without reconstructing the browser session. If an image only shows the page header, hero, empty shell, or setup state while the actual proof is below the fold or too small to read, do not upload it. Recapture, crop through browser positioning, or add a clearer annotated still first.++When a screenshot uses deliberately odd test data, add a one-sentence explanation in the report near the evidence or coverage row. Do this for cases where the visible data is technically valid but not self-explanatory, such as edge-case email syntax, encoded URLs, timezone boundaries, or synthetic billing states.+```bashhogli pr:upload-video --yes --label "demo video" \".qa-frontend/runs/<run-id>/frontend-qa.mp4"diff --git a/.agents/skills/qa-frontend/references/stack-and-login.md b/.agents/skills/qa-frontend/references/stack-and-login.mdindex 78349963ca94..1771a1336aaa 100644--- a/.agents/skills/qa-frontend/references/stack-and-login.md+++ b/.agents/skills/qa-frontend/references/stack-and-login.md@@ -29,6 +29,10 @@ If those checks show the app is reachable, continue. Do not start, restart, replReachable is not the same as serving your checkout. `BASE_URL` may be a forward to a remote stack (for example a Coder devbox), and a forwarded stack can lag behind or diverge from the local working tree. Before exercising the diff or mutating state (login, theme changes, seeded data), confirm the stack actually serves the code under test: open a changed surface, check the change is present, and retry briefly when the stack syncs with a delay. Any data seeding must target the stack the browser talks to - a local `manage.py shell` writes to the local database, which is the wrong place when `BASE_URL` is forwarded to a remote stack. Seed on the stack serving `BASE_URL`, or record a coverage gap instead.+For browser QA, target-route readiness is stronger evidence than a fully green local stack: changed UI loads, branch/SHA or another in-diff marker matches the code under test, and route-critical APIs work. Record unrelated degraded units in `run-notes.md`, but do not chase all-stack health when the target route is usable.++If the user approves agent-managed startup, prefer the repo's normal background stack: `hogli devbox:start --start-app` for a new/stopped devbox, or `hogli up -d -y` from the checkout that serves `BASE_URL`. Use `hogli dev:*` only to understand unclear route dependencies.+If PostHog is not reachable, check user memory/settings and local preferences first, then repo guidance and nearby docs such as `AGENTS.md` for the preferred way to start the stack. Then ask the user how they want to proceed before starting PostHog. If the folder and command are obvious, you may propose that specific startup path, including whether it runs interactively or in the background, but present it as an inference to confirm. If the folder, command, `BASE_URL`, or startup approach is not obvious, ask how and where the user wants the stack run, or whether to use a different `BASE_URL`. Do not mention team-specific env vars unless the user already brought them up.Ask in chat and stop until the user answers. A sandbox escalation prompt, command approval dialog, or already-approved command prefix is not workflow approval; it only authorizes a command after the user has chosen agent-managed startup.diff --git a/.agents/skills/run-posthog/SKILL.md b/.agents/skills/run-posthog/SKILL.mdindex 680fe085a81c..2e9fd914dd58 100644--- a/.agents/skills/run-posthog/SKILL.md+++ b/.agents/skills/run-posthog/SKILL.md@@ -19,14 +19,24 @@ All paths below are relative to the repo root.## Launch+For a normal developer stack, use the saved interactive setup:+```bashhogli dev:setup # first time only — interactive wizard picks which workers to runhogli up -d -y # start the stack detached under phrocshogli services:ready -y # wait for Docker services (Postgres, CH, Kafka, Redis)-hogli wait -y # wait for phrocs-managed units (Django, Vite, Celery, plugin-server)+hogli wait -y # broad all-process signal; confirm with the checks belowhogli doctor # optional: stale migrations, zombie phrocs, disk pressure```+For agent-managed QA, use the normal background stack unless the user asks to tune services. On a devbox, prefer `hogli devbox:start --start-app` for a new/stopped box; if it is already running without the app, start PostHog inside it:++```bash+hogli devbox:exec -- bash -lc 'cd ~/posthog && ./bin/hogli up -d -y'+```++Use `hogli dev:intents`, `hogli dev:explain <intent>`, and `hogli dev:list-units <intent>` only to understand route-specific dependencies; custom generated configs are not the default QA startup path.+First boot is 60-90s while Django imports and Vite warms. Stop with `hogli down -y` (leaves Docker services running for fast restart).## Is the stack ready?@@ -41,7 +51,7 @@ curl -sf -o /dev/null -w '%{http_code}' http://localhost:8010/curl -sS http://localhost:8010/api/projects/@current | grep -q '"code":"not_authenticated"' # API + DB reachable```-Plus these `phrocs` units `ready:true`: `backend`, `frontend`, `nodejs`, `capture`, `ingestion`. Stop here. **Do not chase crashed `migrate-*` units when only `/run` was asked** — the stack is usable for launch, screenshot, and most UI scenes (home, login, settings, feature flags) regardless of migration state.+For UI QA, `backend` and `frontend` are hard gates; add only units the route needs, such as `mcp`, `feature-flags`, `nodejs`, `capture`, or `ingestion`. Stop here. **Do not chase crashed `migrate-*` units when only `/run` was asked** — the stack is usable for launch, screenshot, and most UI scenes (home, login, settings, feature flags) regardless of migration state.**Ready for `/verify` of HogQL-backed scenes** (insights, dashboards, web analytics) and for `POST /api/setup_test/...`:@@ -119,7 +129,7 @@ Canonical sources to grep when the path isn't obvious:## Gotchas- **`migrate-clickhouse` and `migrate-persons-db` often crash on a cold `hogli up -d` due to a startup race.** They start in parallel with `migrate-postgres`, and if Postgres isn't ready yet they crash. This is the hard prereq for `POST /api/setup_test/...` and for HogQL-backed scenes (insights, dashboards, web analytics) — but **not** for `/run`. Don't fix it unless the task needs HogQL/`setup_test`. When you do need to fix it, the canonical sequence is: wait for `migrate-postgres` to show `status:"done"` via `mcp__phrocs__get_process_status`, then restart the crashed migrations. `mcp__phrocs__toggle_process` is the surgical tool but auto-mode blocks it on shared stacks — fall back to `phrocs stop && hogli up -d` which re-runs everything in order, or run `python manage.py migrate_clickhouse` directly (you'll need `set -a; source .env.services; set +a` first so `CLICKHOUSE_DATABASE=posthog`, otherwise it targets `default`). If neither works (corrupted CH replica state in ZooKeeper from a partial run), `hogli dev:reset` is the only path — it wipes Docker volumes, destructive.-- **`hogli wait` exits 0 even when phrocs is unreachable.** Don't trust its return code as ground truth — confirm with `mcp__phrocs__get_process_status` or the `curl` probes.+- **`hogli wait` is a coarse all-process signal.** Confirm with process-specific phrocs status, the `curl` probes, and the target route before deciding the stack is unusable.- **Vite serves on `:8234`, not the URL you browse.** You browse `http://localhost:8010` (the Envoy-style proxy). The proxy reverse-proxies Vite for `/static/*` and Django for everything else. Hitting `:8234/` directly returns 404 because Vite has no index route at the dev-server root.- **Worktrees share Docker containers but compete for ports.** All worktrees on the same machine resolve to the same `posthog-clickhouse-1` / `posthog-db-1` containers, so DB state is global. But ports 8000/8010/8234 can only be held by one worktree at a time — kill the granian/vite/phrocs of the other worktree before `hogli up -d` here.- **CSP warnings and 401s in the browser console are normal pre-auth.** The preflight/login page tries to fetch `/api/projects/@current`, `/api/users/@me/`, and PostHog.js remote config — all 401 until you sign up. WASM/CSP "Report Only" warnings come from the dev CSP.diff --git a/.agents/skills/setting-up-devbox/SKILL.md b/.agents/skills/setting-up-devbox/SKILL.mdindex 3d05d129f5e9..e5ca9a76a2c4 100644--- a/.agents/skills/setting-up-devbox/SKILL.md+++ b/.agents/skills/setting-up-devbox/SKILL.md@@ -53,7 +53,28 @@ hogli devbox:open --vscode # or --cursor / --webhogli devbox:stop # when done — preserves disk, stops billing```-### 4. Auth, if you want it (optional)+### 4. Fast QA and agent resume++Before recreating sync, restarting PostHog, or making a new devbox, check whether the existing box is already usable:++```bash+hogli devbox:status+hogli devbox:exec -- bash -lc 'cd ~/posthog && git status --short --branch && git rev-parse --short HEAD'+hogli devbox:sync --status+hogli devbox:exec -- bash -lc "curl -sf -o /dev/null -w '%{http_code}' http://127.0.0.1:8010/"+```++Use `-n <name>` on each command for a labeled box. If the forwarded app serves the intended branch/SHA, the target route loads, and route-critical APIs work, keep going and note unrelated degraded units rather than chasing perfect all-process health. When startup time matters, record rough timings for devbox start/resume, sync readiness, first route response, and first target-route load.++For agent-managed startup, `hogli devbox:start --start-app` is the supported path for new/stopped boxes. The flag is sticky and starts the regular PostHog stack in the background. If the box is already running without the app, start it inside the box:++```bash+hogli devbox:exec -- bash -lc 'cd ~/posthog && ./bin/hogli up -d -y'+```++Use the target route, route-critical APIs, and process-specific phrocs checks as the readiness gate.++### 5. Auth, if you want it (optional)To have `gh` or Claude Code authenticated on the box, store the token once as a Coder user secret. It's injected as an env var into every box you start, so you set it once rather than per box:@@ -65,14 +86,14 @@ hogli devbox:secret:set CLAUDE_CODE_OAUTH_TOKEN --env CLAUDE_CODE_OAUTH_TOKENAuthing `gh` / Claude on a devbox is fine — that's what these are for. Set the value from `--file` or the hidden prompt; never paste a token into a command line or into this conversation. Restart a running box to pick up a newly set secret.-### 5. Make it yours — your call+### 6. Make it yours — your callThe box is usable as shipped; personalize it however suits you, or not at all. Two supported paths, neither required, don't push one over the other:- **Tweak the box directly** — `devbox:ssh` in and install tools, add aliases, clone repos. Changes under `/home` survive stop/start and template updates, but a `devbox:destroy` (or a brand-new box) starts fresh.- **A dotfiles repo** — if you'd rather keep portable, version-controlled config that re-applies to every box: `hogli devbox:setup --configure-dotfiles` points the box at your `dotfiles_uri`, and Coder clones it (running an executable `~/dotfiles/install.sh` if present) on each start.-### 6. Run commands on the box — `hogli devbox:exec`+### 7. Run commands on the box — `hogli devbox:exec``devbox:exec` runs one command over SSH and propagates its exit code — handy for scripts, agents, and quick checks without opening a shell:@@ -99,6 +120,8 @@ hogli devbox:sync --status # watching / paused / conflhogli devbox:sync --terminate # tear the mirror down when done```+Before relying on sync, verify the remote branch/SHA and `devbox:sync --status`. If the box already matches and sync is watching without source-file conflicts, do not recreate it for cleanliness. Source-file conflicts block reliable QA until resolved; box-local config conflicts such as `.env` can be acceptable when the tracked source is clean.+The non-obvious parts:- **It runs on your machine and pushes to the box — not the reverse.** Don't invoke it through `devbox:exec`. It mirrors whichever checkout you run it from (it walks up from the cwd for `hogli.yaml` + `.git`), so run it from the repo root you are editing — including a `/wt` worktree.