Files
causius/AGENTS.md
CatoandClaude 4be58da713 feat(markets): Switzerland and Liechtenstein only, one record per country (#28)
The owner narrowed the focus: no US market for now. Markets are now a
config (lib/jurisdictions.ts): each country is one record with its regions,
interface languages and a note for the agent; MARKETS lists the ones that
are switched on. Adding a country is that record, its words under
Home.where.<code>, and its code in MARKETS. A test fails if a market lacks
its words in any language.

The agent's country rules moved out of its prompt into each market's note,
read for the matter's own jurisdiction. The front page's markets and kicker
are generated from MARKETS. The US stays pickable under Elsewhere.

The Spanish interface existed for the US market and goes with it (git
history keeps it); a letter can still be translated into Spanish.


Claude-Session: https://claude.ai/code/session_018Lem7GyhyyjKhmwjG8G7Ud

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-21 07:45:38 +02:00

5.5 KiB

Agents

Read bitbaum/fleet AGENTS.md and the registers it names before inventing a host, a name, or a page. Do not copy those facts into this file.

Repo-only notes live below this line.

  • The owner's standing instruction (2026-10-11): finish to production. An instruction from the owner is done when it is live on causius.orangecat.ch, not when a pull request is open. Merge your own pull request as soon as CI is green (gh api -X PUT repos/bitbaum/causius/pulls/N/merge), watch the Deploy run, and check the live site. This overrides the "agents do not merge by hand" line in fleet's auto-merge sweep for this repository. The sweep (auto-merge.yml) is the fallback, not the plan. After every deploy, live-check.yml asks the live site from outside whether every language answers, the security headers are on and analysis is switched on; a red Live check means the product is not working, whatever Deploy said.

  • Run: pnpm install, pnpm dev. Check before pushing: pnpm run verify (type-check, lint, tests). CI also builds.

  • Tests are Vitest, next to the code they test (lib/*.test.ts, i18n/parity.test.ts). They are hermetic. pnpm run check:analyze and pnpm run check:agent call a real model; they need a vendor key and are not in CI.

  • Every string a reader sees lives in messages/<locale>.json for each locale in i18n/routing.ts (en, de, fr, it); the parity test fails on a missing key. English is the source. German uses Swiss spelling (ss, never ß). Link with @/i18n/navigation, never next/link, so a reader on /de stays on /de. Every page is under its language prefix (localePrefix: "always"); see i18n/routing.ts for why the unprefixed default broke production.

  • Security and privacy are not negotiable, whatever else is. The owner wants speed without approvals; that never extends to weakening them. A letter leaves the browser only after lib/redact.ts has anonymised it; nothing about a letter is stored or logged on the server; the CSP in lib/security.ts stays nonce-based with connect-src 'self'. A change that loosens any of these needs a reason written next to it.

  • Anyone on the platform may be pseudonymous: people seeking help, legal assistants and lawyers. A lawyer's admission is verified privately and their name is disclosed to a client on engagement.

  • This repository is public and the product handles legal letters. No real person's letter, name, address or reference number goes into the code, the tests, the sample case or a commit message. lib/sample.ts is invented.

  • Design starts in @bitbaum/design-tokens; the look is decided only in app/theme.css (colours light and dark, faces, radius, headline and action case), so "red and white" or "more gothic" stays a one-file edit; keep it so. lib/theme.test.ts keeps any theme readable (WCAG AA). app/globals.css defines no token (see README "Design").

  • Words are a cost. lib/copy-budget.test.ts holds Home, the quick check, the case page, Helpers, Platform and Security to a word budget, and depth lives one click away. Before adding a sentence, ask who reads it and what they do next; if nobody does, cut it. Whether a capability works today is decided only in lib/capabilities.ts.

  • Matters (lib/matters/) are sealed per matter (lib/crypto.ts). Nothing readable about a person goes into a clear column: the participant alias is a role, never a name. Store and agent tests run on PGlite (lib/test/db.ts).

  • The case file (lib/case.ts) is the one shape the analysis produces, the browser stores and Export writes. Change the zod schema, not a copy of it.

  • The model call is @bitbaum/ai-kit's complete() in lib/analyze.ts. Do not add a vendor SDK, a hand-rolled fetch to a model, or a pinned model id.

  • Causius AI gives legal information, not legal advice. Do not weaken the system prompt's refusal to advise, and do not blur the assistant/lawyer line on /helpers: who may give legal advice is set by law, not by us.

  • Nothing is claimed on a page unless it is true today. No invented helpers, ratings or testimonials.

  • ROADMAP.md and CHANGELOG.md are the public record; Loki's fleet map ingests them and the site reads the map back. A user-facing change adds a changelog line in the same pull request.

This is NOT the Next.js you know

This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in node_modules/next/dist/docs/ (resolved from this file's directory; in monorepos the next package may not be visible from the repo root) before writing any code. Heed deprecation notices.

This block is written and re-added by next dev — verify at node_modules/next/dist/server/lib/generate-agent-files.js. Removing it from a diff only re-creates the uncommitted change; committing it with your work keeps the tree clean.

  • Helpers (lib/helpers/): who may do what is lib/professions.ts, the only domain-specific file in it; Diplodoctor changes that file, not the store. A lawyer is listed only where a reviewer verified the admission. Reviewers are accounts with the staff or admin role, granted only by the "Grant role" workflow or pnpm run role:grant. An attestation never carries a legal name in clear; keep lib/helpers/attest.test.ts proving it.
  • pnpm dev signs in on localhost only with CAUSIUS_DEV_URL=http://localhost:3000 (accounts pin their origin; ignored in production).