This file is read by Claude Code on startup. The authoritative project context lives in AGENTS.md. Read that first.
- This is a Flutter app (Dart 3, SDK
^3.8.0) plus a small Dart CLI and a Node Netlify backend. Repo layout, conventions and the backend contract live indocs/architecture.md. - Run
make buildafter any change to a@freezedclass, ajson_serializablemodel, or an enum with@JsonValueannotations. Never hand-edit*.freezed.dart,*.g.dartorapp_localizations*.dart. - Format what you touch:
dart format <the files you edited>before committing.lib/,test/andbin/are formatted baselines, so any diff the formatter produces is yours — and naming files rather than a directory keeps a commit scoped (dart format lib/reformats files you did not touch).make formatis the whole-tree sweep;make format-checkfails without writing. See rule 10 inAGENTS.md. - Run
flutter analyzeandflutter testbefore claiming a task is done. The old default-templatetest/widget_test.darthas been removed, so a clean run is the expected baseline; if a test fails, fix or flag it rather than asserting all tests pass. - User-visible strings go in
lib/l10n/app_en.arbandlib/l10n/app_nb.arb. No raw English in widgets. After editing an ARB runmake i18n(flutter gen-l10n) —make builddoes NOT regenerateapp_localizations*.dart. An ARB edit also feedsmake labels→lib/l10n/headless_labels.g.dart, the Flutter-free subset the CLI needs;make i18nandmake buildboth run it, andtest/l10n/headless_labels_sync_test.dartcatches drift. - Web-only code lives in
lib/web/behindif (dart.library.io)conditional imports. Do not importpackage:webordart:htmlfrom anything that is also compiled on Android or iOS. - The CLI (
bin/ringdrill.dart) and everything it transitively imports must stay free ofpackage:flutter/*imports. Its closure is now large (the source compiler, the models, the brief layer), so runflutter test test/bin/cli_flutter_free_test.dartwhen you touchlib/data/,lib/models/,lib/utils/orlib/services/brief/;make cli-checkis the authoritative check for the final gate. - Run
make mcp-bundleafter changing anything underlib/data/source/,lib/models/,lib/services/brief/orlib/l10n/. Those are cross-compiled to JavaScript for the hosted MCP endpoint (ADR-0060) and the bundle is committed; a stale one serves old compiler behaviour from/mcpwhile the app and CLI look fine. Changing how the function is packaged (netlify.toml,netlify/functions/mcp.js,netlify/functions/lib/,mcp/tools.mjs) is a different risk with the same silent failure mode — runnode --test netlify/tests/mcp-packaging.test.mjs, andnpm run smoke:mcponce it is deployed. Touching a[[redirects]]block is a third variant that no checkout test can see —/mcp/artifact/*(ADR-0070) is only proven bynpm run smoke:mcp, because a broken rewrite answers 200 with the app shell. See rule 1 inAGENTS.md. - A drill plan can be authored as one YAML source document and compiled:
ringdrill create | build | decompile | analyze | render | schema(DESIGN-014). The format is described exactly once — the field table inlib/data/source/source_fields.dartdrives every command and the generated JSON Schema — so add a field there, not in six places.build(decompile(d))must preserved'scontentHash; numbering comes from list position and names are never parsed or rewritten (ADR-0059). - Sentry calls must be inside the analytics consent gate set up in
lib/main.dart. Default is opt-out. - To see what a widget looks like without a browser or device, render it to a PNG via
skills/flutter-widget-preview/(harness attest/support/widget_preview_harness.dart). No-browser companion to Flutter's Widget Previewer. Reach for it whenever you change a widget's appearance and want to verify before claiming done (see rule 14 inAGENTS.md). - All documentation is written in English (
docs/, ADRs, DESIGN issues,README.md,AGENTS.md,CLAUDE.md). Real example data (e.g. Norwegian SAR-plan content) and quoted template fields may stay in their source language. See rule 12 inAGENTS.md.
/initwill offer to refresh this file. If you run it, keep the section above (the pointer toAGENTS.md) at the top, then update the bullets to match any architectural shifts./reviewand/security-revieware appropriate for changes that touchlib/data/,lib/services/exercise_service.dart,bin/ringdrill.dart, or anything undernetlify/functions/.
AGENTS.md wins. This file is only allowed to be more specific, never to contradict.