All examples

Next.js app (TypeScript)

App Router app with Server Components by default, Server Actions, Zod validation, Vitest, and Playwright.

Composed from the nextjs-typescript rules pack. Same file from the CLI: aibysitter init --packs nextjs-typescript --format agents

Written for this site, CC0, scored by this linter, not tested against any agent.

File
AGENTS.md, 38 lines
Format
AGENTS.md
Save as
AGENTS.md
Category
JavaScript
Tags
License
CC0 1.0, public domain. No attribution needed.

Download AGENTS.md Lint a copy

Aibysitter lint score

100 / 100 — A

Ruleset v4

No deductions.

Badge

Aibysitter lint score: A 100

Markdown for a README:

[![Aibysitter lint score: A 100](https://aibysitting.net/gallery/nextjs-typescript/badge.svg)](https://aibysitting.net/Gallery/nextjs-typescript)

AGENTS.md

View rendered

  1. # Next.js with TypeScript
  2. Next.js with the App Router, TypeScript in strict mode, Tailwind CSS. Package manager: pnpm.
  3. ## Commands
  4. - Install: `pnpm install --frozen-lockfile`
  5. - Dev server: `pnpm dev`
  6. - Type check: `pnpm tsc --noEmit`
  7. - Lint: `pnpm lint`
  8. - Unit tests: `pnpm test` (Vitest)
  9. - End-to-end tests: `pnpm test:e2e` (Playwright)
  10. ## Structure
  11. - Routes live in `app/`. Shared UI lives in `components/`. Data access lives in `lib/data/`.
  12. - Components are Server Components by default. A component that uses state, effects, or browser APIs starts with `"use client"`.
  13. - Client components receive data as props. Data fetching stays in the Server Component that renders them.
  14. - Mutations are Server Actions in `app/**/actions.ts` and call `revalidatePath` for the route they change.
  15. ## TypeScript
  16. - No `any`. Use `unknown` and narrow it.
  17. - No non-null assertions (`!`) outside tests.
  18. - Form data, route params, and API responses are parsed with the Zod schemas in `lib/schemas/` before use.
  19. ## Styling
  20. - Tailwind classes only. No inline `style` attributes and no new CSS files.
  21. - Colors come from the theme tokens in `app/globals.css`. No raw hex values in components.
  22. ## Server code
  23. - Modules that read secrets or the database import `server-only` on their first line.
  24. - Secrets are read from `process.env` in server code only. Secret names never start with `NEXT_PUBLIC_`.
  25. ## Tests
  26. - A component with logic gets a Vitest test next to it: `ProductCard.test.tsx` for `ProductCard.tsx`.
  27. - A new route gets one Playwright test in `e2e/` covering its main path.
  28. ## Before opening a PR
  29. - `pnpm tsc --noEmit`, `pnpm lint`, and `pnpm test` pass.
  30. - No `console.log` calls remain in `app/`, `components/`, or `lib/`.