agentleFS
PostHogKnown publisherPostHog/posthog-foss/.agents/skills/verifying-changes/SKILL.md

verifying-changes

Skill728 starsChanged 7 days agoMITView on GitHub

Picks the cheapest check that is enough to confirm a change works, and says when a slower one is needed. Use before you report a task done, before you start Storybook, the dev stack or a Playwright run to check your own work, and when you are unsure how much verification a diff needs. Maps each kind of change, such as pure logic, DRF serializer or viewset, migration, kea logic, React component, CSS, Django template, CI workflow, SQL or HogQL, or docs and skills, to the layer that is enough and the layer that is wasted. `hogli verify --changed` runs the cheap layers for the current diff and names the slower ones left to run yourself. Trigger terms: verify, how do I test this, is this enough testing, start the stack, render it, run e2e.

5 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 3 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 5 edited versions we read keep these.

  • 3

    Distinctive

    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
  1. Distinctive:

    Start with the cheapest, and move up only when the current layer cannot see what the diff changes.

    line 16
  2. Very specific:

    Use --plan to see the classification without running anything.

    line 30
  3. Distinctive:

    Start the stack only when the behavior spans more than one process and no layer 2 test runs both sides:

    line 61
  4. Distinctive:

    If you could not run a required layer, say so and name the command, so a reviewer knows what is unverified.

    line 75

“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Verifying changes

Verification has six layers, and each one costs roughly ten times the one before it. Start with the cheapest, and move up only when the current layer cannot see what the diff changes.

LayerCheckCommand
1Lint, format, typecheckhogli verify --changed, or ruff check and pnpm --filter=@posthog/frontend typescript:check
2The nearest unit testhogli test <file>, hogli test --changed
3Serializer and OpenAPI regenhogli up -d, hogli build:openapi, then commit the generated diff
4Storybook renderSTORYBOOK_STORIES=<dir> pnpm storybook, open the affected story, compare before and after
5The running stackhogli up -d, hogli wait, then exercise the flow
6Playwright or a recorded runhogli test playwright/<spec>.spec.ts against a running stack

hogli verify --changed classifies the diff against master, runs layers 1 and 2, and lists any higher layer you still have to run yourself. It does not report the diff as verified when a check was skipped, when a check only printed advice, or when no test covers the changed files. mypy is one of those advice-only checks. It runs repo-wide, so hogli verify prints its command instead of running it. Use --plan to see the classification without running anything.

For layer 4, set STORYBOOK_STORIES to the directories or story files you need instead of editing the stories list in main.ts. /working-with-storybook covers starting Storybook, opening a story by URL, screenshots, and writing the story itself.

Decision table

ChangeEnoughWasted
Pure logic, Python or TS2: nearest unit test5: stack
DRF serializer or viewset3: OpenAPI regen, plus the endpoint test at layer 26: Playwright
Migration2: migration test, plus hogli migrations:check4: Storybook
Kea logic2: logic test, plus typecheck4: Storybook
React component4: Storybook render5: stack, unless the data wiring changed
CSS only4: Storybook render2: unit tests
CI workflow1: hogli lint:workflows, hogli ci:plan2: unit tests
SQL or HogQL2: the ClickHouse-backed query test5: stack
Docs or skills1: format, hogli lint:skills2 and above
Django template5: render the page in the running stack6: Playwright
Settings, URLs, middleware5: running stack6: Playwright

A diff that mixes kinds needs the highest layer among them, and only for the files of that kind.

Other rules still apply

  • Reading the code does not confirm visual or UX work, as the root AGENTS.md says. A component or CSS change always needs at least a Storybook render.
  • Layer 2 says where a test runs. Use /writing-tests to decide whether to add or change one. When a regression is hard to reach cheaply, extract the logic and test it at a lower layer.
  • hogli ci:preflight stays the pre-push check, see /running-ci-preflight. hogli verify reuses its lint and format checks, so a pass here usually means a pass there too.

When the stack is required

Start the stack only when the behavior spans more than one process and no layer 2 test runs both sides:

  • Settings, URL routing, middleware, or the Content Security Policy, because only the browser applies them.
  • A Django template, because only Django renders it.
  • A change that a person has to see in the app: a new scene, a navigation change, or data flowing from ingestion to a UI.
  • A Celery task, Temporal workflow, or plugin-server path whose wiring changed. A change to its logic alone stays at layer 2.
  • A Playwright spec you changed, because it runs against the stack.

Everything else can skip the stack. Django and ClickHouse-backed tests need the Postgres and ClickHouse services but not the web app, so hogli up -d plus a scoped hogli test still counts as layer 2.

Report what you ran

Say which layer you stopped at and why the next one was not needed. If you could not run a required layer, say so and name the command, so a reviewer knows what is unverified.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.