Agent rule pattern

Verification by change type

Matches each kind of change to the checks that cover it.

60 of 100 projects

The shape of the rule

  1. Identify the change
  2. Choose the matching checks
  3. Name gaps in coverage
How to use it

A rendering change maps to one command, a protocol change to another. Several files also say what the default test command leaves out.

List the checks for each kind of change. Include required setup and anything the default command skips.

Examples from real projects

3 examples · Pinned source

Distinguish type checks, prose, and executable examples

The validation table gives API type changes, JSDoc text changes, and JSDoc examples different commands. Documentation-only work does not need tests unless examples or code changed.

.agents/AGENTS.mdL17–26
Source excerpt starting at line 17.
Use the narrowest validation that covers the change: | Change type                      | Validation                                                                         || -------------------------------- | ---------------------------------------------------------------------------------- || Code changes                     | `pnpm lint-fix`, targeted `pnpm test --run <test_file.ts>`, `pnpm check`           || Tests-only changes               | `pnpm lint-fix`, targeted `pnpm test --run <test_file.ts>`, `pnpm check`           || Type-level/API type changes      | Targeted `pnpm test-types <filename>`, plus `pnpm check` when source types changed || JSDoc text/category/link changes | `pnpm jsdocs --check`, `pnpm lint`                                                 || JSDoc example changes            | `pnpm jsdocs --check`, `pnpm lint`, root `pnpm doctest --run <files>`              || Docs-only changes                | `pnpm lint-fix`; no tests unless examples or code changed                          |

Match verification to mode and bundler

Four test commands cover development and production under both Turbopack and Webpack. The result must match the runtime combination being changed.

AGENTS.mdL138–143
Source excerpt starting at line 138.
**Test commands by mode:** - `pnpm test-dev-turbo` - Development mode with Turbopack (default)- `pnpm test-dev-webpack` - Development mode with Webpack- `pnpm test-start-turbo` - Production build+start with Turbopack- `pnpm test-start-webpack` - Production build+start with Webpack

Name what the default test command excludes

The file says the cheap default runs Vitest and keeps browser suites opt-in. It reserves the fuller check for a PR-ready hand-off or changes whose scope needs it.

AGENTS.mdL161–168
Source excerpt starting at line 161.
This is the cheap default and only runs the Vitest suite. Browser suites stay opt-in: ```shpnpm test:e2epnpm test:release-smoke``` Run the browser suites only when your change touches them or when you are explicitly verifying CI/release flows.

Projects using this pattern (60)

Browse in directory →
Show 52 more projects
← All agent rule patterns