TaxPilot

Search the docs

Search the Help centre, Developer docs and Legal centre.

Open TaxPilot

Conventions

Follow the house rules for Next 16 code, the design system, money and ids, user-facing text and finishing UI work.

Updated November 22, 2026

These rules keep a small codebase consistent. Most are enforced by a lint rule or a test. The rest are review checks.

Next 16 is not the Next you know

The app runs Next 16.4. APIs, file conventions and defaults differ from older versions. Before you add a route, layout, metadata or data fetching, read the matching guide in apps/web/node_modules/next/dist/docs/ and follow its deprecation notices. AGENTS.md says the same; next dev re-adds that block, so leave it in the diff.

UI components

  • Build screens from @/components/app/ds first. components/app/ds/README.md lists the canonical pieces: PageHeader, PageContainer, EntityListPage, EntityTable, FinancialWorksheet, StatusBadge, Money, EmptyState, NoAccess, ReturnHeader, StatTile and others. Extend a component there rather than forking it in a screen.
  • Lower-level parts come from @workspace/ui/components/...: shadcn on Base UI, ReUI components (reui/…) and Pro blocks (blocks/…). Don't hand-roll something the kit already has.
  • eslint.config.js blocks two imports: the raw @workspace/ui/components/empty (use EmptyState) and @/components/app/ds/page-header (import PageHeader from the barrel).
  • Use semantic tokens only, so dark mode comes from the tokens. State uses the Badge -light variants. Spacing is gap-2 within a row, gap-4 between groups and gap-6 between sections. Body text is text-sm, meta text-xs, nothing smaller. Numbers are tabular-nums.
  • One container family per screen: a Frame, never a Card inside it.
  • Counts go through count(n, one, other?) and amounts through money() in lib/format.ts. Return status labels come only from lib/return-status.ts.

Text in the product

  • Write for an accountant in plain words: short sentences, active voice, the product's own labels.
  • No boilerplate hint text. Add a one-line visible caption only where a layperson needs the specific reason for something, such as why a schedule is required.
  • Error messages from the repository are shown verbatim as toasts, so write them as full sentences that say what to do ("Reopening needs a reason.").

Money, values and ids

  • Amounts are bigint cents (Cents in src/money.ts). Rates are exact fractions. Round once, with a pinned policy. Never use number for money.
  • A field value is a Value, so blank, zero, unknown, not applicable and blocked stay distinct. A blank is never silently 0 where a fact is needed: read it with need().
  • Field ids such as t2.300 or s125.9060 are frozen keys. Saved inputs and locked versions use them, so never rename one. A CRA renumbering is a form revision or a filing-spec mapping.
  • Every law-dependent number lives in a parameter file with a citation, not in code. See Versioned parameters.

Comments and shortcuts

Comment the why the code can't show, in one line. A deliberate shortcut gets a comment in this form, so it can be found later:

Terminal
// shortcut: counts calendar years between year-ends, so extra short tax years are not counted; upgrade if the table gains a year count.

Finishing UI work

  1. Add Playwright coverage for every new form or flow.A vitest unit test isn't enough for a form. Put the spec in apps/web/e2e and use the fixtures in e2e/fixtures.ts.
  2. Take screenshots at phone and desktop widths, in light and dark.Look at them before you call the work done. Layout bugs show up at the edges.
  3. Check accessibility.e2e/a11y.spec.ts runs axe on the main screens. Add your page if it's new.
  4. Add a changelog entry for anything a user will notice.See Reference pages.