This repository follows these guidelines for contributions by AI agents or humans: This repository contains a monorepo managed with NX and npm.
- Install dependencies with
npm install. - Start the dev server with
npm run start. The command runs development server in hot reload. Development works best on Node 22 (see README).
The root package.json defines the main scripts:
npm run build– Start development server with hot reload.npm run lint– Runs Eslint and Prettier to lint/format the codebase.npm run test– Runs unit tests via Jest.npm run cy-test- Runs E2E tests via Cypress
These scripts should be executed from the repository root.
- Formatting and linting are handled by Eslint. Important settings are
two‑space indentation, single quotes, trailing commas (
all) and semicolons always. - Import order and unused code rules are enforced. If a rule must be
bypassed, use
// eslint-ignorecomments. - Source code is written in TypeScript.
- Export types and values explicitly (e.g.
export { Foo }andexport type { Bar }). - Prefer static imports. Use dynamic
import()only when strictly necessary and document why it's required.
- Strict mode enabled
- PascalCase for interfaces and types
- camelCase for variables and functions
- Explicit return types for exported functions
- Run
npm run testto execute the test suite. - Always run the tests before committing changes.
- Focus tests on application behavior and accessibility. Avoid checking Tailwind classes, CSS, or which specific HTML tag is rendered. Prefer queries based on roles or other a11y attributes.
- Do your best to test the exposed API, its inputs and outputs rather than implementation details.
- Group tests with a single
describeblock per subject (e.g. per public function or component). Use the name of the subject as the param fordescribe. Avoid catch‑all labels like “additional tests”. - Prefer expressive matchers such as
toContain,toContainEqual, orcontainSubsetinstead of manual array scans with.some. - When validating failure cases, assert on the specific error (name or class) rather than only checking
result.success === false. - Don’t export internal helpers purely for test coverage.
- Use descriptive names for both
describeanditblocks to make code folding and navigation easier. - Do not test Zod schemas.
The public API is defined by index.ts.
Whenever you modify this file or the modules it re-exports:
- Ensure every exported value or type has a TSDoc comment in its source file.
- Follow the existing style seen in the codebase: multi-line
/** ... */blocks with a short description,@param/@returnstags and@examplesections when relevant. - Keep
index.tsin sync with the actual exports so consumers see an up‑to‑date public API.
Use Conventional Commits format. Examples include:
feat:for new featuresfix:for bug fixesdocs:for documentation changestest:for test-related changeschore:for maintenance tasks
Run the following commands and make a best effort to ensure they succeed:
npm run lint-fix
npm run lint
npm run test
npm run cy-testTests may take a while because Cypress launches browsers. If they fail
due to missing executables, run npx cypress install first.
When addressing a bug, follow a test-driven development approach:
- Red – Write a test that reproduces the issue and fails.
- Green – Implement the minimal fix so the new test passes.
- Refactor – Clean up the solution while keeping all tests green.
- A task is not done unless
npm run lintandnpm run testare all passing. - A task is not done if it has new behavior without tests to ensure the new behavior.