CAITSGet started

Get started

One command creates a full-stack TypeScript app on Marko and Vite, installs it, and leaves every check green. To add CAITS to a project you already have, see Add CAITS to a project.

What you need

ToolVersion
SystemLinux, macOS, or WSL 2 on Windows. Native Windows doesn't work: CAITS starts npm without a shell, and stops the test servers by process group.
Node.js22 (from 22.18), 24, or 26 and later. Vitest doesn't support 23 and 25.
gitAny version. init --example uses it to fetch the example app.

Create your app

Terminal

npx @ingenioz-it/caits init my-app --example
cd my-app
npm run check

npx asks to install CAITS first: answer y. init writes the project in my-app/, runs npm install, and installs the browser of the end-to-end tests. npm may warn about install scripts or vulnerabilities in the tools: the checks pass all the same.

npm run check runs every check of the harness, in less than half a minute:

npm run check

6 checks at once: typecheck, lint:code, lint:architecture, test:coverage, test:mutation, test:e2e
✓ lint:architecture  0s
✓ typecheck          3s
✓ lint:code          4s
✓ test:coverage      4s
✓ test:e2e           9s
✓ test:mutation      23s

All 6 checks passed in 23s.

npm run dev then starts the app on http://localhost:3000.

What you get

The files of a new project

my-app/
├── src/
│   ├── backend/        the backend contexts, one folder each
│   ├── frontend/       the frontend contexts, one folder each
│   └── routes/         the pages and the HTTP API
├── test/e2e/           the end-to-end tests
├── quality/            the setup of each tool, and the architecture rules: yours
│   └── caits/          CAITS's defaults: don't change them
├── AGENTS.md           what your AI agent reads first
├── package.json        the scripts and the packages: yours
└── tsconfig.json
  • Every file is yours, except quality/caits/. Each file of quality/ starts from CAITS's defaults and changes what you want: see Change the rules and the tools.
  • @ingenioz-it/caits stays in your dev dependencies. It gives the container, the message buses, the frontend stores, the test helpers, and the commands that run the checks. Your domain imports only three small types from it.

The architecture shows what goes in each folder, and how each part is tested.

The example app

--example writes a small message board, which shows every part and every kind of test:

  • The page Example (/messages) adds, edits and removes messages. A message has 1 to 280 characters, without the spaces around it.
  • The backend keeps them in tmp/messages.json, or in the folder DATA_DIR when it is set.
  • When the backend refuses a change, the page says why, and keeps what the user typed.

The app lives in its own repository, IngeniozIT/caits-example: init fetches it at the tag of your CAITS version. Without --example, the project starts with one page, its end-to-end test, and the same harness.

Work each day

Keep the unit tests running: at each save, they run the tests of what you changed.

Terminal, in my-app

npm run tdd

In a second terminal, run the app. It reloads as you edit.

Terminal, in my-app

npm run dev

Before each commit, run every check. It prints one line per check, then the output of the checks that failed: see When a check fails.

Terminal, in my-app

npm run check

Hand it to your AI agent

Most coding agents read AGENTS.md on their own. Commit first, so you can review what the agent changes. Then give it a task, and the definition of done: npm run check passes. AI agents gives prompts that work.