{"owner":"matthiasn","repo":"lotti","hasSkills":true,"totalSkillsCount":45,"totalTokensCount":33438,"categories":["anthropic-skill","root-instruction","project-spec","plugin-manifest","claude-rule","subagent-persona"],"hasMcp":false,"mcpConfig":null,"found":[".claude/skills/add-flutter-docusaurus-locale/SKILL.md",".agents/skills/release/SKILL.md",".agents/skills/beads/SKILL.md",".claude/skills/design-review-panel/SKILL.md",".claude/skills/maintain-docusaurus-manual/SKILL.md",".claude/skills/skeptical-review/SKILL.md",".claude/skills/analyze-db-logs/SKILL.md",".claude/skills/app-screenshots/SKILL.md","AGENTS.md",".claude/skills/tutorial-videos/SKILL.md",".claude/skills/review-comments/SKILL.md","DESIGN.md","docs/ARCHITECTURE.md","tools/matrix_provisioner/README.md","tools/tutorial_videos/README.md",".claude/skills/design-review-panel/panel_workflow.js","knowledge/features/agents/chat-input-and-reasoning.md","knowledge/features/agents/index.md","knowledge/features/agents/memory-and-compaction.md","knowledge/features/agents/overview.md","knowledge/features/agents/persistence-and-sync.md","knowledge/features/agents/project-and-event-agents.md","knowledge/features/agents/projection.md","knowledge/features/agents/query-chat.md","knowledge/features/agents/task-agents.md","knowledge/features/agents/templates-souls-evolution.md","knowledge/features/agents/ui-surfaces.md","knowledge/features/agents/wake-orchestration.md","lib/features/agents/README.md","tools/tutorial_videos/config/voices.yaml",".agents/skills/beads/agents/openai.yaml",".claude/skills/add-flutter-docusaurus-locale/agents/openai.yaml",".claude/skills/add-flutter-docusaurus-locale/references/end-to-end-checklist.md",".claude/skills/add-flutter-docusaurus-locale/scripts/audit_locale.py",".claude/skills/maintain-docusaurus-manual/agents/openai.yaml",".claude/skills/maintain-docusaurus-manual/references/discovery-and-review.md",".claude/skills/maintain-docusaurus-manual/scripts/audit_docusaurus_locales.py","lib/features/agents/projection/README.md","tools/tutorial_videos/config/scenarios/app_store_preview.yaml","tools/tutorial_videos/config/scenarios/category_setup.yaml","tools/tutorial_videos/config/scenarios/create_task_from_audio.yaml","tools/tutorial_videos/config/scenarios/onboarding_first_run.yaml","tools/tutorial_videos/config/scenarios/task_coding_prompt.yaml","tools/tutorial_videos/config/scenarios/task_cover_art.yaml","tools/tutorial_videos/config/scenarios/task_filters.yaml"],"skills":{".claude/skills/add-flutter-docusaurus-locale/SKILL.md":"---\nname: add-flutter-docusaurus-locale\ndescription: Add, complete, or audit a locale across a Flutter application's ARB catalogs and a localized Docusaurus manual, including generated localization code, locale selectors, native platform declarations, translated MDX, screenshot fixtures, tests, and parity validation. Use when introducing a new language, finishing an incomplete app or manual translation, aligning manual terminology with UI strings, or reviewing whether a locale is production-ready end to end.\n---\n\n# Add a Flutter and Docusaurus Locale\n\nTreat a locale as an end-to-end product capability, not merely a translated ARB\nfile. Preserve message contracts and wire the locale through app runtime,\nplatform metadata, manual routing, screenshots, tests, and release validation.\n\n## Build the locale inventory\n\n1. Read repository instructions and localization/manual contributor guides.\n2. Identify the canonical ARB, all locale ARBs, `l10n.yaml`, generation and\n   sorting commands, localization access conventions, and missing-translation\n   report.\n3. Find every locale allowlist: app delegates/controllers, settings UI, native\n   platform metadata, Docusaurus config, screenshot registries, CI matrices,\n   and documentation.\n4. Inspect one recently added locale in version history as a completeness map,\n   but verify every location against current code.\n5. Read [references/end-to-end-checklist.md](references/end-to-end-checklist.md)\n   for platform and manual integration surfaces.\n\n## Translate the Flutter catalog\n\n1. Copy the complete key set from the canonical ARB, including required\n   metadata and `@@locale` conventions.\n2. Translate user-visible messages in context. Preserve ICU syntax, placeholder\n   names, escaping, line breaks with semantic meaning, and product names.\n3. Use the project's tone and register. Keep terminology consistent across\n   related screens; inspect call sites when a source message is ambiguous.\n4. Do not translate internal identifiers, URLs, format skeletons, or values the\n   framework treats as syntax.\n5. Add locale-specific canonical metadata only where the generator or project\n   requires it.\n6. Run the generator and catalog sorter. Never hand-edit generated Dart files.\n\n## Wire the app and platforms\n\n- Add the locale to runtime choices and language-override state.\n- Update visible language names using localized strings where the UI requires\n  them.\n- Add native supported-language declarations for every shipped platform that\n  maintains an explicit list.\n- Update screenshot locale helpers and deterministic visible fixture copy.\n- Add behavior-focused tests for locale parsing, selection, persistence,\n  delegates, and any locale-specific formatting or fallback behavior.\n\nDo not infer that generated `supportedLocales` completes native registration.\n\n## Translate and wire the Docusaurus manual\n\n1. Add the locale to Docusaurus `i18n.localeConfigs`, navigation labels, footer\n   labels, and any search or routing configuration.\n2. Create the standard docs plugin translation files and a complete localized\n   page tree matching the canonical docs paths.\n3. Reuse terms from the target ARB for buttons, settings, statuses, and feature\n   names. Translate the surrounding explanation naturally.\n4. Preserve MDX imports, components, props, links, code, identifiers, and\n   screenshot case IDs.\n5. Add the locale to screenshot registries and produce every required theme and\n   viewport variant using the project's deterministic harness.\n6. Update contributor documentation and public language lists that users see.\n\n## Audit and validate\n\nRun the bundled contract audit before project-specific generation:\n\n```bash\npython3 <skill-dir>/scripts/audit_locale.py \\\n  --template-arb path/to/app_en.arb \\\n  --target-arb path/to/app_xx.arb \\\n  --source-docs path/to/docs \\\n  --target-docs path/to/i18n/xx/docusaurus-plugin-content-docs/current\n```\n\nThe audit fails on missing/extra ARB keys, placeholder drift, and manual page\npath mismatch. Identical translated page bodies are warnings unless\n`--fail-identical` is passed.\n\nThen run, in repository order:\n\n1. localization generation and ARB sorting;\n2. targeted localization, locale-selection, screenshot-helper, and manual tests;\n3. formatter and static analysis with zero diagnostics;\n4. the full manual typecheck, validation, tests, production build, and smoke test;\n5. focused Flutter tests required by the repository;\n6. rendered review of representative long strings and every translated manual\n   route.\n\nDo not report the locale complete while generated output is stale, translation\ngaps remain, or required checks fail.\n",".agents/skills/release/SKILL.md":"---\nname: release\ndescription: Cut a Lotti release — assemble the changelog.d/ fragments into CHANGELOG.md and the Flathub metainfo, bump the version, open the release PR, then tag. Use when asked to cut or prepare a release, assemble the changelog, publish a new version, or work out what is unreleased.\n---\n\n# Cut a release\n\nRelease notes are written per change as **fragments** in `changelog.d/`, one new\nfile per pull request, and assembled once per release. A release is therefore a\nsmall, boring, self-contained pull request: it turns the fragments into prose in\ntwo files, moves the version, and deletes what it consumed.\n\n**This is the only change allowed to touch `CHANGELOG.md`,\n`flatpak/com.matthiasn.lotti.metainfo.xml`, or the `version:` line in\n`pubspec.yaml`.** That rule is the whole point — those three files are written at\nthe top by everything, so as long as exactly one pull request per release writes\nthem, nothing can conflict. If you are here for any other reason, you are in the\nwrong skill; write a fragment instead (`changelog.d/README.md`).\n\n## Before you start\n\n```bash\ngit checkout main && git pull\nls changelog.d/[0-9]*.md       # the work queue; README.md is not a fragment\nfvm dart run tool/changelog/validate.dart --strict\n```\n\n`--strict` rather than `make changelog_check`: the house-style warnings the\nauthor-facing check only prints — an entry with no bold headline, a paragraph\npasted as one long line — are about to become published prose, so here they\nblock.\n\n- Work from an up-to-date `main`. A release assembled on a stale branch drops\n  whatever merged in the meantime.\n- If `changelog.d/` holds nothing but its README, there is nothing to release.\n  Say so and stop.\n- Fix any malformed fragment here, in the release branch. It is cheaper than\n  sending the author back.\n- A fragment describing something that was reverted before it shipped gets\n  deleted, not published.\n\n**Ask before committing, pushing or tagging.** Every step below writes files;\nthe git operations are the user's call, always.\n\n## 1. Read every fragment\n\nRead them all before writing anything. You are producing one coherent set of\nrelease notes, not a concatenation: two fragments may describe two halves of the\nsame user-visible change and should be merged into one entry, and a later\nfragment may supersede an earlier one.\n\n## 2. Choose the version\n\n```bash\ngrep -m1 '^version:' pubspec.yaml     # e.g. version: 1.0.13+4352\n```\n\n- **Bug fixes alone:** keep the semantic version unchanged and increment only\n  the build number (`1.0.21+4362` → `1.0.21+4363`). A fix-only release appends\n  its notes to the current top changelog section and metainfo release block; it\n  must not create a duplicate `## [1.0.21]` heading or `<release\n  version=\"1.0.21\">` block.\n- **User-facing additions or changes:** increment the patch version and the\n  build number (`1.0.21+4362` → `1.0.22+4363`). Any publishable `Added`,\n  `Changed`, `Deprecated`, or `Removed` entry makes this a user-facing release.\n- **Explicit minor release:** increment the minor version and reset the patch\n  component to zero only when the user explicitly requests a minor release\n  (`1.0.21+4362` → `1.1.0+4363`). The build number still increments normally.\n- **Build number:** always previous + 1. It only has to be unique and increasing\n  per tag — every release lane triggers on tag push, not on merges to `main` —\n  so it moves once per release, not once per pull request.\n\nIf the user named a version, use it. Otherwise propose one from what the\nfragments contain and confirm it.\n\n## 3. Assemble the CHANGELOG section\n\nFor a user-facing release, insert one new section at the top of `CHANGELOG.md`,\ndirectly under the Keep a Changelog preamble and above the previous version:\n\n```markdown\n## [1.0.22]\n### Added\n- **...**\n\n### Changed\n- **...**\n\n### Fixed\n- **...**\n```\n\n- **One section per type, in this order**: Added, Changed, Deprecated, Removed,\n  Fixed, Security. Skip the ones with no entries. Never repeat a heading inside\n  a version — older sections do, because entries used to be appended one PR at a\n  time; assembling from fragments is what fixes that.\n- **The version heading carries no date.** That is the file's existing shape.\n- Keep each entry's wording as the fragment wrote it, minus edits for\n  duplication, house voice, or an entry that reads oddly next to its neighbours.\n- Wrap at about 78 columns, continuation lines indented two spaces.\n\nFor a fix-only build release, add the new bullets to the current top semantic\nversion instead. Reuse its existing `### Fixed` heading, or create that heading\nin the normal section order if it does not have one. Never create a second\nversion section or a second `### Fixed` heading.\n\n## 4. Write the Flathub release block\n\nFor a user-facing release, add one `<release>` to\n`flatpak/com.matthiasn.lotti.metainfo.xml`, as the **first** child of\n`<releases>` — newest first:\n\n```xml\n<release version=\"1.0.22\" date=\"2026-08-25\">\n  <description>\n    <p>Fixed: ...</p>\n  </description>\n</release>\n```\n\nThis is the same prose, mechanically transformed. AppStream renders `<p>` as\nplain text: markdown does not survive it, and an unescaped `&` breaks the build.\n\nFor a fix-only build release, append the new `Fixed:` paragraphs to the\ndescription of the existing first `<release>` block and update that block's\ndate to the day the build is cut. Do not create a duplicate release block for\nthe unchanged semantic version.\n\n| In `CHANGELOG.md` | In the metainfo |\n|---|---|\n| one `- ` bullet | one `<p>`, same order as the section |\n| the `### Fixed` heading above it | the prefix `Fixed: ` on every paragraph in that section |\n| `- **Bold headline.** Detail…` | `Fixed: bold headline. Detail…` — bold markers dropped, first letter lowercased unless it is a proper noun (`Settings`, `Flathub`) |\n| hard-wrapped over several lines | one long line |\n| `—` or `–` | ` - ` |\n| `` `code` `` or a glyph like `•••` | plain words a user recognises — `\"...\"`, `the \"Location with the name CEST doesn't exist\" error` |\n| `&`, `<`, `>` | `&amp;`, `&lt;`, `&gt;` |\n\nWorked example, from 1.0.13:\n\n```markdown\n- **Daily habit reminders arrived hours late on iPhone, iPad and Android.** The\n  app could not work out which timezone the device was in, quietly settled for\n  UTC, and then built the reminder's time of day in UTC — so an 08:00 habit\n  reminder rang at 10:00 in Central European Summer Time.\n```\n\n```xml\n<p>Fixed: daily habit reminders arrived hours late on iPhone, iPad and Android. The app could not work out which timezone the device was in, quietly settled for UTC, and then built the reminder's time of day in UTC - so an 08:00 habit reminder rang at 10:00 in Central European Summer Time.</p>\n```\n\nThe `date` is the day the release is cut, `YYYY-MM-DD`.\n\n## 5. Bump the version\n\nOne line in `pubspec.yaml`:\n\n```yaml\nversion: 1.0.22+4363\n```\n\n## 6. Delete the fragments you consumed\n\n```bash\ngit rm changelog.d/[0-9]*.md       # fragments start with their date; README.md does not\n```\n\nEverything you just published goes. `changelog.d/` holding only its README is\nwhat \"nothing unreleased\" looks like; git history keeps the originals.\n\n## 7. Verify\n\n```bash\nmake changelog_check                                     # versions now agree\nxmllint --noout flatpak/com.matthiasn.lotti.metainfo.xml # if available\ngit status --short\n```\n\n`git status` must show exactly four kinds of change and nothing else:\n`CHANGELOG.md`, the metainfo, `pubspec.yaml`, and deleted fragments. A release\nPR that also carries code is a release PR that can conflict.\n\nRe-read the assembled section once as a user would. It is the text that reaches\nFlathub, the GitHub release and the app's What's New — it is read far more often\nthan it is written.\n\n## 8. Open the release pull request\n\nUse the semantic version in the title for a user-facing release:\n\n```\nchore(release): 1.0.22\n```\n\nUse the full version and build for a fix-only release so it is distinguishable\nfrom the release that first introduced that semantic version:\n\n```\nchore(release): 1.0.21+4363\n```\n\nBody: the entries assembled for this release, grouped under their release\nheadings, so review reads the new notes rather than the diff. For a fix-only\nrelease, label the body with the full version and build even though the\nchangelog heading remains the unchanged semantic version. No screenshots —\nnothing visual changed.\n\n## 9. Tag, after it merges\n\n```bash\ngit checkout main && git pull\nmake tag_push        # tags 1.0.22+4363 from pubspec.yaml and pushes it\n```\n\n`make tag_push` reads the version with `yq`; install it (`brew install yq`) or tag\nby hand with the exact `version+build` string if the target reports it missing.\n\nThe tag is what ships. Pushing it triggers, in parallel: macOS and iOS\nTestFlight, the Android release, the Linux GitHub release, the macOS signed\n`.dmg`, the Flathub submission PR against `flathub/com.matthiasn.lotti` —\nwhich is why the metainfo has to be right *before* the tag, not after — and\nthe manual of that version (`/manual/<x.y.z>/`, the one the app links to).\nA tag whose manual sources are unchanged publishes in a minute by reusing the\nprevious release's snapshot; otherwise the manual run recaptures all eleven\nlocales and takes about an hour.\n\nOn Google Play the release tag stops at internal testing. Moving that build on\nis a separate tag from the same commit, once the internal upload has finished:\n`make android_closed_testing` for closed testing, `make android_release` for\nproduction. Both promote the build Play already has rather than rebuilding it;\nthe mechanism is the *Google Play tracks* section of\n[`knowledge/architecture/platform-and-release.md`](../../../knowledge/architecture/platform-and-release.md).\n\nConfirm with the user before tagging. Watch the lanes; `docs/macos-release.md`\nand `docs/flatpak-flathub-recovery.md` cover the two that fail in interesting\nways.\n\n## 10. Downstream, and out of scope here\n\nThe app's **What's New** modal reads from the separate `matthiasn/lotti-docs`\nrepository (`whats-new/`), not from this one. Publishing there is an editorial\nstep in that repo — mention it once the release is tagged; do not attempt it\nfrom here.\n\n## Gotchas\n\n- **The metainfo lagging a version behind is invisible until Flathub ships it.**\n  `make changelog_check` fails on exactly that, which is why it runs in CI on\n  every push rather than only at release time.\n- **Tags carry the build number** (`1.0.14+4353`), and every release lane keys\n  on tag push. Re-tagging the same build number to fix a mistake will not give\n  you a fresh TestFlight build; bump the build number and cut again.\n- **Do not fold anything else into the release PR** — not a \"quick fix\", not a\n  dependency bump. The moment it carries code it can conflict, and the reason\n  this flow exists is gone.\n",".agents/skills/beads/SKILL.md":"---\nname: beads\ndescription: Use for authorized Lotti maintainer work that needs private durable task tracking, issue dependencies, blocker management, multi-session handoff, or shared agent memory. Public contributors use GitHub Issues instead.\n---\n\n# Beads\n\nUse Beads as the private durable task system for authorized Lotti maintainers.\nPublic bugs, feature requests, and contributor coordination stay in GitHub\nIssues. Local plans remain useful for the current turn.\n\n## First Step\n\nFirst confirm that the private tracker is available:\n\n```bash\nbd --readonly list --json\n```\n\nIf no database exists and the current user is an authorized maintainer, run:\n\n```bash\nchmod 700 .beads\ngit config beads.role maintainer\nbd bootstrap\n```\n\nIf access is denied, do not initialize a competing database. Use GitHub Issues\nand PR discussion instead.\n\nRun `bd prime` manually when workflow context is needed. Do not install Git,\nCodex, or Claude hooks for Beads in this repository.\n\n## Core CLI Workflow\n\n1. Pull and find work:\n\n```bash\nbd dolt pull\nbd ready\nbd list --status=open\nbd list --status=in_progress\n```\n\n2. Inspect before editing:\n\n```bash\nbd show <id>\n```\n\n3. Claim work atomically:\n\n```bash\nbd update <id> --claim\n```\n\n4. Create durable follow-up work when implementation reveals new tasks:\n\n```bash\nbd create \"Short title\" --description=\"Why this exists and what needs to be done\" --type=task --priority=2\n```\n\n5. Close completed work:\n\n```bash\nbd close <id> --reason=\"Completed\"\n```\n\n6. With explicit authority, publish durable changes:\n\n```bash\nbd dolt push\n```\n\n## What Belongs In Beads\n\nMaintainers use Beads for:\n\n- shared project tasks\n- blockers and dependencies\n- discovered follow-up work\n- work that must survive thread reset, compaction, or handoff\n- status that another person or agent should be able to resume\n\nPublic-facing context must still be copied into GitHub issues, PR descriptions,\nor review discussion so contributors never need private tracker access.\n\n## Rules\n\n- Do not use `bd edit`; it opens an interactive editor. Use `bd update` flags instead.\n- Prefer `--json` when parsing `bd` output programmatically.\n- Do not auto-close or mutate tasks unless the work is actually complete.\n- Do not store credentials, private user data, or other secrets in Beads.\n- Do not commit, push Git, or sync Dolt without explicit authority.\n",".claude/skills/design-review-panel/SKILL.md":"---\nname: design-review-panel\ndescription: Run a multi-agent design review on a UI surface — capture reproducible baseline screenshots, then rate them with a panel of design experts (one agent per craft dimension) and, optionally, a panel of user personas with different cognitive styles. Iterate implement → re-screenshot → re-rate until every panel hits a numeric target (e.g. avg ≥8/10). Use when polishing or redesigning a screen/modal/dialog and the user wants grounded, scored design feedback (\"summon the design panel\", \"rate this with the experts\", \"run the persona panel\").\nargument-hint: \"<surface to review, e.g. 'AI popup model picker'>\"\n---\n\n# Design Review Panel\n\nA repeatable, grounded process for design polish and redesign work. It pairs\ntwo parallel agent panels — **design experts** (craft dimensions) and,\noptionally, **user personas** (cognitive styles) — and drives them against\n**real screenshots the agents actually `Read`**, iterating to a numeric target.\n\nThis is how the user wants UI/design tasks run. The numeric target is the\nsuccess condition: keep iterating until both panel averages clear the bar\n(the workflow's `cleared` flag).\n\n## The loop\n\n```mermaid\nstateDiagram-v2\n    [*] --> Baseline\n    Baseline --> RateBaseline: capture reproducible PNGs (app-screenshots)\n    RateBaseline --> Implement: both panels score the current state\n    Implement --> Rescreenshot: apply highest-leverage fixes (design-system tokens only)\n    Rescreenshot --> Rerate: regenerate the SAME shots\n    Rerate --> Implement: either panel average < target\n    Rerate --> Harden: both panel averages ≥ target\n    Harden --> [*]: tests, l10n, README, changelog.d fragment, analyzer clean, PR\n```\n\n1. **Baseline screenshot first.** Use the `app-screenshots` skill / the\n   `test/test_utils/screenshot_harness.dart` `captureInApp` harness to render\n   the surface at phone **and** desktop, dark (add light + large-text shots\n   when accessibility is in scope). Reproducible PNGs are mandatory — the\n   panels are only as honest as the pixels they read.\n2. **Rate the baseline with BOTH panels up front.** Get grounded starting\n   scores before changing anything. Never carry over scores from a previous\n   session — re-rate on a freshly regenerated PNG every time (grounded\n   re-rating reliably deflates inflated prior numbers).\n3. **Iterate with the expert panel** until experts clear the bar. Bring the\n   persona panel into the loop once experts reach ≥8 so the two converge\n   together. Each iteration: implement → regenerate the exact same screenshots\n   → re-rate.\n4. **Adjudicate genuine tradeoffs with the user** (`AskUserQuestion`) instead\n   of silently picking a side — before declaring a conflict irreducible, hunt\n   for a both-sides fix (one change that serves two opposed reviewers).\n5. **Harden to PR-ready** once converged: tests, l10n, feature README, a\n   `changelog.d/` fragment (never `CHANGELOG.md` or the flatpak metainfo\n   directly — those belong to the release), analyzer zero-warning, formatter,\n   PR on latest main.\n\n## The two panels\n\n### Design-expert panel (always)\nOne agent per craft dimension. Default lenses (adapt to the surface):\n- **Visual hierarchy / IA** — what reads primary/secondary/tertiary; scent.\n- **Design-system consistency** — tokens, spacing rhythm, component reuse;\n  does the surface feel like ONE system or bolted-together parts.\n- **Color / contrast / semantics** — palette restraint, status-by-more-than-color.\n- **Typography** — ramp, weight contrast, measure, rhythm.\n- **Spacing / density / rhythm** — padding, alignment, optical balance.\n- **Interaction / task-flow** — taps-to-goal, affordances, dead-ends, the\n  \"1-tap to the common case\" promise.\n\n### User-persona panel (on by default — pass `includePersonas: false` to skip)\nDifferent cognitive styles stress the surface as real users:\n- **ADHD / clutter-sensitive** — needs \"what now\" instant; abandons noise.\n- **Power user** — counts seconds, allergic to wasted space/steps.\n- **Low-vision / low-confidence** — large text, strong contrast, fears\n  irreversible taps.\n- **Minimalist aesthete** — wants calm, uniform, restrained.\n- **Non-technical novice / second-language** — reads copy literally; jargon\n  and ambiguous labels break them.\n\nPersonas return a **verdict** (would-use / would-struggle / would-abandon) plus\nblockers / frictions / delights. Experts return a **1–10 score** per surface\nplus severity-tagged issues with evidence + a concrete fix.\n\n## Grounding rules (give these to every agent verbatim)\n- **`Read` every screenshot path.** Base every visual claim on actual pixels.\n  Panels hallucinate failures when they don't — forbid it.\n- **No invented measurements.** Don't fabricate px gaps or contrast ratios; if\n  you can't measure it, describe it qualitatively and tie it to something\n  visible.\n- **Every issue carries evidence** — a named screenshot (\"picker_desktop: …\")\n  or a `file:line`. Code claims (e.g. \"hardcodes spacing\") require Reading the\n  file and citing the line.\n- **Grumpy, calibrated scoring:** 10 = ship-grade, nothing to fix; 8 = good,\n  only polish left; 6 = usable but rough; 4 = several real problems; ≤3 =\n  broken. Do not be generous.\n- **List test-rig artifacts to IGNORE** (stand-in nav bars, tofu glyphs,\n  folded-hour bands) so the panel doesn't score the harness.\n\n## Running it\n\nDrive both panels as a `Workflow` so the agents run in parallel and return\nstructured scores. A parameterized reference script lives next to this file:\n**`panel_workflow.js`** — pass `args` describing the surface, screenshot paths,\nsource files, expert lenses, personas, and `includePersonas` /\n`target`. Adapt the lenses and persona prompts to the surface; keep the schema\nand the iterate-to-target loop.\n\n```\nWorkflow({ scriptPath: \".claude/skills/design-review-panel/panel_workflow.js\", args: { ...see file header... } })\n```\n\nRead the returned synthesis, apply the must-fixes, regenerate the same\nscreenshots, and re-run until the returned `cleared` is `true` (both panel\naverages meet the `target`). Then delete the scratch capture test and\n`test/screenshots/` (per the app-screenshots skill) unless the user asks to\nkeep them.\n\n## See also\n- `app-screenshots` — the reproducible capture harness this skill depends on.\n- `AskUserQuestion` — for adjudicating genuine, irreducible design tradeoffs.\n",".claude/skills/maintain-docusaurus-manual/SKILL.md":"---\nname: maintain-docusaurus-manual\ndescription: Maintain a Docusaurus product manual whose prose, navigation, localized page trees, screenshots, coverage metadata, and release build must stay aligned with the application. Use when adding or revising manual pages, documenting a product change, updating translated MDX, repairing locale parity, adding registered screenshots, auditing stale documentation, or validating a multilingual Docusaurus site before publication.\n---\n\n# Maintain a Docusaurus Manual\n\nTreat the running product and source code as authoritative. Keep documentation,\ntranslations, navigation, screenshots, inventories, and generated site behavior\nconsistent in the same change.\n\n## Discover the project contract\n\n1. Read the repository instructions and the manual's own contributor guide.\n2. Locate the Docusaurus config, source docs, localized docs, sidebar, package\n   scripts, validation scripts, screenshot registry, coverage inventory, and CI.\n3. Identify the canonical locale, supported locales, URL/version scheme, and\n   whether localized pages may fall back or must have exact path parity.\n4. Locate app strings or another terminology source before translating UI names.\n5. Read [references/discovery-and-review.md](references/discovery-and-review.md)\n   when the repository has custom inventories, generated screenshots, or\n   versioned publishing.\n\nDo not assume conventional paths when the repository declares its own.\n\n## Update the manual\n\n1. Verify the current product behavior from implementation and focused tests.\n2. Update the canonical page with concrete, task-oriented prose. Describe only\n   controls, states, limitations, and workflows that exist.\n3. Preserve stable frontmatter identifiers, component calls, links, anchors,\n   admonitions, and code unless the change intentionally modifies them.\n4. Add new pages to navigation and every repository-owned coverage or surface\n   inventory.\n5. Update every published locale required by the project. Translate meaning,\n   not sentence shape; preserve product terminology from the localized app.\n6. Record questionable product wording separately unless changing UI copy is\n   explicitly in scope.\n\n## Handle screenshots as evidence\n\n- Prefer the repository's deterministic screenshot harness and registry.\n- Capture the real production widget or route with representative state.\n- Keep required locale, viewport, and theme variants complete.\n- Reference screenshots through the site's component or registry rather than\n  hard-coded media URLs when such an abstraction exists.\n- Keep generated media outside the source repository when that is the declared\n  architecture.\n\nIf the task is only a one-off application screenshot, use the repository's\nscreenshot skill instead of extending the manual pipeline.\n\n## Validate in increasing scope\n\n1. Run the bundled parity audit when the site uses standard Docusaurus locale\n   trees:\n\n   ```bash\n   python3 <skill-dir>/scripts/audit_docusaurus_locales.py \\\n     --site-root path/to/site\n   ```\n\n   Pass `--fail-identical` only when identical localized page bodies are\n   forbidden. Treat its default identical-page output as a review warning.\n\n2. Run focused repository validators and tests for touched metadata or helpers.\n3. Run type checking, link/content validation, unit tests, and the production\n   Docusaurus build through repository scripts.\n4. Smoke-test built routes, locale switching, assets, search, and base URLs.\n5. Review the rendered page at representative widths and in every changed\n   locale. A successful build does not prove prose accuracy or layout quality.\n\nDo not claim completion while required checks fail. Report any validation that\ncould not run and why.\n",".claude/skills/skeptical-review/SKILL.md":"---\nname: skeptical-review\ndescription: Act as a skeptical senior engineer performing a detailed code review of the latest changes on the current branch (or a given PR) — best practices, maintainability, performance, security, and readability. Objective and concise; only real issues, with a clear \"no issues\" verdict when the code is clean. Replaces CodeRabbit / Gemini Code Review.\nargument-hint: \"[optional: PR number, base branch, or path scope]\"\n---\n\n# Skeptical Senior Engineer Review\n\nYou are a skeptical senior engineer performing a detailed, professional code\nreview. The bar is a practical, fair assessment a maintainer can act on\ndirectly, not a wall of generated nitpicks.\n\n## Ground rules (non-negotiable)\n\n- **Be objective and concise** — only point out real issues or suboptimal\n  practices you can defend with a concrete failure mode or maintenance cost.\n- **If the code follows best practices and there are no issues, say so\n  clearly.** Do not invent imaginary problems to look thorough. \"This diff is\n  clean\" is a valid and valuable review outcome.\n- **For each issue**, briefly explain *why* it's a problem and suggest a\n  better approach or concrete improvement.\n- **Focus on** clarity, structure, code style, logic, and efficiency —\n  correctness first, then maintainability, performance, security,\n  readability.\n- **Avoid nitpicking** minor style differences unless they impact clarity or\n  maintainability. The analyzer and formatter already police style; don't\n  duplicate them.\n- **Review the diff, not the whole file** — but read enough surrounding code\n  to judge the change in context. Never flag something as missing without\n  first checking whether it exists elsewhere in the codebase.\n\n## Scoping the diff\n\nTreat `$ARGUMENTS` as optional. Resolve what to review in this order:\n\n1. **PR number given** (e.g. `/skeptical-review 3413`) — fetch the PR diff\n   via `gh pr diff <n>` and `gh pr view <n>` for title/description context.\n2. **Base branch given** (e.g. `/skeptical-review develop`) — diff the\n   current branch against that base.\n3. **Path scope given** (e.g. `/skeptical-review lib/features/ai`) — limit\n   the branch diff to that path.\n4. **No arguments** — review the current branch's latest changes:\n   `git diff main...HEAD` **plus** uncommitted work\n   (`git diff HEAD` and untracked files via `git status`). Say explicitly\n   which of the two buckets each finding falls in when both exist.\n\nBefore reviewing, print a one-paragraph scope statement: branch, base,\nnumber of files/insertions/deletions, and a one-line summary of what the\nchange is trying to do (from commit messages / PR description). If the diff\nis empty, say so and stop.\n\nSkip generated files (`*.g.dart`, `*.freezed.dart`, `lib/l10n/app_localizations_*.dart`)\nexcept to verify they were regenerated when their sources changed. Treat\n`third_party/` as vendored: review it lighter — flag only correctness and\nsecurity issues, not style, and note divergence-from-upstream risk instead.\n\n## Review dimensions\n\nWork through the diff with these lenses, in this priority order:\n\n1. **Correctness & logic** — off-by-one, null/async races, wrong operator,\n   state not reset, error paths swallowed, edge cases (empty list, first\n   run, migration), broken invariants between files that changed together.\n2. **Maintainability & structure** — duplication that should be extracted,\n   wrong layer (business logic in widgets, UI concerns in repositories),\n   dead code added, public API surface grown without need, missing or\n   now-stale docstrings on touched functions.\n3. **Performance** — unnecessary rebuilds (missing `const`, provider\n   over-watching), N+1 queries, work in `build()` that belongs in a\n   provider/controller, unbounded growth (caches, listeners never disposed,\n   stream subscriptions leaked).\n4. **Security & privacy** — secrets or tokens in code/logs, injection into\n   SQL/shell/URLs, sensitive journal data written to logs or synced when it\n   shouldn't be, permissions widened.\n5. **Readability** — misleading names, comments that restate code or will\n   rot, control flow that needs a rewrite to be followed (only when it\n   genuinely impairs the next reader — see nitpick rule above).\n\n## Project-specific checks (Lotti)\n\nThis repo has house rules; a change violating them is a real finding, not a\nnitpick. Verify against `AGENTS.md` (authoritative) — highlights:\n\n- **Tests**: one test file per source file, mirrored paths; centralized\n  mocks (`test/mocks/mocks.dart`), fallbacks, and `makeTestableWidget` /\n  `setUpTestGetIt` helpers; no `Future.delayed`/`sleep`/real timers; no\n  `DateTime.now()`; meaningful assertions only (`findsOneWidget` alone is\n  not a test). New/changed behavior in `lib/` without matching test changes\n  is worth flagging.\n- **l10n**: no hardcoded user-visible strings; new labels added to every\n  full catalog in `lib/l10n/`, with `app_en_GB.arb` getting an entry only\n  where British spelling differs (list, exception and register rules in\n  `knowledge/conventions/localization.md`); generated l10n Dart files never\n  hand-edited.\n- **Design system**: no raw spacing numbers, `TextStyle` constructors, or\n  ad-hoc colors — tokens (`tokens.spacing.*`, `tokens.typography.*`,\n  `tokens.colors.*`) are mandatory in UI code.\n- **UI stability**: async providers must not flash loading/empty shells on\n  background refresh (`skipLoadingOnReload` or equivalent).\n- **Docs & release hygiene**: feature READMEs updated when behavior\n  changed; a release note as a new `changelog.d/YYYY-MM-DD-slug.md` fragment\n  (only for user-visible changes). A PR that edits `CHANGELOG.md`, the flatpak\n  metainfo, or the `version:` line in `pubspec.yaml` is a finding, not a\n  courtesy — those three belong to the release alone.\n- **Conventions**: Conventional Commits; no dependencies from new code onto\n  old code being replaced; no hoarded/unused code.\n\nDo not re-run the analyzer or tests as part of the review by default — this\nis a reading review. If a finding hinges on runtime behavior you cannot\ndetermine by reading (e.g. \"does this provider rebuild?\"), say so and mark\nthe finding as needing verification rather than asserting it.\n\n## Output format\n\nDeliver the review as a single final message:\n\n1. **Verdict line** — one sentence: overall assessment (e.g. \"Solid change\n   with two real issues and one suggestion\" or \"Clean — no issues found\").\n2. **Scope statement** — the paragraph described above.\n3. **Findings**, ordered by severity, each formatted as:\n\n   ```text\n   ### <severity> — <one-line summary>\n   `path/to/file.dart:123`\n   Why it's a problem: <one or two sentences>\n   Suggestion: <concrete fix or better approach; short code sketch if it helps>\n   ```\n\n   Severity levels: **Blocker** (must fix before merge — bugs, security,\n   data loss), **Should fix** (real maintainability/performance cost),\n   **Consider** (worthwhile improvement, author's call). Do not pad lower\n   tiers to seem thorough — an empty tier is fine.\n4. **What's done well** — one short paragraph max, only if genuinely\n   noteworthy (patterns worth repeating), never as filler praise.\n\nKeep the whole review proportional to the diff: a 20-line diff gets a short\nreview. If the real issues would make a long list, the change needs a rewrite\nconversation, not a list; say that instead.\n\n## What NOT to do\n\n- Do not modify any code. This skill is read-only; if the user wants fixes\n  applied, they will ask after reading the review.\n- Do not flag issues in code the diff merely touches adjacent to (moved\n  lines, re-indentation) — pre-existing problems may be *mentioned* once,\n  clearly labeled \"pre-existing, out of scope\".\n- Do not restate the diff's contents as findings (\"this adds a provider\")\n  — every finding must carry a judgment.\n- Do not hedge to inflate counts: if you're unsure it's a problem, either\n  verify by reading more code or drop it.\n",".claude/skills/analyze-db-logs/SKILL.md":"---\nname: analyze-db-logs\ndescription: Analyze Drift / SQLite slow-query and super-slow-query logs against this app's known stall patterns (read waves, N+1, transaction scoping, MultiExecutor contention, WAL/OS factors)\nargument-hint: \"<path-to-logs-dir> [optional: date YYYY-MM-DD or relative window]\"\n---\n\n# Analyze DB Slow-Query Logs\n\nReads slow-query log files written by `lib/database/slow_query_logging.dart`\nand produces an actionable diagnosis grounded in this codebase's stack\n(Dart, Flutter, Drift, SQLite).\n\n## Invocation\n\nThe user provides the path to the log directory — typically a gitignored\nlocal copy they pulled off a device or simulator. Repository convention is\n`./logs/` at the repo root (already in `.gitignore`).\n\n```sh\n/analyze-db-logs ./logs/                       # most recent date in ./logs/\n/analyze-db-logs ./logs/desktop                # platform-scoped subdir\n/analyze-db-logs ./logs/mobile 2026-05-02      # specific date\n/analyze-db-logs /tmp/from-device              # any absolute path\n```\n\nTreat `$ARGUMENTS` as `<path> [optional date or window]`. The first\npositional must be the path; refuse with a one-line prompt if it is\nmissing — do NOT invent a default location, the user knows where their\nlogs are. Date is optional and defaults to \"the most recent file per\nstem found under that path\".\n\nAlways print the resolved paths and line counts before analysing, so the\nuser can confirm the right files are loaded.\n\n## Log file shapes\n\nThe `SlowQueryInterceptor.fileReporter` writes two daily files per\nplatform under whatever `documentsDirectoryPath/logs/` the running app\nresolved to. The user is responsible for copying them into the path they\nhand to this skill. Expect:\n\n- `slow_queries-YYYY-MM-DD.log` — every query above the configured\n  threshold (default 10ms; gated by `SlowQueryLoggingGate.isEnabled`).\n- `super_slow_queries-YYYY-MM-DD.log` — duplicates of queries above the\n  super-slow threshold (default 200ms), enriched with `EXPLAIN QUERY\n  PLAN` rows under `PLAN:` and (when first-call stack capture is on)\n  filtered application stack frames under `STACK:`.\n\n### Subdirectory layout\n\nBy convention this repo's `./logs/` contains one subdirectory per\nplatform — typically `desktop/` and `mobile/` (sometimes `ios/`,\n`android/`). Each subdir holds its own daily files. When the path the\nuser supplies is a directory that contains *only* subdirectories (no\n`*.log` files at its top level), treat each subdirectory as a separate\nplatform-scoped scan and label every finding with the subdir name so\nthe user can tell which device it came from.\n\nIf the user supplies a more specific path (e.g. `./logs/mobile/`),\nrespect that and don't go up a level. If they supply the parent and\nboth `desktop/` and `mobile/` are present, analyse both and produce one\nreport section per platform plus a brief cross-platform summary at the\nend.\n\nGlob discovery rule of thumb:\n\n```text\n<path>/{slow_queries,super_slow_queries}-*.log         # path is leaf\n<path>/*/{slow_queries,super_slow_queries}-*.log       # path is parent\n```\n\nPick the most recent date per `(subdir, stem)` pair unless a date arg\nis given.\n\n## Log line formats\n\nA slow-query line is a single line:\n\n```text\n2026-05-02T19:11:48.592 [db.sqlite] select 388.759ms args=0 SELECT * FROM ...\n```\n\nA super-slow entry is the same line plus indented continuation lines:\n\n```text\n2026-05-02T19:11:48.592 [db.sqlite] select 388.759ms args=0 SELECT ...\n  PLAN: 4|0|SEARCH journal USING INDEX idx_journal_browse (deleted=? AND type=?)\n  PLAN: 84|0|USE TEMP B-TREE FOR ORDER BY\n  STACK: #10     JournalDb.getAllDashboards (package:lotti/database/database.dart:3056:34)\n  STACK: #11     dashboardsProvider.<anonymous closure> (package:lotti/features/dashboards/state/dashboards_page_controller.dart:20:14)\n```\n\nThe interceptor filters `STACK:` lines to drop drift, dart-runtime,\nriverpod and the slow-query plumbing itself; only `package:lotti/...`\nframes remain.\n\n## Analysis procedure\n\n1. **Resolve the file set.** Honor the platform argument; pick the most\n   recent date per stem if no date is given. Tail-load the file (last\n   ~2000 lines is usually enough — the interceptor appends, so the wave\n   you care about is at the end). Print the resolved paths.\n\n2. **Bucket entries by query shape.** Collapse per-row args; group by\n   the normalized statement. For each bucket capture: count, p50/p95/max\n   elapsed, the unique `PLAN:` shapes, and the unique `STACK:` heads\n   (top app-code frame).\n\n3. **Diagnose against the known patterns below.** For every finding,\n   cite the specific log lines (timestamp + elapsed + statement\n   prefix). Do not generalize — show the data.\n\n4. **Recommend the fix.** Reference the existing seam (drift query,\n   coalescer, transaction wrapper, index, etc.) and where in the code\n   the change would land. If a fix is speculative, say so.\n\n## Known stall patterns to look for\n\nThese are battle-tested findings from this codebase. Apply them in order;\nthe first match is usually the dominant cost.\n\n### 1. Read waves — N queries reporting hundreds of ms but finishing in a tight burst\n\n**Signature**: a cluster of 10–20+ queries whose `elapsed` is roughly\nidentical (e.g., all in the 600–700ms band) but whose timestamps span\nonly 10–30ms. Each query's plan is fine; the SQL itself is fast.\n\n**Diagnosis**: the queries were *queued* behind something — typically a\nwrite transaction holding the writer lock, an `ANALYZE` on the boot\npath, or a slow `beforeOpen` hook. The wall-clock measurement starts\nwhen drift accepts the request, so queue wait shows up as \"elapsed\".\n\n**Confirm by**:\n- Check the `elapsed` band: a 100ms+ spread *across* the wave with\n  near-identical *finish* timestamps (use the leading ISO timestamp,\n  not the elapsed) means the queries unblocked together. The\n  interceptor strips drift / dart-runtime frames so the original\n  `STACK: #5 DatabaseConnectionUser.doWhenOpened` boilerplate is\n  *not* visible in the log — infer the gate from the timing pattern,\n  not from a frame name.\n- Look at the line *just before* the wave for a long-running write or\n  transaction.\n- Boot waves often correlate with `EntitiesCacheService.init` firing\n  `Future.wait` of definitions queries — the surviving `STACK:` heads\n  for the wave will point at distinct controllers / repositories\n  whose initial fetches all queued together.\n\n**Likely fixes**:\n- Move `ANALYZE` and other heavy work *off* the boot path (`beforeOpen`\n  must return fast).\n- Narrow transaction scopes (see pattern 4).\n- Raise the read pool size only after confirming isolate-spawn cost is\n  the bottleneck — bumping `readPool` adds isolate-spawn cost upfront.\n\n### 2. N+1 reads — a cluster of single-id selects from one call site\n\n**Signature**: many lines like\n`SELECT * FROM \"journal\" WHERE \"id\" = ? AND \"deleted\" = ?`, all from the\nsame `STACK:` head, all reporting nearly identical elapsed times.\n\n**Diagnosis**: a `Future.wait(ids.map(byId))` or a per-row provider\nfamily fanning out single-id reads. Each call queues through the read\npool independently.\n\n**Recurring offenders already fixed in this codebase**:\n- `taskLiveDataProvider` (FutureProvider.family per task) → solved by\n  `JournalDb._coalesceEntityById` (microtask-coalesced bulk fetch).\n- `LinkedAiResponsesController._fetch` → switched from `Future.wait` to\n  `journalRepository.getJournalEntitiesByIds(...)`.\n- `EditorStateService.init` drafts loop → switched to\n  `journalEntitiesByIdsUnorderedAllPrivate(idList)`.\n\n**Likely fixes**:\n- Replace fan-out with a bulk drift query (`journalEntitiesByIdsUnorderedAllPrivate`,\n  `getJournalEntitiesForIdsUnordered`, `linksForEntryIds`, etc.).\n- For Riverpod families that genuinely need per-row instances, route\n  through the existing entity-by-id microtask coalescer.\n\n### 3. Drift MultiExecutor contention — reads inside a transaction run on the writer\n\n**Reminder**: in drift, anything wrapped in `db.transaction(() async { ... })`\nruns on the *write* connection — even pure `select(...)` calls inside\nthe block. The read-pool isolates do NOT pick those up. So a\n`transaction { read; read; …; write; commit }` body serialises every\nread behind every other write that touches the same writer.\n\n**Confirm by**: look at the `STACK:` head for a frame inside an apply /\nupsert / migration path. If the read appears to hit a fast plan but\nelapsed is high and other writes are visible nearby, the read was\nforced onto the writer.\n\n**Likely fixes**:\n- Pull pre-read / post-write side effects *out* of the transaction\n  block.\n- Only wrap statements that genuinely need atomicity together.\n- Cross-DB writes (e.g., to `sync_db`, `settings_db`, `agent_db`,\n  `ai_config_db`) cannot be atomic with `JournalDb` writes anyway —\n  doing them inside a `JournalDb.transaction` only holds the journal\n  writer lock for unrelated work.\n\n### 4. Transaction scoping — broad wrappers around unrelated DB writes\n\n**Signature**: the same wave shape as pattern 1, but the suspected\n\"writer holding the lock\" is a sync apply that's logging a\n`SyncJournalEntity`-shaped write while *also* awaiting a\n`_sequenceLogService.recordReceivedEntry` (sync_db) or other cross-DB\nwork inside the same `transaction { ... }`.\n\n**Diagnosis**: this codebase fixed exactly this in\n`queue_apply_adapter.dart` via `_writesJournalDb(SyncMessage)` — the\nadapter now wraps in `JournalDb.transaction` *only* for payload\nfamilies that actually write to JournalDb tables (journal entity,\nentry link, entity definitions, outbox bundle, conservatively the\nbackfill request/response paths). Theming, ai-config, agent\nentity/link/bundle writes bypass the wrapper because they target\nother databases.\n\n`_persistJournalEntity` was also restructured: the pre-read\ndiagnostic `journalEntityById`, the post-write\n`_sequenceLogService.recordReceivedEntry` (`sync_db`), and the\nentry-exists check now run **outside** the narrow journal transaction.\n\n**When inspecting new code**: any new `db.transaction(() async { ... })`\nthat contains an `await` to a different database, a network call, or a\nfilesystem write is a candidate for narrowing.\n\n### 5. Wrong-index plans masquerading as slow SQL\n\n**Signature**: a single query reporting hundreds of ms with a plan\nthat includes `USE TEMP B-TREE FOR ORDER BY`, `SCAN <table>`, or an\nindex match where the leading column is not the most selective\npredicate.\n\n**Recurring offenders already fixed in shipped code** — verify these\nstill match the current `lib/database/database.drift`,\n`lib/database/sync_db.dart`, and `lib/database/database.dart` before\nciting them. Treat the list as historical context, not an asserted\ncurrent truth:\n- `task_priority_rank` ordering with high-cardinality\n  `category IN (...)` predicate. The fix shipped as a partial index\n  named (at the time) `idx_journal_tasks_status_priority_date`; if it\n  is still in `database.drift`, recommend it as the steady-state path,\n  otherwise treat the symptom as an open issue.\n- `getBulkLinkedTimeSpans` join over `linked_entries`. The fix shipped\n  as a covering index `idx_linked_entries_from_id_hidden_to_id`.\n- `inbound_event_queue` stats `MIN(enqueued_at)` SCAN. The fix shipped\n  as `idx_inbound_event_queue_status_enqueued` plus\n  `idx_inbound_event_queue_status_due_lease`.\n- `claimNextOutboxBatch` SCAN from\n  `status = pending OR (status = sending AND updated_at < cutoff)`.\n  The fix shipped as two indexed seeks merged in Dart.\n\nIf a query still matches one of these symptom shapes despite the named\nindex existing, suspect stale stats first (recommend `ANALYZE`) before\nproposing a new index.\n\n**When inspecting new logs**: if the plan is suboptimal, recommend\nrunning `ANALYZE` first (planner stats can drift); only after\nconfirming with fresh stats should you propose a new index. Bad plans\non a freshly-`ANALYZE`d DB are real index gaps.\n\n### 6. WAL / OS-level factors\n\nWhen patterns 1–5 don't explain a stall, consider:\n- **WAL checkpoint storms**: a write that crosses\n  `wal_autocheckpoint` (default 1000 pages, ~4MB) triggers a\n  checkpoint that briefly takes a more aggressive lock. Bursty write\n  workloads can stall reads at checkpoint boundaries.\n- **macOS sandboxed file locks**: `fcntl(F_FULLFSYNC)` and BSD locks\n  on iCloud-backed paths have shown long tails. Less likely on dev\n  but worth flagging.\n- **Background isolate spawn (`createInBackground(readPool: N)`)** —\n  isolates may spawn on first use; the *first* boot wave can pay\n  per-isolate setup cost (~50–200ms each). Subsequent app sessions\n  should be much faster — first wave is the worst case.\n- **`PRAGMA foreign_keys = ON`** runs per-connection; cheap but real.\n\n### 7. Per-launch repair / housekeeping that shouldn't run every boot\n\n**Signature**: an entry whose `STACK:` head points at a `beforeOpen`,\nself-heal, or migration helper — but the user just opened the app\nnormally. With `readPool: N`, drift calls `beforeOpen` on every\nconnection, so any repair work done there runs `1 + N` times per\nlaunch.\n\n**Lessons already applied in this codebase**:\n- Per-launch `ANALYZE` was removed — stats persist in `sqlite_stat1`\n  and the v42 migration runs `ANALYZE` once on upgrade.\n- The self-heal `CREATE INDEX IF NOT EXISTS` block was removed\n  entirely — the recovery path it covered targeted an aborted-migration\n  scenario that has not occurred in production.\n- `beforeOpen` is now just `PRAGMA foreign_keys = ON`.\n\nWhen you see boot-time housekeeping in a stack, ask: does this need\nto run on every launch, or once per upgrade?\n\n## Output format\n\nProduce a concise report, in this order:\n\n1. **Inputs** — paths read, line counts, date window.\n2. **Findings**, each with: severity (high/medium/low), pattern\n   matched (numbered above), evidence (specific log lines with\n   timestamps), root-cause hypothesis, and the file/seam where the\n   fix would land.\n3. **Recommended actions**, ordered by impact. Cite specific\n   call sites (`lib/...:line`) where possible.\n4. **Things you ruled out** (and why), so the user can sanity-check.\n\nKeep the report skimmable. If the log is mostly clean, say so — don't\nmanufacture findings.\n\n## Guardrails\n\n- **Never** propose schema bumps (`schemaVersion++`) without confirming\n  the v42-style migration shape and asking the user. New indices that\n  don't need a column change can land via migration; per-launch\n  defensive code should not.\n- **Never** propose a per-boot `ANALYZE`, `CREATE INDEX IF NOT EXISTS`\n  loop, or other \"self-heal on every open\" — this codebase explicitly\n  removed those.\n- **Don't assume** an `INDEXED BY` hint solves a planner problem. The\n  autoindex names (`sqlite_autoindex_*_1`) are not part of the public\n  SQLite contract; recommend `ANALYZE` first.\n- **Match real seams**: prefer adding fixes to existing patterns\n  (`_PendingEntityByIdWave` for entity-by-id coalescing,\n  `_PendingLinksWave` for to-id link batches, `_writesJournalDb` for\n  per-payload transaction scoping) over inventing new ones.\n- **Show your work**: every finding should cite specific log lines so\n  the user can verify.\n",".claude/skills/app-screenshots/SKILL.md":"---\nname: app-screenshots\ndescription: Capture in-app screenshots of a widget or flow at mobile + desktop sizes — offline, deterministic, real fonts and icons — using the reusable screenshot harness. Use when asked to \"show me X in the app\", \"screenshot this screen\", or to preview a UI change for review on phone vs desktop.\nargument-hint: \"<surface to capture, e.g. 'project create modal'>\"\n---\n\n# In-App Screenshots\n\nProduces PNGs of a widget or flow rendered inside the real app shell, at phone\nand desktop viewports, with real fonts and icons. It runs through\n`flutter test --update-goldens` — fully offline and deterministic — so it does\n**not** require a display, the GUI app, or driving the device.\n\nThis is a visualization tool, **not** a golden test: there are no committed\nreference images. You write a throwaway capture test, emit the PNGs, share\nthem, then delete the test. Nothing screenshot-related gets committed unless\nthe user explicitly asks to keep it.\n\n## When to use\n\n- \"Show me the <screen/modal/dialog> in app context.\"\n- \"What does this change look like on mobile vs desktop?\"\n- Previewing a UI change for design review.\n\nFor \"is this change actually wired up / does it behave correctly\", prefer the\n`run` skill (launches the real app). This skill is about *appearance*.\n\n## The harness\n\n`test/test_utils/screenshot_harness.dart` provides:\n\n- `loadAppFonts()` — loads every bundled font (app families + Material/Cupertino\n  icon fonts + icon-font packages) from `FontManifest.json`. Call once in\n  `setUpAll`. Without it, glyphs and icons render as boxes.\n- `screenshotTheme({bool dark = true})` — the production `withOverrides` theme\n  with `Inter` applied to the Material text themes (the bare test theme falls\n  back to an unbundled font otherwise).\n- `captureInApp(tester, {child, name, size, dark, devicePixelRatio, overrides, interaction, outputDir})`\n  — sizes the view, pumps `child` in the app shell, runs `interaction` (open a\n  modal, tap a FAB, focus a field…), then writes `<outputDir>/<name>.png`\n  relative to the **calling test file's** directory.\n- `ScreenshotViewport.phone` (390×844) and `ScreenshotViewport.desktop`\n  (1280×800).\n\n## Workflow\n\n1. **Find the surface and how to reach the state.** Identify the entry widget\n   (often a tab/page like `ProjectsTabPage`) and the tap/scroll needed to reach\n   the state to capture (e.g. tapping the FAB to open a modal). Reuse existing\n   widget tests for that surface to learn the required service registrations\n   and provider overrides — copy their `setUp`.\n\n2. **Write a throwaway capture test** at `test/_scratch_capture_test.dart`\n   (the `_scratch_` prefix marks it disposable). Use `setUpTestGetIt` +\n   `additionalSetup` for services the surface resolves through `getIt`, and\n   pass provider overrides via `captureInApp(overrides: ...)`. Drive the state\n   in `interaction`.\n\n3. **Generate the PNGs:**\n   ```sh\n   fvm flutter test --update-goldens test/_scratch_capture_test.dart\n   ```\n   Images land in `test/screenshots/` (the `outputDir`, next to the test).\n\n4. **View and share.** Read the PNGs to inspect them and give the user their\n   paths. For a PR's before/after pair, stage and publish them per\n   `knowledge/conventions/screenshots.md` before the cleanup step deletes\n   them.\n\n5. **Clean up** — this is mandatory unless the user asks to keep anything:\n   ```sh\n   rm test/_scratch_capture_test.dart && rm -rf test/screenshots\n   ```\n\n## Example capture test\n\n```dart\nimport 'package:flutter/material.dart';\nimport 'package:flutter_riverpod/flutter_riverpod.dart';\nimport 'package:flutter_riverpod/misc.dart'; // Override\nimport 'package:flutter_test/flutter_test.dart';\nimport 'package:lotti/classes/project_data.dart';\nimport 'package:lotti/features/projects/model/projects_overview_models.dart';\nimport 'package:lotti/features/projects/state/project_providers.dart';\nimport 'package:lotti/features/projects/ui/pages/projects_tab_page.dart';\nimport 'package:lotti/features/user_activity/state/user_activity_service.dart';\nimport 'package:lotti/get_it.dart';\nimport 'package:lotti/services/entities_cache_service.dart';\nimport 'package:lotti/services/nav_service.dart';\nimport 'package:mocktail/mocktail.dart';\n\nimport 'features/categories/test_utils.dart';\nimport 'features/projects/test_utils.dart';\nimport 'mocks/mocks.dart';\nimport 'test_utils/screenshot_harness.dart';\nimport 'widget_test_utils.dart';\n\nvoid main() {\n  setUpAll(loadAppFonts);\n\n  final groups = [\n    ProjectCategoryGroup(\n      categoryId: 'lotti',\n      category: CategoryTestUtils.createTestCategory(id: 'lotti', name: 'Lotti'),\n      projects: [\n        ProjectListItemData(\n          project: makeTestProject(id: 'p1', title: 'Daily Operating System'),\n          category: CategoryTestUtils.createTestCategory(id: 'lotti', name: 'Lotti'),\n          taskRollup: const ProjectTaskRollupData(totalTaskCount: 25),\n        ),\n      ],\n    ),\n  ];\n\n  List<Override> overrides() => [\n    projectsOverviewProvider.overrideWith(\n      (ref) => Stream.value(ProjectsOverviewSnapshot(groups: groups)),\n    ),\n    visibleProjectGroupsProvider.overrideWith((ref) => AsyncValue.data(groups)),\n  ];\n\n  setUp(() async {\n    await setUpTestGetIt(\n      additionalSetup: () {\n        final activity = MockUserActivityService();\n        when(activity.updateActivity).thenReturn(null);\n        getIt.registerSingleton<UserActivityService>(activity);\n\n        final nav = MockNavService();\n        when(() => nav.isDesktopMode).thenReturn(false);\n        when(() => nav.desktopSelectedProjectId)\n            .thenReturn(ValueNotifier<String?>(null));\n        getIt.registerSingleton<NavService>(nav);\n\n        final cache = MockEntitiesCacheService();\n        when(() => cache.getCategoryById(any())).thenReturn(null);\n        getIt.registerSingleton<EntitiesCacheService>(cache);\n      },\n    );\n  });\n  tearDown(tearDownTestGetIt);\n\n  Future<void> openCreate(WidgetTester tester) =>\n      tester.tap(find.bySemanticsLabel('New Project'));\n\n  testWidgets('phone', (tester) async {\n    await captureInApp(\n      tester,\n      child: const ProjectsTabPage(),\n      name: 'create_mobile',\n      overrides: overrides(),\n      interaction: openCreate,\n    );\n  });\n\n  testWidgets('desktop', (tester) async {\n    await captureInApp(\n      tester,\n      child: const ProjectsTabPage(),\n      name: 'create_desktop',\n      size: ScreenshotViewport.desktop,\n      overrides: overrides(),\n      interaction: openCreate,\n    );\n  });\n}\n```\n\n## Gotchas\n\n- **`Override` lives in `package:flutter_riverpod/misc.dart`** in this Riverpod\n  version — import it for the `List<Override>` type (separate from\n  `flutter_riverpod.dart`, which has `AsyncValue`).\n- **Register every service the surface touches** via `setUpTestGetIt`'s\n  `additionalSetup`, or the widget throws on a missing `getIt` registration.\n  Modals pull in their own deps (e.g. the create modal's `CategoryField` needs\n  `EntitiesCacheService`).\n- **Desktop layout is width-driven.** `captureInApp(size: ScreenshotViewport.desktop)`\n  sets both the view physical size and `MediaQuery`, so width-gated split\n  views (`isDesktopLayout`) and the dialog branch (modal page breakpoint)\n  engage correctly.\n- **Capture target is `find.byType(MaterialApp)`** so overlay content (modals,\n  dialogs, toasts) is included, not just the page body.\n- **Don't commit the scratch test or `test/screenshots/`.** Delete them when\n  done. The harness itself is the only permanent artifact.\n","AGENTS.md":"# Repository Guidelines\n\n## Project Structure & Module Organization\n- `lib/` — Flutter/Dart source (features, services, widgets). Do not edit generated files (`*.g.dart`, `*.freezed.dart`).\n- `test/` and `integration_test/` — unit and integration tests; keep test files as `*_test.dart`.\n- `assets/` — images, icons, and other static assets.\n- Platform targets: `android/`, `ios/`, `macos/`, `linux/`, `windows/`.\n- Tooling & CI: `Makefile`, `.buildkite/`, `analysis_options.yaml`, `l10n.yaml`.\n- Localization: `lib/l10n/*.arb` with `missing_translations.txt` for gaps.\n\n## Build, Test, and Development Commands\n- Install deps: `make deps` (runs through FVM when `fvm` is installed).\n- Static analysis: `make analyze` (Very Good Analysis rules).\n- Unit tests + coverage: `make test` • HTML report: `make coverage`.\n- Code generation: `make build_runner` • Watch mode: `make watch`.\n- Localization generation: `make l10n` (prints missing translations) • Sort ARB: `make sort_arb_files`.\n- Run locally: `fvm flutter run -d macos` (or `flutter run -d <device>`).\n- Integration tests: `make integration_test`.\n- Packaging (examples): `make ios`, `make macos`, or `make bundle` (see Makefile for more).\n\n## Coding Style & Naming Conventions\n- Follow `analysis_options.yaml` (Very Good Analysis). 2‑space indent, prefer `const` and `final`.\n- Files: `lower_snake_case.dart`; types (classes/enums): `PascalCase`; members: `lowerCamelCase`.\n- Keep hand-written files in `lib/` at or below 1,000 lines. `test/architecture/file_size_ratchet_test.dart` fails on a new file above that, and holds the files already above it at their current size (`file_size_baseline.json`): put new code in a file of its own, and lower or delete an entry when a file shrinks.\n- Imports in `lib/` follow the layer order in `tool/architecture/layer_guard.dart` (`make layer_check`): no feature imports one ranked above it, `lib/classes`, `database`, `services`, `logic` and `utils` import no feature, non-UI code never imports another feature's UI, and nothing below the shell imports it (the service locator excepted, which `tool/di` counts). Existing breaks are baselined and may only shrink — move the shared type down or invert the dependency rather than adding one.\n- Format before committing: `fvm dart format .`.\n- Do not modify generated code (`*.g.dart`, `*.freezed.dart`); regenerate via `make build_runner`.\n\n## Testing Guidelines\n- Framework: `flutter_test`, helpers in `test/`. Name tests `*_test.dart` and co-locate by feature. **One test file per source file**, mirroring the path.\n- Run tests via the dart-mcp server, **only for the files you actually touched**. Do not run the whole suite locally, and do not run a whole feature's suite either — `agents` alone takes minutes, worse in a Linux VM. CI runs everything ten-way sharded on every push, so let it. Broader local runs only when asked, or when a change genuinely cannot be scoped to the files you touched.\n- **Never `Future.delayed`, `sleep()` or a real `Timer` in a test.** Use `fakeAsync` or `tester.pump(duration)`, and deterministic dates rather than `DateTime.now()`.\n- **Reuse the shared harness**: mocks from `test/mocks/mocks.dart`, fallbacks from `test/helpers/fallbacks.dart`, `setUpTestGetIt()` / `tearDownTestGetIt()`, `makeTestableWidget()`. Never improvise a per-file equivalent.\n- **Every test must assert something meaningful.** `findsOneWidget` alone proves only that the tree built; a constructor smoke test proves nothing at all.\n- **Re-run every new regression test with the fix reverted.** If it still passes, it is not testing the fix.\n- The full contract — the DRY rules, the infrastructure table, the quality bar, the vacuous-pass traps, property tests, time-driven UI — is [knowledge/conventions/testing.md](knowledge/conventions/testing.md), plus [test/README.md](test/README.md) for the fake-time policy and mocktail hygiene. Read them rather than working from this summary.\n\n## Commit & Pull Request Guidelines\n- Use Conventional Commits (e.g., `feat:`, `fix:`, `chore:`, `ci:`). Keep subjects concise and imperative.\n- PRs must pass `make analyze` and `make test`; include a clear description and linked issues.\n- **UI changes need a before/after screenshot pair per surface**, captured with the harness (see the `app-screenshots` skill). Capture `before/` from the base commit *first* — it cannot be reconstructed once the change is in. **Fixtures come from `test/test_data` and the penguin demo world only — never from a user's own habits, tasks, notes or bug screenshots**; a capture is published to a public bucket and a public PR. **Never commit images to any repo.** Publish the pair to the R2 bucket with `make pr_screenshots_publish` and link the printed public URLs from the PR body. The staging layout, the naming rules and the publish command are in [knowledge/conventions/screenshots.md](knowledge/conventions/screenshots.md).\n- Update docs and localization as needed (run `make l10n`).\n\n## Security & Configuration Tips\n- Never commit secrets. Use `.env` for local config; keep it out of VCS.\n- Use FVM (`.fvmrc`) to match the repo’s Flutter version: `fvm flutter ...`.\n\n## Agent MCP Usage\n- Prefer MCP tools over raw shell commands:\n  - Use `dart-mcp` for analyzer, tests, formatting, fixes, pub, and build tasks.\n    - Analyze: `dart-mcp.analyze_files`\n    - Tests: `dart-mcp.run_tests` (set platforms as needed)\n    - Format: `fvm dart format .`\n    - Apply fixes: `dart-mcp.dart_fix`\n    - Pub: `dart-mcp.pub` (e.g., `get`, `add`, `upgrade`)\n    - Hot reload/runtime hooks: connect to the Dart Tooling Daemon first\n  - Use `context7` for up-to-date docs. Resolve with `context7.resolve-library-id`, then fetch via `context7.get-library-docs`.\n- Register the repo root before using `dart-mcp` commands: `dart-mcp.add_roots` with the workspace URI.\n- For runtime/Flutter app introspection, request a DTD URI from the user and connect via `dart-mcp.connect_dart_tooling_daemon`.\n- Follow the planning and preamble conventions:\n  - Send a brief preamble before grouped tool calls.\n  - Keep a concise plan in your agent's planning tool for multi-step work.\n- Test-first workflow when adding/fixing tests:\n  - Run `dart-mcp.analyze_files` to catch lints quickly.\n  - Run `fvm dart format .` to normalize diffs. Do not use `dart-mcp.dart_format`.\n  - Run targeted tests (single file or folder) via `dart-mcp.run_tests` before broad runs.\n  - Iterate until the targeted tests pass; CI runs the full suite.\n- Do not edit generated files (`*.g.dart`, `*.freezed.dart`); run `dart-mcp.pub` + `make build_runner` (or `dart run build_runner`) via MCP when regeneration is required.\n- Favor `rg` for searches and read files in chunks (≤250 lines) when using shell reads.\n\n## Analyzer Zero‑Warning Policy\n- Before opening a PR, the analyzer must report zero warnings or infos.\n- Always run `dart-mcp.analyze_files` and address every message:\n  - In tests, you may add line ignores for clarity (e.g., `// ignore: avoid_redundant_argument_values`).\n  - In production code, fix the root cause rather than ignoring.\n- Run `fvm dart format .` to normalize formatting prior to final checks. Do not use\n  `dart-mcp.dart_format`.\n\n## Documentation\n\nDocumentation is split by audience. **No fact is written twice.**\n\n- **`lib/features/<x>/README.md` — product description.** What the feature does,\n  what it owns versus what it delegates, and where the code sits. Roughly 40–100\n  lines, ending with a link to its knowledge concept. If a README starts\n  explaining provider routing or wake scheduling, that content belongs in\n  `knowledge/`.\n- **`knowledge/` — the architecture, in OKF v0.2 form.** Runtime flows, state\n  machines, invariants, key classes, gotchas. This is the durable, agent-readable\n  map of how the app actually works. Read the relevant concept *before* changing\n  a subsystem, and update it in the same change.\n  [knowledge/index.md](knowledge/index.md) is the entry point: it carries the\n  reading order and the code-to-concept map.\n- **`docs/adr/` — decisions.** An ADR records a choice at a point in time and is\n  not rewritten; concepts cite ADRs rather than restating them.\n\n**These concepts are derived maps, not authority.** The source code outranks\nthem: if a concept contradicts the code, the concept is the defect, and fixing it\nis part of your change. Verify a claim before you depend on it.\n\nRules for `knowledge/`:\n\n- Every concept carries required OKF frontmatter, and `make okf_check` fails on a\n  missing or malformed field. The field-by-field contract is in\n  [knowledge/conventions/knowledge-bundle.md](knowledge/conventions/knowledge-bundle.md)\n  — follow it there rather than from memory.\n- Do **not** set `verified` on a concept you wrote. That field records\n  independent confirmation by someone other than the author.\n- Use Mermaid diagrams generously for flows, architecture, data movement and\n  lifecycles. If the code contains a real lifecycle or state machine, the\n  concept must include a diagram for it — prefer `stateDiagram-v2`, and never\n  invent states that are not implemented.\n- Every path a concept references must exist. `make okf_check` fails the build\n  on a dangling code pointer, which is the mechanism that keeps the map honest.\n- Run `make knowledge_check` after touching anything under `knowledge/`. It runs the Dart validator *and* parses every Mermaid diagram — `make okf_check` alone cannot see a diagram that fails to render.\n\n## Misc\n- Whenever touching any function, consider its docstring and if it needs updating\n- Only report completion after code compiles and all tests pass; verify via analyze and test via the dart-mcp server.\n- Invest in making tests work; avoid deleting or abandoning failing tests prematurely.\n- When old and new feature versions coexist, create no dependencies from the new code to the old — the old code is meant to be removed once the new one reaches parity.\n- Uphold high standards: DRY where sensible, proper modularity, and strong testability.\n- Use `fvm` for all `flutter` commands.\n\n## Localization (l10n)\n- All user-visible label texts MUST be localized using arb files in `lib/l10n/`.\n- Never hardcode strings that users will see — add them to the arb files instead.\n- **Add every new label to every catalog in `lib/l10n/`**, translated — not a\n  subset. The catalog list, the `app_en_GB.arb` exception and the per-language\n  register table live in\n  [knowledge/conventions/localization.md](knowledge/conventions/localization.md).\n  Read it rather than working from a count or a list quoted anywhere else,\n  including here.\n- Access localized strings via `context.messages.labelName` (import `app_localizations_context.dart`).\n- After adding labels, run `make l10n` to generate the Dart files.\n- Run `make sort_arb_files` to keep arb files consistently sorted.\n- Edit the `.arb` sources and regenerate; `lib/l10n/app_localizations_*.dart` is generated output.\n- **Use the informal register** in every translation, with Romanian as the one deliberate exception. Which pronouns that means per language is in the concept linked above.\n\n## Implementation discipline\n\nEvery UI change is bound by the design system. Read\n[knowledge/features/design_system/](knowledge/features/design_system/) before\ntouching visual code — the token pipeline and its naming, the component contracts,\nand what is enforced at construction rather than by review.\n\n- **Design-system tokens are mandatory.** For colors, spacing, radii, typography, elevation, and other visual styling values, always use the exported design-system tokens or existing design-system abstractions first.\n- **Spacings and font styles MUST come from the Design System.** Never hardcode spacing values (raw numbers in `EdgeInsets`/`SizedBox`/local `const double` constants) or font styles (raw `fontSize`/`fontWeight`/`TextStyle` constructors). Use `tokens.spacing.stepN` (or `cardPadding`/`cardItemSpacing`/`sectionGap`) and `tokens.typography.styles.{display,heading,subtitle,body,others}.<name>`. If no suitable token exists, stop and ask before introducing one.\n- **Do not invent ad hoc visual values by default.** Before adding a hard-coded color, spacing value, radius, opacity, or a one-off semantic alias for a visual token, first check the design-system token export and existing design-system components/palettes.\n- **Ask before introducing new visual tokens or hard-coded values.** If no suitable design-system token exists, stop and ask for permission before creating an ad hoc fallback, local palette entry, or other non-token visual value.\n- **Never use loading states over content: stay while reload. This is a hard rule.** Once a surface has shown its content, a reload — sync, a database notification, an agent wake, a transcript landing, any watched dependency — must not take it off the screen: no spinner, skeleton, empty placeholder or error shell in its place, and no teardown and rebuild of the same content. Keep the shown data until the new data replaces it in place. A loading shell is allowed only on the first load and on a deliberate change of subject (another day, person or route); progress for a background reload is a quiet local affordance at most.\n  - Read async state with `.value` and show a shell only while it is null. A bare `.when` runs `loading:` on every reload (Riverpod 3 defaults `skipLoadingOnReload` to false); `whenData` and `unwrapPrevious` drop the value.\n  - Key every list child whose position can shift, and give every `*.builder` list a `findChildIndexCallback` — without it a builder list matches by index even when its children carry keys, and rebuilds everything below an insertion.\n  - The rationale, the before/after code and how to test it: [stay while reload](knowledge/conventions/stay-while-reload.md).\n- **Prefer fixing the token source over patching the widget.** If a Figma export flattened or obscured a semantic token name, prefer tracing it back to the exported token set or improving the import/export path instead of hard-coding a widget-level substitute.\n- **Check the token name in the actual Figma node inspect panel first.** Even when the Variables API is incomplete or unavailable, the selected node often shows the bound token name directly under Colors, e.g. `background/02`.\n- **Know the naming path across tools.** The same token is named differently in Figma, `tokens.json` and Dart — the table is in [design tokens and theming](knowledge/features/design_system/tokens-and-theming.md#one-token-three-names). Treat them as one token with normalised naming, not as different concepts.\n- **Verifying a visual token, in order:** inspect the selected node in Figma Desktop Bridge, confirm the entry in `assets/design_system/tokens.json`, then map it to the generated token. If the inspect panel already shows the name, do not conclude it is unavailable just because the Variables API returned empty data.\n- Always ensure the analyzer has no complaints and everything compiles. Also run the formatter\n  frequently.\n- Prefer running commands via the dart-mcp server.\n- Only move on to adding new files when already created tests are all green.\n- Aim for full coverage of every code path.\n- Every widget we touch should get as close to full test coverage as is reasonable, with meaningful\n  tests.\n- **Release notes go in `changelog.d/`, never straight into `CHANGELOG.md`.** Add one new file\n  per pull request — `changelog.d/YYYY-MM-DD-slug.md`, holding the `### Fixed` (or `### Added`,\n  `### Changed`, …) section your change deserves, worded as it should read to a user. **Never\n  edit `CHANGELOG.md`, `flatpak/com.matthiasn.lotti.metainfo.xml` or the `version:` line in\n  `pubspec.yaml`.** Those three are written at the top by everything, so they are written once\n  per release, by the release — which is what stops concurrent pull requests conflicting over\n  prose they do not share. The format, the naming and what deserves an entry at all are in\n  [changelog.d/README.md](changelog.d/README.md); `make changelog_check` validates it.\n- Fragments are only for what a user would actually notice — not dependency bumps, refactors,\n  test-only changes, CI tweaks, docs, or a bug introduced and fixed before it ever shipped. If\n  in doubt, ask, but default to no fragment when nothing changes at runtime.\n- Assembling a release — fragments into `CHANGELOG.md` and the Flathub metainfo, version bump,\n  tag — is [.agents/skills/release/SKILL.md](.agents/skills/release/SKILL.md). It is the only\n  change permitted to touch those three files.\n- Update the documentation we touch such that it matches reality in the codebase, not only\n  for what we touch but in its entirety. See \"Documentation\" above for which file gets what.\n- Use fvm when running any flutter command\n- Read test/README.md on every session start and keep it up to date when gaining relevant new information\n- Do not hoard code. We do not keep unused code around. Also, this is no library, there are no known mysterious callers for whom we would keep any code around.\n\n## Issue Tracking\n\n- Public bugs, feature requests, and contributor coordination belong in\n  [GitHub Issues](https://github.com/matthiasn/lotti/issues).\n- Authorized maintainers may use the private Beads tracker for implementation\n  plans, dependencies, handoffs, and durable agent memory. Follow\n  `.agents/skills/beads/SKILL.md`.\n- Public contributors are not expected to install Beads or have access to the\n  private tracker. PR descriptions and GitHub issue links must contain all\n  context needed for public review.\n- Agent-local planning tools remain appropriate for the current turn. Beads is\n  the durable maintainer record, not a replacement for a short execution plan.\n- Beads sync, Git commits, and pushes require explicit user or orchestrator\n  authority. Never store secrets in Beads.\n- Do not install repository-controlled Git, Codex, or Claude hooks for Beads.\n  Maintainers run `bd prime`, `bd dolt pull`, and `bd dolt push` explicitly.\n",".claude/skills/tutorial-videos/SKILL.md":"---\nname: tutorial-videos\ndescription: Build, debug, extend, localize, or publish the automated tutorial videos — the workbench that drives the real Linux app under Xvfb (virtual mic, live Voxtral transcription, task-agent proposals), records the screen, narrates with Gemini or ElevenLabs TTS, fast-forwards waits, composes MP4s via OpenMontage, and uploads finished videos to Cloudflare R2 for docs-site embedding. Use when asked to \"build/regenerate the tutorial video(s)\", add a tutorial scenario, add a tutorial locale, fix a broken tutorial run, adapt the pipeline, or upload/publish a video.\nargument-hint: \"<what to do, e.g. 'build de+en', 'add scenario X', 'debug the failing run'>\"\n---\n\n# Tutorial Video Workbench\n\nArchitecture and rationale live in `tools/tutorial_videos/README.md` — read\nit first. This skill is the operational runbook.\n\n## Build videos\n\n```sh\nmake tutorial_video TUTORIAL_LOCALE=de                       # one locale (~5-8 min)\nmake tutorial_video TUTORIAL_LOCALE=de TUTORIAL_DEVICE=mobile # phone-shaped window, `_mobile`-suffixed output\nmake tutorial_videos_all                                     # all TUTORIAL_LOCALES\n```\n\n`TUTORIAL_DEVICE` (`desktop`|`mobile`, default `desktop`) picks the capture\nwindow size — see the README's \"Desktop vs. mobile\" section for the\nbreakpoint rationale and the `tutorialDeviceIsMobile()` test hook.\n\nPreconditions (fail fast if missing):\n- `.env` at repo root with `GEMINI_API_KEY`, `MELIOUS_API_KEY`,\n  `MELIOUS_BASE_URL`. If absent, the keys can be extracted from the dev\n  app's `ai_config.sqlite` provider rows (never print or commit them).\n  `ELEVENLABS_API_KEY` too when narrating with ElevenLabs\n  (`--tts-engine elevenlabs`) — that one is not in the app's config, ask\n  the user for it.\n- Sibling `../OpenMontage` checkout at the commit pinned in\n  `tools/tutorial_videos/config/openmontage.pin`, bootstrapped via\n  `make -C ../OpenMontage setup`.\n- `Xvfb`, `ffmpeg`, `pactl`, `paplay`, `x11-utils` installed; Flutter via\n  `fvm`.\n\nOutput lands in `build/tutorial_videos/<scenario>_<locale>.mp4`. Verify with\nframe extraction (`ffmpeg -ss <t> -frames:v 1`) and check: cursor visible and\ngliding, HUD clock top-center, transcript/proposals on screen, narration\naudible at step starts (`volumedetect`), duration ≈ warped timeline total.\n\n## Publish to R2\n\n```sh\nmake tutorial_video_publish TUTORIAL_SCENARIO=create_task_from_audio TUTORIAL_LOCALE=de\nmake tutorial_video_publish TUTORIAL_SCENARIO=create_task_from_audio TUTORIAL_LOCALE=de TUTORIAL_DEVICE=mobile\n```\n\nUploads `build/tutorial_videos/<scenario>_<locale>.mp4` (or, with\n`TUTORIAL_DEVICE=mobile`, `<scenario>_<locale>_mobile.mp4`) to Cloudflare R2\nat the matching `tutorial-videos/...` key and prints its public r2.dev URL —\nthis is the URL the docs-site `TutorialVideo` component builds from\n`TUTORIAL_VIDEO_BASE_URL`/`tutorialVideoBaseUrl`. `TUTORIAL_DEVICE` must\nmatch whatever `--device` the video was built with, or publish will look for\na file that was never produced. Full one-time Cloudflare setup (API token,\nenabling the bucket's public r2.dev URL) and the `.env` variable list are in\nthe README's \"Publishing to Cloudflare R2\" section — read it before the\nfirst publish.\n\n`boto3` (needed only by publish, not by build/tts/validate) is not installed\ninto the system Python on this host (PEP 668). Either run publish through\n`tools/tutorial_videos/.venv` (`.venv/bin/python3 -m tutorial_videos publish\n--scenario ... --locale ...`, created via `python3 -m venv .venv &&\n.venv/bin/pip install boto3 pyyaml`), or install `boto3` into whatever\nPython `make tutorial_video_publish` resolves to.\n\n## The pipeline in one paragraph\n\n`python3 -m tutorial_videos build` (run from `tools/tutorial_videos/`) does:\nTTS pre-pass (Gemini by default, `--tts-engine elevenlabs` to switch; cached by content hash → durations manifest) → Xvfb +\nvirtual-mic null sink + ffmpeg x11grab capture → `fvm flutter drive` runs\n`integration_test/tutorial/<scenario>_tutorial_test.dart` against the real\napp (penguin demo world + Melious/Voxtral/Qwen agent config seeded, UI\nlanguage via `MANUAL_LANGUAGE` settings row) → the test emits\n`timeline.json` (step boundaries, wait spans, zero epoch) → `timewarp.py`\nplans fast-forward segments for the waits (narration never overlaps) →\n`compose.py` warps the capture and drives the pinned OpenMontage headlessly\n(narration placement + mux) → ffprobe validation.\n\n## Debugging a failing run\n\n1. The run log tail shows the failing step and a `Diagnostics:` line\n   (current route, detail stack, key widget presence).\n2. **Look at the failure screenshot first**:\n   `build/tutorial_videos/failure_<context>.png` is captured at the moment of\n   every timeout — it almost always explains the failure instantly.\n3. Reproduce faster without video: run the same test via `flutter drive`\n   directly (see the doc comment in\n   `integration_test/tutorial/tutorial_harness.dart` for the env contract);\n   Xvfb + sink setup must match `session.py`.\n4. Common causes, in order of historical frequency: a finder matching an\n   offstage duplicate (scope to the visible page + `.hitTestable()`), a\n   scroll helper given a non-vertical scrollable, a modal/dialog blocking\n   the UI (onboarding, discard-recording), the agent's\n   `automaticUpdatesEnabled` flag not sticking (set-and-verify), cloud\n   latency beyond a `pumpUntil` timeout.\n\n## Adding a locale\n\n1. Add the locale's text to\n   `tools/tutorial_videos/config/scenarios/<scenario>.yaml`: `title`,\n   `dictionary`, every step's `narration`, the dictation step's\n   `dictation_text`. Write informal register (du/tu) per repo l10n rules;\n   keep the penguin vocabulary.\n2. Add per-stream `style` lines for the locale under `engines.gemini` in\n   `config/voices.yaml` (style prompts in the target language —\n   Voxtral/Gemini behave better). ElevenLabs needs nothing per locale, as\n   long as `eleven_multilingual_v2` supports the language.\n3. `python3 -m tutorial_videos validate --scenario <s> --locale <l>` must\n   pass, then build. The app UI localizes itself via `LOTTI_MANUAL_LOCALE`\n   (same mechanism as manual screenshots; for a wholly new app locale, run\n   the `add-flutter-docusaurus-locale` skill first).\n4. Localized finder strings in the test (`localized(en:, de:)` /\n   `manualScreenshotText`) need the new locale only if its UI labels are\n   used as finders — prefer keys over text finders where possible.\n\n## Adding a scenario\n\n1. New YAML in `config/scenarios/<name>.yaml` — schema documented in\n   `create_task_from_audio.yaml` (unique step ids, exactly one\n   `dictation: true` step, per-locale text, `min_duration` floors).\n2. New `integration_test/tutorial/<name>_tutorial_test.dart` built on\n   `TutorialAppHarness` + `TutorialDriver`. Copy the structure of\n   `create_task_from_audio_tutorial_test.dart`:\n   - one `driver.step(id, action)` per YAML step, ids matching exactly;\n   - interactions via `driver.tapLikeUser` (cursor glide), waits via\n     `driver.pumpUntil*` (records fast-forwardable wait spans), scrolling\n     via `driver.scrollIntoView` with a **vertical** scrollable finder;\n   - anything that must be SEEN gets asserted via visible widgets, not just\n     the DB;\n   - wire the `diagnostics` and `onTimeout` hooks for failure screenshots.\n3. Iterate with builds; expect the first runs to fail — read the failure\n   screenshots, they carry the answer.\n\n## Non-negotiable gotchas\n\nThe full list with rationale is in the README's \"Hard-won constraints\" —\nthe ones that bite hardest: `flutter drive` not `flutter test` (no window\notherwise); `GDK_BACKEND=x11` + empty `WAYLAND_DISPLAY` (or the app opens on\nthe real desktop); Voxtral prompts in the audio's language (else it\ntranslates); `automaticUpdatesEnabled` set-and-verify (initial wake clobbers\nearly writes); 16ms pump cadence during holds (else animations render\nchoppy); timeline starts after startup settles; assert transcript keywords,\nnot exact strings.\n\n## Adapting / extending\n\n- **App Store preview**: `config/scenarios/app_store_preview.yaml` is the\n  narration of `make store_preview_ios`, not a tutorial — never\n  `make tutorial_video` it. Its step ids must stay the `_beatIds` of\n  `integration_test/store_preview_test.dart` (`tests/test_app_preview.py`\n  guards it), and all four lines together must leave the beats under 30 s\n  (`python3 -m tutorial_videos.app_preview pacing` fails first if not).\n  See the README's \"The App Store preview reuses the narration\".\n- **Compositor changes**: all OpenMontage API usage is isolated in\n  `tutorial_videos/om_compose_driver.py`; bump the pin in\n  `config/openmontage.pin` deliberately and re-verify determinism\n  (compose twice, compare `ffmpeg -f framemd5` of the streams — never file\n  hashes).\n- **TTS vendor**: implement the `TtsEngine` protocol (`tts/base.py`) next to\n  `tts/gemini.py` and `tts/elevenlabs.py`, register it with its `.env` key\n  in `tts/engines.py`, and give it an `engines.<name>` block (model + both\n  streams) in `config/voices.yaml`. Voices: switch ElevenLabs ones by\n  changing the voice id there; the README's \"TTS engines\" has the details.\n- **Speed/pacing knobs**: `timewarp.py` (`MAX_SPEED`, lead-in, narration\n  gap); per-step floors in the scenario YAML.\n- **Talking avatar**: `make tutorial_video TUTORIAL_AVATAR=1` (or `build\n  --avatar`) lays the scenario's avatar into the top-right corner of the\n  finished video, lip-synced to the narrator clips only — never the\n  dictation. It acts, not just talks: nods on stresses, a head tilt per\n  phrase, brow lifts, breathing, and in pauses it watches the app\n  (`tutorial_videos/avatar/acting.py`; tune there, check with\n  `avatar-preview`). Characters live in `tutorial_videos/avatar/characters.py`\n  (`CHARACTERS`): Pip the penguin by default, Theo for any scenario whose\n  YAML says `avatar: theo` (the onboarding does); `--avatar-character`\n  overrides it for one build, `--character` picks it for the two avatar\n  commands. `--avatar-position` / `avatar-overlay --position` move it to\n  another corner; `avatar-overlay --video <built mp4>` adds it to an\n  already-built video as `<stem>_avatar.mp4`; `avatar-preview --wav <wav>`\n  renders the character alone — check any art change at badge size with it\n  first.\n  See the README's \"Talking avatar\".\n",".claude/skills/review-comments/SKILL.md":"---\nname: review-comments\ndescription: Fetch PR review comments, address each one in code, and post resolution replies\nargument-hint: \"[pr-number]\"\n---\n\n# Review PR Comments\n\nFetch all review comments from a pull request, address each one (fix code, add\ndocs, or explain the rationale), and reply to each comment on GitHub with the\nresolution.\n\n## Steps\n\n1. **Fetch comments** — use `gh api` to get all review comments:\n   ```bash\n   gh api repos/{owner}/{repo}/pulls/$ARGUMENTS/comments \\\n     --jq '.[] | {id, path, line, body, in_reply_to_id}'\n   ```\n   Filter to top-level comments only (`in_reply_to_id == null`) — those are the\n   ones that need responses.\n\n2. **Understand each comment** — read the referenced file and line to understand\n   the concern. Group related comments if they touch the same issue.\n\n3. **Address each comment** — make the appropriate code change (fix, refactor,\n   add docs, add tests). If you disagree with a suggestion, prepare a clear\n   rationale.\n\n4. **Reply to each comment** — post a reply using:\n   ```bash\n   gh api repos/{owner}/{repo}/pulls/$ARGUMENTS/comments -X POST \\\n     -f body=\"<resolution>\" \\\n     -F in_reply_to=<comment-id>\n   ```\n   Keep replies concise: state what was done (e.g., \"Fixed. Replaced generic\n   fallback with explicit throw.\") or explain why it was left as-is.\n\n5. **Close every codecov gap — target 100% patch coverage.** The Codecov bot\n   posts a PR comment/check; treat its uncovered lines as review comments that\n   MUST be resolved with tests. **Every line codecov marks uncovered has to be\n   covered — no exceptions for \"pre-existing\" files.** If a file shows up in the\n   PR diff with uncovered lines, cover them even if you didn't write them.\n\n   a. **Find what's actually uncovered.** The bot summary only gives totals;\n      pull the per-line data from the Codecov API and intersect it with the\n      PR's added lines (this is exactly what `codecov/patch` scores):\n      ```bash\n      # Per-line diff coverage (head_cov == 0 → miss):\n      curl -s \"https://api.codecov.io/api/v2/github/{owner}/repos/{repo}/compare?pullid=$ARGUMENTS\" \\\n        > /tmp/cc.json\n      # Then: for each file with has_diff, list lines where\n      #   coverage.head == 0 && is_diff, and intersect with the file's\n      #   git-diff added-line numbers (git diff --unified=0 origin/main...HEAD).\n      ```\n      Codecov ignores are in `codecov.yml` (`*.g.dart`, `*.freezed.dart`,\n      `l10n/*.dart` here) — skip those.\n\n   b. **Codecov is often stale/partial — trust local coverage for new code.**\n      Coverage is sharded; if any shard failed or the run is mid-flight, the\n      bot shows a partial picture (e.g. \"1% of diff\") that inflates the miss\n      list with trivial lines (`@override`, const ctors). Regenerate locally\n      and intersect with the git-diff added lines for the authoritative set:\n      ```bash\n      fvm flutter test --coverage <the test dirs that exercise the diff>\n      # parse coverage/lcov.info: DA:<line>,0 == uncovered\n      ```\n      Run enough test dirs that every diff file is genuinely exercised (a file\n      covered only by tests you didn't run shows as a false miss).\n\n   c. **Write real tests for each uncovered line** — mirror the sibling case\n      already tested (e.g. a new `.map`/`switch` arm → copy the `aiConfig`\n      case for `savedTaskFilter`; a debounce-cancel line → emit *two*\n      notifications so the timer is non-null when cancelled). Extend\n      parameterized `variantCases`/`variantsByBucket` tables rather than\n      duplicating whole test bodies.\n\n   d. **Uncoverable private-ctor lines** (`const FooKeys._();` in a static-only\n      keys class) can't be hit and dart coverage ignores no inline comment —\n      convert the class to `abstract final class FooKeys { ... }` so the\n      constructor line disappears entirely.\n\n   e. **Re-run coverage until the (added ∩ uncovered) set is empty**, then run\n      the affected suites to confirm still-green.\n\n6. **Verify** — run analyzer and affected tests to confirm all changes compile\n   and pass.\n\n7. **Babysit the PR until it is actually done.** Opening a PR and replying once\n   is not the end of the job. A PR is finished only when all three hold at the\n   same time:\n\n   - **mergeable** — `gh pr view <n> --json mergeable` is `MERGEABLE`\n   - **all green** — every check passed, not merely \"not failing\": zero\n     `pending` and zero failures, including `codecov/patch`\n   - **all replied** — every top-level review comment has a reply, with a real\n     fix or a stated reason for declining\n\n   **Pushing requires authorization.** Commits, rebases and pushes need\n   explicit user or orchestrator approval (AGENTS.md, \"Issue Tracking\").\n   Being asked to *address review comments* authorizes the\n   code changes, not the push — confirm before the first push of a session,\n   and never force-push a branch you did not create in this session.\n   `--force-with-lease` guards against clobbering a concurrent update; it is\n   not a substitute for approval.\n\n   Reviews arrive *after* pushes, so pushing fixes restarts the loop: the\n   reviewer re-reviews the new commit and may file new findings. Bots also\n   rate-limit and arrive late (CodeRabbit will say \"next review available in\n   N minutes\" and skip the run entirely). Keep watching until the three\n   conditions hold together.\n\n   Poll on the structured status rather than the display columns — the table\n   format is human-facing, and a failed API or auth call prints to stderr and\n   would otherwise read as \"no pending checks\".\n\n   Note `gh pr checks` has **no** `--json` flag (checked on gh 2.45); the\n   structured source is `gh pr view --json statusCheckRollup`. Verify whatever\n   command you poll with actually works *before* wrapping it in an `until`\n   loop: a command that errors makes the loop exit immediately and every\n   subsequent report a lie.\n\n   For a CheckRun, `status` is the lifecycle (`COMPLETED`) and `conclusion`\n   carries the verdict (`SUCCESS` / `FAILURE` / `CANCELLED`) — a failed check\n   is `COMPLETED`, so keying on `status` alone reports a red run as done and\n   green. Read the conclusion for completed checks and the state for\n   StatusContexts:\n\n   ```bash\n   # one \"<verdict>\\t<name>\" line per check; empty output means the query\n   # failed, not that everything passed — so treat it as not-done.\n   rollup() {\n     gh pr view \"$1\" --json statusCheckRollup --jq '\n       .statusCheckRollup[]\n       | if .status == \"COMPLETED\" then .conclusion\n         elif .status then .status\n         else .state end\n       + \"\\t\" + (.name // .context)'\n   }\n   # Capture once per iteration and check the exit status: an errored or\n   # empty result is \"not done\", never \"done and green\".\n   while :; do\n     out=$(rollup <n>) || { echo \"poll failed\"; sleep 30; continue; }\n     [ -n \"$out\" ] || { echo \"empty rollup — treating as not done\"; sleep 30; continue; }\n     printf '%s\\n' \"$out\" | grep -qE '^(IN_PROGRESS|QUEUED|PENDING)' || break\n     sleep 30\n   done\n   bad=$(printf '%s\\n' \"$out\" | grep -vE '^(SUCCESS|NEUTRAL|SKIPPED)')\n   [ -z \"$bad\" ] && echo \"all green (${#out} bytes of verdicts)\" || printf '%s\\n' \"$bad\"\n   ```\n\n   Three ways these snippets lie if written casually, all worth guarding:\n   an errored command inside `$( )` yields empty output that a\n   `grep -q pending` reads as \"nothing pending\"; `grep … || echo \"all green\"`\n   turns *no output at all* into a pass; and a background poller whose result\n   is never collected lets the summary be written before it finishes. Capture\n   the output, check the status, and `wait` for the poller before reporting.\n\n   Cross-check the total against `gh pr checks <n>` before declaring green —\n   a poller that exits on its first iteration otherwise reports \"settled\"\n   while checks are still queued.\n\n   Run that in the background (`run_in_background: true`, or `… &` with the\n   PID kept) so replying to comments proceeds concurrently rather than\n   blocking on CI.\n\n   Then re-check for comments filed against the new commits — including\n   top-level ones with no reply yet:\n\n   `gh api` returns **one page (30 comments)** unless `--paginate` is passed,\n   and `--jq` then runs per page — so a comment and its reply landing on\n   different pages makes an answered comment look unanswered, and a comment on\n   a later page look absent. Fetch every page and aggregate once with `jq -s`:\n\n   ```bash\n   # `set -o pipefail` so an API failure fails the pipeline instead of\n   # producing an empty list that reads as \"nothing unanswered\".\n   ( set -o pipefail\n     gh api --paginate repos/{owner}/{repo}/pulls/<n>/comments --jq '.[]' | jq -s -r '\n       [.[] | select(.in_reply_to_id != null) | .in_reply_to_id] as $replied\n       | [.[] | select(.in_reply_to_id == null)] as $top\n       | \"top-level: \\($top | length), answered: \\([$top[] | select(.id as $i | $replied | index($i))] | length)\",\n         ($top[] | select(.id as $i | ($replied | index($i)) | not)\n          | \"UNANSWERED \\(.id) \\(.user.login) \\(.path)\")'\n   ) || echo \"comment query FAILED — do not report all-replied\"\n   ```\n\n   Print the counted totals, not just the unanswered lines: \"top-level: 26,\n   answered: 22\" is checkable, whereas empty output is indistinguishable from\n   a query that never ran.\n\n   Post replies with `-F body=@file` rather than an inline shell string.\n   Review bodies contain backticks, quotes and code fences; nested shell\n   quoting silently mangles them, and a failed POST inside a loop can still\n   look like it succeeded.\n\n   Report the real state — \"27 pass, 1 pending\" is the honest answer while a\n   check is still running, not \"all green\".\n\n## Guidelines\n\n- Address every comment.\n- Make real code fixes, not just reply text.\n- Run the analyzer and formatter after all fixes.\n- Run affected tests to verify fixes.\n- Keep reply text concise and factual.\n- If a comment is from a bot review (e.g., CodeRabbit, Gemini), still address\n  valid points but use your judgement on noise.\n- Coverage is not optional: every codecov-flagged line in the diff must end up\n  covered (goal 100% patch), pre-existing or not. Prefer real behavioural tests;\n  only restructure code (e.g. `abstract final class`) for genuinely\n  uncoverable lines.\n","DESIGN.md":"# UI Design System & Style Tokens\n\nPath: `DESIGN.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/DESIGN.md)","docs/ARCHITECTURE.md":"# docs - System Architecture & Module Boundaries\n\nPath: `docs/ARCHITECTURE.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/docs/ARCHITECTURE.md)","tools/matrix_provisioner/README.md":"# matrix_provisioner Documentation\n\nPath: `tools/matrix_provisioner/README.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/tools/matrix_provisioner/README.md)","tools/tutorial_videos/README.md":"# tutorial_videos Documentation\n\nPath: `tools/tutorial_videos/README.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/tools/tutorial_videos/README.md)",".claude/skills/design-review-panel/panel_workflow.js":"# Claude Directive: panel_workflow.js\n\nPath: `.claude/skills/design-review-panel/panel_workflow.js`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/.claude/skills/design-review-panel/panel_workflow.js)","knowledge/features/agents/chat-input-and-reasoning.md":"# Subagent: chat-input-and-reasoning\n\nPath: `knowledge/features/agents/chat-input-and-reasoning.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/knowledge/features/agents/chat-input-and-reasoning.md)","knowledge/features/agents/index.md":"# Subagent: index\n\nPath: `knowledge/features/agents/index.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/knowledge/features/agents/index.md)","knowledge/features/agents/memory-and-compaction.md":"# Subagent: memory-and-compaction\n\nPath: `knowledge/features/agents/memory-and-compaction.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/knowledge/features/agents/memory-and-compaction.md)","knowledge/features/agents/overview.md":"# Subagent: overview\n\nPath: `knowledge/features/agents/overview.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/knowledge/features/agents/overview.md)","knowledge/features/agents/persistence-and-sync.md":"# Subagent: persistence-and-sync\n\nPath: `knowledge/features/agents/persistence-and-sync.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/knowledge/features/agents/persistence-and-sync.md)","knowledge/features/agents/project-and-event-agents.md":"# Subagent: project-and-event-agents\n\nPath: `knowledge/features/agents/project-and-event-agents.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/knowledge/features/agents/project-and-event-agents.md)","knowledge/features/agents/projection.md":"# Subagent: projection\n\nPath: `knowledge/features/agents/projection.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/knowledge/features/agents/projection.md)","knowledge/features/agents/query-chat.md":"# Subagent: query-chat\n\nPath: `knowledge/features/agents/query-chat.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/knowledge/features/agents/query-chat.md)","knowledge/features/agents/task-agents.md":"# Subagent: task-agents\n\nPath: `knowledge/features/agents/task-agents.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/knowledge/features/agents/task-agents.md)","knowledge/features/agents/templates-souls-evolution.md":"# Subagent: templates-souls-evolution\n\nPath: `knowledge/features/agents/templates-souls-evolution.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/knowledge/features/agents/templates-souls-evolution.md)","knowledge/features/agents/ui-surfaces.md":"# Subagent: ui-surfaces\n\nPath: `knowledge/features/agents/ui-surfaces.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/knowledge/features/agents/ui-surfaces.md)","knowledge/features/agents/wake-orchestration.md":"# Subagent: wake-orchestration\n\nPath: `knowledge/features/agents/wake-orchestration.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/knowledge/features/agents/wake-orchestration.md)","lib/features/agents/README.md":"# Subagent: readme\n\nPath: `lib/features/agents/README.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/lib/features/agents/README.md)","tools/tutorial_videos/config/voices.yaml":"# Config Skill\n\nPath: `tools/tutorial_videos/config/voices.yaml`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/tools/tutorial_videos/config/voices.yaml)",".agents/skills/beads/agents/openai.yaml":"# Agents Skill\n\nPath: `.agents/skills/beads/agents/openai.yaml`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/.agents/skills/beads/agents/openai.yaml)",".claude/skills/add-flutter-docusaurus-locale/agents/openai.yaml":"# Agents Skill\n\nPath: `.claude/skills/add-flutter-docusaurus-locale/agents/openai.yaml`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/.claude/skills/add-flutter-docusaurus-locale/agents/openai.yaml)",".claude/skills/add-flutter-docusaurus-locale/references/end-to-end-checklist.md":"# References Skill\n\nPath: `.claude/skills/add-flutter-docusaurus-locale/references/end-to-end-checklist.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/.claude/skills/add-flutter-docusaurus-locale/references/end-to-end-checklist.md)",".claude/skills/add-flutter-docusaurus-locale/scripts/audit_locale.py":"# Claude Directive: audit_locale.py\n\nPath: `.claude/skills/add-flutter-docusaurus-locale/scripts/audit_locale.py`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/.claude/skills/add-flutter-docusaurus-locale/scripts/audit_locale.py)",".claude/skills/maintain-docusaurus-manual/agents/openai.yaml":"# Agents Skill\n\nPath: `.claude/skills/maintain-docusaurus-manual/agents/openai.yaml`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/.claude/skills/maintain-docusaurus-manual/agents/openai.yaml)",".claude/skills/maintain-docusaurus-manual/references/discovery-and-review.md":"# References Skill\n\nPath: `.claude/skills/maintain-docusaurus-manual/references/discovery-and-review.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/.claude/skills/maintain-docusaurus-manual/references/discovery-and-review.md)",".claude/skills/maintain-docusaurus-manual/scripts/audit_docusaurus_locales.py":"# Claude Directive: audit_docusaurus_locales.py\n\nPath: `.claude/skills/maintain-docusaurus-manual/scripts/audit_docusaurus_locales.py`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/.claude/skills/maintain-docusaurus-manual/scripts/audit_docusaurus_locales.py)","lib/features/agents/projection/README.md":"# Subagent: readme\n\nPath: `lib/features/agents/projection/README.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/lib/features/agents/projection/README.md)","tools/tutorial_videos/config/scenarios/app_store_preview.yaml":"# Scenarios Skill\n\nPath: `tools/tutorial_videos/config/scenarios/app_store_preview.yaml`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/tools/tutorial_videos/config/scenarios/app_store_preview.yaml)","tools/tutorial_videos/config/scenarios/category_setup.yaml":"# Scenarios Skill\n\nPath: `tools/tutorial_videos/config/scenarios/category_setup.yaml`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/tools/tutorial_videos/config/scenarios/category_setup.yaml)","tools/tutorial_videos/config/scenarios/create_task_from_audio.yaml":"# Scenarios Skill\n\nPath: `tools/tutorial_videos/config/scenarios/create_task_from_audio.yaml`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/tools/tutorial_videos/config/scenarios/create_task_from_audio.yaml)","tools/tutorial_videos/config/scenarios/onboarding_first_run.yaml":"# Scenarios Skill\n\nPath: `tools/tutorial_videos/config/scenarios/onboarding_first_run.yaml`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/tools/tutorial_videos/config/scenarios/onboarding_first_run.yaml)","tools/tutorial_videos/config/scenarios/task_coding_prompt.yaml":"# Scenarios Skill\n\nPath: `tools/tutorial_videos/config/scenarios/task_coding_prompt.yaml`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/tools/tutorial_videos/config/scenarios/task_coding_prompt.yaml)","tools/tutorial_videos/config/scenarios/task_cover_art.yaml":"# Scenarios Skill\n\nPath: `tools/tutorial_videos/config/scenarios/task_cover_art.yaml`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/tools/tutorial_videos/config/scenarios/task_cover_art.yaml)","tools/tutorial_videos/config/scenarios/task_filters.yaml":"# Scenarios Skill\n\nPath: `tools/tutorial_videos/config/scenarios/task_filters.yaml`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/tools/tutorial_videos/config/scenarios/task_filters.yaml)"},"files":{".claude/skills/add-flutter-docusaurus-locale/SKILL.md":"---\nname: add-flutter-docusaurus-locale\ndescription: Add, complete, or audit a locale across a Flutter application's ARB catalogs and a localized Docusaurus manual, including generated localization code, locale selectors, native platform declarations, translated MDX, screenshot fixtures, tests, and parity validation. Use when introducing a new language, finishing an incomplete app or manual translation, aligning manual terminology with UI strings, or reviewing whether a locale is production-ready end to end.\n---\n\n# Add a Flutter and Docusaurus Locale\n\nTreat a locale as an end-to-end product capability, not merely a translated ARB\nfile. Preserve message contracts and wire the locale through app runtime,\nplatform metadata, manual routing, screenshots, tests, and release validation.\n\n## Build the locale inventory\n\n1. Read repository instructions and localization/manual contributor guides.\n2. Identify the canonical ARB, all locale ARBs, `l10n.yaml`, generation and\n   sorting commands, localization access conventions, and missing-translation\n   report.\n3. Find every locale allowlist: app delegates/controllers, settings UI, native\n   platform metadata, Docusaurus config, screenshot registries, CI matrices,\n   and documentation.\n4. Inspect one recently added locale in version history as a completeness map,\n   but verify every location against current code.\n5. Read [references/end-to-end-checklist.md](references/end-to-end-checklist.md)\n   for platform and manual integration surfaces.\n\n## Translate the Flutter catalog\n\n1. Copy the complete key set from the canonical ARB, including required\n   metadata and `@@locale` conventions.\n2. Translate user-visible messages in context. Preserve ICU syntax, placeholder\n   names, escaping, line breaks with semantic meaning, and product names.\n3. Use the project's tone and register. Keep terminology consistent across\n   related screens; inspect call sites when a source message is ambiguous.\n4. Do not translate internal identifiers, URLs, format skeletons, or values the\n   framework treats as syntax.\n5. Add locale-specific canonical metadata only where the generator or project\n   requires it.\n6. Run the generator and catalog sorter. Never hand-edit generated Dart files.\n\n## Wire the app and platforms\n\n- Add the locale to runtime choices and language-override state.\n- Update visible language names using localized strings where the UI requires\n  them.\n- Add native supported-language declarations for every shipped platform that\n  maintains an explicit list.\n- Update screenshot locale helpers and deterministic visible fixture copy.\n- Add behavior-focused tests for locale parsing, selection, persistence,\n  delegates, and any locale-specific formatting or fallback behavior.\n\nDo not infer that generated `supportedLocales` completes native registration.\n\n## Translate and wire the Docusaurus manual\n\n1. Add the locale to Docusaurus `i18n.localeConfigs`, navigation labels, footer\n   labels, and any search or routing configuration.\n2. Create the standard docs plugin translation files and a complete localized\n   page tree matching the canonical docs paths.\n3. Reuse terms from the target ARB for buttons, settings, statuses, and feature\n   names. Translate the surrounding explanation naturally.\n4. Preserve MDX imports, components, props, links, code, identifiers, and\n   screenshot case IDs.\n5. Add the locale to screenshot registries and produce every required theme and\n   viewport variant using the project's deterministic harness.\n6. Update contributor documentation and public language lists that users see.\n\n## Audit and validate\n\nRun the bundled contract audit before project-specific generation:\n\n```bash\npython3 <skill-dir>/scripts/audit_locale.py \\\n  --template-arb path/to/app_en.arb \\\n  --target-arb path/to/app_xx.arb \\\n  --source-docs path/to/docs \\\n  --target-docs path/to/i18n/xx/docusaurus-plugin-content-docs/current\n```\n\nThe audit fails on missing/extra ARB keys, placeholder drift, and manual page\npath mismatch. Identical translated page bodies are warnings unless\n`--fail-identical` is passed.\n\nThen run, in repository order:\n\n1. localization generation and ARB sorting;\n2. targeted localization, locale-selection, screenshot-helper, and manual tests;\n3. formatter and static analysis with zero diagnostics;\n4. the full manual typecheck, validation, tests, production build, and smoke test;\n5. focused Flutter tests required by the repository;\n6. rendered review of representative long strings and every translated manual\n   route.\n\nDo not report the locale complete while generated output is stale, translation\ngaps remain, or required checks fail.\n",".agents/skills/release/SKILL.md":"---\nname: release\ndescription: Cut a Lotti release — assemble the changelog.d/ fragments into CHANGELOG.md and the Flathub metainfo, bump the version, open the release PR, then tag. Use when asked to cut or prepare a release, assemble the changelog, publish a new version, or work out what is unreleased.\n---\n\n# Cut a release\n\nRelease notes are written per change as **fragments** in `changelog.d/`, one new\nfile per pull request, and assembled once per release. A release is therefore a\nsmall, boring, self-contained pull request: it turns the fragments into prose in\ntwo files, moves the version, and deletes what it consumed.\n\n**This is the only change allowed to touch `CHANGELOG.md`,\n`flatpak/com.matthiasn.lotti.metainfo.xml`, or the `version:` line in\n`pubspec.yaml`.** That rule is the whole point — those three files are written at\nthe top by everything, so as long as exactly one pull request per release writes\nthem, nothing can conflict. If you are here for any other reason, you are in the\nwrong skill; write a fragment instead (`changelog.d/README.md`).\n\n## Before you start\n\n```bash\ngit checkout main && git pull\nls changelog.d/[0-9]*.md       # the work queue; README.md is not a fragment\nfvm dart run tool/changelog/validate.dart --strict\n```\n\n`--strict` rather than `make changelog_check`: the house-style warnings the\nauthor-facing check only prints — an entry with no bold headline, a paragraph\npasted as one long line — are about to become published prose, so here they\nblock.\n\n- Work from an up-to-date `main`. A release assembled on a stale branch drops\n  whatever merged in the meantime.\n- If `changelog.d/` holds nothing but its README, there is nothing to release.\n  Say so and stop.\n- Fix any malformed fragment here, in the release branch. It is cheaper than\n  sending the author back.\n- A fragment describing something that was reverted before it shipped gets\n  deleted, not published.\n\n**Ask before committing, pushing or tagging.** Every step below writes files;\nthe git operations are the user's call, always.\n\n## 1. Read every fragment\n\nRead them all before writing anything. You are producing one coherent set of\nrelease notes, not a concatenation: two fragments may describe two halves of the\nsame user-visible change and should be merged into one entry, and a later\nfragment may supersede an earlier one.\n\n## 2. Choose the version\n\n```bash\ngrep -m1 '^version:' pubspec.yaml     # e.g. version: 1.0.13+4352\n```\n\n- **Bug fixes alone:** keep the semantic version unchanged and increment only\n  the build number (`1.0.21+4362` → `1.0.21+4363`). A fix-only release appends\n  its notes to the current top changelog section and metainfo release block; it\n  must not create a duplicate `## [1.0.21]` heading or `<release\n  version=\"1.0.21\">` block.\n- **User-facing additions or changes:** increment the patch version and the\n  build number (`1.0.21+4362` → `1.0.22+4363`). Any publishable `Added`,\n  `Changed`, `Deprecated`, or `Removed` entry makes this a user-facing release.\n- **Explicit minor release:** increment the minor version and reset the patch\n  component to zero only when the user explicitly requests a minor release\n  (`1.0.21+4362` → `1.1.0+4363`). The build number still increments normally.\n- **Build number:** always previous + 1. It only has to be unique and increasing\n  per tag — every release lane triggers on tag push, not on merges to `main` —\n  so it moves once per release, not once per pull request.\n\nIf the user named a version, use it. Otherwise propose one from what the\nfragments contain and confirm it.\n\n## 3. Assemble the CHANGELOG section\n\nFor a user-facing release, insert one new section at the top of `CHANGELOG.md`,\ndirectly under the Keep a Changelog preamble and above the previous version:\n\n```markdown\n## [1.0.22]\n### Added\n- **...**\n\n### Changed\n- **...**\n\n### Fixed\n- **...**\n```\n\n- **One section per type, in this order**: Added, Changed, Deprecated, Removed,\n  Fixed, Security. Skip the ones with no entries. Never repeat a heading inside\n  a version — older sections do, because entries used to be appended one PR at a\n  time; assembling from fragments is what fixes that.\n- **The version heading carries no date.** That is the file's existing shape.\n- Keep each entry's wording as the fragment wrote it, minus edits for\n  duplication, house voice, or an entry that reads oddly next to its neighbours.\n- Wrap at about 78 columns, continuation lines indented two spaces.\n\nFor a fix-only build release, add the new bullets to the current top semantic\nversion instead. Reuse its existing `### Fixed` heading, or create that heading\nin the normal section order if it does not have one. Never create a second\nversion section or a second `### Fixed` heading.\n\n## 4. Write the Flathub release block\n\nFor a user-facing release, add one `<release>` to\n`flatpak/com.matthiasn.lotti.metainfo.xml`, as the **first** child of\n`<releases>` — newest first:\n\n```xml\n<release version=\"1.0.22\" date=\"2026-08-25\">\n  <description>\n    <p>Fixed: ...</p>\n  </description>\n</release>\n```\n\nThis is the same prose, mechanically transformed. AppStream renders `<p>` as\nplain text: markdown does not survive it, and an unescaped `&` breaks the build.\n\nFor a fix-only build release, append the new `Fixed:` paragraphs to the\ndescription of the existing first `<release>` block and update that block's\ndate to the day the build is cut. Do not create a duplicate release block for\nthe unchanged semantic version.\n\n| In `CHANGELOG.md` | In the metainfo |\n|---|---|\n| one `- ` bullet | one `<p>`, same order as the section |\n| the `### Fixed` heading above it | the prefix `Fixed: ` on every paragraph in that section |\n| `- **Bold headline.** Detail…` | `Fixed: bold headline. Detail…` — bold markers dropped, first letter lowercased unless it is a proper noun (`Settings`, `Flathub`) |\n| hard-wrapped over several lines | one long line |\n| `—` or `–` | ` - ` |\n| `` `code` `` or a glyph like `•••` | plain words a user recognises — `\"...\"`, `the \"Location with the name CEST doesn't exist\" error` |\n| `&`, `<`, `>` | `&amp;`, `&lt;`, `&gt;` |\n\nWorked example, from 1.0.13:\n\n```markdown\n- **Daily habit reminders arrived hours late on iPhone, iPad and Android.** The\n  app could not work out which timezone the device was in, quietly settled for\n  UTC, and then built the reminder's time of day in UTC — so an 08:00 habit\n  reminder rang at 10:00 in Central European Summer Time.\n```\n\n```xml\n<p>Fixed: daily habit reminders arrived hours late on iPhone, iPad and Android. The app could not work out which timezone the device was in, quietly settled for UTC, and then built the reminder's time of day in UTC - so an 08:00 habit reminder rang at 10:00 in Central European Summer Time.</p>\n```\n\nThe `date` is the day the release is cut, `YYYY-MM-DD`.\n\n## 5. Bump the version\n\nOne line in `pubspec.yaml`:\n\n```yaml\nversion: 1.0.22+4363\n```\n\n## 6. Delete the fragments you consumed\n\n```bash\ngit rm changelog.d/[0-9]*.md       # fragments start with their date; README.md does not\n```\n\nEverything you just published goes. `changelog.d/` holding only its README is\nwhat \"nothing unreleased\" looks like; git history keeps the originals.\n\n## 7. Verify\n\n```bash\nmake changelog_check                                     # versions now agree\nxmllint --noout flatpak/com.matthiasn.lotti.metainfo.xml # if available\ngit status --short\n```\n\n`git status` must show exactly four kinds of change and nothing else:\n`CHANGELOG.md`, the metainfo, `pubspec.yaml`, and deleted fragments. A release\nPR that also carries code is a release PR that can conflict.\n\nRe-read the assembled section once as a user would. It is the text that reaches\nFlathub, the GitHub release and the app's What's New — it is read far more often\nthan it is written.\n\n## 8. Open the release pull request\n\nUse the semantic version in the title for a user-facing release:\n\n```\nchore(release): 1.0.22\n```\n\nUse the full version and build for a fix-only release so it is distinguishable\nfrom the release that first introduced that semantic version:\n\n```\nchore(release): 1.0.21+4363\n```\n\nBody: the entries assembled for this release, grouped under their release\nheadings, so review reads the new notes rather than the diff. For a fix-only\nrelease, label the body with the full version and build even though the\nchangelog heading remains the unchanged semantic version. No screenshots —\nnothing visual changed.\n\n## 9. Tag, after it merges\n\n```bash\ngit checkout main && git pull\nmake tag_push        # tags 1.0.22+4363 from pubspec.yaml and pushes it\n```\n\n`make tag_push` reads the version with `yq`; install it (`brew install yq`) or tag\nby hand with the exact `version+build` string if the target reports it missing.\n\nThe tag is what ships. Pushing it triggers, in parallel: macOS and iOS\nTestFlight, the Android release, the Linux GitHub release, the macOS signed\n`.dmg`, the Flathub submission PR against `flathub/com.matthiasn.lotti` —\nwhich is why the metainfo has to be right *before* the tag, not after — and\nthe manual of that version (`/manual/<x.y.z>/`, the one the app links to).\nA tag whose manual sources are unchanged publishes in a minute by reusing the\nprevious release's snapshot; otherwise the manual run recaptures all eleven\nlocales and takes about an hour.\n\nOn Google Play the release tag stops at internal testing. Moving that build on\nis a separate tag from the same commit, once the internal upload has finished:\n`make android_closed_testing` for closed testing, `make android_release` for\nproduction. Both promote the build Play already has rather than rebuilding it;\nthe mechanism is the *Google Play tracks* section of\n[`knowledge/architecture/platform-and-release.md`](../../../knowledge/architecture/platform-and-release.md).\n\nConfirm with the user before tagging. Watch the lanes; `docs/macos-release.md`\nand `docs/flatpak-flathub-recovery.md` cover the two that fail in interesting\nways.\n\n## 10. Downstream, and out of scope here\n\nThe app's **What's New** modal reads from the separate `matthiasn/lotti-docs`\nrepository (`whats-new/`), not from this one. Publishing there is an editorial\nstep in that repo — mention it once the release is tagged; do not attempt it\nfrom here.\n\n## Gotchas\n\n- **The metainfo lagging a version behind is invisible until Flathub ships it.**\n  `make changelog_check` fails on exactly that, which is why it runs in CI on\n  every push rather than only at release time.\n- **Tags carry the build number** (`1.0.14+4353`), and every release lane keys\n  on tag push. Re-tagging the same build number to fix a mistake will not give\n  you a fresh TestFlight build; bump the build number and cut again.\n- **Do not fold anything else into the release PR** — not a \"quick fix\", not a\n  dependency bump. The moment it carries code it can conflict, and the reason\n  this flow exists is gone.\n",".agents/skills/beads/SKILL.md":"---\nname: beads\ndescription: Use for authorized Lotti maintainer work that needs private durable task tracking, issue dependencies, blocker management, multi-session handoff, or shared agent memory. Public contributors use GitHub Issues instead.\n---\n\n# Beads\n\nUse Beads as the private durable task system for authorized Lotti maintainers.\nPublic bugs, feature requests, and contributor coordination stay in GitHub\nIssues. Local plans remain useful for the current turn.\n\n## First Step\n\nFirst confirm that the private tracker is available:\n\n```bash\nbd --readonly list --json\n```\n\nIf no database exists and the current user is an authorized maintainer, run:\n\n```bash\nchmod 700 .beads\ngit config beads.role maintainer\nbd bootstrap\n```\n\nIf access is denied, do not initialize a competing database. Use GitHub Issues\nand PR discussion instead.\n\nRun `bd prime` manually when workflow context is needed. Do not install Git,\nCodex, or Claude hooks for Beads in this repository.\n\n## Core CLI Workflow\n\n1. Pull and find work:\n\n```bash\nbd dolt pull\nbd ready\nbd list --status=open\nbd list --status=in_progress\n```\n\n2. Inspect before editing:\n\n```bash\nbd show <id>\n```\n\n3. Claim work atomically:\n\n```bash\nbd update <id> --claim\n```\n\n4. Create durable follow-up work when implementation reveals new tasks:\n\n```bash\nbd create \"Short title\" --description=\"Why this exists and what needs to be done\" --type=task --priority=2\n```\n\n5. Close completed work:\n\n```bash\nbd close <id> --reason=\"Completed\"\n```\n\n6. With explicit authority, publish durable changes:\n\n```bash\nbd dolt push\n```\n\n## What Belongs In Beads\n\nMaintainers use Beads for:\n\n- shared project tasks\n- blockers and dependencies\n- discovered follow-up work\n- work that must survive thread reset, compaction, or handoff\n- status that another person or agent should be able to resume\n\nPublic-facing context must still be copied into GitHub issues, PR descriptions,\nor review discussion so contributors never need private tracker access.\n\n## Rules\n\n- Do not use `bd edit`; it opens an interactive editor. Use `bd update` flags instead.\n- Prefer `--json` when parsing `bd` output programmatically.\n- Do not auto-close or mutate tasks unless the work is actually complete.\n- Do not store credentials, private user data, or other secrets in Beads.\n- Do not commit, push Git, or sync Dolt without explicit authority.\n",".claude/skills/design-review-panel/SKILL.md":"---\nname: design-review-panel\ndescription: Run a multi-agent design review on a UI surface — capture reproducible baseline screenshots, then rate them with a panel of design experts (one agent per craft dimension) and, optionally, a panel of user personas with different cognitive styles. Iterate implement → re-screenshot → re-rate until every panel hits a numeric target (e.g. avg ≥8/10). Use when polishing or redesigning a screen/modal/dialog and the user wants grounded, scored design feedback (\"summon the design panel\", \"rate this with the experts\", \"run the persona panel\").\nargument-hint: \"<surface to review, e.g. 'AI popup model picker'>\"\n---\n\n# Design Review Panel\n\nA repeatable, grounded process for design polish and redesign work. It pairs\ntwo parallel agent panels — **design experts** (craft dimensions) and,\noptionally, **user personas** (cognitive styles) — and drives them against\n**real screenshots the agents actually `Read`**, iterating to a numeric target.\n\nThis is how the user wants UI/design tasks run. The numeric target is the\nsuccess condition: keep iterating until both panel averages clear the bar\n(the workflow's `cleared` flag).\n\n## The loop\n\n```mermaid\nstateDiagram-v2\n    [*] --> Baseline\n    Baseline --> RateBaseline: capture reproducible PNGs (app-screenshots)\n    RateBaseline --> Implement: both panels score the current state\n    Implement --> Rescreenshot: apply highest-leverage fixes (design-system tokens only)\n    Rescreenshot --> Rerate: regenerate the SAME shots\n    Rerate --> Implement: either panel average < target\n    Rerate --> Harden: both panel averages ≥ target\n    Harden --> [*]: tests, l10n, README, changelog.d fragment, analyzer clean, PR\n```\n\n1. **Baseline screenshot first.** Use the `app-screenshots` skill / the\n   `test/test_utils/screenshot_harness.dart` `captureInApp` harness to render\n   the surface at phone **and** desktop, dark (add light + large-text shots\n   when accessibility is in scope). Reproducible PNGs are mandatory — the\n   panels are only as honest as the pixels they read.\n2. **Rate the baseline with BOTH panels up front.** Get grounded starting\n   scores before changing anything. Never carry over scores from a previous\n   session — re-rate on a freshly regenerated PNG every time (grounded\n   re-rating reliably deflates inflated prior numbers).\n3. **Iterate with the expert panel** until experts clear the bar. Bring the\n   persona panel into the loop once experts reach ≥8 so the two converge\n   together. Each iteration: implement → regenerate the exact same screenshots\n   → re-rate.\n4. **Adjudicate genuine tradeoffs with the user** (`AskUserQuestion`) instead\n   of silently picking a side — before declaring a conflict irreducible, hunt\n   for a both-sides fix (one change that serves two opposed reviewers).\n5. **Harden to PR-ready** once converged: tests, l10n, feature README, a\n   `changelog.d/` fragment (never `CHANGELOG.md` or the flatpak metainfo\n   directly — those belong to the release), analyzer zero-warning, formatter,\n   PR on latest main.\n\n## The two panels\n\n### Design-expert panel (always)\nOne agent per craft dimension. Default lenses (adapt to the surface):\n- **Visual hierarchy / IA** — what reads primary/secondary/tertiary; scent.\n- **Design-system consistency** — tokens, spacing rhythm, component reuse;\n  does the surface feel like ONE system or bolted-together parts.\n- **Color / contrast / semantics** — palette restraint, status-by-more-than-color.\n- **Typography** — ramp, weight contrast, measure, rhythm.\n- **Spacing / density / rhythm** — padding, alignment, optical balance.\n- **Interaction / task-flow** — taps-to-goal, affordances, dead-ends, the\n  \"1-tap to the common case\" promise.\n\n### User-persona panel (on by default — pass `includePersonas: false` to skip)\nDifferent cognitive styles stress the surface as real users:\n- **ADHD / clutter-sensitive** — needs \"what now\" instant; abandons noise.\n- **Power user** — counts seconds, allergic to wasted space/steps.\n- **Low-vision / low-confidence** — large text, strong contrast, fears\n  irreversible taps.\n- **Minimalist aesthete** — wants calm, uniform, restrained.\n- **Non-technical novice / second-language** — reads copy literally; jargon\n  and ambiguous labels break them.\n\nPersonas return a **verdict** (would-use / would-struggle / would-abandon) plus\nblockers / frictions / delights. Experts return a **1–10 score** per surface\nplus severity-tagged issues with evidence + a concrete fix.\n\n## Grounding rules (give these to every agent verbatim)\n- **`Read` every screenshot path.** Base every visual claim on actual pixels.\n  Panels hallucinate failures when they don't — forbid it.\n- **No invented measurements.** Don't fabricate px gaps or contrast ratios; if\n  you can't measure it, describe it qualitatively and tie it to something\n  visible.\n- **Every issue carries evidence** — a named screenshot (\"picker_desktop: …\")\n  or a `file:line`. Code claims (e.g. \"hardcodes spacing\") require Reading the\n  file and citing the line.\n- **Grumpy, calibrated scoring:** 10 = ship-grade, nothing to fix; 8 = good,\n  only polish left; 6 = usable but rough; 4 = several real problems; ≤3 =\n  broken. Do not be generous.\n- **List test-rig artifacts to IGNORE** (stand-in nav bars, tofu glyphs,\n  folded-hour bands) so the panel doesn't score the harness.\n\n## Running it\n\nDrive both panels as a `Workflow` so the agents run in parallel and return\nstructured scores. A parameterized reference script lives next to this file:\n**`panel_workflow.js`** — pass `args` describing the surface, screenshot paths,\nsource files, expert lenses, personas, and `includePersonas` /\n`target`. Adapt the lenses and persona prompts to the surface; keep the schema\nand the iterate-to-target loop.\n\n```\nWorkflow({ scriptPath: \".claude/skills/design-review-panel/panel_workflow.js\", args: { ...see file header... } })\n```\n\nRead the returned synthesis, apply the must-fixes, regenerate the same\nscreenshots, and re-run until the returned `cleared` is `true` (both panel\naverages meet the `target`). Then delete the scratch capture test and\n`test/screenshots/` (per the app-screenshots skill) unless the user asks to\nkeep them.\n\n## See also\n- `app-screenshots` — the reproducible capture harness this skill depends on.\n- `AskUserQuestion` — for adjudicating genuine, irreducible design tradeoffs.\n",".claude/skills/maintain-docusaurus-manual/SKILL.md":"---\nname: maintain-docusaurus-manual\ndescription: Maintain a Docusaurus product manual whose prose, navigation, localized page trees, screenshots, coverage metadata, and release build must stay aligned with the application. Use when adding or revising manual pages, documenting a product change, updating translated MDX, repairing locale parity, adding registered screenshots, auditing stale documentation, or validating a multilingual Docusaurus site before publication.\n---\n\n# Maintain a Docusaurus Manual\n\nTreat the running product and source code as authoritative. Keep documentation,\ntranslations, navigation, screenshots, inventories, and generated site behavior\nconsistent in the same change.\n\n## Discover the project contract\n\n1. Read the repository instructions and the manual's own contributor guide.\n2. Locate the Docusaurus config, source docs, localized docs, sidebar, package\n   scripts, validation scripts, screenshot registry, coverage inventory, and CI.\n3. Identify the canonical locale, supported locales, URL/version scheme, and\n   whether localized pages may fall back or must have exact path parity.\n4. Locate app strings or another terminology source before translating UI names.\n5. Read [references/discovery-and-review.md](references/discovery-and-review.md)\n   when the repository has custom inventories, generated screenshots, or\n   versioned publishing.\n\nDo not assume conventional paths when the repository declares its own.\n\n## Update the manual\n\n1. Verify the current product behavior from implementation and focused tests.\n2. Update the canonical page with concrete, task-oriented prose. Describe only\n   controls, states, limitations, and workflows that exist.\n3. Preserve stable frontmatter identifiers, component calls, links, anchors,\n   admonitions, and code unless the change intentionally modifies them.\n4. Add new pages to navigation and every repository-owned coverage or surface\n   inventory.\n5. Update every published locale required by the project. Translate meaning,\n   not sentence shape; preserve product terminology from the localized app.\n6. Record questionable product wording separately unless changing UI copy is\n   explicitly in scope.\n\n## Handle screenshots as evidence\n\n- Prefer the repository's deterministic screenshot harness and registry.\n- Capture the real production widget or route with representative state.\n- Keep required locale, viewport, and theme variants complete.\n- Reference screenshots through the site's component or registry rather than\n  hard-coded media URLs when such an abstraction exists.\n- Keep generated media outside the source repository when that is the declared\n  architecture.\n\nIf the task is only a one-off application screenshot, use the repository's\nscreenshot skill instead of extending the manual pipeline.\n\n## Validate in increasing scope\n\n1. Run the bundled parity audit when the site uses standard Docusaurus locale\n   trees:\n\n   ```bash\n   python3 <skill-dir>/scripts/audit_docusaurus_locales.py \\\n     --site-root path/to/site\n   ```\n\n   Pass `--fail-identical` only when identical localized page bodies are\n   forbidden. Treat its default identical-page output as a review warning.\n\n2. Run focused repository validators and tests for touched metadata or helpers.\n3. Run type checking, link/content validation, unit tests, and the production\n   Docusaurus build through repository scripts.\n4. Smoke-test built routes, locale switching, assets, search, and base URLs.\n5. Review the rendered page at representative widths and in every changed\n   locale. A successful build does not prove prose accuracy or layout quality.\n\nDo not claim completion while required checks fail. Report any validation that\ncould not run and why.\n",".claude/skills/skeptical-review/SKILL.md":"---\nname: skeptical-review\ndescription: Act as a skeptical senior engineer performing a detailed code review of the latest changes on the current branch (or a given PR) — best practices, maintainability, performance, security, and readability. Objective and concise; only real issues, with a clear \"no issues\" verdict when the code is clean. Replaces CodeRabbit / Gemini Code Review.\nargument-hint: \"[optional: PR number, base branch, or path scope]\"\n---\n\n# Skeptical Senior Engineer Review\n\nYou are a skeptical senior engineer performing a detailed, professional code\nreview. The bar is a practical, fair assessment a maintainer can act on\ndirectly, not a wall of generated nitpicks.\n\n## Ground rules (non-negotiable)\n\n- **Be objective and concise** — only point out real issues or suboptimal\n  practices you can defend with a concrete failure mode or maintenance cost.\n- **If the code follows best practices and there are no issues, say so\n  clearly.** Do not invent imaginary problems to look thorough. \"This diff is\n  clean\" is a valid and valuable review outcome.\n- **For each issue**, briefly explain *why* it's a problem and suggest a\n  better approach or concrete improvement.\n- **Focus on** clarity, structure, code style, logic, and efficiency —\n  correctness first, then maintainability, performance, security,\n  readability.\n- **Avoid nitpicking** minor style differences unless they impact clarity or\n  maintainability. The analyzer and formatter already police style; don't\n  duplicate them.\n- **Review the diff, not the whole file** — but read enough surrounding code\n  to judge the change in context. Never flag something as missing without\n  first checking whether it exists elsewhere in the codebase.\n\n## Scoping the diff\n\nTreat `$ARGUMENTS` as optional. Resolve what to review in this order:\n\n1. **PR number given** (e.g. `/skeptical-review 3413`) — fetch the PR diff\n   via `gh pr diff <n>` and `gh pr view <n>` for title/description context.\n2. **Base branch given** (e.g. `/skeptical-review develop`) — diff the\n   current branch against that base.\n3. **Path scope given** (e.g. `/skeptical-review lib/features/ai`) — limit\n   the branch diff to that path.\n4. **No arguments** — review the current branch's latest changes:\n   `git diff main...HEAD` **plus** uncommitted work\n   (`git diff HEAD` and untracked files via `git status`). Say explicitly\n   which of the two buckets each finding falls in when both exist.\n\nBefore reviewing, print a one-paragraph scope statement: branch, base,\nnumber of files/insertions/deletions, and a one-line summary of what the\nchange is trying to do (from commit messages / PR description). If the diff\nis empty, say so and stop.\n\nSkip generated files (`*.g.dart`, `*.freezed.dart`, `lib/l10n/app_localizations_*.dart`)\nexcept to verify they were regenerated when their sources changed. Treat\n`third_party/` as vendored: review it lighter — flag only correctness and\nsecurity issues, not style, and note divergence-from-upstream risk instead.\n\n## Review dimensions\n\nWork through the diff with these lenses, in this priority order:\n\n1. **Correctness & logic** — off-by-one, null/async races, wrong operator,\n   state not reset, error paths swallowed, edge cases (empty list, first\n   run, migration), broken invariants between files that changed together.\n2. **Maintainability & structure** — duplication that should be extracted,\n   wrong layer (business logic in widgets, UI concerns in repositories),\n   dead code added, public API surface grown without need, missing or\n   now-stale docstrings on touched functions.\n3. **Performance** — unnecessary rebuilds (missing `const`, provider\n   over-watching), N+1 queries, work in `build()` that belongs in a\n   provider/controller, unbounded growth (caches, listeners never disposed,\n   stream subscriptions leaked).\n4. **Security & privacy** — secrets or tokens in code/logs, injection into\n   SQL/shell/URLs, sensitive journal data written to logs or synced when it\n   shouldn't be, permissions widened.\n5. **Readability** — misleading names, comments that restate code or will\n   rot, control flow that needs a rewrite to be followed (only when it\n   genuinely impairs the next reader — see nitpick rule above).\n\n## Project-specific checks (Lotti)\n\nThis repo has house rules; a change violating them is a real finding, not a\nnitpick. Verify against `AGENTS.md` (authoritative) — highlights:\n\n- **Tests**: one test file per source file, mirrored paths; centralized\n  mocks (`test/mocks/mocks.dart`), fallbacks, and `makeTestableWidget` /\n  `setUpTestGetIt` helpers; no `Future.delayed`/`sleep`/real timers; no\n  `DateTime.now()`; meaningful assertions only (`findsOneWidget` alone is\n  not a test). New/changed behavior in `lib/` without matching test changes\n  is worth flagging.\n- **l10n**: no hardcoded user-visible strings; new labels added to every\n  full catalog in `lib/l10n/`, with `app_en_GB.arb` getting an entry only\n  where British spelling differs (list, exception and register rules in\n  `knowledge/conventions/localization.md`); generated l10n Dart files never\n  hand-edited.\n- **Design system**: no raw spacing numbers, `TextStyle` constructors, or\n  ad-hoc colors — tokens (`tokens.spacing.*`, `tokens.typography.*`,\n  `tokens.colors.*`) are mandatory in UI code.\n- **UI stability**: async providers must not flash loading/empty shells on\n  background refresh (`skipLoadingOnReload` or equivalent).\n- **Docs & release hygiene**: feature READMEs updated when behavior\n  changed; a release note as a new `changelog.d/YYYY-MM-DD-slug.md` fragment\n  (only for user-visible changes). A PR that edits `CHANGELOG.md`, the flatpak\n  metainfo, or the `version:` line in `pubspec.yaml` is a finding, not a\n  courtesy — those three belong to the release alone.\n- **Conventions**: Conventional Commits; no dependencies from new code onto\n  old code being replaced; no hoarded/unused code.\n\nDo not re-run the analyzer or tests as part of the review by default — this\nis a reading review. If a finding hinges on runtime behavior you cannot\ndetermine by reading (e.g. \"does this provider rebuild?\"), say so and mark\nthe finding as needing verification rather than asserting it.\n\n## Output format\n\nDeliver the review as a single final message:\n\n1. **Verdict line** — one sentence: overall assessment (e.g. \"Solid change\n   with two real issues and one suggestion\" or \"Clean — no issues found\").\n2. **Scope statement** — the paragraph described above.\n3. **Findings**, ordered by severity, each formatted as:\n\n   ```text\n   ### <severity> — <one-line summary>\n   `path/to/file.dart:123`\n   Why it's a problem: <one or two sentences>\n   Suggestion: <concrete fix or better approach; short code sketch if it helps>\n   ```\n\n   Severity levels: **Blocker** (must fix before merge — bugs, security,\n   data loss), **Should fix** (real maintainability/performance cost),\n   **Consider** (worthwhile improvement, author's call). Do not pad lower\n   tiers to seem thorough — an empty tier is fine.\n4. **What's done well** — one short paragraph max, only if genuinely\n   noteworthy (patterns worth repeating), never as filler praise.\n\nKeep the whole review proportional to the diff: a 20-line diff gets a short\nreview. If the real issues would make a long list, the change needs a rewrite\nconversation, not a list; say that instead.\n\n## What NOT to do\n\n- Do not modify any code. This skill is read-only; if the user wants fixes\n  applied, they will ask after reading the review.\n- Do not flag issues in code the diff merely touches adjacent to (moved\n  lines, re-indentation) — pre-existing problems may be *mentioned* once,\n  clearly labeled \"pre-existing, out of scope\".\n- Do not restate the diff's contents as findings (\"this adds a provider\")\n  — every finding must carry a judgment.\n- Do not hedge to inflate counts: if you're unsure it's a problem, either\n  verify by reading more code or drop it.\n",".claude/skills/analyze-db-logs/SKILL.md":"---\nname: analyze-db-logs\ndescription: Analyze Drift / SQLite slow-query and super-slow-query logs against this app's known stall patterns (read waves, N+1, transaction scoping, MultiExecutor contention, WAL/OS factors)\nargument-hint: \"<path-to-logs-dir> [optional: date YYYY-MM-DD or relative window]\"\n---\n\n# Analyze DB Slow-Query Logs\n\nReads slow-query log files written by `lib/database/slow_query_logging.dart`\nand produces an actionable diagnosis grounded in this codebase's stack\n(Dart, Flutter, Drift, SQLite).\n\n## Invocation\n\nThe user provides the path to the log directory — typically a gitignored\nlocal copy they pulled off a device or simulator. Repository convention is\n`./logs/` at the repo root (already in `.gitignore`).\n\n```sh\n/analyze-db-logs ./logs/                       # most recent date in ./logs/\n/analyze-db-logs ./logs/desktop                # platform-scoped subdir\n/analyze-db-logs ./logs/mobile 2026-05-02      # specific date\n/analyze-db-logs /tmp/from-device              # any absolute path\n```\n\nTreat `$ARGUMENTS` as `<path> [optional date or window]`. The first\npositional must be the path; refuse with a one-line prompt if it is\nmissing — do NOT invent a default location, the user knows where their\nlogs are. Date is optional and defaults to \"the most recent file per\nstem found under that path\".\n\nAlways print the resolved paths and line counts before analysing, so the\nuser can confirm the right files are loaded.\n\n## Log file shapes\n\nThe `SlowQueryInterceptor.fileReporter` writes two daily files per\nplatform under whatever `documentsDirectoryPath/logs/` the running app\nresolved to. The user is responsible for copying them into the path they\nhand to this skill. Expect:\n\n- `slow_queries-YYYY-MM-DD.log` — every query above the configured\n  threshold (default 10ms; gated by `SlowQueryLoggingGate.isEnabled`).\n- `super_slow_queries-YYYY-MM-DD.log` — duplicates of queries above the\n  super-slow threshold (default 200ms), enriched with `EXPLAIN QUERY\n  PLAN` rows under `PLAN:` and (when first-call stack capture is on)\n  filtered application stack frames under `STACK:`.\n\n### Subdirectory layout\n\nBy convention this repo's `./logs/` contains one subdirectory per\nplatform — typically `desktop/` and `mobile/` (sometimes `ios/`,\n`android/`). Each subdir holds its own daily files. When the path the\nuser supplies is a directory that contains *only* subdirectories (no\n`*.log` files at its top level), treat each subdirectory as a separate\nplatform-scoped scan and label every finding with the subdir name so\nthe user can tell which device it came from.\n\nIf the user supplies a more specific path (e.g. `./logs/mobile/`),\nrespect that and don't go up a level. If they supply the parent and\nboth `desktop/` and `mobile/` are present, analyse both and produce one\nreport section per platform plus a brief cross-platform summary at the\nend.\n\nGlob discovery rule of thumb:\n\n```text\n<path>/{slow_queries,super_slow_queries}-*.log         # path is leaf\n<path>/*/{slow_queries,super_slow_queries}-*.log       # path is parent\n```\n\nPick the most recent date per `(subdir, stem)` pair unless a date arg\nis given.\n\n## Log line formats\n\nA slow-query line is a single line:\n\n```text\n2026-05-02T19:11:48.592 [db.sqlite] select 388.759ms args=0 SELECT * FROM ...\n```\n\nA super-slow entry is the same line plus indented continuation lines:\n\n```text\n2026-05-02T19:11:48.592 [db.sqlite] select 388.759ms args=0 SELECT ...\n  PLAN: 4|0|SEARCH journal USING INDEX idx_journal_browse (deleted=? AND type=?)\n  PLAN: 84|0|USE TEMP B-TREE FOR ORDER BY\n  STACK: #10     JournalDb.getAllDashboards (package:lotti/database/database.dart:3056:34)\n  STACK: #11     dashboardsProvider.<anonymous closure> (package:lotti/features/dashboards/state/dashboards_page_controller.dart:20:14)\n```\n\nThe interceptor filters `STACK:` lines to drop drift, dart-runtime,\nriverpod and the slow-query plumbing itself; only `package:lotti/...`\nframes remain.\n\n## Analysis procedure\n\n1. **Resolve the file set.** Honor the platform argument; pick the most\n   recent date per stem if no date is given. Tail-load the file (last\n   ~2000 lines is usually enough — the interceptor appends, so the wave\n   you care about is at the end). Print the resolved paths.\n\n2. **Bucket entries by query shape.** Collapse per-row args; group by\n   the normalized statement. For each bucket capture: count, p50/p95/max\n   elapsed, the unique `PLAN:` shapes, and the unique `STACK:` heads\n   (top app-code frame).\n\n3. **Diagnose against the known patterns below.** For every finding,\n   cite the specific log lines (timestamp + elapsed + statement\n   prefix). Do not generalize — show the data.\n\n4. **Recommend the fix.** Reference the existing seam (drift query,\n   coalescer, transaction wrapper, index, etc.) and where in the code\n   the change would land. If a fix is speculative, say so.\n\n## Known stall patterns to look for\n\nThese are battle-tested findings from this codebase. Apply them in order;\nthe first match is usually the dominant cost.\n\n### 1. Read waves — N queries reporting hundreds of ms but finishing in a tight burst\n\n**Signature**: a cluster of 10–20+ queries whose `elapsed` is roughly\nidentical (e.g., all in the 600–700ms band) but whose timestamps span\nonly 10–30ms. Each query's plan is fine; the SQL itself is fast.\n\n**Diagnosis**: the queries were *queued* behind something — typically a\nwrite transaction holding the writer lock, an `ANALYZE` on the boot\npath, or a slow `beforeOpen` hook. The wall-clock measurement starts\nwhen drift accepts the request, so queue wait shows up as \"elapsed\".\n\n**Confirm by**:\n- Check the `elapsed` band: a 100ms+ spread *across* the wave with\n  near-identical *finish* timestamps (use the leading ISO timestamp,\n  not the elapsed) means the queries unblocked together. The\n  interceptor strips drift / dart-runtime frames so the original\n  `STACK: #5 DatabaseConnectionUser.doWhenOpened` boilerplate is\n  *not* visible in the log — infer the gate from the timing pattern,\n  not from a frame name.\n- Look at the line *just before* the wave for a long-running write or\n  transaction.\n- Boot waves often correlate with `EntitiesCacheService.init` firing\n  `Future.wait` of definitions queries — the surviving `STACK:` heads\n  for the wave will point at distinct controllers / repositories\n  whose initial fetches all queued together.\n\n**Likely fixes**:\n- Move `ANALYZE` and other heavy work *off* the boot path (`beforeOpen`\n  must return fast).\n- Narrow transaction scopes (see pattern 4).\n- Raise the read pool size only after confirming isolate-spawn cost is\n  the bottleneck — bumping `readPool` adds isolate-spawn cost upfront.\n\n### 2. N+1 reads — a cluster of single-id selects from one call site\n\n**Signature**: many lines like\n`SELECT * FROM \"journal\" WHERE \"id\" = ? AND \"deleted\" = ?`, all from the\nsame `STACK:` head, all reporting nearly identical elapsed times.\n\n**Diagnosis**: a `Future.wait(ids.map(byId))` or a per-row provider\nfamily fanning out single-id reads. Each call queues through the read\npool independently.\n\n**Recurring offenders already fixed in this codebase**:\n- `taskLiveDataProvider` (FutureProvider.family per task) → solved by\n  `JournalDb._coalesceEntityById` (microtask-coalesced bulk fetch).\n- `LinkedAiResponsesController._fetch` → switched from `Future.wait` to\n  `journalRepository.getJournalEntitiesByIds(...)`.\n- `EditorStateService.init` drafts loop → switched to\n  `journalEntitiesByIdsUnorderedAllPrivate(idList)`.\n\n**Likely fixes**:\n- Replace fan-out with a bulk drift query (`journalEntitiesByIdsUnorderedAllPrivate`,\n  `getJournalEntitiesForIdsUnordered`, `linksForEntryIds`, etc.).\n- For Riverpod families that genuinely need per-row instances, route\n  through the existing entity-by-id microtask coalescer.\n\n### 3. Drift MultiExecutor contention — reads inside a transaction run on the writer\n\n**Reminder**: in drift, anything wrapped in `db.transaction(() async { ... })`\nruns on the *write* connection — even pure `select(...)` calls inside\nthe block. The read-pool isolates do NOT pick those up. So a\n`transaction { read; read; …; write; commit }` body serialises every\nread behind every other write that touches the same writer.\n\n**Confirm by**: look at the `STACK:` head for a frame inside an apply /\nupsert / migration path. If the read appears to hit a fast plan but\nelapsed is high and other writes are visible nearby, the read was\nforced onto the writer.\n\n**Likely fixes**:\n- Pull pre-read / post-write side effects *out* of the transaction\n  block.\n- Only wrap statements that genuinely need atomicity together.\n- Cross-DB writes (e.g., to `sync_db`, `settings_db`, `agent_db`,\n  `ai_config_db`) cannot be atomic with `JournalDb` writes anyway —\n  doing them inside a `JournalDb.transaction` only holds the journal\n  writer lock for unrelated work.\n\n### 4. Transaction scoping — broad wrappers around unrelated DB writes\n\n**Signature**: the same wave shape as pattern 1, but the suspected\n\"writer holding the lock\" is a sync apply that's logging a\n`SyncJournalEntity`-shaped write while *also* awaiting a\n`_sequenceLogService.recordReceivedEntry` (sync_db) or other cross-DB\nwork inside the same `transaction { ... }`.\n\n**Diagnosis**: this codebase fixed exactly this in\n`queue_apply_adapter.dart` via `_writesJournalDb(SyncMessage)` — the\nadapter now wraps in `JournalDb.transaction` *only* for payload\nfamilies that actually write to JournalDb tables (journal entity,\nentry link, entity definitions, outbox bundle, conservatively the\nbackfill request/response paths). Theming, ai-config, agent\nentity/link/bundle writes bypass the wrapper because they target\nother databases.\n\n`_persistJournalEntity` was also restructured: the pre-read\ndiagnostic `journalEntityById`, the post-write\n`_sequenceLogService.recordReceivedEntry` (`sync_db`), and the\nentry-exists check now run **outside** the narrow journal transaction.\n\n**When inspecting new code**: any new `db.transaction(() async { ... })`\nthat contains an `await` to a different database, a network call, or a\nfilesystem write is a candidate for narrowing.\n\n### 5. Wrong-index plans masquerading as slow SQL\n\n**Signature**: a single query reporting hundreds of ms with a plan\nthat includes `USE TEMP B-TREE FOR ORDER BY`, `SCAN <table>`, or an\nindex match where the leading column is not the most selective\npredicate.\n\n**Recurring offenders already fixed in shipped code** — verify these\nstill match the current `lib/database/database.drift`,\n`lib/database/sync_db.dart`, and `lib/database/database.dart` before\nciting them. Treat the list as historical context, not an asserted\ncurrent truth:\n- `task_priority_rank` ordering with high-cardinality\n  `category IN (...)` predicate. The fix shipped as a partial index\n  named (at the time) `idx_journal_tasks_status_priority_date`; if it\n  is still in `database.drift`, recommend it as the steady-state path,\n  otherwise treat the symptom as an open issue.\n- `getBulkLinkedTimeSpans` join over `linked_entries`. The fix shipped\n  as a covering index `idx_linked_entries_from_id_hidden_to_id`.\n- `inbound_event_queue` stats `MIN(enqueued_at)` SCAN. The fix shipped\n  as `idx_inbound_event_queue_status_enqueued` plus\n  `idx_inbound_event_queue_status_due_lease`.\n- `claimNextOutboxBatch` SCAN from\n  `status = pending OR (status = sending AND updated_at < cutoff)`.\n  The fix shipped as two indexed seeks merged in Dart.\n\nIf a query still matches one of these symptom shapes despite the named\nindex existing, suspect stale stats first (recommend `ANALYZE`) before\nproposing a new index.\n\n**When inspecting new logs**: if the plan is suboptimal, recommend\nrunning `ANALYZE` first (planner stats can drift); only after\nconfirming with fresh stats should you propose a new index. Bad plans\non a freshly-`ANALYZE`d DB are real index gaps.\n\n### 6. WAL / OS-level factors\n\nWhen patterns 1–5 don't explain a stall, consider:\n- **WAL checkpoint storms**: a write that crosses\n  `wal_autocheckpoint` (default 1000 pages, ~4MB) triggers a\n  checkpoint that briefly takes a more aggressive lock. Bursty write\n  workloads can stall reads at checkpoint boundaries.\n- **macOS sandboxed file locks**: `fcntl(F_FULLFSYNC)` and BSD locks\n  on iCloud-backed paths have shown long tails. Less likely on dev\n  but worth flagging.\n- **Background isolate spawn (`createInBackground(readPool: N)`)** —\n  isolates may spawn on first use; the *first* boot wave can pay\n  per-isolate setup cost (~50–200ms each). Subsequent app sessions\n  should be much faster — first wave is the worst case.\n- **`PRAGMA foreign_keys = ON`** runs per-connection; cheap but real.\n\n### 7. Per-launch repair / housekeeping that shouldn't run every boot\n\n**Signature**: an entry whose `STACK:` head points at a `beforeOpen`,\nself-heal, or migration helper — but the user just opened the app\nnormally. With `readPool: N`, drift calls `beforeOpen` on every\nconnection, so any repair work done there runs `1 + N` times per\nlaunch.\n\n**Lessons already applied in this codebase**:\n- Per-launch `ANALYZE` was removed — stats persist in `sqlite_stat1`\n  and the v42 migration runs `ANALYZE` once on upgrade.\n- The self-heal `CREATE INDEX IF NOT EXISTS` block was removed\n  entirely — the recovery path it covered targeted an aborted-migration\n  scenario that has not occurred in production.\n- `beforeOpen` is now just `PRAGMA foreign_keys = ON`.\n\nWhen you see boot-time housekeeping in a stack, ask: does this need\nto run on every launch, or once per upgrade?\n\n## Output format\n\nProduce a concise report, in this order:\n\n1. **Inputs** — paths read, line counts, date window.\n2. **Findings**, each with: severity (high/medium/low), pattern\n   matched (numbered above), evidence (specific log lines with\n   timestamps), root-cause hypothesis, and the file/seam where the\n   fix would land.\n3. **Recommended actions**, ordered by impact. Cite specific\n   call sites (`lib/...:line`) where possible.\n4. **Things you ruled out** (and why), so the user can sanity-check.\n\nKeep the report skimmable. If the log is mostly clean, say so — don't\nmanufacture findings.\n\n## Guardrails\n\n- **Never** propose schema bumps (`schemaVersion++`) without confirming\n  the v42-style migration shape and asking the user. New indices that\n  don't need a column change can land via migration; per-launch\n  defensive code should not.\n- **Never** propose a per-boot `ANALYZE`, `CREATE INDEX IF NOT EXISTS`\n  loop, or other \"self-heal on every open\" — this codebase explicitly\n  removed those.\n- **Don't assume** an `INDEXED BY` hint solves a planner problem. The\n  autoindex names (`sqlite_autoindex_*_1`) are not part of the public\n  SQLite contract; recommend `ANALYZE` first.\n- **Match real seams**: prefer adding fixes to existing patterns\n  (`_PendingEntityByIdWave` for entity-by-id coalescing,\n  `_PendingLinksWave` for to-id link batches, `_writesJournalDb` for\n  per-payload transaction scoping) over inventing new ones.\n- **Show your work**: every finding should cite specific log lines so\n  the user can verify.\n",".claude/skills/app-screenshots/SKILL.md":"---\nname: app-screenshots\ndescription: Capture in-app screenshots of a widget or flow at mobile + desktop sizes — offline, deterministic, real fonts and icons — using the reusable screenshot harness. Use when asked to \"show me X in the app\", \"screenshot this screen\", or to preview a UI change for review on phone vs desktop.\nargument-hint: \"<surface to capture, e.g. 'project create modal'>\"\n---\n\n# In-App Screenshots\n\nProduces PNGs of a widget or flow rendered inside the real app shell, at phone\nand desktop viewports, with real fonts and icons. It runs through\n`flutter test --update-goldens` — fully offline and deterministic — so it does\n**not** require a display, the GUI app, or driving the device.\n\nThis is a visualization tool, **not** a golden test: there are no committed\nreference images. You write a throwaway capture test, emit the PNGs, share\nthem, then delete the test. Nothing screenshot-related gets committed unless\nthe user explicitly asks to keep it.\n\n## When to use\n\n- \"Show me the <screen/modal/dialog> in app context.\"\n- \"What does this change look like on mobile vs desktop?\"\n- Previewing a UI change for design review.\n\nFor \"is this change actually wired up / does it behave correctly\", prefer the\n`run` skill (launches the real app). This skill is about *appearance*.\n\n## The harness\n\n`test/test_utils/screenshot_harness.dart` provides:\n\n- `loadAppFonts()` — loads every bundled font (app families + Material/Cupertino\n  icon fonts + icon-font packages) from `FontManifest.json`. Call once in\n  `setUpAll`. Without it, glyphs and icons render as boxes.\n- `screenshotTheme({bool dark = true})` — the production `withOverrides` theme\n  with `Inter` applied to the Material text themes (the bare test theme falls\n  back to an unbundled font otherwise).\n- `captureInApp(tester, {child, name, size, dark, devicePixelRatio, overrides, interaction, outputDir})`\n  — sizes the view, pumps `child` in the app shell, runs `interaction` (open a\n  modal, tap a FAB, focus a field…), then writes `<outputDir>/<name>.png`\n  relative to the **calling test file's** directory.\n- `ScreenshotViewport.phone` (390×844) and `ScreenshotViewport.desktop`\n  (1280×800).\n\n## Workflow\n\n1. **Find the surface and how to reach the state.** Identify the entry widget\n   (often a tab/page like `ProjectsTabPage`) and the tap/scroll needed to reach\n   the state to capture (e.g. tapping the FAB to open a modal). Reuse existing\n   widget tests for that surface to learn the required service registrations\n   and provider overrides — copy their `setUp`.\n\n2. **Write a throwaway capture test** at `test/_scratch_capture_test.dart`\n   (the `_scratch_` prefix marks it disposable). Use `setUpTestGetIt` +\n   `additionalSetup` for services the surface resolves through `getIt`, and\n   pass provider overrides via `captureInApp(overrides: ...)`. Drive the state\n   in `interaction`.\n\n3. **Generate the PNGs:**\n   ```sh\n   fvm flutter test --update-goldens test/_scratch_capture_test.dart\n   ```\n   Images land in `test/screenshots/` (the `outputDir`, next to the test).\n\n4. **View and share.** Read the PNGs to inspect them and give the user their\n   paths. For a PR's before/after pair, stage and publish them per\n   `knowledge/conventions/screenshots.md` before the cleanup step deletes\n   them.\n\n5. **Clean up** — this is mandatory unless the user asks to keep anything:\n   ```sh\n   rm test/_scratch_capture_test.dart && rm -rf test/screenshots\n   ```\n\n## Example capture test\n\n```dart\nimport 'package:flutter/material.dart';\nimport 'package:flutter_riverpod/flutter_riverpod.dart';\nimport 'package:flutter_riverpod/misc.dart'; // Override\nimport 'package:flutter_test/flutter_test.dart';\nimport 'package:lotti/classes/project_data.dart';\nimport 'package:lotti/features/projects/model/projects_overview_models.dart';\nimport 'package:lotti/features/projects/state/project_providers.dart';\nimport 'package:lotti/features/projects/ui/pages/projects_tab_page.dart';\nimport 'package:lotti/features/user_activity/state/user_activity_service.dart';\nimport 'package:lotti/get_it.dart';\nimport 'package:lotti/services/entities_cache_service.dart';\nimport 'package:lotti/services/nav_service.dart';\nimport 'package:mocktail/mocktail.dart';\n\nimport 'features/categories/test_utils.dart';\nimport 'features/projects/test_utils.dart';\nimport 'mocks/mocks.dart';\nimport 'test_utils/screenshot_harness.dart';\nimport 'widget_test_utils.dart';\n\nvoid main() {\n  setUpAll(loadAppFonts);\n\n  final groups = [\n    ProjectCategoryGroup(\n      categoryId: 'lotti',\n      category: CategoryTestUtils.createTestCategory(id: 'lotti', name: 'Lotti'),\n      projects: [\n        ProjectListItemData(\n          project: makeTestProject(id: 'p1', title: 'Daily Operating System'),\n          category: CategoryTestUtils.createTestCategory(id: 'lotti', name: 'Lotti'),\n          taskRollup: const ProjectTaskRollupData(totalTaskCount: 25),\n        ),\n      ],\n    ),\n  ];\n\n  List<Override> overrides() => [\n    projectsOverviewProvider.overrideWith(\n      (ref) => Stream.value(ProjectsOverviewSnapshot(groups: groups)),\n    ),\n    visibleProjectGroupsProvider.overrideWith((ref) => AsyncValue.data(groups)),\n  ];\n\n  setUp(() async {\n    await setUpTestGetIt(\n      additionalSetup: () {\n        final activity = MockUserActivityService();\n        when(activity.updateActivity).thenReturn(null);\n        getIt.registerSingleton<UserActivityService>(activity);\n\n        final nav = MockNavService();\n        when(() => nav.isDesktopMode).thenReturn(false);\n        when(() => nav.desktopSelectedProjectId)\n            .thenReturn(ValueNotifier<String?>(null));\n        getIt.registerSingleton<NavService>(nav);\n\n        final cache = MockEntitiesCacheService();\n        when(() => cache.getCategoryById(any())).thenReturn(null);\n        getIt.registerSingleton<EntitiesCacheService>(cache);\n      },\n    );\n  });\n  tearDown(tearDownTestGetIt);\n\n  Future<void> openCreate(WidgetTester tester) =>\n      tester.tap(find.bySemanticsLabel('New Project'));\n\n  testWidgets('phone', (tester) async {\n    await captureInApp(\n      tester,\n      child: const ProjectsTabPage(),\n      name: 'create_mobile',\n      overrides: overrides(),\n      interaction: openCreate,\n    );\n  });\n\n  testWidgets('desktop', (tester) async {\n    await captureInApp(\n      tester,\n      child: const ProjectsTabPage(),\n      name: 'create_desktop',\n      size: ScreenshotViewport.desktop,\n      overrides: overrides(),\n      interaction: openCreate,\n    );\n  });\n}\n```\n\n## Gotchas\n\n- **`Override` lives in `package:flutter_riverpod/misc.dart`** in this Riverpod\n  version — import it for the `List<Override>` type (separate from\n  `flutter_riverpod.dart`, which has `AsyncValue`).\n- **Register every service the surface touches** via `setUpTestGetIt`'s\n  `additionalSetup`, or the widget throws on a missing `getIt` registration.\n  Modals pull in their own deps (e.g. the create modal's `CategoryField` needs\n  `EntitiesCacheService`).\n- **Desktop layout is width-driven.** `captureInApp(size: ScreenshotViewport.desktop)`\n  sets both the view physical size and `MediaQuery`, so width-gated split\n  views (`isDesktopLayout`) and the dialog branch (modal page breakpoint)\n  engage correctly.\n- **Capture target is `find.byType(MaterialApp)`** so overlay content (modals,\n  dialogs, toasts) is included, not just the page body.\n- **Don't commit the scratch test or `test/screenshots/`.** Delete them when\n  done. The harness itself is the only permanent artifact.\n","AGENTS.md":"# Repository Guidelines\n\n## Project Structure & Module Organization\n- `lib/` — Flutter/Dart source (features, services, widgets). Do not edit generated files (`*.g.dart`, `*.freezed.dart`).\n- `test/` and `integration_test/` — unit and integration tests; keep test files as `*_test.dart`.\n- `assets/` — images, icons, and other static assets.\n- Platform targets: `android/`, `ios/`, `macos/`, `linux/`, `windows/`.\n- Tooling & CI: `Makefile`, `.buildkite/`, `analysis_options.yaml`, `l10n.yaml`.\n- Localization: `lib/l10n/*.arb` with `missing_translations.txt` for gaps.\n\n## Build, Test, and Development Commands\n- Install deps: `make deps` (runs through FVM when `fvm` is installed).\n- Static analysis: `make analyze` (Very Good Analysis rules).\n- Unit tests + coverage: `make test` • HTML report: `make coverage`.\n- Code generation: `make build_runner` • Watch mode: `make watch`.\n- Localization generation: `make l10n` (prints missing translations) • Sort ARB: `make sort_arb_files`.\n- Run locally: `fvm flutter run -d macos` (or `flutter run -d <device>`).\n- Integration tests: `make integration_test`.\n- Packaging (examples): `make ios`, `make macos`, or `make bundle` (see Makefile for more).\n\n## Coding Style & Naming Conventions\n- Follow `analysis_options.yaml` (Very Good Analysis). 2‑space indent, prefer `const` and `final`.\n- Files: `lower_snake_case.dart`; types (classes/enums): `PascalCase`; members: `lowerCamelCase`.\n- Keep hand-written files in `lib/` at or below 1,000 lines. `test/architecture/file_size_ratchet_test.dart` fails on a new file above that, and holds the files already above it at their current size (`file_size_baseline.json`): put new code in a file of its own, and lower or delete an entry when a file shrinks.\n- Imports in `lib/` follow the layer order in `tool/architecture/layer_guard.dart` (`make layer_check`): no feature imports one ranked above it, `lib/classes`, `database`, `services`, `logic` and `utils` import no feature, non-UI code never imports another feature's UI, and nothing below the shell imports it (the service locator excepted, which `tool/di` counts). Existing breaks are baselined and may only shrink — move the shared type down or invert the dependency rather than adding one.\n- Format before committing: `fvm dart format .`.\n- Do not modify generated code (`*.g.dart`, `*.freezed.dart`); regenerate via `make build_runner`.\n\n## Testing Guidelines\n- Framework: `flutter_test`, helpers in `test/`. Name tests `*_test.dart` and co-locate by feature. **One test file per source file**, mirroring the path.\n- Run tests via the dart-mcp server, **only for the files you actually touched**. Do not run the whole suite locally, and do not run a whole feature's suite either — `agents` alone takes minutes, worse in a Linux VM. CI runs everything ten-way sharded on every push, so let it. Broader local runs only when asked, or when a change genuinely cannot be scoped to the files you touched.\n- **Never `Future.delayed`, `sleep()` or a real `Timer` in a test.** Use `fakeAsync` or `tester.pump(duration)`, and deterministic dates rather than `DateTime.now()`.\n- **Reuse the shared harness**: mocks from `test/mocks/mocks.dart`, fallbacks from `test/helpers/fallbacks.dart`, `setUpTestGetIt()` / `tearDownTestGetIt()`, `makeTestableWidget()`. Never improvise a per-file equivalent.\n- **Every test must assert something meaningful.** `findsOneWidget` alone proves only that the tree built; a constructor smoke test proves nothing at all.\n- **Re-run every new regression test with the fix reverted.** If it still passes, it is not testing the fix.\n- The full contract — the DRY rules, the infrastructure table, the quality bar, the vacuous-pass traps, property tests, time-driven UI — is [knowledge/conventions/testing.md](knowledge/conventions/testing.md), plus [test/README.md](test/README.md) for the fake-time policy and mocktail hygiene. Read them rather than working from this summary.\n\n## Commit & Pull Request Guidelines\n- Use Conventional Commits (e.g., `feat:`, `fix:`, `chore:`, `ci:`). Keep subjects concise and imperative.\n- PRs must pass `make analyze` and `make test`; include a clear description and linked issues.\n- **UI changes need a before/after screenshot pair per surface**, captured with the harness (see the `app-screenshots` skill). Capture `before/` from the base commit *first* — it cannot be reconstructed once the change is in. **Fixtures come from `test/test_data` and the penguin demo world only — never from a user's own habits, tasks, notes or bug screenshots**; a capture is published to a public bucket and a public PR. **Never commit images to any repo.** Publish the pair to the R2 bucket with `make pr_screenshots_publish` and link the printed public URLs from the PR body. The staging layout, the naming rules and the publish command are in [knowledge/conventions/screenshots.md](knowledge/conventions/screenshots.md).\n- Update docs and localization as needed (run `make l10n`).\n\n## Security & Configuration Tips\n- Never commit secrets. Use `.env` for local config; keep it out of VCS.\n- Use FVM (`.fvmrc`) to match the repo’s Flutter version: `fvm flutter ...`.\n\n## Agent MCP Usage\n- Prefer MCP tools over raw shell commands:\n  - Use `dart-mcp` for analyzer, tests, formatting, fixes, pub, and build tasks.\n    - Analyze: `dart-mcp.analyze_files`\n    - Tests: `dart-mcp.run_tests` (set platforms as needed)\n    - Format: `fvm dart format .`\n    - Apply fixes: `dart-mcp.dart_fix`\n    - Pub: `dart-mcp.pub` (e.g., `get`, `add`, `upgrade`)\n    - Hot reload/runtime hooks: connect to the Dart Tooling Daemon first\n  - Use `context7` for up-to-date docs. Resolve with `context7.resolve-library-id`, then fetch via `context7.get-library-docs`.\n- Register the repo root before using `dart-mcp` commands: `dart-mcp.add_roots` with the workspace URI.\n- For runtime/Flutter app introspection, request a DTD URI from the user and connect via `dart-mcp.connect_dart_tooling_daemon`.\n- Follow the planning and preamble conventions:\n  - Send a brief preamble before grouped tool calls.\n  - Keep a concise plan in your agent's planning tool for multi-step work.\n- Test-first workflow when adding/fixing tests:\n  - Run `dart-mcp.analyze_files` to catch lints quickly.\n  - Run `fvm dart format .` to normalize diffs. Do not use `dart-mcp.dart_format`.\n  - Run targeted tests (single file or folder) via `dart-mcp.run_tests` before broad runs.\n  - Iterate until the targeted tests pass; CI runs the full suite.\n- Do not edit generated files (`*.g.dart`, `*.freezed.dart`); run `dart-mcp.pub` + `make build_runner` (or `dart run build_runner`) via MCP when regeneration is required.\n- Favor `rg` for searches and read files in chunks (≤250 lines) when using shell reads.\n\n## Analyzer Zero‑Warning Policy\n- Before opening a PR, the analyzer must report zero warnings or infos.\n- Always run `dart-mcp.analyze_files` and address every message:\n  - In tests, you may add line ignores for clarity (e.g., `// ignore: avoid_redundant_argument_values`).\n  - In production code, fix the root cause rather than ignoring.\n- Run `fvm dart format .` to normalize formatting prior to final checks. Do not use\n  `dart-mcp.dart_format`.\n\n## Documentation\n\nDocumentation is split by audience. **No fact is written twice.**\n\n- **`lib/features/<x>/README.md` — product description.** What the feature does,\n  what it owns versus what it delegates, and where the code sits. Roughly 40–100\n  lines, ending with a link to its knowledge concept. If a README starts\n  explaining provider routing or wake scheduling, that content belongs in\n  `knowledge/`.\n- **`knowledge/` — the architecture, in OKF v0.2 form.** Runtime flows, state\n  machines, invariants, key classes, gotchas. This is the durable, agent-readable\n  map of how the app actually works. Read the relevant concept *before* changing\n  a subsystem, and update it in the same change.\n  [knowledge/index.md](knowledge/index.md) is the entry point: it carries the\n  reading order and the code-to-concept map.\n- **`docs/adr/` — decisions.** An ADR records a choice at a point in time and is\n  not rewritten; concepts cite ADRs rather than restating them.\n\n**These concepts are derived maps, not authority.** The source code outranks\nthem: if a concept contradicts the code, the concept is the defect, and fixing it\nis part of your change. Verify a claim before you depend on it.\n\nRules for `knowledge/`:\n\n- Every concept carries required OKF frontmatter, and `make okf_check` fails on a\n  missing or malformed field. The field-by-field contract is in\n  [knowledge/conventions/knowledge-bundle.md](knowledge/conventions/knowledge-bundle.md)\n  — follow it there rather than from memory.\n- Do **not** set `verified` on a concept you wrote. That field records\n  independent confirmation by someone other than the author.\n- Use Mermaid diagrams generously for flows, architecture, data movement and\n  lifecycles. If the code contains a real lifecycle or state machine, the\n  concept must include a diagram for it — prefer `stateDiagram-v2`, and never\n  invent states that are not implemented.\n- Every path a concept references must exist. `make okf_check` fails the build\n  on a dangling code pointer, which is the mechanism that keeps the map honest.\n- Run `make knowledge_check` after touching anything under `knowledge/`. It runs the Dart validator *and* parses every Mermaid diagram — `make okf_check` alone cannot see a diagram that fails to render.\n\n## Misc\n- Whenever touching any function, consider its docstring and if it needs updating\n- Only report completion after code compiles and all tests pass; verify via analyze and test via the dart-mcp server.\n- Invest in making tests work; avoid deleting or abandoning failing tests prematurely.\n- When old and new feature versions coexist, create no dependencies from the new code to the old — the old code is meant to be removed once the new one reaches parity.\n- Uphold high standards: DRY where sensible, proper modularity, and strong testability.\n- Use `fvm` for all `flutter` commands.\n\n## Localization (l10n)\n- All user-visible label texts MUST be localized using arb files in `lib/l10n/`.\n- Never hardcode strings that users will see — add them to the arb files instead.\n- **Add every new label to every catalog in `lib/l10n/`**, translated — not a\n  subset. The catalog list, the `app_en_GB.arb` exception and the per-language\n  register table live in\n  [knowledge/conventions/localization.md](knowledge/conventions/localization.md).\n  Read it rather than working from a count or a list quoted anywhere else,\n  including here.\n- Access localized strings via `context.messages.labelName` (import `app_localizations_context.dart`).\n- After adding labels, run `make l10n` to generate the Dart files.\n- Run `make sort_arb_files` to keep arb files consistently sorted.\n- Edit the `.arb` sources and regenerate; `lib/l10n/app_localizations_*.dart` is generated output.\n- **Use the informal register** in every translation, with Romanian as the one deliberate exception. Which pronouns that means per language is in the concept linked above.\n\n## Implementation discipline\n\nEvery UI change is bound by the design system. Read\n[knowledge/features/design_system/](knowledge/features/design_system/) before\ntouching visual code — the token pipeline and its naming, the component contracts,\nand what is enforced at construction rather than by review.\n\n- **Design-system tokens are mandatory.** For colors, spacing, radii, typography, elevation, and other visual styling values, always use the exported design-system tokens or existing design-system abstractions first.\n- **Spacings and font styles MUST come from the Design System.** Never hardcode spacing values (raw numbers in `EdgeInsets`/`SizedBox`/local `const double` constants) or font styles (raw `fontSize`/`fontWeight`/`TextStyle` constructors). Use `tokens.spacing.stepN` (or `cardPadding`/`cardItemSpacing`/`sectionGap`) and `tokens.typography.styles.{display,heading,subtitle,body,others}.<name>`. If no suitable token exists, stop and ask before introducing one.\n- **Do not invent ad hoc visual values by default.** Before adding a hard-coded color, spacing value, radius, opacity, or a one-off semantic alias for a visual token, first check the design-system token export and existing design-system components/palettes.\n- **Ask before introducing new visual tokens or hard-coded values.** If no suitable design-system token exists, stop and ask for permission before creating an ad hoc fallback, local palette entry, or other non-token visual value.\n- **Never use loading states over content: stay while reload. This is a hard rule.** Once a surface has shown its content, a reload — sync, a database notification, an agent wake, a transcript landing, any watched dependency — must not take it off the screen: no spinner, skeleton, empty placeholder or error shell in its place, and no teardown and rebuild of the same content. Keep the shown data until the new data replaces it in place. A loading shell is allowed only on the first load and on a deliberate change of subject (another day, person or route); progress for a background reload is a quiet local affordance at most.\n  - Read async state with `.value` and show a shell only while it is null. A bare `.when` runs `loading:` on every reload (Riverpod 3 defaults `skipLoadingOnReload` to false); `whenData` and `unwrapPrevious` drop the value.\n  - Key every list child whose position can shift, and give every `*.builder` list a `findChildIndexCallback` — without it a builder list matches by index even when its children carry keys, and rebuilds everything below an insertion.\n  - The rationale, the before/after code and how to test it: [stay while reload](knowledge/conventions/stay-while-reload.md).\n- **Prefer fixing the token source over patching the widget.** If a Figma export flattened or obscured a semantic token name, prefer tracing it back to the exported token set or improving the import/export path instead of hard-coding a widget-level substitute.\n- **Check the token name in the actual Figma node inspect panel first.** Even when the Variables API is incomplete or unavailable, the selected node often shows the bound token name directly under Colors, e.g. `background/02`.\n- **Know the naming path across tools.** The same token is named differently in Figma, `tokens.json` and Dart — the table is in [design tokens and theming](knowledge/features/design_system/tokens-and-theming.md#one-token-three-names). Treat them as one token with normalised naming, not as different concepts.\n- **Verifying a visual token, in order:** inspect the selected node in Figma Desktop Bridge, confirm the entry in `assets/design_system/tokens.json`, then map it to the generated token. If the inspect panel already shows the name, do not conclude it is unavailable just because the Variables API returned empty data.\n- Always ensure the analyzer has no complaints and everything compiles. Also run the formatter\n  frequently.\n- Prefer running commands via the dart-mcp server.\n- Only move on to adding new files when already created tests are all green.\n- Aim for full coverage of every code path.\n- Every widget we touch should get as close to full test coverage as is reasonable, with meaningful\n  tests.\n- **Release notes go in `changelog.d/`, never straight into `CHANGELOG.md`.** Add one new file\n  per pull request — `changelog.d/YYYY-MM-DD-slug.md`, holding the `### Fixed` (or `### Added`,\n  `### Changed`, …) section your change deserves, worded as it should read to a user. **Never\n  edit `CHANGELOG.md`, `flatpak/com.matthiasn.lotti.metainfo.xml` or the `version:` line in\n  `pubspec.yaml`.** Those three are written at the top by everything, so they are written once\n  per release, by the release — which is what stops concurrent pull requests conflicting over\n  prose they do not share. The format, the naming and what deserves an entry at all are in\n  [changelog.d/README.md](changelog.d/README.md); `make changelog_check` validates it.\n- Fragments are only for what a user would actually notice — not dependency bumps, refactors,\n  test-only changes, CI tweaks, docs, or a bug introduced and fixed before it ever shipped. If\n  in doubt, ask, but default to no fragment when nothing changes at runtime.\n- Assembling a release — fragments into `CHANGELOG.md` and the Flathub metainfo, version bump,\n  tag — is [.agents/skills/release/SKILL.md](.agents/skills/release/SKILL.md). It is the only\n  change permitted to touch those three files.\n- Update the documentation we touch such that it matches reality in the codebase, not only\n  for what we touch but in its entirety. See \"Documentation\" above for which file gets what.\n- Use fvm when running any flutter command\n- Read test/README.md on every session start and keep it up to date when gaining relevant new information\n- Do not hoard code. We do not keep unused code around. Also, this is no library, there are no known mysterious callers for whom we would keep any code around.\n\n## Issue Tracking\n\n- Public bugs, feature requests, and contributor coordination belong in\n  [GitHub Issues](https://github.com/matthiasn/lotti/issues).\n- Authorized maintainers may use the private Beads tracker for implementation\n  plans, dependencies, handoffs, and durable agent memory. Follow\n  `.agents/skills/beads/SKILL.md`.\n- Public contributors are not expected to install Beads or have access to the\n  private tracker. PR descriptions and GitHub issue links must contain all\n  context needed for public review.\n- Agent-local planning tools remain appropriate for the current turn. Beads is\n  the durable maintainer record, not a replacement for a short execution plan.\n- Beads sync, Git commits, and pushes require explicit user or orchestrator\n  authority. Never store secrets in Beads.\n- Do not install repository-controlled Git, Codex, or Claude hooks for Beads.\n  Maintainers run `bd prime`, `bd dolt pull`, and `bd dolt push` explicitly.\n",".claude/skills/tutorial-videos/SKILL.md":"---\nname: tutorial-videos\ndescription: Build, debug, extend, localize, or publish the automated tutorial videos — the workbench that drives the real Linux app under Xvfb (virtual mic, live Voxtral transcription, task-agent proposals), records the screen, narrates with Gemini or ElevenLabs TTS, fast-forwards waits, composes MP4s via OpenMontage, and uploads finished videos to Cloudflare R2 for docs-site embedding. Use when asked to \"build/regenerate the tutorial video(s)\", add a tutorial scenario, add a tutorial locale, fix a broken tutorial run, adapt the pipeline, or upload/publish a video.\nargument-hint: \"<what to do, e.g. 'build de+en', 'add scenario X', 'debug the failing run'>\"\n---\n\n# Tutorial Video Workbench\n\nArchitecture and rationale live in `tools/tutorial_videos/README.md` — read\nit first. This skill is the operational runbook.\n\n## Build videos\n\n```sh\nmake tutorial_video TUTORIAL_LOCALE=de                       # one locale (~5-8 min)\nmake tutorial_video TUTORIAL_LOCALE=de TUTORIAL_DEVICE=mobile # phone-shaped window, `_mobile`-suffixed output\nmake tutorial_videos_all                                     # all TUTORIAL_LOCALES\n```\n\n`TUTORIAL_DEVICE` (`desktop`|`mobile`, default `desktop`) picks the capture\nwindow size — see the README's \"Desktop vs. mobile\" section for the\nbreakpoint rationale and the `tutorialDeviceIsMobile()` test hook.\n\nPreconditions (fail fast if missing):\n- `.env` at repo root with `GEMINI_API_KEY`, `MELIOUS_API_KEY`,\n  `MELIOUS_BASE_URL`. If absent, the keys can be extracted from the dev\n  app's `ai_config.sqlite` provider rows (never print or commit them).\n  `ELEVENLABS_API_KEY` too when narrating with ElevenLabs\n  (`--tts-engine elevenlabs`) — that one is not in the app's config, ask\n  the user for it.\n- Sibling `../OpenMontage` checkout at the commit pinned in\n  `tools/tutorial_videos/config/openmontage.pin`, bootstrapped via\n  `make -C ../OpenMontage setup`.\n- `Xvfb`, `ffmpeg`, `pactl`, `paplay`, `x11-utils` installed; Flutter via\n  `fvm`.\n\nOutput lands in `build/tutorial_videos/<scenario>_<locale>.mp4`. Verify with\nframe extraction (`ffmpeg -ss <t> -frames:v 1`) and check: cursor visible and\ngliding, HUD clock top-center, transcript/proposals on screen, narration\naudible at step starts (`volumedetect`), duration ≈ warped timeline total.\n\n## Publish to R2\n\n```sh\nmake tutorial_video_publish TUTORIAL_SCENARIO=create_task_from_audio TUTORIAL_LOCALE=de\nmake tutorial_video_publish TUTORIAL_SCENARIO=create_task_from_audio TUTORIAL_LOCALE=de TUTORIAL_DEVICE=mobile\n```\n\nUploads `build/tutorial_videos/<scenario>_<locale>.mp4` (or, with\n`TUTORIAL_DEVICE=mobile`, `<scenario>_<locale>_mobile.mp4`) to Cloudflare R2\nat the matching `tutorial-videos/...` key and prints its public r2.dev URL —\nthis is the URL the docs-site `TutorialVideo` component builds from\n`TUTORIAL_VIDEO_BASE_URL`/`tutorialVideoBaseUrl`. `TUTORIAL_DEVICE` must\nmatch whatever `--device` the video was built with, or publish will look for\na file that was never produced. Full one-time Cloudflare setup (API token,\nenabling the bucket's public r2.dev URL) and the `.env` variable list are in\nthe README's \"Publishing to Cloudflare R2\" section — read it before the\nfirst publish.\n\n`boto3` (needed only by publish, not by build/tts/validate) is not installed\ninto the system Python on this host (PEP 668). Either run publish through\n`tools/tutorial_videos/.venv` (`.venv/bin/python3 -m tutorial_videos publish\n--scenario ... --locale ...`, created via `python3 -m venv .venv &&\n.venv/bin/pip install boto3 pyyaml`), or install `boto3` into whatever\nPython `make tutorial_video_publish` resolves to.\n\n## The pipeline in one paragraph\n\n`python3 -m tutorial_videos build` (run from `tools/tutorial_videos/`) does:\nTTS pre-pass (Gemini by default, `--tts-engine elevenlabs` to switch; cached by content hash → durations manifest) → Xvfb +\nvirtual-mic null sink + ffmpeg x11grab capture → `fvm flutter drive` runs\n`integration_test/tutorial/<scenario>_tutorial_test.dart` against the real\napp (penguin demo world + Melious/Voxtral/Qwen agent config seeded, UI\nlanguage via `MANUAL_LANGUAGE` settings row) → the test emits\n`timeline.json` (step boundaries, wait spans, zero epoch) → `timewarp.py`\nplans fast-forward segments for the waits (narration never overlaps) →\n`compose.py` warps the capture and drives the pinned OpenMontage headlessly\n(narration placement + mux) → ffprobe validation.\n\n## Debugging a failing run\n\n1. The run log tail shows the failing step and a `Diagnostics:` line\n   (current route, detail stack, key widget presence).\n2. **Look at the failure screenshot first**:\n   `build/tutorial_videos/failure_<context>.png` is captured at the moment of\n   every timeout — it almost always explains the failure instantly.\n3. Reproduce faster without video: run the same test via `flutter drive`\n   directly (see the doc comment in\n   `integration_test/tutorial/tutorial_harness.dart` for the env contract);\n   Xvfb + sink setup must match `session.py`.\n4. Common causes, in order of historical frequency: a finder matching an\n   offstage duplicate (scope to the visible page + `.hitTestable()`), a\n   scroll helper given a non-vertical scrollable, a modal/dialog blocking\n   the UI (onboarding, discard-recording), the agent's\n   `automaticUpdatesEnabled` flag not sticking (set-and-verify), cloud\n   latency beyond a `pumpUntil` timeout.\n\n## Adding a locale\n\n1. Add the locale's text to\n   `tools/tutorial_videos/config/scenarios/<scenario>.yaml`: `title`,\n   `dictionary`, every step's `narration`, the dictation step's\n   `dictation_text`. Write informal register (du/tu) per repo l10n rules;\n   keep the penguin vocabulary.\n2. Add per-stream `style` lines for the locale under `engines.gemini` in\n   `config/voices.yaml` (style prompts in the target language —\n   Voxtral/Gemini behave better). ElevenLabs needs nothing per locale, as\n   long as `eleven_multilingual_v2` supports the language.\n3. `python3 -m tutorial_videos validate --scenario <s> --locale <l>` must\n   pass, then build. The app UI localizes itself via `LOTTI_MANUAL_LOCALE`\n   (same mechanism as manual screenshots; for a wholly new app locale, run\n   the `add-flutter-docusaurus-locale` skill first).\n4. Localized finder strings in the test (`localized(en:, de:)` /\n   `manualScreenshotText`) need the new locale only if its UI labels are\n   used as finders — prefer keys over text finders where possible.\n\n## Adding a scenario\n\n1. New YAML in `config/scenarios/<name>.yaml` — schema documented in\n   `create_task_from_audio.yaml` (unique step ids, exactly one\n   `dictation: true` step, per-locale text, `min_duration` floors).\n2. New `integration_test/tutorial/<name>_tutorial_test.dart` built on\n   `TutorialAppHarness` + `TutorialDriver`. Copy the structure of\n   `create_task_from_audio_tutorial_test.dart`:\n   - one `driver.step(id, action)` per YAML step, ids matching exactly;\n   - interactions via `driver.tapLikeUser` (cursor glide), waits via\n     `driver.pumpUntil*` (records fast-forwardable wait spans), scrolling\n     via `driver.scrollIntoView` with a **vertical** scrollable finder;\n   - anything that must be SEEN gets asserted via visible widgets, not just\n     the DB;\n   - wire the `diagnostics` and `onTimeout` hooks for failure screenshots.\n3. Iterate with builds; expect the first runs to fail — read the failure\n   screenshots, they carry the answer.\n\n## Non-negotiable gotchas\n\nThe full list with rationale is in the README's \"Hard-won constraints\" —\nthe ones that bite hardest: `flutter drive` not `flutter test` (no window\notherwise); `GDK_BACKEND=x11` + empty `WAYLAND_DISPLAY` (or the app opens on\nthe real desktop); Voxtral prompts in the audio's language (else it\ntranslates); `automaticUpdatesEnabled` set-and-verify (initial wake clobbers\nearly writes); 16ms pump cadence during holds (else animations render\nchoppy); timeline starts after startup settles; assert transcript keywords,\nnot exact strings.\n\n## Adapting / extending\n\n- **App Store preview**: `config/scenarios/app_store_preview.yaml` is the\n  narration of `make store_preview_ios`, not a tutorial — never\n  `make tutorial_video` it. Its step ids must stay the `_beatIds` of\n  `integration_test/store_preview_test.dart` (`tests/test_app_preview.py`\n  guards it), and all four lines together must leave the beats under 30 s\n  (`python3 -m tutorial_videos.app_preview pacing` fails first if not).\n  See the README's \"The App Store preview reuses the narration\".\n- **Compositor changes**: all OpenMontage API usage is isolated in\n  `tutorial_videos/om_compose_driver.py`; bump the pin in\n  `config/openmontage.pin` deliberately and re-verify determinism\n  (compose twice, compare `ffmpeg -f framemd5` of the streams — never file\n  hashes).\n- **TTS vendor**: implement the `TtsEngine` protocol (`tts/base.py`) next to\n  `tts/gemini.py` and `tts/elevenlabs.py`, register it with its `.env` key\n  in `tts/engines.py`, and give it an `engines.<name>` block (model + both\n  streams) in `config/voices.yaml`. Voices: switch ElevenLabs ones by\n  changing the voice id there; the README's \"TTS engines\" has the details.\n- **Speed/pacing knobs**: `timewarp.py` (`MAX_SPEED`, lead-in, narration\n  gap); per-step floors in the scenario YAML.\n- **Talking avatar**: `make tutorial_video TUTORIAL_AVATAR=1` (or `build\n  --avatar`) lays the scenario's avatar into the top-right corner of the\n  finished video, lip-synced to the narrator clips only — never the\n  dictation. It acts, not just talks: nods on stresses, a head tilt per\n  phrase, brow lifts, breathing, and in pauses it watches the app\n  (`tutorial_videos/avatar/acting.py`; tune there, check with\n  `avatar-preview`). Characters live in `tutorial_videos/avatar/characters.py`\n  (`CHARACTERS`): Pip the penguin by default, Theo for any scenario whose\n  YAML says `avatar: theo` (the onboarding does); `--avatar-character`\n  overrides it for one build, `--character` picks it for the two avatar\n  commands. `--avatar-position` / `avatar-overlay --position` move it to\n  another corner; `avatar-overlay --video <built mp4>` adds it to an\n  already-built video as `<stem>_avatar.mp4`; `avatar-preview --wav <wav>`\n  renders the character alone — check any art change at badge size with it\n  first.\n  See the README's \"Talking avatar\".\n",".claude/skills/review-comments/SKILL.md":"---\nname: review-comments\ndescription: Fetch PR review comments, address each one in code, and post resolution replies\nargument-hint: \"[pr-number]\"\n---\n\n# Review PR Comments\n\nFetch all review comments from a pull request, address each one (fix code, add\ndocs, or explain the rationale), and reply to each comment on GitHub with the\nresolution.\n\n## Steps\n\n1. **Fetch comments** — use `gh api` to get all review comments:\n   ```bash\n   gh api repos/{owner}/{repo}/pulls/$ARGUMENTS/comments \\\n     --jq '.[] | {id, path, line, body, in_reply_to_id}'\n   ```\n   Filter to top-level comments only (`in_reply_to_id == null`) — those are the\n   ones that need responses.\n\n2. **Understand each comment** — read the referenced file and line to understand\n   the concern. Group related comments if they touch the same issue.\n\n3. **Address each comment** — make the appropriate code change (fix, refactor,\n   add docs, add tests). If you disagree with a suggestion, prepare a clear\n   rationale.\n\n4. **Reply to each comment** — post a reply using:\n   ```bash\n   gh api repos/{owner}/{repo}/pulls/$ARGUMENTS/comments -X POST \\\n     -f body=\"<resolution>\" \\\n     -F in_reply_to=<comment-id>\n   ```\n   Keep replies concise: state what was done (e.g., \"Fixed. Replaced generic\n   fallback with explicit throw.\") or explain why it was left as-is.\n\n5. **Close every codecov gap — target 100% patch coverage.** The Codecov bot\n   posts a PR comment/check; treat its uncovered lines as review comments that\n   MUST be resolved with tests. **Every line codecov marks uncovered has to be\n   covered — no exceptions for \"pre-existing\" files.** If a file shows up in the\n   PR diff with uncovered lines, cover them even if you didn't write them.\n\n   a. **Find what's actually uncovered.** The bot summary only gives totals;\n      pull the per-line data from the Codecov API and intersect it with the\n      PR's added lines (this is exactly what `codecov/patch` scores):\n      ```bash\n      # Per-line diff coverage (head_cov == 0 → miss):\n      curl -s \"https://api.codecov.io/api/v2/github/{owner}/repos/{repo}/compare?pullid=$ARGUMENTS\" \\\n        > /tmp/cc.json\n      # Then: for each file with has_diff, list lines where\n      #   coverage.head == 0 && is_diff, and intersect with the file's\n      #   git-diff added-line numbers (git diff --unified=0 origin/main...HEAD).\n      ```\n      Codecov ignores are in `codecov.yml` (`*.g.dart`, `*.freezed.dart`,\n      `l10n/*.dart` here) — skip those.\n\n   b. **Codecov is often stale/partial — trust local coverage for new code.**\n      Coverage is sharded; if any shard failed or the run is mid-flight, the\n      bot shows a partial picture (e.g. \"1% of diff\") that inflates the miss\n      list with trivial lines (`@override`, const ctors). Regenerate locally\n      and intersect with the git-diff added lines for the authoritative set:\n      ```bash\n      fvm flutter test --coverage <the test dirs that exercise the diff>\n      # parse coverage/lcov.info: DA:<line>,0 == uncovered\n      ```\n      Run enough test dirs that every diff file is genuinely exercised (a file\n      covered only by tests you didn't run shows as a false miss).\n\n   c. **Write real tests for each uncovered line** — mirror the sibling case\n      already tested (e.g. a new `.map`/`switch` arm → copy the `aiConfig`\n      case for `savedTaskFilter`; a debounce-cancel line → emit *two*\n      notifications so the timer is non-null when cancelled). Extend\n      parameterized `variantCases`/`variantsByBucket` tables rather than\n      duplicating whole test bodies.\n\n   d. **Uncoverable private-ctor lines** (`const FooKeys._();` in a static-only\n      keys class) can't be hit and dart coverage ignores no inline comment —\n      convert the class to `abstract final class FooKeys { ... }` so the\n      constructor line disappears entirely.\n\n   e. **Re-run coverage until the (added ∩ uncovered) set is empty**, then run\n      the affected suites to confirm still-green.\n\n6. **Verify** — run analyzer and affected tests to confirm all changes compile\n   and pass.\n\n7. **Babysit the PR until it is actually done.** Opening a PR and replying once\n   is not the end of the job. A PR is finished only when all three hold at the\n   same time:\n\n   - **mergeable** — `gh pr view <n> --json mergeable` is `MERGEABLE`\n   - **all green** — every check passed, not merely \"not failing\": zero\n     `pending` and zero failures, including `codecov/patch`\n   - **all replied** — every top-level review comment has a reply, with a real\n     fix or a stated reason for declining\n\n   **Pushing requires authorization.** Commits, rebases and pushes need\n   explicit user or orchestrator approval (AGENTS.md, \"Issue Tracking\").\n   Being asked to *address review comments* authorizes the\n   code changes, not the push — confirm before the first push of a session,\n   and never force-push a branch you did not create in this session.\n   `--force-with-lease` guards against clobbering a concurrent update; it is\n   not a substitute for approval.\n\n   Reviews arrive *after* pushes, so pushing fixes restarts the loop: the\n   reviewer re-reviews the new commit and may file new findings. Bots also\n   rate-limit and arrive late (CodeRabbit will say \"next review available in\n   N minutes\" and skip the run entirely). Keep watching until the three\n   conditions hold together.\n\n   Poll on the structured status rather than the display columns — the table\n   format is human-facing, and a failed API or auth call prints to stderr and\n   would otherwise read as \"no pending checks\".\n\n   Note `gh pr checks` has **no** `--json` flag (checked on gh 2.45); the\n   structured source is `gh pr view --json statusCheckRollup`. Verify whatever\n   command you poll with actually works *before* wrapping it in an `until`\n   loop: a command that errors makes the loop exit immediately and every\n   subsequent report a lie.\n\n   For a CheckRun, `status` is the lifecycle (`COMPLETED`) and `conclusion`\n   carries the verdict (`SUCCESS` / `FAILURE` / `CANCELLED`) — a failed check\n   is `COMPLETED`, so keying on `status` alone reports a red run as done and\n   green. Read the conclusion for completed checks and the state for\n   StatusContexts:\n\n   ```bash\n   # one \"<verdict>\\t<name>\" line per check; empty output means the query\n   # failed, not that everything passed — so treat it as not-done.\n   rollup() {\n     gh pr view \"$1\" --json statusCheckRollup --jq '\n       .statusCheckRollup[]\n       | if .status == \"COMPLETED\" then .conclusion\n         elif .status then .status\n         else .state end\n       + \"\\t\" + (.name // .context)'\n   }\n   # Capture once per iteration and check the exit status: an errored or\n   # empty result is \"not done\", never \"done and green\".\n   while :; do\n     out=$(rollup <n>) || { echo \"poll failed\"; sleep 30; continue; }\n     [ -n \"$out\" ] || { echo \"empty rollup — treating as not done\"; sleep 30; continue; }\n     printf '%s\\n' \"$out\" | grep -qE '^(IN_PROGRESS|QUEUED|PENDING)' || break\n     sleep 30\n   done\n   bad=$(printf '%s\\n' \"$out\" | grep -vE '^(SUCCESS|NEUTRAL|SKIPPED)')\n   [ -z \"$bad\" ] && echo \"all green (${#out} bytes of verdicts)\" || printf '%s\\n' \"$bad\"\n   ```\n\n   Three ways these snippets lie if written casually, all worth guarding:\n   an errored command inside `$( )` yields empty output that a\n   `grep -q pending` reads as \"nothing pending\"; `grep … || echo \"all green\"`\n   turns *no output at all* into a pass; and a background poller whose result\n   is never collected lets the summary be written before it finishes. Capture\n   the output, check the status, and `wait` for the poller before reporting.\n\n   Cross-check the total against `gh pr checks <n>` before declaring green —\n   a poller that exits on its first iteration otherwise reports \"settled\"\n   while checks are still queued.\n\n   Run that in the background (`run_in_background: true`, or `… &` with the\n   PID kept) so replying to comments proceeds concurrently rather than\n   blocking on CI.\n\n   Then re-check for comments filed against the new commits — including\n   top-level ones with no reply yet:\n\n   `gh api` returns **one page (30 comments)** unless `--paginate` is passed,\n   and `--jq` then runs per page — so a comment and its reply landing on\n   different pages makes an answered comment look unanswered, and a comment on\n   a later page look absent. Fetch every page and aggregate once with `jq -s`:\n\n   ```bash\n   # `set -o pipefail` so an API failure fails the pipeline instead of\n   # producing an empty list that reads as \"nothing unanswered\".\n   ( set -o pipefail\n     gh api --paginate repos/{owner}/{repo}/pulls/<n>/comments --jq '.[]' | jq -s -r '\n       [.[] | select(.in_reply_to_id != null) | .in_reply_to_id] as $replied\n       | [.[] | select(.in_reply_to_id == null)] as $top\n       | \"top-level: \\($top | length), answered: \\([$top[] | select(.id as $i | $replied | index($i))] | length)\",\n         ($top[] | select(.id as $i | ($replied | index($i)) | not)\n          | \"UNANSWERED \\(.id) \\(.user.login) \\(.path)\")'\n   ) || echo \"comment query FAILED — do not report all-replied\"\n   ```\n\n   Print the counted totals, not just the unanswered lines: \"top-level: 26,\n   answered: 22\" is checkable, whereas empty output is indistinguishable from\n   a query that never ran.\n\n   Post replies with `-F body=@file` rather than an inline shell string.\n   Review bodies contain backticks, quotes and code fences; nested shell\n   quoting silently mangles them, and a failed POST inside a loop can still\n   look like it succeeded.\n\n   Report the real state — \"27 pass, 1 pending\" is the honest answer while a\n   check is still running, not \"all green\".\n\n## Guidelines\n\n- Address every comment.\n- Make real code fixes, not just reply text.\n- Run the analyzer and formatter after all fixes.\n- Run affected tests to verify fixes.\n- Keep reply text concise and factual.\n- If a comment is from a bot review (e.g., CodeRabbit, Gemini), still address\n  valid points but use your judgement on noise.\n- Coverage is not optional: every codecov-flagged line in the diff must end up\n  covered (goal 100% patch), pre-existing or not. Prefer real behavioural tests;\n  only restructure code (e.g. `abstract final class`) for genuinely\n  uncoverable lines.\n","DESIGN.md":"# UI Design System & Style Tokens\n\nPath: `DESIGN.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/DESIGN.md)","docs/ARCHITECTURE.md":"# docs - System Architecture & Module Boundaries\n\nPath: `docs/ARCHITECTURE.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/docs/ARCHITECTURE.md)","tools/matrix_provisioner/README.md":"# matrix_provisioner Documentation\n\nPath: `tools/matrix_provisioner/README.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/tools/matrix_provisioner/README.md)","tools/tutorial_videos/README.md":"# tutorial_videos Documentation\n\nPath: `tools/tutorial_videos/README.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/tools/tutorial_videos/README.md)",".claude/skills/design-review-panel/panel_workflow.js":"# Claude Directive: panel_workflow.js\n\nPath: `.claude/skills/design-review-panel/panel_workflow.js`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/.claude/skills/design-review-panel/panel_workflow.js)","knowledge/features/agents/chat-input-and-reasoning.md":"# Subagent: chat-input-and-reasoning\n\nPath: `knowledge/features/agents/chat-input-and-reasoning.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/knowledge/features/agents/chat-input-and-reasoning.md)","knowledge/features/agents/index.md":"# Subagent: index\n\nPath: `knowledge/features/agents/index.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/knowledge/features/agents/index.md)","knowledge/features/agents/memory-and-compaction.md":"# Subagent: memory-and-compaction\n\nPath: `knowledge/features/agents/memory-and-compaction.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/knowledge/features/agents/memory-and-compaction.md)","knowledge/features/agents/overview.md":"# Subagent: overview\n\nPath: `knowledge/features/agents/overview.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/knowledge/features/agents/overview.md)","knowledge/features/agents/persistence-and-sync.md":"# Subagent: persistence-and-sync\n\nPath: `knowledge/features/agents/persistence-and-sync.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/knowledge/features/agents/persistence-and-sync.md)","knowledge/features/agents/project-and-event-agents.md":"# Subagent: project-and-event-agents\n\nPath: `knowledge/features/agents/project-and-event-agents.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/knowledge/features/agents/project-and-event-agents.md)","knowledge/features/agents/projection.md":"# Subagent: projection\n\nPath: `knowledge/features/agents/projection.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/knowledge/features/agents/projection.md)","knowledge/features/agents/query-chat.md":"# Subagent: query-chat\n\nPath: `knowledge/features/agents/query-chat.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/knowledge/features/agents/query-chat.md)","knowledge/features/agents/task-agents.md":"# Subagent: task-agents\n\nPath: `knowledge/features/agents/task-agents.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/knowledge/features/agents/task-agents.md)","knowledge/features/agents/templates-souls-evolution.md":"# Subagent: templates-souls-evolution\n\nPath: `knowledge/features/agents/templates-souls-evolution.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/knowledge/features/agents/templates-souls-evolution.md)","knowledge/features/agents/ui-surfaces.md":"# Subagent: ui-surfaces\n\nPath: `knowledge/features/agents/ui-surfaces.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/knowledge/features/agents/ui-surfaces.md)","knowledge/features/agents/wake-orchestration.md":"# Subagent: wake-orchestration\n\nPath: `knowledge/features/agents/wake-orchestration.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/knowledge/features/agents/wake-orchestration.md)","lib/features/agents/README.md":"# Subagent: readme\n\nPath: `lib/features/agents/README.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/lib/features/agents/README.md)","tools/tutorial_videos/config/voices.yaml":"# Config Skill\n\nPath: `tools/tutorial_videos/config/voices.yaml`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/tools/tutorial_videos/config/voices.yaml)",".agents/skills/beads/agents/openai.yaml":"# Agents Skill\n\nPath: `.agents/skills/beads/agents/openai.yaml`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/.agents/skills/beads/agents/openai.yaml)",".claude/skills/add-flutter-docusaurus-locale/agents/openai.yaml":"# Agents Skill\n\nPath: `.claude/skills/add-flutter-docusaurus-locale/agents/openai.yaml`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/.claude/skills/add-flutter-docusaurus-locale/agents/openai.yaml)",".claude/skills/add-flutter-docusaurus-locale/references/end-to-end-checklist.md":"# References Skill\n\nPath: `.claude/skills/add-flutter-docusaurus-locale/references/end-to-end-checklist.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/.claude/skills/add-flutter-docusaurus-locale/references/end-to-end-checklist.md)",".claude/skills/add-flutter-docusaurus-locale/scripts/audit_locale.py":"# Claude Directive: audit_locale.py\n\nPath: `.claude/skills/add-flutter-docusaurus-locale/scripts/audit_locale.py`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/.claude/skills/add-flutter-docusaurus-locale/scripts/audit_locale.py)",".claude/skills/maintain-docusaurus-manual/agents/openai.yaml":"# Agents Skill\n\nPath: `.claude/skills/maintain-docusaurus-manual/agents/openai.yaml`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/.claude/skills/maintain-docusaurus-manual/agents/openai.yaml)",".claude/skills/maintain-docusaurus-manual/references/discovery-and-review.md":"# References Skill\n\nPath: `.claude/skills/maintain-docusaurus-manual/references/discovery-and-review.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/.claude/skills/maintain-docusaurus-manual/references/discovery-and-review.md)",".claude/skills/maintain-docusaurus-manual/scripts/audit_docusaurus_locales.py":"# Claude Directive: audit_docusaurus_locales.py\n\nPath: `.claude/skills/maintain-docusaurus-manual/scripts/audit_docusaurus_locales.py`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/.claude/skills/maintain-docusaurus-manual/scripts/audit_docusaurus_locales.py)","lib/features/agents/projection/README.md":"# Subagent: readme\n\nPath: `lib/features/agents/projection/README.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/lib/features/agents/projection/README.md)","tools/tutorial_videos/config/scenarios/app_store_preview.yaml":"# Scenarios Skill\n\nPath: `tools/tutorial_videos/config/scenarios/app_store_preview.yaml`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/tools/tutorial_videos/config/scenarios/app_store_preview.yaml)","tools/tutorial_videos/config/scenarios/category_setup.yaml":"# Scenarios Skill\n\nPath: `tools/tutorial_videos/config/scenarios/category_setup.yaml`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/tools/tutorial_videos/config/scenarios/category_setup.yaml)","tools/tutorial_videos/config/scenarios/create_task_from_audio.yaml":"# Scenarios Skill\n\nPath: `tools/tutorial_videos/config/scenarios/create_task_from_audio.yaml`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/tools/tutorial_videos/config/scenarios/create_task_from_audio.yaml)","tools/tutorial_videos/config/scenarios/onboarding_first_run.yaml":"# Scenarios Skill\n\nPath: `tools/tutorial_videos/config/scenarios/onboarding_first_run.yaml`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/tools/tutorial_videos/config/scenarios/onboarding_first_run.yaml)","tools/tutorial_videos/config/scenarios/task_coding_prompt.yaml":"# Scenarios Skill\n\nPath: `tools/tutorial_videos/config/scenarios/task_coding_prompt.yaml`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/tools/tutorial_videos/config/scenarios/task_coding_prompt.yaml)","tools/tutorial_videos/config/scenarios/task_cover_art.yaml":"# Scenarios Skill\n\nPath: `tools/tutorial_videos/config/scenarios/task_cover_art.yaml`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/tools/tutorial_videos/config/scenarios/task_cover_art.yaml)","tools/tutorial_videos/config/scenarios/task_filters.yaml":"# Scenarios Skill\n\nPath: `tools/tutorial_videos/config/scenarios/task_filters.yaml`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/tools/tutorial_videos/config/scenarios/task_filters.yaml)"},"items":[{"name":"AGENTS.md","path":"AGENTS.md","rawUrl":"https://raw.githubusercontent.com/matthiasn/lotti/HEAD/AGENTS.md","title":"AI Agent Protocol & Instructions","category":"root-instruction","format":"markdown","content":"# Repository Guidelines\n\n## Project Structure & Module Organization\n- `lib/` — Flutter/Dart source (features, services, widgets). Do not edit generated files (`*.g.dart`, `*.freezed.dart`).\n- `test/` and `integration_test/` — unit and integration tests; keep test files as `*_test.dart`.\n- `assets/` — images, icons, and other static assets.\n- Platform targets: `android/`, `ios/`, `macos/`, `linux/`, `windows/`.\n- Tooling & CI: `Makefile`, `.buildkite/`, `analysis_options.yaml`, `l10n.yaml`.\n- Localization: `lib/l10n/*.arb` with `missing_translations.txt` for gaps.\n\n## Build, Test, and Development Commands\n- Install deps: `make deps` (runs through FVM when `fvm` is installed).\n- Static analysis: `make analyze` (Very Good Analysis rules).\n- Unit tests + coverage: `make test` • HTML report: `make coverage`.\n- Code generation: `make build_runner` • Watch mode: `make watch`.\n- Localization generation: `make l10n` (prints missing translations) • Sort ARB: `make sort_arb_files`.\n- Run locally: `fvm flutter run -d macos` (or `flutter run -d <device>`).\n- Integration tests: `make integration_test`.\n- Packaging (examples): `make ios`, `make macos`, or `make bundle` (see Makefile for more).\n\n## Coding Style & Naming Conventions\n- Follow `analysis_options.yaml` (Very Good Analysis). 2‑space indent, prefer `const` and `final`.\n- Files: `lower_snake_case.dart`; types (classes/enums): `PascalCase`; members: `lowerCamelCase`.\n- Keep hand-written files in `lib/` at or below 1,000 lines. `test/architecture/file_size_ratchet_test.dart` fails on a new file above that, and holds the files already above it at their current size (`file_size_baseline.json`): put new code in a file of its own, and lower or delete an entry when a file shrinks.\n- Imports in `lib/` follow the layer order in `tool/architecture/layer_guard.dart` (`make layer_check`): no feature imports one ranked above it, `lib/classes`, `database`, `services`, `logic` and `utils` import no feature, non-UI code never imports another feature's UI, and nothing below the shell imports it (the service locator excepted, which `tool/di` counts). Existing breaks are baselined and may only shrink — move the shared type down or invert the dependency rather than adding one.\n- Format before committing: `fvm dart format .`.\n- Do not modify generated code (`*.g.dart`, `*.freezed.dart`); regenerate via `make build_runner`.\n\n## Testing Guidelines\n- Framework: `flutter_test`, helpers in `test/`. Name tests `*_test.dart` and co-locate by feature. **One test file per source file**, mirroring the path.\n- Run tests via the dart-mcp server, **only for the files you actually touched**. Do not run the whole suite locally, and do not run a whole feature's suite either — `agents` alone takes minutes, worse in a Linux VM. CI runs everything ten-way sharded on every push, so let it. Broader local runs only when asked, or when a change genuinely cannot be scoped to the files you touched.\n- **Never `Future.delayed`, `sleep()` or a real `Timer` in a test.** Use `fakeAsync` or `tester.pump(duration)`, and deterministic dates rather than `DateTime.now()`.\n- **Reuse the shared harness**: mocks from `test/mocks/mocks.dart`, fallbacks from `test/helpers/fallbacks.dart`, `setUpTestGetIt()` / `tearDownTestGetIt()`, `makeTestableWidget()`. Never improvise a per-file equivalent.\n- **Every test must assert something meaningful.** `findsOneWidget` alone proves only that the tree built; a constructor smoke test proves nothing at all.\n- **Re-run every new regression test with the fix reverted.** If it still passes, it is not testing the fix.\n- The full contract — the DRY rules, the infrastructure table, the quality bar, the vacuous-pass traps, property tests, time-driven UI — is [knowledge/conventions/testing.md](knowledge/conventions/testing.md), plus [test/README.md](test/README.md) for the fake-time policy and mocktail hygiene. Read them rather than working from this summary.\n\n## Commit & Pull Request Guidelines\n- Use Conventional Commits (e.g., `feat:`, `fix:`, `chore:`, `ci:`). Keep subjects concise and imperative.\n- PRs must pass `make analyze` and `make test`; include a clear description and linked issues.\n- **UI changes need a before/after screenshot pair per surface**, captured with the harness (see the `app-screenshots` skill). Capture `before/` from the base commit *first* — it cannot be reconstructed once the change is in. **Fixtures come from `test/test_data` and the penguin demo world only — never from a user's own habits, tasks, notes or bug screenshots**; a capture is published to a public bucket and a public PR. **Never commit images to any repo.** Publish the pair to the R2 bucket with `make pr_screenshots_publish` and link the printed public URLs from the PR body. The staging layout, the naming rules and the publish command are in [knowledge/conventions/screenshots.md](knowledge/conventions/screenshots.md).\n- Update docs and localization as needed (run `make l10n`).\n\n## Security & Configuration Tips\n- Never commit secrets. Use `.env` for local config; keep it out of VCS.\n- Use FVM (`.fvmrc`) to match the repo’s Flutter version: `fvm flutter ...`.\n\n## Agent MCP Usage\n- Prefer MCP tools over raw shell commands:\n  - Use `dart-mcp` for analyzer, tests, formatting, fixes, pub, and build tasks.\n    - Analyze: `dart-mcp.analyze_files`\n    - Tests: `dart-mcp.run_tests` (set platforms as needed)\n    - Format: `fvm dart format .`\n    - Apply fixes: `dart-mcp.dart_fix`\n    - Pub: `dart-mcp.pub` (e.g., `get`, `add`, `upgrade`)\n    - Hot reload/runtime hooks: connect to the Dart Tooling Daemon first\n  - Use `context7` for up-to-date docs. Resolve with `context7.resolve-library-id`, then fetch via `context7.get-library-docs`.\n- Register the repo root before using `dart-mcp` commands: `dart-mcp.add_roots` with the workspace URI.\n- For runtime/Flutter app introspection, request a DTD URI from the user and connect via `dart-mcp.connect_dart_tooling_daemon`.\n- Follow the planning and preamble conventions:\n  - Send a brief preamble before grouped tool calls.\n  - Keep a concise plan in your agent's planning tool for multi-step work.\n- Test-first workflow when adding/fixing tests:\n  - Run `dart-mcp.analyze_files` to catch lints quickly.\n  - Run `fvm dart format .` to normalize diffs. Do not use `dart-mcp.dart_format`.\n  - Run targeted tests (single file or folder) via `dart-mcp.run_tests` before broad runs.\n  - Iterate until the targeted tests pass; CI runs the full suite.\n- Do not edit generated files (`*.g.dart`, `*.freezed.dart`); run `dart-mcp.pub` + `make build_runner` (or `dart run build_runner`) via MCP when regeneration is required.\n- Favor `rg` for searches and read files in chunks (≤250 lines) when using shell reads.\n\n## Analyzer Zero‑Warning Policy\n- Before opening a PR, the analyzer must report zero warnings or infos.\n- Always run `dart-mcp.analyze_files` and address every message:\n  - In tests, you may add line ignores for clarity (e.g., `// ignore: avoid_redundant_argument_values`).\n  - In production code, fix the root cause rather than ignoring.\n- Run `fvm dart format .` to normalize formatting prior to final checks. Do not use\n  `dart-mcp.dart_format`.\n\n## Documentation\n\nDocumentation is split by audience. **No fact is written twice.**\n\n- **`lib/features/<x>/README.md` — product description.** What the feature does,\n  what it owns versus what it delegates, and where the code sits. Roughly 40–100\n  lines, ending with a link to its knowledge concept. If a README starts\n  explaining provider routing or wake scheduling, that content belongs in\n  `knowledge/`.\n- **`knowledge/` — the architecture, in OKF v0.2 form.** Runtime flows, state\n  machines, invariants, key classes, gotchas. This is the durable, agent-readable\n  map of how the app actually works. Read the relevant concept *before* changing\n  a subsystem, and update it in the same change.\n  [knowledge/index.md](knowledge/index.md) is the entry point: it carries the\n  reading order and the code-to-concept map.\n- **`docs/adr/` — decisions.** An ADR records a choice at a point in time and is\n  not rewritten; concepts cite ADRs rather than restating them.\n\n**These concepts are derived maps, not authority.** The source code outranks\nthem: if a concept contradicts the code, the concept is the defect, and fixing it\nis part of your change. Verify a claim before you depend on it.\n\nRules for `knowledge/`:\n\n- Every concept carries required OKF frontmatter, and `make okf_check` fails on a\n  missing or malformed field. The field-by-field contract is in\n  [knowledge/conventions/knowledge-bundle.md](knowledge/conventions/knowledge-bundle.md)\n  — follow it there rather than from memory.\n- Do **not** set `verified` on a concept you wrote. That field records\n  independent confirmation by someone other than the author.\n- Use Mermaid diagrams generously for flows, architecture, data movement and\n  lifecycles. If the code contains a real lifecycle or state machine, the\n  concept must include a diagram for it — prefer `stateDiagram-v2`, and never\n  invent states that are not implemented.\n- Every path a concept references must exist. `make okf_check` fails the build\n  on a dangling code pointer, which is the mechanism that keeps the map honest.\n- Run `make knowledge_check` after touching anything under `knowledge/`. It runs the Dart validator *and* parses every Mermaid diagram — `make okf_check` alone cannot see a diagram that fails to render.\n\n## Misc\n- Whenever touching any function, consider its docstring and if it needs updating\n- Only report completion after code compiles and all tests pass; verify via analyze and test via the dart-mcp server.\n- Invest in making tests work; avoid deleting or abandoning failing tests prematurely.\n- When old and new feature versions coexist, create no dependencies from the new code to the old — the old code is meant to be removed once the new one reaches parity.\n- Uphold high standards: DRY where sensible, proper modularity, and strong testability.\n- Use `fvm` for all `flutter` commands.\n\n## Localization (l10n)\n- All user-visible label texts MUST be localized using arb files in `lib/l10n/`.\n- Never hardcode strings that users will see — add them to the arb files instead.\n- **Add every new label to every catalog in `lib/l10n/`**, translated — not a\n  subset. The catalog list, the `app_en_GB.arb` exception and the per-language\n  register table live in\n  [knowledge/conventions/localization.md](knowledge/conventions/localization.md).\n  Read it rather than working from a count or a list quoted anywhere else,\n  including here.\n- Access localized strings via `context.messages.labelName` (import `app_localizations_context.dart`).\n- After adding labels, run `make l10n` to generate the Dart files.\n- Run `make sort_arb_files` to keep arb files consistently sorted.\n- Edit the `.arb` sources and regenerate; `lib/l10n/app_localizations_*.dart` is generated output.\n- **Use the informal register** in every translation, with Romanian as the one deliberate exception. Which pronouns that means per language is in the concept linked above.\n\n## Implementation discipline\n\nEvery UI change is bound by the design system. Read\n[knowledge/features/design_system/](knowledge/features/design_system/) before\ntouching visual code — the token pipeline and its naming, the component contracts,\nand what is enforced at construction rather than by review.\n\n- **Design-system tokens are mandatory.** For colors, spacing, radii, typography, elevation, and other visual styling values, always use the exported design-system tokens or existing design-system abstractions first.\n- **Spacings and font styles MUST come from the Design System.** Never hardcode spacing values (raw numbers in `EdgeInsets`/`SizedBox`/local `const double` constants) or font styles (raw `fontSize`/`fontWeight`/`TextStyle` constructors). Use `tokens.spacing.stepN` (or `cardPadding`/`cardItemSpacing`/`sectionGap`) and `tokens.typography.styles.{display,heading,subtitle,body,others}.<name>`. If no suitable token exists, stop and ask before introducing one.\n- **Do not invent ad hoc visual values by default.** Before adding a hard-coded color, spacing value, radius, opacity, or a one-off semantic alias for a visual token, first check the design-system token export and existing design-system components/palettes.\n- **Ask before introducing new visual tokens or hard-coded values.** If no suitable design-system token exists, stop and ask for permission before creating an ad hoc fallback, local palette entry, or other non-token visual value.\n- **Never use loading states over content: stay while reload. This is a hard rule.** Once a surface has shown its content, a reload — sync, a database notification, an agent wake, a transcript landing, any watched dependency — must not take it off the screen: no spinner, skeleton, empty placeholder or error shell in its place, and no teardown and rebuild of the same content. Keep the shown data until the new data replaces it in place. A loading shell is allowed only on the first load and on a deliberate change of subject (another day, person or route); progress for a background reload is a quiet local affordance at most.\n  - Read async state with `.value` and show a shell only while it is null. A bare `.when` runs `loading:` on every reload (Riverpod 3 defaults `skipLoadingOnReload` to false); `whenData` and `unwrapPrevious` drop the value.\n  - Key every list child whose position can shift, and give every `*.builder` list a `findChildIndexCallback` — without it a builder list matches by index even when its children carry keys, and rebuilds everything below an insertion.\n  - The rationale, the before/after code and how to test it: [stay while reload](knowledge/conventions/stay-while-reload.md).\n- **Prefer fixing the token source over patching the widget.** If a Figma export flattened or obscured a semantic token name, prefer tracing it back to the exported token set or improving the import/export path instead of hard-coding a widget-level substitute.\n- **Check the token name in the actual Figma node inspect panel first.** Even when the Variables API is incomplete or unavailable, the selected node often shows the bound token name directly under Colors, e.g. `background/02`.\n- **Know the naming path across tools.** The same token is named differently in Figma, `tokens.json` and Dart — the table is in [design tokens and theming](knowledge/features/design_system/tokens-and-theming.md#one-token-three-names). Treat them as one token with normalised naming, not as different concepts.\n- **Verifying a visual token, in order:** inspect the selected node in Figma Desktop Bridge, confirm the entry in `assets/design_system/tokens.json`, then map it to the generated token. If the inspect panel already shows the name, do not conclude it is unavailable just because the Variables API returned empty data.\n- Always ensure the analyzer has no complaints and everything compiles. Also run the formatter\n  frequently.\n- Prefer running commands via the dart-mcp server.\n- Only move on to adding new files when already created tests are all green.\n- Aim for full coverage of every code path.\n- Every widget we touch should get as close to full test coverage as is reasonable, with meaningful\n  tests.\n- **Release notes go in `changelog.d/`, never straight into `CHANGELOG.md`.** Add one new file\n  per pull request — `changelog.d/YYYY-MM-DD-slug.md`, holding the `### Fixed` (or `### Added`,\n  `### Changed`, …) section your change deserves, worded as it should read to a user. **Never\n  edit `CHANGELOG.md`, `flatpak/com.matthiasn.lotti.metainfo.xml` or the `version:` line in\n  `pubspec.yaml`.** Those three are written at the top by everything, so they are written once\n  per release, by the release — which is what stops concurrent pull requests conflicting over\n  prose they do not share. The format, the naming and what deserves an entry at all are in\n  [changelog.d/README.md](changelog.d/README.md); `make changelog_check` validates it.\n- Fragments are only for what a user would actually notice — not dependency bumps, refactors,\n  test-only changes, CI tweaks, docs, or a bug introduced and fixed before it ever shipped. If\n  in doubt, ask, but default to no fragment when nothing changes at runtime.\n- Assembling a release — fragments into `CHANGELOG.md` and the Flathub metainfo, version bump,\n  tag — is [.agents/skills/release/SKILL.md](.agents/skills/release/SKILL.md). It is the only\n  change permitted to touch those three files.\n- Update the documentation we touch such that it matches reality in the codebase, not only\n  for what we touch but in its entirety. See \"Documentation\" above for which file gets what.\n- Use fvm when running any flutter command\n- Read test/README.md on every session start and keep it up to date when gaining relevant new information\n- Do not hoard code. We do not keep unused code around. Also, this is no library, there are no known mysterious callers for whom we would keep any code around.\n\n## Issue Tracking\n\n- Public bugs, feature requests, and contributor coordination belong in\n  [GitHub Issues](https://github.com/matthiasn/lotti/issues).\n- Authorized maintainers may use the private Beads tracker for implementation\n  plans, dependencies, handoffs, and durable agent memory. Follow\n  `.agents/skills/beads/SKILL.md`.\n- Public contributors are not expected to install Beads or have access to the\n  private tracker. PR descriptions and GitHub issue links must contain all\n  context needed for public review.\n- Agent-local planning tools remain appropriate for the current turn. Beads is\n  the durable maintainer record, not a replacement for a short execution plan.\n- Beads sync, Git commits, and pushes require explicit user or orchestrator\n  authority. Never store secrets in Beads.\n- Do not install repository-controlled Git, Codex, or Claude hooks for Beads.\n  Maintainers run `bd prime`, `bd dolt pull`, and `bd dolt push` explicitly.\n","isInternal":false,"tokens":4258,"sizeBytes":18059},{"name":"DESIGN.md","path":"DESIGN.md","rawUrl":"https://raw.githubusercontent.com/matthiasn/lotti/HEAD/DESIGN.md","title":"UI Design System & Style Tokens","category":"project-spec","format":"markdown","content":"# UI Design System & Style Tokens\n\nPath: `DESIGN.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/DESIGN.md)","tokens":300,"sizeBytes":148},{"name":"ARCHITECTURE.md","path":"docs/ARCHITECTURE.md","rawUrl":"https://raw.githubusercontent.com/matthiasn/lotti/HEAD/docs/ARCHITECTURE.md","title":"docs - System Architecture & Module Boundaries","category":"project-spec","format":"markdown","content":"# docs - System Architecture & Module Boundaries\n\nPath: `docs/ARCHITECTURE.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/docs/ARCHITECTURE.md)","tokens":300,"sizeBytes":185},{"name":"openai.yaml","path":".agents/skills/beads/agents/openai.yaml","rawUrl":"https://raw.githubusercontent.com/matthiasn/lotti/HEAD/.agents/skills/beads/agents/openai.yaml","title":"Agents Skill","category":"anthropic-skill","format":"yaml","content":"# Agents Skill\n\nPath: `.agents/skills/beads/agents/openai.yaml`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/.agents/skills/beads/agents/openai.yaml)","tokens":300,"sizeBytes":189},{"name":"SKILL.md","path":".agents/skills/beads/SKILL.md","rawUrl":"https://raw.githubusercontent.com/matthiasn/lotti/HEAD/.agents/skills/beads/SKILL.md","title":"beads","category":"anthropic-skill","format":"markdown","content":"---\nname: beads\ndescription: Use for authorized Lotti maintainer work that needs private durable task tracking, issue dependencies, blocker management, multi-session handoff, or shared agent memory. Public contributors use GitHub Issues instead.\n---\n\n# Beads\n\nUse Beads as the private durable task system for authorized Lotti maintainers.\nPublic bugs, feature requests, and contributor coordination stay in GitHub\nIssues. Local plans remain useful for the current turn.\n\n## First Step\n\nFirst confirm that the private tracker is available:\n\n```bash\nbd --readonly list --json\n```\n\nIf no database exists and the current user is an authorized maintainer, run:\n\n```bash\nchmod 700 .beads\ngit config beads.role maintainer\nbd bootstrap\n```\n\nIf access is denied, do not initialize a competing database. Use GitHub Issues\nand PR discussion instead.\n\nRun `bd prime` manually when workflow context is needed. Do not install Git,\nCodex, or Claude hooks for Beads in this repository.\n\n## Core CLI Workflow\n\n1. Pull and find work:\n\n```bash\nbd dolt pull\nbd ready\nbd list --status=open\nbd list --status=in_progress\n```\n\n2. Inspect before editing:\n\n```bash\nbd show <id>\n```\n\n3. Claim work atomically:\n\n```bash\nbd update <id> --claim\n```\n\n4. Create durable follow-up work when implementation reveals new tasks:\n\n```bash\nbd create \"Short title\" --description=\"Why this exists and what needs to be done\" --type=task --priority=2\n```\n\n5. Close completed work:\n\n```bash\nbd close <id> --reason=\"Completed\"\n```\n\n6. With explicit authority, publish durable changes:\n\n```bash\nbd dolt push\n```\n\n## What Belongs In Beads\n\nMaintainers use Beads for:\n\n- shared project tasks\n- blockers and dependencies\n- discovered follow-up work\n- work that must survive thread reset, compaction, or handoff\n- status that another person or agent should be able to resume\n\nPublic-facing context must still be copied into GitHub issues, PR descriptions,\nor review discussion so contributors never need private tracker access.\n\n## Rules\n\n- Do not use `bd edit`; it opens an interactive editor. Use `bd update` flags instead.\n- Prefer `--json` when parsing `bd` output programmatically.\n- Do not auto-close or mutate tasks unless the work is actually complete.\n- Do not store credentials, private user data, or other secrets in Beads.\n- Do not commit, push Git, or sync Dolt without explicit authority.\n","frontmatter":{"name":"beads","description":"Use for authorized Lotti maintainer work that needs private durable task tracking, issue dependencies, blocker management, multi-session handoff, or shared agent memory. Public contributors use GitHub Issues instead."},"isInternal":false,"tokens":538,"sizeBytes":2353},{"name":"SKILL.md","path":".agents/skills/release/SKILL.md","rawUrl":"https://raw.githubusercontent.com/matthiasn/lotti/HEAD/.agents/skills/release/SKILL.md","title":"release","category":"anthropic-skill","format":"markdown","content":"---\nname: release\ndescription: Cut a Lotti release — assemble the changelog.d/ fragments into CHANGELOG.md and the Flathub metainfo, bump the version, open the release PR, then tag. Use when asked to cut or prepare a release, assemble the changelog, publish a new version, or work out what is unreleased.\n---\n\n# Cut a release\n\nRelease notes are written per change as **fragments** in `changelog.d/`, one new\nfile per pull request, and assembled once per release. A release is therefore a\nsmall, boring, self-contained pull request: it turns the fragments into prose in\ntwo files, moves the version, and deletes what it consumed.\n\n**This is the only change allowed to touch `CHANGELOG.md`,\n`flatpak/com.matthiasn.lotti.metainfo.xml`, or the `version:` line in\n`pubspec.yaml`.** That rule is the whole point — those three files are written at\nthe top by everything, so as long as exactly one pull request per release writes\nthem, nothing can conflict. If you are here for any other reason, you are in the\nwrong skill; write a fragment instead (`changelog.d/README.md`).\n\n## Before you start\n\n```bash\ngit checkout main && git pull\nls changelog.d/[0-9]*.md       # the work queue; README.md is not a fragment\nfvm dart run tool/changelog/validate.dart --strict\n```\n\n`--strict` rather than `make changelog_check`: the house-style warnings the\nauthor-facing check only prints — an entry with no bold headline, a paragraph\npasted as one long line — are about to become published prose, so here they\nblock.\n\n- Work from an up-to-date `main`. A release assembled on a stale branch drops\n  whatever merged in the meantime.\n- If `changelog.d/` holds nothing but its README, there is nothing to release.\n  Say so and stop.\n- Fix any malformed fragment here, in the release branch. It is cheaper than\n  sending the author back.\n- A fragment describing something that was reverted before it shipped gets\n  deleted, not published.\n\n**Ask before committing, pushing or tagging.** Every step below writes files;\nthe git operations are the user's call, always.\n\n## 1. Read every fragment\n\nRead them all before writing anything. You are producing one coherent set of\nrelease notes, not a concatenation: two fragments may describe two halves of the\nsame user-visible change and should be merged into one entry, and a later\nfragment may supersede an earlier one.\n\n## 2. Choose the version\n\n```bash\ngrep -m1 '^version:' pubspec.yaml     # e.g. version: 1.0.13+4352\n```\n\n- **Bug fixes alone:** keep the semantic version unchanged and increment only\n  the build number (`1.0.21+4362` → `1.0.21+4363`). A fix-only release appends\n  its notes to the current top changelog section and metainfo release block; it\n  must not create a duplicate `## [1.0.21]` heading or `<release\n  version=\"1.0.21\">` block.\n- **User-facing additions or changes:** increment the patch version and the\n  build number (`1.0.21+4362` → `1.0.22+4363`). Any publishable `Added`,\n  `Changed`, `Deprecated`, or `Removed` entry makes this a user-facing release.\n- **Explicit minor release:** increment the minor version and reset the patch\n  component to zero only when the user explicitly requests a minor release\n  (`1.0.21+4362` → `1.1.0+4363`). The build number still increments normally.\n- **Build number:** always previous + 1. It only has to be unique and increasing\n  per tag — every release lane triggers on tag push, not on merges to `main` —\n  so it moves once per release, not once per pull request.\n\nIf the user named a version, use it. Otherwise propose one from what the\nfragments contain and confirm it.\n\n## 3. Assemble the CHANGELOG section\n\nFor a user-facing release, insert one new section at the top of `CHANGELOG.md`,\ndirectly under the Keep a Changelog preamble and above the previous version:\n\n```markdown\n## [1.0.22]\n### Added\n- **...**\n\n### Changed\n- **...**\n\n### Fixed\n- **...**\n```\n\n- **One section per type, in this order**: Added, Changed, Deprecated, Removed,\n  Fixed, Security. Skip the ones with no entries. Never repeat a heading inside\n  a version — older sections do, because entries used to be appended one PR at a\n  time; assembling from fragments is what fixes that.\n- **The version heading carries no date.** That is the file's existing shape.\n- Keep each entry's wording as the fragment wrote it, minus edits for\n  duplication, house voice, or an entry that reads oddly next to its neighbours.\n- Wrap at about 78 columns, continuation lines indented two spaces.\n\nFor a fix-only build release, add the new bullets to the current top semantic\nversion instead. Reuse its existing `### Fixed` heading, or create that heading\nin the normal section order if it does not have one. Never create a second\nversion section or a second `### Fixed` heading.\n\n## 4. Write the Flathub release block\n\nFor a user-facing release, add one `<release>` to\n`flatpak/com.matthiasn.lotti.metainfo.xml`, as the **first** child of\n`<releases>` — newest first:\n\n```xml\n<release version=\"1.0.22\" date=\"2026-08-25\">\n  <description>\n    <p>Fixed: ...</p>\n  </description>\n</release>\n```\n\nThis is the same prose, mechanically transformed. AppStream renders `<p>` as\nplain text: markdown does not survive it, and an unescaped `&` breaks the build.\n\nFor a fix-only build release, append the new `Fixed:` paragraphs to the\ndescription of the existing first `<release>` block and update that block's\ndate to the day the build is cut. Do not create a duplicate release block for\nthe unchanged semantic version.\n\n| In `CHANGELOG.md` | In the metainfo |\n|---|---|\n| one `- ` bullet | one `<p>`, same order as the section |\n| the `### Fixed` heading above it | the prefix `Fixed: ` on every paragraph in that section |\n| `- **Bold headline.** Detail…` | `Fixed: bold headline. Detail…` — bold markers dropped, first letter lowercased unless it is a proper noun (`Settings`, `Flathub`) |\n| hard-wrapped over several lines | one long line |\n| `—` or `–` | ` - ` |\n| `` `code` `` or a glyph like `•••` | plain words a user recognises — `\"...\"`, `the \"Location with the name CEST doesn't exist\" error` |\n| `&`, `<`, `>` | `&amp;`, `&lt;`, `&gt;` |\n\nWorked example, from 1.0.13:\n\n```markdown\n- **Daily habit reminders arrived hours late on iPhone, iPad and Android.** The\n  app could not work out which timezone the device was in, quietly settled for\n  UTC, and then built the reminder's time of day in UTC — so an 08:00 habit\n  reminder rang at 10:00 in Central European Summer Time.\n```\n\n```xml\n<p>Fixed: daily habit reminders arrived hours late on iPhone, iPad and Android. The app could not work out which timezone the device was in, quietly settled for UTC, and then built the reminder's time of day in UTC - so an 08:00 habit reminder rang at 10:00 in Central European Summer Time.</p>\n```\n\nThe `date` is the day the release is cut, `YYYY-MM-DD`.\n\n## 5. Bump the version\n\nOne line in `pubspec.yaml`:\n\n```yaml\nversion: 1.0.22+4363\n```\n\n## 6. Delete the fragments you consumed\n\n```bash\ngit rm changelog.d/[0-9]*.md       # fragments start with their date; README.md does not\n```\n\nEverything you just published goes. `changelog.d/` holding only its README is\nwhat \"nothing unreleased\" looks like; git history keeps the originals.\n\n## 7. Verify\n\n```bash\nmake changelog_check                                     # versions now agree\nxmllint --noout flatpak/com.matthiasn.lotti.metainfo.xml # if available\ngit status --short\n```\n\n`git status` must show exactly four kinds of change and nothing else:\n`CHANGELOG.md`, the metainfo, `pubspec.yaml`, and deleted fragments. A release\nPR that also carries code is a release PR that can conflict.\n\nRe-read the assembled section once as a user would. It is the text that reaches\nFlathub, the GitHub release and the app's What's New — it is read far more often\nthan it is written.\n\n## 8. Open the release pull request\n\nUse the semantic version in the title for a user-facing release:\n\n```\nchore(release): 1.0.22\n```\n\nUse the full version and build for a fix-only release so it is distinguishable\nfrom the release that first introduced that semantic version:\n\n```\nchore(release): 1.0.21+4363\n```\n\nBody: the entries assembled for this release, grouped under their release\nheadings, so review reads the new notes rather than the diff. For a fix-only\nrelease, label the body with the full version and build even though the\nchangelog heading remains the unchanged semantic version. No screenshots —\nnothing visual changed.\n\n## 9. Tag, after it merges\n\n```bash\ngit checkout main && git pull\nmake tag_push        # tags 1.0.22+4363 from pubspec.yaml and pushes it\n```\n\n`make tag_push` reads the version with `yq`; install it (`brew install yq`) or tag\nby hand with the exact `version+build` string if the target reports it missing.\n\nThe tag is what ships. Pushing it triggers, in parallel: macOS and iOS\nTestFlight, the Android release, the Linux GitHub release, the macOS signed\n`.dmg`, the Flathub submission PR against `flathub/com.matthiasn.lotti` —\nwhich is why the metainfo has to be right *before* the tag, not after — and\nthe manual of that version (`/manual/<x.y.z>/`, the one the app links to).\nA tag whose manual sources are unchanged publishes in a minute by reusing the\nprevious release's snapshot; otherwise the manual run recaptures all eleven\nlocales and takes about an hour.\n\nOn Google Play the release tag stops at internal testing. Moving that build on\nis a separate tag from the same commit, once the internal upload has finished:\n`make android_closed_testing` for closed testing, `make android_release` for\nproduction. Both promote the build Play already has rather than rebuilding it;\nthe mechanism is the *Google Play tracks* section of\n[`knowledge/architecture/platform-and-release.md`](../../../knowledge/architecture/platform-and-release.md).\n\nConfirm with the user before tagging. Watch the lanes; `docs/macos-release.md`\nand `docs/flatpak-flathub-recovery.md` cover the two that fail in interesting\nways.\n\n## 10. Downstream, and out of scope here\n\nThe app's **What's New** modal reads from the separate `matthiasn/lotti-docs`\nrepository (`whats-new/`), not from this one. Publishing there is an editorial\nstep in that repo — mention it once the release is tagged; do not attempt it\nfrom here.\n\n## Gotchas\n\n- **The metainfo lagging a version behind is invisible until Flathub ships it.**\n  `make changelog_check` fails on exactly that, which is why it runs in CI on\n  every push rather than only at release time.\n- **Tags carry the build number** (`1.0.14+4353`), and every release lane keys\n  on tag push. Re-tagging the same build number to fix a mistake will not give\n  you a fresh TestFlight build; bump the build number and cut again.\n- **Do not fold anything else into the release PR** — not a \"quick fix\", not a\n  dependency bump. The moment it carries code it can conflict, and the reason\n  this flow exists is gone.\n","frontmatter":{"name":"release","description":"Cut a Lotti release — assemble the changelog.d/ fragments into CHANGELOG.md and the Flathub metainfo, bump the version, open the release PR, then tag. Use when asked to cut or prepare a release, assemble the changelog, publish a new version, or work out what is unreleased."},"isInternal":false,"tokens":2736,"sizeBytes":10880},{"name":"openai.yaml","path":".claude/skills/add-flutter-docusaurus-locale/agents/openai.yaml","rawUrl":"https://raw.githubusercontent.com/matthiasn/lotti/HEAD/.claude/skills/add-flutter-docusaurus-locale/agents/openai.yaml","title":"Agents Skill","category":"anthropic-skill","format":"yaml","content":"# Agents Skill\n\nPath: `.claude/skills/add-flutter-docusaurus-locale/agents/openai.yaml`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/.claude/skills/add-flutter-docusaurus-locale/agents/openai.yaml)","tokens":300,"sizeBytes":237},{"name":"end-to-end-checklist.md","path":".claude/skills/add-flutter-docusaurus-locale/references/end-to-end-checklist.md","rawUrl":"https://raw.githubusercontent.com/matthiasn/lotti/HEAD/.claude/skills/add-flutter-docusaurus-locale/references/end-to-end-checklist.md","title":"References Skill","category":"anthropic-skill","format":"markdown","content":"# References Skill\n\nPath: `.claude/skills/add-flutter-docusaurus-locale/references/end-to-end-checklist.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/.claude/skills/add-flutter-docusaurus-locale/references/end-to-end-checklist.md)","tokens":300,"sizeBytes":273},{"name":"SKILL.md","path":".claude/skills/add-flutter-docusaurus-locale/SKILL.md","rawUrl":"https://raw.githubusercontent.com/matthiasn/lotti/HEAD/.claude/skills/add-flutter-docusaurus-locale/SKILL.md","title":"add-flutter-docusaurus-locale","category":"anthropic-skill","format":"markdown","content":"---\nname: add-flutter-docusaurus-locale\ndescription: Add, complete, or audit a locale across a Flutter application's ARB catalogs and a localized Docusaurus manual, including generated localization code, locale selectors, native platform declarations, translated MDX, screenshot fixtures, tests, and parity validation. Use when introducing a new language, finishing an incomplete app or manual translation, aligning manual terminology with UI strings, or reviewing whether a locale is production-ready end to end.\n---\n\n# Add a Flutter and Docusaurus Locale\n\nTreat a locale as an end-to-end product capability, not merely a translated ARB\nfile. Preserve message contracts and wire the locale through app runtime,\nplatform metadata, manual routing, screenshots, tests, and release validation.\n\n## Build the locale inventory\n\n1. Read repository instructions and localization/manual contributor guides.\n2. Identify the canonical ARB, all locale ARBs, `l10n.yaml`, generation and\n   sorting commands, localization access conventions, and missing-translation\n   report.\n3. Find every locale allowlist: app delegates/controllers, settings UI, native\n   platform metadata, Docusaurus config, screenshot registries, CI matrices,\n   and documentation.\n4. Inspect one recently added locale in version history as a completeness map,\n   but verify every location against current code.\n5. Read [references/end-to-end-checklist.md](references/end-to-end-checklist.md)\n   for platform and manual integration surfaces.\n\n## Translate the Flutter catalog\n\n1. Copy the complete key set from the canonical ARB, including required\n   metadata and `@@locale` conventions.\n2. Translate user-visible messages in context. Preserve ICU syntax, placeholder\n   names, escaping, line breaks with semantic meaning, and product names.\n3. Use the project's tone and register. Keep terminology consistent across\n   related screens; inspect call sites when a source message is ambiguous.\n4. Do not translate internal identifiers, URLs, format skeletons, or values the\n   framework treats as syntax.\n5. Add locale-specific canonical metadata only where the generator or project\n   requires it.\n6. Run the generator and catalog sorter. Never hand-edit generated Dart files.\n\n## Wire the app and platforms\n\n- Add the locale to runtime choices and language-override state.\n- Update visible language names using localized strings where the UI requires\n  them.\n- Add native supported-language declarations for every shipped platform that\n  maintains an explicit list.\n- Update screenshot locale helpers and deterministic visible fixture copy.\n- Add behavior-focused tests for locale parsing, selection, persistence,\n  delegates, and any locale-specific formatting or fallback behavior.\n\nDo not infer that generated `supportedLocales` completes native registration.\n\n## Translate and wire the Docusaurus manual\n\n1. Add the locale to Docusaurus `i18n.localeConfigs`, navigation labels, footer\n   labels, and any search or routing configuration.\n2. Create the standard docs plugin translation files and a complete localized\n   page tree matching the canonical docs paths.\n3. Reuse terms from the target ARB for buttons, settings, statuses, and feature\n   names. Translate the surrounding explanation naturally.\n4. Preserve MDX imports, components, props, links, code, identifiers, and\n   screenshot case IDs.\n5. Add the locale to screenshot registries and produce every required theme and\n   viewport variant using the project's deterministic harness.\n6. Update contributor documentation and public language lists that users see.\n\n## Audit and validate\n\nRun the bundled contract audit before project-specific generation:\n\n```bash\npython3 <skill-dir>/scripts/audit_locale.py \\\n  --template-arb path/to/app_en.arb \\\n  --target-arb path/to/app_xx.arb \\\n  --source-docs path/to/docs \\\n  --target-docs path/to/i18n/xx/docusaurus-plugin-content-docs/current\n```\n\nThe audit fails on missing/extra ARB keys, placeholder drift, and manual page\npath mismatch. Identical translated page bodies are warnings unless\n`--fail-identical` is passed.\n\nThen run, in repository order:\n\n1. localization generation and ARB sorting;\n2. targeted localization, locale-selection, screenshot-helper, and manual tests;\n3. formatter and static analysis with zero diagnostics;\n4. the full manual typecheck, validation, tests, production build, and smoke test;\n5. focused Flutter tests required by the repository;\n6. rendered review of representative long strings and every translated manual\n   route.\n\nDo not report the locale complete while generated output is stale, translation\ngaps remain, or required checks fail.\n","frontmatter":{"name":"add-flutter-docusaurus-locale","description":"Add, complete, or audit a locale across a Flutter application's ARB catalogs and a localized Docusaurus manual, including generated localization code, locale selectors, native platform declarations, translated MDX, screenshot fixtures, tests, and parity validation. Use when introducing a new language, finishing an incomplete app or manual translation, aligning manual terminology with UI strings, or reviewing whether a locale is production-ready end to end."},"isInternal":false,"tokens":942,"sizeBytes":4645},{"name":"SKILL.md","path":".claude/skills/analyze-db-logs/SKILL.md","rawUrl":"https://raw.githubusercontent.com/matthiasn/lotti/HEAD/.claude/skills/analyze-db-logs/SKILL.md","title":"analyze-db-logs","category":"anthropic-skill","format":"markdown","content":"---\nname: analyze-db-logs\ndescription: Analyze Drift / SQLite slow-query and super-slow-query logs against this app's known stall patterns (read waves, N+1, transaction scoping, MultiExecutor contention, WAL/OS factors)\nargument-hint: \"<path-to-logs-dir> [optional: date YYYY-MM-DD or relative window]\"\n---\n\n# Analyze DB Slow-Query Logs\n\nReads slow-query log files written by `lib/database/slow_query_logging.dart`\nand produces an actionable diagnosis grounded in this codebase's stack\n(Dart, Flutter, Drift, SQLite).\n\n## Invocation\n\nThe user provides the path to the log directory — typically a gitignored\nlocal copy they pulled off a device or simulator. Repository convention is\n`./logs/` at the repo root (already in `.gitignore`).\n\n```sh\n/analyze-db-logs ./logs/                       # most recent date in ./logs/\n/analyze-db-logs ./logs/desktop                # platform-scoped subdir\n/analyze-db-logs ./logs/mobile 2026-05-02      # specific date\n/analyze-db-logs /tmp/from-device              # any absolute path\n```\n\nTreat `$ARGUMENTS` as `<path> [optional date or window]`. The first\npositional must be the path; refuse with a one-line prompt if it is\nmissing — do NOT invent a default location, the user knows where their\nlogs are. Date is optional and defaults to \"the most recent file per\nstem found under that path\".\n\nAlways print the resolved paths and line counts before analysing, so the\nuser can confirm the right files are loaded.\n\n## Log file shapes\n\nThe `SlowQueryInterceptor.fileReporter` writes two daily files per\nplatform under whatever `documentsDirectoryPath/logs/` the running app\nresolved to. The user is responsible for copying them into the path they\nhand to this skill. Expect:\n\n- `slow_queries-YYYY-MM-DD.log` — every query above the configured\n  threshold (default 10ms; gated by `SlowQueryLoggingGate.isEnabled`).\n- `super_slow_queries-YYYY-MM-DD.log` — duplicates of queries above the\n  super-slow threshold (default 200ms), enriched with `EXPLAIN QUERY\n  PLAN` rows under `PLAN:` and (when first-call stack capture is on)\n  filtered application stack frames under `STACK:`.\n\n### Subdirectory layout\n\nBy convention this repo's `./logs/` contains one subdirectory per\nplatform — typically `desktop/` and `mobile/` (sometimes `ios/`,\n`android/`). Each subdir holds its own daily files. When the path the\nuser supplies is a directory that contains *only* subdirectories (no\n`*.log` files at its top level), treat each subdirectory as a separate\nplatform-scoped scan and label every finding with the subdir name so\nthe user can tell which device it came from.\n\nIf the user supplies a more specific path (e.g. `./logs/mobile/`),\nrespect that and don't go up a level. If they supply the parent and\nboth `desktop/` and `mobile/` are present, analyse both and produce one\nreport section per platform plus a brief cross-platform summary at the\nend.\n\nGlob discovery rule of thumb:\n\n```text\n<path>/{slow_queries,super_slow_queries}-*.log         # path is leaf\n<path>/*/{slow_queries,super_slow_queries}-*.log       # path is parent\n```\n\nPick the most recent date per `(subdir, stem)` pair unless a date arg\nis given.\n\n## Log line formats\n\nA slow-query line is a single line:\n\n```text\n2026-05-02T19:11:48.592 [db.sqlite] select 388.759ms args=0 SELECT * FROM ...\n```\n\nA super-slow entry is the same line plus indented continuation lines:\n\n```text\n2026-05-02T19:11:48.592 [db.sqlite] select 388.759ms args=0 SELECT ...\n  PLAN: 4|0|SEARCH journal USING INDEX idx_journal_browse (deleted=? AND type=?)\n  PLAN: 84|0|USE TEMP B-TREE FOR ORDER BY\n  STACK: #10     JournalDb.getAllDashboards (package:lotti/database/database.dart:3056:34)\n  STACK: #11     dashboardsProvider.<anonymous closure> (package:lotti/features/dashboards/state/dashboards_page_controller.dart:20:14)\n```\n\nThe interceptor filters `STACK:` lines to drop drift, dart-runtime,\nriverpod and the slow-query plumbing itself; only `package:lotti/...`\nframes remain.\n\n## Analysis procedure\n\n1. **Resolve the file set.** Honor the platform argument; pick the most\n   recent date per stem if no date is given. Tail-load the file (last\n   ~2000 lines is usually enough — the interceptor appends, so the wave\n   you care about is at the end). Print the resolved paths.\n\n2. **Bucket entries by query shape.** Collapse per-row args; group by\n   the normalized statement. For each bucket capture: count, p50/p95/max\n   elapsed, the unique `PLAN:` shapes, and the unique `STACK:` heads\n   (top app-code frame).\n\n3. **Diagnose against the known patterns below.** For every finding,\n   cite the specific log lines (timestamp + elapsed + statement\n   prefix). Do not generalize — show the data.\n\n4. **Recommend the fix.** Reference the existing seam (drift query,\n   coalescer, transaction wrapper, index, etc.) and where in the code\n   the change would land. If a fix is speculative, say so.\n\n## Known stall patterns to look for\n\nThese are battle-tested findings from this codebase. Apply them in order;\nthe first match is usually the dominant cost.\n\n### 1. Read waves — N queries reporting hundreds of ms but finishing in a tight burst\n\n**Signature**: a cluster of 10–20+ queries whose `elapsed` is roughly\nidentical (e.g., all in the 600–700ms band) but whose timestamps span\nonly 10–30ms. Each query's plan is fine; the SQL itself is fast.\n\n**Diagnosis**: the queries were *queued* behind something — typically a\nwrite transaction holding the writer lock, an `ANALYZE` on the boot\npath, or a slow `beforeOpen` hook. The wall-clock measurement starts\nwhen drift accepts the request, so queue wait shows up as \"elapsed\".\n\n**Confirm by**:\n- Check the `elapsed` band: a 100ms+ spread *across* the wave with\n  near-identical *finish* timestamps (use the leading ISO timestamp,\n  not the elapsed) means the queries unblocked together. The\n  interceptor strips drift / dart-runtime frames so the original\n  `STACK: #5 DatabaseConnectionUser.doWhenOpened` boilerplate is\n  *not* visible in the log — infer the gate from the timing pattern,\n  not from a frame name.\n- Look at the line *just before* the wave for a long-running write or\n  transaction.\n- Boot waves often correlate with `EntitiesCacheService.init` firing\n  `Future.wait` of definitions queries — the surviving `STACK:` heads\n  for the wave will point at distinct controllers / repositories\n  whose initial fetches all queued together.\n\n**Likely fixes**:\n- Move `ANALYZE` and other heavy work *off* the boot path (`beforeOpen`\n  must return fast).\n- Narrow transaction scopes (see pattern 4).\n- Raise the read pool size only after confirming isolate-spawn cost is\n  the bottleneck — bumping `readPool` adds isolate-spawn cost upfront.\n\n### 2. N+1 reads — a cluster of single-id selects from one call site\n\n**Signature**: many lines like\n`SELECT * FROM \"journal\" WHERE \"id\" = ? AND \"deleted\" = ?`, all from the\nsame `STACK:` head, all reporting nearly identical elapsed times.\n\n**Diagnosis**: a `Future.wait(ids.map(byId))` or a per-row provider\nfamily fanning out single-id reads. Each call queues through the read\npool independently.\n\n**Recurring offenders already fixed in this codebase**:\n- `taskLiveDataProvider` (FutureProvider.family per task) → solved by\n  `JournalDb._coalesceEntityById` (microtask-coalesced bulk fetch).\n- `LinkedAiResponsesController._fetch` → switched from `Future.wait` to\n  `journalRepository.getJournalEntitiesByIds(...)`.\n- `EditorStateService.init` drafts loop → switched to\n  `journalEntitiesByIdsUnorderedAllPrivate(idList)`.\n\n**Likely fixes**:\n- Replace fan-out with a bulk drift query (`journalEntitiesByIdsUnorderedAllPrivate`,\n  `getJournalEntitiesForIdsUnordered`, `linksForEntryIds`, etc.).\n- For Riverpod families that genuinely need per-row instances, route\n  through the existing entity-by-id microtask coalescer.\n\n### 3. Drift MultiExecutor contention — reads inside a transaction run on the writer\n\n**Reminder**: in drift, anything wrapped in `db.transaction(() async { ... })`\nruns on the *write* connection — even pure `select(...)` calls inside\nthe block. The read-pool isolates do NOT pick those up. So a\n`transaction { read; read; …; write; commit }` body serialises every\nread behind every other write that touches the same writer.\n\n**Confirm by**: look at the `STACK:` head for a frame inside an apply /\nupsert / migration path. If the read appears to hit a fast plan but\nelapsed is high and other writes are visible nearby, the read was\nforced onto the writer.\n\n**Likely fixes**:\n- Pull pre-read / post-write side effects *out* of the transaction\n  block.\n- Only wrap statements that genuinely need atomicity together.\n- Cross-DB writes (e.g., to `sync_db`, `settings_db`, `agent_db`,\n  `ai_config_db`) cannot be atomic with `JournalDb` writes anyway —\n  doing them inside a `JournalDb.transaction` only holds the journal\n  writer lock for unrelated work.\n\n### 4. Transaction scoping — broad wrappers around unrelated DB writes\n\n**Signature**: the same wave shape as pattern 1, but the suspected\n\"writer holding the lock\" is a sync apply that's logging a\n`SyncJournalEntity`-shaped write while *also* awaiting a\n`_sequenceLogService.recordReceivedEntry` (sync_db) or other cross-DB\nwork inside the same `transaction { ... }`.\n\n**Diagnosis**: this codebase fixed exactly this in\n`queue_apply_adapter.dart` via `_writesJournalDb(SyncMessage)` — the\nadapter now wraps in `JournalDb.transaction` *only* for payload\nfamilies that actually write to JournalDb tables (journal entity,\nentry link, entity definitions, outbox bundle, conservatively the\nbackfill request/response paths). Theming, ai-config, agent\nentity/link/bundle writes bypass the wrapper because they target\nother databases.\n\n`_persistJournalEntity` was also restructured: the pre-read\ndiagnostic `journalEntityById`, the post-write\n`_sequenceLogService.recordReceivedEntry` (`sync_db`), and the\nentry-exists check now run **outside** the narrow journal transaction.\n\n**When inspecting new code**: any new `db.transaction(() async { ... })`\nthat contains an `await` to a different database, a network call, or a\nfilesystem write is a candidate for narrowing.\n\n### 5. Wrong-index plans masquerading as slow SQL\n\n**Signature**: a single query reporting hundreds of ms with a plan\nthat includes `USE TEMP B-TREE FOR ORDER BY`, `SCAN <table>`, or an\nindex match where the leading column is not the most selective\npredicate.\n\n**Recurring offenders already fixed in shipped code** — verify these\nstill match the current `lib/database/database.drift`,\n`lib/database/sync_db.dart`, and `lib/database/database.dart` before\nciting them. Treat the list as historical context, not an asserted\ncurrent truth:\n- `task_priority_rank` ordering with high-cardinality\n  `category IN (...)` predicate. The fix shipped as a partial index\n  named (at the time) `idx_journal_tasks_status_priority_date`; if it\n  is still in `database.drift`, recommend it as the steady-state path,\n  otherwise treat the symptom as an open issue.\n- `getBulkLinkedTimeSpans` join over `linked_entries`. The fix shipped\n  as a covering index `idx_linked_entries_from_id_hidden_to_id`.\n- `inbound_event_queue` stats `MIN(enqueued_at)` SCAN. The fix shipped\n  as `idx_inbound_event_queue_status_enqueued` plus\n  `idx_inbound_event_queue_status_due_lease`.\n- `claimNextOutboxBatch` SCAN from\n  `status = pending OR (status = sending AND updated_at < cutoff)`.\n  The fix shipped as two indexed seeks merged in Dart.\n\nIf a query still matches one of these symptom shapes despite the named\nindex existing, suspect stale stats first (recommend `ANALYZE`) before\nproposing a new index.\n\n**When inspecting new logs**: if the plan is suboptimal, recommend\nrunning `ANALYZE` first (planner stats can drift); only after\nconfirming with fresh stats should you propose a new index. Bad plans\non a freshly-`ANALYZE`d DB are real index gaps.\n\n### 6. WAL / OS-level factors\n\nWhen patterns 1–5 don't explain a stall, consider:\n- **WAL checkpoint storms**: a write that crosses\n  `wal_autocheckpoint` (default 1000 pages, ~4MB) triggers a\n  checkpoint that briefly takes a more aggressive lock. Bursty write\n  workloads can stall reads at checkpoint boundaries.\n- **macOS sandboxed file locks**: `fcntl(F_FULLFSYNC)` and BSD locks\n  on iCloud-backed paths have shown long tails. Less likely on dev\n  but worth flagging.\n- **Background isolate spawn (`createInBackground(readPool: N)`)** —\n  isolates may spawn on first use; the *first* boot wave can pay\n  per-isolate setup cost (~50–200ms each). Subsequent app sessions\n  should be much faster — first wave is the worst case.\n- **`PRAGMA foreign_keys = ON`** runs per-connection; cheap but real.\n\n### 7. Per-launch repair / housekeeping that shouldn't run every boot\n\n**Signature**: an entry whose `STACK:` head points at a `beforeOpen`,\nself-heal, or migration helper — but the user just opened the app\nnormally. With `readPool: N`, drift calls `beforeOpen` on every\nconnection, so any repair work done there runs `1 + N` times per\nlaunch.\n\n**Lessons already applied in this codebase**:\n- Per-launch `ANALYZE` was removed — stats persist in `sqlite_stat1`\n  and the v42 migration runs `ANALYZE` once on upgrade.\n- The self-heal `CREATE INDEX IF NOT EXISTS` block was removed\n  entirely — the recovery path it covered targeted an aborted-migration\n  scenario that has not occurred in production.\n- `beforeOpen` is now just `PRAGMA foreign_keys = ON`.\n\nWhen you see boot-time housekeeping in a stack, ask: does this need\nto run on every launch, or once per upgrade?\n\n## Output format\n\nProduce a concise report, in this order:\n\n1. **Inputs** — paths read, line counts, date window.\n2. **Findings**, each with: severity (high/medium/low), pattern\n   matched (numbered above), evidence (specific log lines with\n   timestamps), root-cause hypothesis, and the file/seam where the\n   fix would land.\n3. **Recommended actions**, ordered by impact. Cite specific\n   call sites (`lib/...:line`) where possible.\n4. **Things you ruled out** (and why), so the user can sanity-check.\n\nKeep the report skimmable. If the log is mostly clean, say so — don't\nmanufacture findings.\n\n## Guardrails\n\n- **Never** propose schema bumps (`schemaVersion++`) without confirming\n  the v42-style migration shape and asking the user. New indices that\n  don't need a column change can land via migration; per-launch\n  defensive code should not.\n- **Never** propose a per-boot `ANALYZE`, `CREATE INDEX IF NOT EXISTS`\n  loop, or other \"self-heal on every open\" — this codebase explicitly\n  removed those.\n- **Don't assume** an `INDEXED BY` hint solves a planner problem. The\n  autoindex names (`sqlite_autoindex_*_1`) are not part of the public\n  SQLite contract; recommend `ANALYZE` first.\n- **Match real seams**: prefer adding fixes to existing patterns\n  (`_PendingEntityByIdWave` for entity-by-id coalescing,\n  `_PendingLinksWave` for to-id link batches, `_writesJournalDb` for\n  per-payload transaction scoping) over inventing new ones.\n- **Show your work**: every finding should cite specific log lines so\n  the user can verify.\n","frontmatter":{"name":"analyze-db-logs","description":"Analyze Drift / SQLite slow-query and super-slow-query logs against this app's known stall patterns (read waves, N+1, transaction scoping, MultiExecutor contention, WAL/OS factors)","argument-hint":"<path-to-logs-dir> [optional: date YYYY-MM-DD or relative window]"},"isInternal":false,"tokens":3695,"sizeBytes":15111},{"name":"SKILL.md","path":".claude/skills/app-screenshots/SKILL.md","rawUrl":"https://raw.githubusercontent.com/matthiasn/lotti/HEAD/.claude/skills/app-screenshots/SKILL.md","title":"app-screenshots","category":"anthropic-skill","format":"markdown","content":"---\nname: app-screenshots\ndescription: Capture in-app screenshots of a widget or flow at mobile + desktop sizes — offline, deterministic, real fonts and icons — using the reusable screenshot harness. Use when asked to \"show me X in the app\", \"screenshot this screen\", or to preview a UI change for review on phone vs desktop.\nargument-hint: \"<surface to capture, e.g. 'project create modal'>\"\n---\n\n# In-App Screenshots\n\nProduces PNGs of a widget or flow rendered inside the real app shell, at phone\nand desktop viewports, with real fonts and icons. It runs through\n`flutter test --update-goldens` — fully offline and deterministic — so it does\n**not** require a display, the GUI app, or driving the device.\n\nThis is a visualization tool, **not** a golden test: there are no committed\nreference images. You write a throwaway capture test, emit the PNGs, share\nthem, then delete the test. Nothing screenshot-related gets committed unless\nthe user explicitly asks to keep it.\n\n## When to use\n\n- \"Show me the <screen/modal/dialog> in app context.\"\n- \"What does this change look like on mobile vs desktop?\"\n- Previewing a UI change for design review.\n\nFor \"is this change actually wired up / does it behave correctly\", prefer the\n`run` skill (launches the real app). This skill is about *appearance*.\n\n## The harness\n\n`test/test_utils/screenshot_harness.dart` provides:\n\n- `loadAppFonts()` — loads every bundled font (app families + Material/Cupertino\n  icon fonts + icon-font packages) from `FontManifest.json`. Call once in\n  `setUpAll`. Without it, glyphs and icons render as boxes.\n- `screenshotTheme({bool dark = true})` — the production `withOverrides` theme\n  with `Inter` applied to the Material text themes (the bare test theme falls\n  back to an unbundled font otherwise).\n- `captureInApp(tester, {child, name, size, dark, devicePixelRatio, overrides, interaction, outputDir})`\n  — sizes the view, pumps `child` in the app shell, runs `interaction` (open a\n  modal, tap a FAB, focus a field…), then writes `<outputDir>/<name>.png`\n  relative to the **calling test file's** directory.\n- `ScreenshotViewport.phone` (390×844) and `ScreenshotViewport.desktop`\n  (1280×800).\n\n## Workflow\n\n1. **Find the surface and how to reach the state.** Identify the entry widget\n   (often a tab/page like `ProjectsTabPage`) and the tap/scroll needed to reach\n   the state to capture (e.g. tapping the FAB to open a modal). Reuse existing\n   widget tests for that surface to learn the required service registrations\n   and provider overrides — copy their `setUp`.\n\n2. **Write a throwaway capture test** at `test/_scratch_capture_test.dart`\n   (the `_scratch_` prefix marks it disposable). Use `setUpTestGetIt` +\n   `additionalSetup` for services the surface resolves through `getIt`, and\n   pass provider overrides via `captureInApp(overrides: ...)`. Drive the state\n   in `interaction`.\n\n3. **Generate the PNGs:**\n   ```sh\n   fvm flutter test --update-goldens test/_scratch_capture_test.dart\n   ```\n   Images land in `test/screenshots/` (the `outputDir`, next to the test).\n\n4. **View and share.** Read the PNGs to inspect them and give the user their\n   paths. For a PR's before/after pair, stage and publish them per\n   `knowledge/conventions/screenshots.md` before the cleanup step deletes\n   them.\n\n5. **Clean up** — this is mandatory unless the user asks to keep anything:\n   ```sh\n   rm test/_scratch_capture_test.dart && rm -rf test/screenshots\n   ```\n\n## Example capture test\n\n```dart\nimport 'package:flutter/material.dart';\nimport 'package:flutter_riverpod/flutter_riverpod.dart';\nimport 'package:flutter_riverpod/misc.dart'; // Override\nimport 'package:flutter_test/flutter_test.dart';\nimport 'package:lotti/classes/project_data.dart';\nimport 'package:lotti/features/projects/model/projects_overview_models.dart';\nimport 'package:lotti/features/projects/state/project_providers.dart';\nimport 'package:lotti/features/projects/ui/pages/projects_tab_page.dart';\nimport 'package:lotti/features/user_activity/state/user_activity_service.dart';\nimport 'package:lotti/get_it.dart';\nimport 'package:lotti/services/entities_cache_service.dart';\nimport 'package:lotti/services/nav_service.dart';\nimport 'package:mocktail/mocktail.dart';\n\nimport 'features/categories/test_utils.dart';\nimport 'features/projects/test_utils.dart';\nimport 'mocks/mocks.dart';\nimport 'test_utils/screenshot_harness.dart';\nimport 'widget_test_utils.dart';\n\nvoid main() {\n  setUpAll(loadAppFonts);\n\n  final groups = [\n    ProjectCategoryGroup(\n      categoryId: 'lotti',\n      category: CategoryTestUtils.createTestCategory(id: 'lotti', name: 'Lotti'),\n      projects: [\n        ProjectListItemData(\n          project: makeTestProject(id: 'p1', title: 'Daily Operating System'),\n          category: CategoryTestUtils.createTestCategory(id: 'lotti', name: 'Lotti'),\n          taskRollup: const ProjectTaskRollupData(totalTaskCount: 25),\n        ),\n      ],\n    ),\n  ];\n\n  List<Override> overrides() => [\n    projectsOverviewProvider.overrideWith(\n      (ref) => Stream.value(ProjectsOverviewSnapshot(groups: groups)),\n    ),\n    visibleProjectGroupsProvider.overrideWith((ref) => AsyncValue.data(groups)),\n  ];\n\n  setUp(() async {\n    await setUpTestGetIt(\n      additionalSetup: () {\n        final activity = MockUserActivityService();\n        when(activity.updateActivity).thenReturn(null);\n        getIt.registerSingleton<UserActivityService>(activity);\n\n        final nav = MockNavService();\n        when(() => nav.isDesktopMode).thenReturn(false);\n        when(() => nav.desktopSelectedProjectId)\n            .thenReturn(ValueNotifier<String?>(null));\n        getIt.registerSingleton<NavService>(nav);\n\n        final cache = MockEntitiesCacheService();\n        when(() => cache.getCategoryById(any())).thenReturn(null);\n        getIt.registerSingleton<EntitiesCacheService>(cache);\n      },\n    );\n  });\n  tearDown(tearDownTestGetIt);\n\n  Future<void> openCreate(WidgetTester tester) =>\n      tester.tap(find.bySemanticsLabel('New Project'));\n\n  testWidgets('phone', (tester) async {\n    await captureInApp(\n      tester,\n      child: const ProjectsTabPage(),\n      name: 'create_mobile',\n      overrides: overrides(),\n      interaction: openCreate,\n    );\n  });\n\n  testWidgets('desktop', (tester) async {\n    await captureInApp(\n      tester,\n      child: const ProjectsTabPage(),\n      name: 'create_desktop',\n      size: ScreenshotViewport.desktop,\n      overrides: overrides(),\n      interaction: openCreate,\n    );\n  });\n}\n```\n\n## Gotchas\n\n- **`Override` lives in `package:flutter_riverpod/misc.dart`** in this Riverpod\n  version — import it for the `List<Override>` type (separate from\n  `flutter_riverpod.dart`, which has `AsyncValue`).\n- **Register every service the surface touches** via `setUpTestGetIt`'s\n  `additionalSetup`, or the widget throws on a missing `getIt` registration.\n  Modals pull in their own deps (e.g. the create modal's `CategoryField` needs\n  `EntitiesCacheService`).\n- **Desktop layout is width-driven.** `captureInApp(size: ScreenshotViewport.desktop)`\n  sets both the view physical size and `MediaQuery`, so width-gated split\n  views (`isDesktopLayout`) and the dialog branch (modal page breakpoint)\n  engage correctly.\n- **Capture target is `find.byType(MaterialApp)`** so overlay content (modals,\n  dialogs, toasts) is included, not just the page body.\n- **Don't commit the scratch test or `test/screenshots/`.** Delete them when\n  done. The harness itself is the only permanent artifact.\n","frontmatter":{"name":"app-screenshots","description":"Capture in-app screenshots of a widget or flow at mobile + desktop sizes — offline, deterministic, real fonts and icons — using the reusable screenshot harness. Use when asked to \"show me X in the app\", \"screenshot this screen\", or to preview a UI change for review on phone vs desktop.","argument-hint":"<surface to capture, e.g. 'project create modal'>"},"isInternal":false,"tokens":1745,"sizeBytes":7516},{"name":"SKILL.md","path":".claude/skills/design-review-panel/SKILL.md","rawUrl":"https://raw.githubusercontent.com/matthiasn/lotti/HEAD/.claude/skills/design-review-panel/SKILL.md","title":"design-review-panel","category":"anthropic-skill","format":"markdown","content":"---\nname: design-review-panel\ndescription: Run a multi-agent design review on a UI surface — capture reproducible baseline screenshots, then rate them with a panel of design experts (one agent per craft dimension) and, optionally, a panel of user personas with different cognitive styles. Iterate implement → re-screenshot → re-rate until every panel hits a numeric target (e.g. avg ≥8/10). Use when polishing or redesigning a screen/modal/dialog and the user wants grounded, scored design feedback (\"summon the design panel\", \"rate this with the experts\", \"run the persona panel\").\nargument-hint: \"<surface to review, e.g. 'AI popup model picker'>\"\n---\n\n# Design Review Panel\n\nA repeatable, grounded process for design polish and redesign work. It pairs\ntwo parallel agent panels — **design experts** (craft dimensions) and,\noptionally, **user personas** (cognitive styles) — and drives them against\n**real screenshots the agents actually `Read`**, iterating to a numeric target.\n\nThis is how the user wants UI/design tasks run. The numeric target is the\nsuccess condition: keep iterating until both panel averages clear the bar\n(the workflow's `cleared` flag).\n\n## The loop\n\n```mermaid\nstateDiagram-v2\n    [*] --> Baseline\n    Baseline --> RateBaseline: capture reproducible PNGs (app-screenshots)\n    RateBaseline --> Implement: both panels score the current state\n    Implement --> Rescreenshot: apply highest-leverage fixes (design-system tokens only)\n    Rescreenshot --> Rerate: regenerate the SAME shots\n    Rerate --> Implement: either panel average < target\n    Rerate --> Harden: both panel averages ≥ target\n    Harden --> [*]: tests, l10n, README, changelog.d fragment, analyzer clean, PR\n```\n\n1. **Baseline screenshot first.** Use the `app-screenshots` skill / the\n   `test/test_utils/screenshot_harness.dart` `captureInApp` harness to render\n   the surface at phone **and** desktop, dark (add light + large-text shots\n   when accessibility is in scope). Reproducible PNGs are mandatory — the\n   panels are only as honest as the pixels they read.\n2. **Rate the baseline with BOTH panels up front.** Get grounded starting\n   scores before changing anything. Never carry over scores from a previous\n   session — re-rate on a freshly regenerated PNG every time (grounded\n   re-rating reliably deflates inflated prior numbers).\n3. **Iterate with the expert panel** until experts clear the bar. Bring the\n   persona panel into the loop once experts reach ≥8 so the two converge\n   together. Each iteration: implement → regenerate the exact same screenshots\n   → re-rate.\n4. **Adjudicate genuine tradeoffs with the user** (`AskUserQuestion`) instead\n   of silently picking a side — before declaring a conflict irreducible, hunt\n   for a both-sides fix (one change that serves two opposed reviewers).\n5. **Harden to PR-ready** once converged: tests, l10n, feature README, a\n   `changelog.d/` fragment (never `CHANGELOG.md` or the flatpak metainfo\n   directly — those belong to the release), analyzer zero-warning, formatter,\n   PR on latest main.\n\n## The two panels\n\n### Design-expert panel (always)\nOne agent per craft dimension. Default lenses (adapt to the surface):\n- **Visual hierarchy / IA** — what reads primary/secondary/tertiary; scent.\n- **Design-system consistency** — tokens, spacing rhythm, component reuse;\n  does the surface feel like ONE system or bolted-together parts.\n- **Color / contrast / semantics** — palette restraint, status-by-more-than-color.\n- **Typography** — ramp, weight contrast, measure, rhythm.\n- **Spacing / density / rhythm** — padding, alignment, optical balance.\n- **Interaction / task-flow** — taps-to-goal, affordances, dead-ends, the\n  \"1-tap to the common case\" promise.\n\n### User-persona panel (on by default — pass `includePersonas: false` to skip)\nDifferent cognitive styles stress the surface as real users:\n- **ADHD / clutter-sensitive** — needs \"what now\" instant; abandons noise.\n- **Power user** — counts seconds, allergic to wasted space/steps.\n- **Low-vision / low-confidence** — large text, strong contrast, fears\n  irreversible taps.\n- **Minimalist aesthete** — wants calm, uniform, restrained.\n- **Non-technical novice / second-language** — reads copy literally; jargon\n  and ambiguous labels break them.\n\nPersonas return a **verdict** (would-use / would-struggle / would-abandon) plus\nblockers / frictions / delights. Experts return a **1–10 score** per surface\nplus severity-tagged issues with evidence + a concrete fix.\n\n## Grounding rules (give these to every agent verbatim)\n- **`Read` every screenshot path.** Base every visual claim on actual pixels.\n  Panels hallucinate failures when they don't — forbid it.\n- **No invented measurements.** Don't fabricate px gaps or contrast ratios; if\n  you can't measure it, describe it qualitatively and tie it to something\n  visible.\n- **Every issue carries evidence** — a named screenshot (\"picker_desktop: …\")\n  or a `file:line`. Code claims (e.g. \"hardcodes spacing\") require Reading the\n  file and citing the line.\n- **Grumpy, calibrated scoring:** 10 = ship-grade, nothing to fix; 8 = good,\n  only polish left; 6 = usable but rough; 4 = several real problems; ≤3 =\n  broken. Do not be generous.\n- **List test-rig artifacts to IGNORE** (stand-in nav bars, tofu glyphs,\n  folded-hour bands) so the panel doesn't score the harness.\n\n## Running it\n\nDrive both panels as a `Workflow` so the agents run in parallel and return\nstructured scores. A parameterized reference script lives next to this file:\n**`panel_workflow.js`** — pass `args` describing the surface, screenshot paths,\nsource files, expert lenses, personas, and `includePersonas` /\n`target`. Adapt the lenses and persona prompts to the surface; keep the schema\nand the iterate-to-target loop.\n\n```\nWorkflow({ scriptPath: \".claude/skills/design-review-panel/panel_workflow.js\", args: { ...see file header... } })\n```\n\nRead the returned synthesis, apply the must-fixes, regenerate the same\nscreenshots, and re-run until the returned `cleared` is `true` (both panel\naverages meet the `target`). Then delete the scratch capture test and\n`test/screenshots/` (per the app-screenshots skill) unless the user asks to\nkeep them.\n\n## See also\n- `app-screenshots` — the reproducible capture harness this skill depends on.\n- `AskUserQuestion` — for adjudicating genuine, irreducible design tradeoffs.\n","frontmatter":{"name":"design-review-panel","description":"Run a multi-agent design review on a UI surface — capture reproducible baseline screenshots, then rate them with a panel of design experts (one agent per craft dimension) and, optionally, a panel of user personas with different cognitive styles. Iterate implement → re-screenshot → re-rate until every panel hits a numeric target (e.g. avg ≥8/10). Use when polishing or redesigning a screen/modal/dialog and the user wants grounded, scored design feedback (\"summon the design panel\", \"rate this with the experts\", \"run the persona panel\").","argument-hint":"<surface to review, e.g. 'AI popup model picker'>"},"isInternal":false,"tokens":1500,"sizeBytes":6429},{"name":"openai.yaml","path":".claude/skills/maintain-docusaurus-manual/agents/openai.yaml","rawUrl":"https://raw.githubusercontent.com/matthiasn/lotti/HEAD/.claude/skills/maintain-docusaurus-manual/agents/openai.yaml","title":"Agents Skill","category":"anthropic-skill","format":"yaml","content":"# Agents Skill\n\nPath: `.claude/skills/maintain-docusaurus-manual/agents/openai.yaml`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/.claude/skills/maintain-docusaurus-manual/agents/openai.yaml)","tokens":300,"sizeBytes":231},{"name":"discovery-and-review.md","path":".claude/skills/maintain-docusaurus-manual/references/discovery-and-review.md","rawUrl":"https://raw.githubusercontent.com/matthiasn/lotti/HEAD/.claude/skills/maintain-docusaurus-manual/references/discovery-and-review.md","title":"References Skill","category":"anthropic-skill","format":"markdown","content":"# References Skill\n\nPath: `.claude/skills/maintain-docusaurus-manual/references/discovery-and-review.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/.claude/skills/maintain-docusaurus-manual/references/discovery-and-review.md)","tokens":300,"sizeBytes":267},{"name":"SKILL.md","path":".claude/skills/maintain-docusaurus-manual/SKILL.md","rawUrl":"https://raw.githubusercontent.com/matthiasn/lotti/HEAD/.claude/skills/maintain-docusaurus-manual/SKILL.md","title":"maintain-docusaurus-manual","category":"anthropic-skill","format":"markdown","content":"---\nname: maintain-docusaurus-manual\ndescription: Maintain a Docusaurus product manual whose prose, navigation, localized page trees, screenshots, coverage metadata, and release build must stay aligned with the application. Use when adding or revising manual pages, documenting a product change, updating translated MDX, repairing locale parity, adding registered screenshots, auditing stale documentation, or validating a multilingual Docusaurus site before publication.\n---\n\n# Maintain a Docusaurus Manual\n\nTreat the running product and source code as authoritative. Keep documentation,\ntranslations, navigation, screenshots, inventories, and generated site behavior\nconsistent in the same change.\n\n## Discover the project contract\n\n1. Read the repository instructions and the manual's own contributor guide.\n2. Locate the Docusaurus config, source docs, localized docs, sidebar, package\n   scripts, validation scripts, screenshot registry, coverage inventory, and CI.\n3. Identify the canonical locale, supported locales, URL/version scheme, and\n   whether localized pages may fall back or must have exact path parity.\n4. Locate app strings or another terminology source before translating UI names.\n5. Read [references/discovery-and-review.md](references/discovery-and-review.md)\n   when the repository has custom inventories, generated screenshots, or\n   versioned publishing.\n\nDo not assume conventional paths when the repository declares its own.\n\n## Update the manual\n\n1. Verify the current product behavior from implementation and focused tests.\n2. Update the canonical page with concrete, task-oriented prose. Describe only\n   controls, states, limitations, and workflows that exist.\n3. Preserve stable frontmatter identifiers, component calls, links, anchors,\n   admonitions, and code unless the change intentionally modifies them.\n4. Add new pages to navigation and every repository-owned coverage or surface\n   inventory.\n5. Update every published locale required by the project. Translate meaning,\n   not sentence shape; preserve product terminology from the localized app.\n6. Record questionable product wording separately unless changing UI copy is\n   explicitly in scope.\n\n## Handle screenshots as evidence\n\n- Prefer the repository's deterministic screenshot harness and registry.\n- Capture the real production widget or route with representative state.\n- Keep required locale, viewport, and theme variants complete.\n- Reference screenshots through the site's component or registry rather than\n  hard-coded media URLs when such an abstraction exists.\n- Keep generated media outside the source repository when that is the declared\n  architecture.\n\nIf the task is only a one-off application screenshot, use the repository's\nscreenshot skill instead of extending the manual pipeline.\n\n## Validate in increasing scope\n\n1. Run the bundled parity audit when the site uses standard Docusaurus locale\n   trees:\n\n   ```bash\n   python3 <skill-dir>/scripts/audit_docusaurus_locales.py \\\n     --site-root path/to/site\n   ```\n\n   Pass `--fail-identical` only when identical localized page bodies are\n   forbidden. Treat its default identical-page output as a review warning.\n\n2. Run focused repository validators and tests for touched metadata or helpers.\n3. Run type checking, link/content validation, unit tests, and the production\n   Docusaurus build through repository scripts.\n4. Smoke-test built routes, locale switching, assets, search, and base URLs.\n5. Review the rendered page at representative widths and in every changed\n   locale. A successful build does not prove prose accuracy or layout quality.\n\nDo not claim completion while required checks fail. Report any validation that\ncould not run and why.\n","frontmatter":{"name":"maintain-docusaurus-manual","description":"Maintain a Docusaurus product manual whose prose, navigation, localized page trees, screenshots, coverage metadata, and release build must stay aligned with the application. Use when adding or revising manual pages, documenting a product change, updating translated MDX, repairing locale parity, adding registered screenshots, auditing stale documentation, or validating a multilingual Docusaurus site before publication."},"isInternal":false,"tokens":717,"sizeBytes":3718},{"name":"SKILL.md","path":".claude/skills/review-comments/SKILL.md","rawUrl":"https://raw.githubusercontent.com/matthiasn/lotti/HEAD/.claude/skills/review-comments/SKILL.md","title":"review-comments","category":"anthropic-skill","format":"markdown","content":"---\nname: review-comments\ndescription: Fetch PR review comments, address each one in code, and post resolution replies\nargument-hint: \"[pr-number]\"\n---\n\n# Review PR Comments\n\nFetch all review comments from a pull request, address each one (fix code, add\ndocs, or explain the rationale), and reply to each comment on GitHub with the\nresolution.\n\n## Steps\n\n1. **Fetch comments** — use `gh api` to get all review comments:\n   ```bash\n   gh api repos/{owner}/{repo}/pulls/$ARGUMENTS/comments \\\n     --jq '.[] | {id, path, line, body, in_reply_to_id}'\n   ```\n   Filter to top-level comments only (`in_reply_to_id == null`) — those are the\n   ones that need responses.\n\n2. **Understand each comment** — read the referenced file and line to understand\n   the concern. Group related comments if they touch the same issue.\n\n3. **Address each comment** — make the appropriate code change (fix, refactor,\n   add docs, add tests). If you disagree with a suggestion, prepare a clear\n   rationale.\n\n4. **Reply to each comment** — post a reply using:\n   ```bash\n   gh api repos/{owner}/{repo}/pulls/$ARGUMENTS/comments -X POST \\\n     -f body=\"<resolution>\" \\\n     -F in_reply_to=<comment-id>\n   ```\n   Keep replies concise: state what was done (e.g., \"Fixed. Replaced generic\n   fallback with explicit throw.\") or explain why it was left as-is.\n\n5. **Close every codecov gap — target 100% patch coverage.** The Codecov bot\n   posts a PR comment/check; treat its uncovered lines as review comments that\n   MUST be resolved with tests. **Every line codecov marks uncovered has to be\n   covered — no exceptions for \"pre-existing\" files.** If a file shows up in the\n   PR diff with uncovered lines, cover them even if you didn't write them.\n\n   a. **Find what's actually uncovered.** The bot summary only gives totals;\n      pull the per-line data from the Codecov API and intersect it with the\n      PR's added lines (this is exactly what `codecov/patch` scores):\n      ```bash\n      # Per-line diff coverage (head_cov == 0 → miss):\n      curl -s \"https://api.codecov.io/api/v2/github/{owner}/repos/{repo}/compare?pullid=$ARGUMENTS\" \\\n        > /tmp/cc.json\n      # Then: for each file with has_diff, list lines where\n      #   coverage.head == 0 && is_diff, and intersect with the file's\n      #   git-diff added-line numbers (git diff --unified=0 origin/main...HEAD).\n      ```\n      Codecov ignores are in `codecov.yml` (`*.g.dart`, `*.freezed.dart`,\n      `l10n/*.dart` here) — skip those.\n\n   b. **Codecov is often stale/partial — trust local coverage for new code.**\n      Coverage is sharded; if any shard failed or the run is mid-flight, the\n      bot shows a partial picture (e.g. \"1% of diff\") that inflates the miss\n      list with trivial lines (`@override`, const ctors). Regenerate locally\n      and intersect with the git-diff added lines for the authoritative set:\n      ```bash\n      fvm flutter test --coverage <the test dirs that exercise the diff>\n      # parse coverage/lcov.info: DA:<line>,0 == uncovered\n      ```\n      Run enough test dirs that every diff file is genuinely exercised (a file\n      covered only by tests you didn't run shows as a false miss).\n\n   c. **Write real tests for each uncovered line** — mirror the sibling case\n      already tested (e.g. a new `.map`/`switch` arm → copy the `aiConfig`\n      case for `savedTaskFilter`; a debounce-cancel line → emit *two*\n      notifications so the timer is non-null when cancelled). Extend\n      parameterized `variantCases`/`variantsByBucket` tables rather than\n      duplicating whole test bodies.\n\n   d. **Uncoverable private-ctor lines** (`const FooKeys._();` in a static-only\n      keys class) can't be hit and dart coverage ignores no inline comment —\n      convert the class to `abstract final class FooKeys { ... }` so the\n      constructor line disappears entirely.\n\n   e. **Re-run coverage until the (added ∩ uncovered) set is empty**, then run\n      the affected suites to confirm still-green.\n\n6. **Verify** — run analyzer and affected tests to confirm all changes compile\n   and pass.\n\n7. **Babysit the PR until it is actually done.** Opening a PR and replying once\n   is not the end of the job. A PR is finished only when all three hold at the\n   same time:\n\n   - **mergeable** — `gh pr view <n> --json mergeable` is `MERGEABLE`\n   - **all green** — every check passed, not merely \"not failing\": zero\n     `pending` and zero failures, including `codecov/patch`\n   - **all replied** — every top-level review comment has a reply, with a real\n     fix or a stated reason for declining\n\n   **Pushing requires authorization.** Commits, rebases and pushes need\n   explicit user or orchestrator approval (AGENTS.md, \"Issue Tracking\").\n   Being asked to *address review comments* authorizes the\n   code changes, not the push — confirm before the first push of a session,\n   and never force-push a branch you did not create in this session.\n   `--force-with-lease` guards against clobbering a concurrent update; it is\n   not a substitute for approval.\n\n   Reviews arrive *after* pushes, so pushing fixes restarts the loop: the\n   reviewer re-reviews the new commit and may file new findings. Bots also\n   rate-limit and arrive late (CodeRabbit will say \"next review available in\n   N minutes\" and skip the run entirely). Keep watching until the three\n   conditions hold together.\n\n   Poll on the structured status rather than the display columns — the table\n   format is human-facing, and a failed API or auth call prints to stderr and\n   would otherwise read as \"no pending checks\".\n\n   Note `gh pr checks` has **no** `--json` flag (checked on gh 2.45); the\n   structured source is `gh pr view --json statusCheckRollup`. Verify whatever\n   command you poll with actually works *before* wrapping it in an `until`\n   loop: a command that errors makes the loop exit immediately and every\n   subsequent report a lie.\n\n   For a CheckRun, `status` is the lifecycle (`COMPLETED`) and `conclusion`\n   carries the verdict (`SUCCESS` / `FAILURE` / `CANCELLED`) — a failed check\n   is `COMPLETED`, so keying on `status` alone reports a red run as done and\n   green. Read the conclusion for completed checks and the state for\n   StatusContexts:\n\n   ```bash\n   # one \"<verdict>\\t<name>\" line per check; empty output means the query\n   # failed, not that everything passed — so treat it as not-done.\n   rollup() {\n     gh pr view \"$1\" --json statusCheckRollup --jq '\n       .statusCheckRollup[]\n       | if .status == \"COMPLETED\" then .conclusion\n         elif .status then .status\n         else .state end\n       + \"\\t\" + (.name // .context)'\n   }\n   # Capture once per iteration and check the exit status: an errored or\n   # empty result is \"not done\", never \"done and green\".\n   while :; do\n     out=$(rollup <n>) || { echo \"poll failed\"; sleep 30; continue; }\n     [ -n \"$out\" ] || { echo \"empty rollup — treating as not done\"; sleep 30; continue; }\n     printf '%s\\n' \"$out\" | grep -qE '^(IN_PROGRESS|QUEUED|PENDING)' || break\n     sleep 30\n   done\n   bad=$(printf '%s\\n' \"$out\" | grep -vE '^(SUCCESS|NEUTRAL|SKIPPED)')\n   [ -z \"$bad\" ] && echo \"all green (${#out} bytes of verdicts)\" || printf '%s\\n' \"$bad\"\n   ```\n\n   Three ways these snippets lie if written casually, all worth guarding:\n   an errored command inside `$( )` yields empty output that a\n   `grep -q pending` reads as \"nothing pending\"; `grep … || echo \"all green\"`\n   turns *no output at all* into a pass; and a background poller whose result\n   is never collected lets the summary be written before it finishes. Capture\n   the output, check the status, and `wait` for the poller before reporting.\n\n   Cross-check the total against `gh pr checks <n>` before declaring green —\n   a poller that exits on its first iteration otherwise reports \"settled\"\n   while checks are still queued.\n\n   Run that in the background (`run_in_background: true`, or `… &` with the\n   PID kept) so replying to comments proceeds concurrently rather than\n   blocking on CI.\n\n   Then re-check for comments filed against the new commits — including\n   top-level ones with no reply yet:\n\n   `gh api` returns **one page (30 comments)** unless `--paginate` is passed,\n   and `--jq` then runs per page — so a comment and its reply landing on\n   different pages makes an answered comment look unanswered, and a comment on\n   a later page look absent. Fetch every page and aggregate once with `jq -s`:\n\n   ```bash\n   # `set -o pipefail` so an API failure fails the pipeline instead of\n   # producing an empty list that reads as \"nothing unanswered\".\n   ( set -o pipefail\n     gh api --paginate repos/{owner}/{repo}/pulls/<n>/comments --jq '.[]' | jq -s -r '\n       [.[] | select(.in_reply_to_id != null) | .in_reply_to_id] as $replied\n       | [.[] | select(.in_reply_to_id == null)] as $top\n       | \"top-level: \\($top | length), answered: \\([$top[] | select(.id as $i | $replied | index($i))] | length)\",\n         ($top[] | select(.id as $i | ($replied | index($i)) | not)\n          | \"UNANSWERED \\(.id) \\(.user.login) \\(.path)\")'\n   ) || echo \"comment query FAILED — do not report all-replied\"\n   ```\n\n   Print the counted totals, not just the unanswered lines: \"top-level: 26,\n   answered: 22\" is checkable, whereas empty output is indistinguishable from\n   a query that never ran.\n\n   Post replies with `-F body=@file` rather than an inline shell string.\n   Review bodies contain backticks, quotes and code fences; nested shell\n   quoting silently mangles them, and a failed POST inside a loop can still\n   look like it succeeded.\n\n   Report the real state — \"27 pass, 1 pending\" is the honest answer while a\n   check is still running, not \"all green\".\n\n## Guidelines\n\n- Address every comment.\n- Make real code fixes, not just reply text.\n- Run the analyzer and formatter after all fixes.\n- Run affected tests to verify fixes.\n- Keep reply text concise and factual.\n- If a comment is from a bot review (e.g., CodeRabbit, Gemini), still address\n  valid points but use your judgement on noise.\n- Coverage is not optional: every codecov-flagged line in the diff must end up\n  covered (goal 100% patch), pre-existing or not. Prefer real behavioural tests;\n  only restructure code (e.g. `abstract final class`) for genuinely\n  uncoverable lines.\n","frontmatter":{"name":"review-comments","description":"Fetch PR review comments, address each one in code, and post resolution replies","argument-hint":"[pr-number]"},"isInternal":false,"tokens":2598,"sizeBytes":10308},{"name":"SKILL.md","path":".claude/skills/skeptical-review/SKILL.md","rawUrl":"https://raw.githubusercontent.com/matthiasn/lotti/HEAD/.claude/skills/skeptical-review/SKILL.md","title":"skeptical-review","category":"anthropic-skill","format":"markdown","content":"---\nname: skeptical-review\ndescription: Act as a skeptical senior engineer performing a detailed code review of the latest changes on the current branch (or a given PR) — best practices, maintainability, performance, security, and readability. Objective and concise; only real issues, with a clear \"no issues\" verdict when the code is clean. Replaces CodeRabbit / Gemini Code Review.\nargument-hint: \"[optional: PR number, base branch, or path scope]\"\n---\n\n# Skeptical Senior Engineer Review\n\nYou are a skeptical senior engineer performing a detailed, professional code\nreview. The bar is a practical, fair assessment a maintainer can act on\ndirectly, not a wall of generated nitpicks.\n\n## Ground rules (non-negotiable)\n\n- **Be objective and concise** — only point out real issues or suboptimal\n  practices you can defend with a concrete failure mode or maintenance cost.\n- **If the code follows best practices and there are no issues, say so\n  clearly.** Do not invent imaginary problems to look thorough. \"This diff is\n  clean\" is a valid and valuable review outcome.\n- **For each issue**, briefly explain *why* it's a problem and suggest a\n  better approach or concrete improvement.\n- **Focus on** clarity, structure, code style, logic, and efficiency —\n  correctness first, then maintainability, performance, security,\n  readability.\n- **Avoid nitpicking** minor style differences unless they impact clarity or\n  maintainability. The analyzer and formatter already police style; don't\n  duplicate them.\n- **Review the diff, not the whole file** — but read enough surrounding code\n  to judge the change in context. Never flag something as missing without\n  first checking whether it exists elsewhere in the codebase.\n\n## Scoping the diff\n\nTreat `$ARGUMENTS` as optional. Resolve what to review in this order:\n\n1. **PR number given** (e.g. `/skeptical-review 3413`) — fetch the PR diff\n   via `gh pr diff <n>` and `gh pr view <n>` for title/description context.\n2. **Base branch given** (e.g. `/skeptical-review develop`) — diff the\n   current branch against that base.\n3. **Path scope given** (e.g. `/skeptical-review lib/features/ai`) — limit\n   the branch diff to that path.\n4. **No arguments** — review the current branch's latest changes:\n   `git diff main...HEAD` **plus** uncommitted work\n   (`git diff HEAD` and untracked files via `git status`). Say explicitly\n   which of the two buckets each finding falls in when both exist.\n\nBefore reviewing, print a one-paragraph scope statement: branch, base,\nnumber of files/insertions/deletions, and a one-line summary of what the\nchange is trying to do (from commit messages / PR description). If the diff\nis empty, say so and stop.\n\nSkip generated files (`*.g.dart`, `*.freezed.dart`, `lib/l10n/app_localizations_*.dart`)\nexcept to verify they were regenerated when their sources changed. Treat\n`third_party/` as vendored: review it lighter — flag only correctness and\nsecurity issues, not style, and note divergence-from-upstream risk instead.\n\n## Review dimensions\n\nWork through the diff with these lenses, in this priority order:\n\n1. **Correctness & logic** — off-by-one, null/async races, wrong operator,\n   state not reset, error paths swallowed, edge cases (empty list, first\n   run, migration), broken invariants between files that changed together.\n2. **Maintainability & structure** — duplication that should be extracted,\n   wrong layer (business logic in widgets, UI concerns in repositories),\n   dead code added, public API surface grown without need, missing or\n   now-stale docstrings on touched functions.\n3. **Performance** — unnecessary rebuilds (missing `const`, provider\n   over-watching), N+1 queries, work in `build()` that belongs in a\n   provider/controller, unbounded growth (caches, listeners never disposed,\n   stream subscriptions leaked).\n4. **Security & privacy** — secrets or tokens in code/logs, injection into\n   SQL/shell/URLs, sensitive journal data written to logs or synced when it\n   shouldn't be, permissions widened.\n5. **Readability** — misleading names, comments that restate code or will\n   rot, control flow that needs a rewrite to be followed (only when it\n   genuinely impairs the next reader — see nitpick rule above).\n\n## Project-specific checks (Lotti)\n\nThis repo has house rules; a change violating them is a real finding, not a\nnitpick. Verify against `AGENTS.md` (authoritative) — highlights:\n\n- **Tests**: one test file per source file, mirrored paths; centralized\n  mocks (`test/mocks/mocks.dart`), fallbacks, and `makeTestableWidget` /\n  `setUpTestGetIt` helpers; no `Future.delayed`/`sleep`/real timers; no\n  `DateTime.now()`; meaningful assertions only (`findsOneWidget` alone is\n  not a test). New/changed behavior in `lib/` without matching test changes\n  is worth flagging.\n- **l10n**: no hardcoded user-visible strings; new labels added to every\n  full catalog in `lib/l10n/`, with `app_en_GB.arb` getting an entry only\n  where British spelling differs (list, exception and register rules in\n  `knowledge/conventions/localization.md`); generated l10n Dart files never\n  hand-edited.\n- **Design system**: no raw spacing numbers, `TextStyle` constructors, or\n  ad-hoc colors — tokens (`tokens.spacing.*`, `tokens.typography.*`,\n  `tokens.colors.*`) are mandatory in UI code.\n- **UI stability**: async providers must not flash loading/empty shells on\n  background refresh (`skipLoadingOnReload` or equivalent).\n- **Docs & release hygiene**: feature READMEs updated when behavior\n  changed; a release note as a new `changelog.d/YYYY-MM-DD-slug.md` fragment\n  (only for user-visible changes). A PR that edits `CHANGELOG.md`, the flatpak\n  metainfo, or the `version:` line in `pubspec.yaml` is a finding, not a\n  courtesy — those three belong to the release alone.\n- **Conventions**: Conventional Commits; no dependencies from new code onto\n  old code being replaced; no hoarded/unused code.\n\nDo not re-run the analyzer or tests as part of the review by default — this\nis a reading review. If a finding hinges on runtime behavior you cannot\ndetermine by reading (e.g. \"does this provider rebuild?\"), say so and mark\nthe finding as needing verification rather than asserting it.\n\n## Output format\n\nDeliver the review as a single final message:\n\n1. **Verdict line** — one sentence: overall assessment (e.g. \"Solid change\n   with two real issues and one suggestion\" or \"Clean — no issues found\").\n2. **Scope statement** — the paragraph described above.\n3. **Findings**, ordered by severity, each formatted as:\n\n   ```text\n   ### <severity> — <one-line summary>\n   `path/to/file.dart:123`\n   Why it's a problem: <one or two sentences>\n   Suggestion: <concrete fix or better approach; short code sketch if it helps>\n   ```\n\n   Severity levels: **Blocker** (must fix before merge — bugs, security,\n   data loss), **Should fix** (real maintainability/performance cost),\n   **Consider** (worthwhile improvement, author's call). Do not pad lower\n   tiers to seem thorough — an empty tier is fine.\n4. **What's done well** — one short paragraph max, only if genuinely\n   noteworthy (patterns worth repeating), never as filler praise.\n\nKeep the whole review proportional to the diff: a 20-line diff gets a short\nreview. If the real issues would make a long list, the change needs a rewrite\nconversation, not a list; say that instead.\n\n## What NOT to do\n\n- Do not modify any code. This skill is read-only; if the user wants fixes\n  applied, they will ask after reading the review.\n- Do not flag issues in code the diff merely touches adjacent to (moved\n  lines, re-indentation) — pre-existing problems may be *mentioned* once,\n  clearly labeled \"pre-existing, out of scope\".\n- Do not restate the diff's contents as findings (\"this adds a provider\")\n  — every finding must carry a judgment.\n- Do not hedge to inflate counts: if you're unsure it's a problem, either\n  verify by reading more code or drop it.\n","frontmatter":{"name":"skeptical-review","description":"Act as a skeptical senior engineer performing a detailed code review of the latest changes on the current branch (or a given PR) — best practices, maintainability, performance, security, and readability. Objective and concise; only real issues, with a clear \"no issues\" verdict when the code is clean. Replaces CodeRabbit / Gemini Code Review.","argument-hint":"[optional: PR number, base branch, or path scope]"},"isInternal":false,"tokens":1875,"sizeBytes":7957},{"name":"SKILL.md","path":".claude/skills/tutorial-videos/SKILL.md","rawUrl":"https://raw.githubusercontent.com/matthiasn/lotti/HEAD/.claude/skills/tutorial-videos/SKILL.md","title":"tutorial-videos","category":"anthropic-skill","format":"markdown","content":"---\nname: tutorial-videos\ndescription: Build, debug, extend, localize, or publish the automated tutorial videos — the workbench that drives the real Linux app under Xvfb (virtual mic, live Voxtral transcription, task-agent proposals), records the screen, narrates with Gemini or ElevenLabs TTS, fast-forwards waits, composes MP4s via OpenMontage, and uploads finished videos to Cloudflare R2 for docs-site embedding. Use when asked to \"build/regenerate the tutorial video(s)\", add a tutorial scenario, add a tutorial locale, fix a broken tutorial run, adapt the pipeline, or upload/publish a video.\nargument-hint: \"<what to do, e.g. 'build de+en', 'add scenario X', 'debug the failing run'>\"\n---\n\n# Tutorial Video Workbench\n\nArchitecture and rationale live in `tools/tutorial_videos/README.md` — read\nit first. This skill is the operational runbook.\n\n## Build videos\n\n```sh\nmake tutorial_video TUTORIAL_LOCALE=de                       # one locale (~5-8 min)\nmake tutorial_video TUTORIAL_LOCALE=de TUTORIAL_DEVICE=mobile # phone-shaped window, `_mobile`-suffixed output\nmake tutorial_videos_all                                     # all TUTORIAL_LOCALES\n```\n\n`TUTORIAL_DEVICE` (`desktop`|`mobile`, default `desktop`) picks the capture\nwindow size — see the README's \"Desktop vs. mobile\" section for the\nbreakpoint rationale and the `tutorialDeviceIsMobile()` test hook.\n\nPreconditions (fail fast if missing):\n- `.env` at repo root with `GEMINI_API_KEY`, `MELIOUS_API_KEY`,\n  `MELIOUS_BASE_URL`. If absent, the keys can be extracted from the dev\n  app's `ai_config.sqlite` provider rows (never print or commit them).\n  `ELEVENLABS_API_KEY` too when narrating with ElevenLabs\n  (`--tts-engine elevenlabs`) — that one is not in the app's config, ask\n  the user for it.\n- Sibling `../OpenMontage` checkout at the commit pinned in\n  `tools/tutorial_videos/config/openmontage.pin`, bootstrapped via\n  `make -C ../OpenMontage setup`.\n- `Xvfb`, `ffmpeg`, `pactl`, `paplay`, `x11-utils` installed; Flutter via\n  `fvm`.\n\nOutput lands in `build/tutorial_videos/<scenario>_<locale>.mp4`. Verify with\nframe extraction (`ffmpeg -ss <t> -frames:v 1`) and check: cursor visible and\ngliding, HUD clock top-center, transcript/proposals on screen, narration\naudible at step starts (`volumedetect`), duration ≈ warped timeline total.\n\n## Publish to R2\n\n```sh\nmake tutorial_video_publish TUTORIAL_SCENARIO=create_task_from_audio TUTORIAL_LOCALE=de\nmake tutorial_video_publish TUTORIAL_SCENARIO=create_task_from_audio TUTORIAL_LOCALE=de TUTORIAL_DEVICE=mobile\n```\n\nUploads `build/tutorial_videos/<scenario>_<locale>.mp4` (or, with\n`TUTORIAL_DEVICE=mobile`, `<scenario>_<locale>_mobile.mp4`) to Cloudflare R2\nat the matching `tutorial-videos/...` key and prints its public r2.dev URL —\nthis is the URL the docs-site `TutorialVideo` component builds from\n`TUTORIAL_VIDEO_BASE_URL`/`tutorialVideoBaseUrl`. `TUTORIAL_DEVICE` must\nmatch whatever `--device` the video was built with, or publish will look for\na file that was never produced. Full one-time Cloudflare setup (API token,\nenabling the bucket's public r2.dev URL) and the `.env` variable list are in\nthe README's \"Publishing to Cloudflare R2\" section — read it before the\nfirst publish.\n\n`boto3` (needed only by publish, not by build/tts/validate) is not installed\ninto the system Python on this host (PEP 668). Either run publish through\n`tools/tutorial_videos/.venv` (`.venv/bin/python3 -m tutorial_videos publish\n--scenario ... --locale ...`, created via `python3 -m venv .venv &&\n.venv/bin/pip install boto3 pyyaml`), or install `boto3` into whatever\nPython `make tutorial_video_publish` resolves to.\n\n## The pipeline in one paragraph\n\n`python3 -m tutorial_videos build` (run from `tools/tutorial_videos/`) does:\nTTS pre-pass (Gemini by default, `--tts-engine elevenlabs` to switch; cached by content hash → durations manifest) → Xvfb +\nvirtual-mic null sink + ffmpeg x11grab capture → `fvm flutter drive` runs\n`integration_test/tutorial/<scenario>_tutorial_test.dart` against the real\napp (penguin demo world + Melious/Voxtral/Qwen agent config seeded, UI\nlanguage via `MANUAL_LANGUAGE` settings row) → the test emits\n`timeline.json` (step boundaries, wait spans, zero epoch) → `timewarp.py`\nplans fast-forward segments for the waits (narration never overlaps) →\n`compose.py` warps the capture and drives the pinned OpenMontage headlessly\n(narration placement + mux) → ffprobe validation.\n\n## Debugging a failing run\n\n1. The run log tail shows the failing step and a `Diagnostics:` line\n   (current route, detail stack, key widget presence).\n2. **Look at the failure screenshot first**:\n   `build/tutorial_videos/failure_<context>.png` is captured at the moment of\n   every timeout — it almost always explains the failure instantly.\n3. Reproduce faster without video: run the same test via `flutter drive`\n   directly (see the doc comment in\n   `integration_test/tutorial/tutorial_harness.dart` for the env contract);\n   Xvfb + sink setup must match `session.py`.\n4. Common causes, in order of historical frequency: a finder matching an\n   offstage duplicate (scope to the visible page + `.hitTestable()`), a\n   scroll helper given a non-vertical scrollable, a modal/dialog blocking\n   the UI (onboarding, discard-recording), the agent's\n   `automaticUpdatesEnabled` flag not sticking (set-and-verify), cloud\n   latency beyond a `pumpUntil` timeout.\n\n## Adding a locale\n\n1. Add the locale's text to\n   `tools/tutorial_videos/config/scenarios/<scenario>.yaml`: `title`,\n   `dictionary`, every step's `narration`, the dictation step's\n   `dictation_text`. Write informal register (du/tu) per repo l10n rules;\n   keep the penguin vocabulary.\n2. Add per-stream `style` lines for the locale under `engines.gemini` in\n   `config/voices.yaml` (style prompts in the target language —\n   Voxtral/Gemini behave better). ElevenLabs needs nothing per locale, as\n   long as `eleven_multilingual_v2` supports the language.\n3. `python3 -m tutorial_videos validate --scenario <s> --locale <l>` must\n   pass, then build. The app UI localizes itself via `LOTTI_MANUAL_LOCALE`\n   (same mechanism as manual screenshots; for a wholly new app locale, run\n   the `add-flutter-docusaurus-locale` skill first).\n4. Localized finder strings in the test (`localized(en:, de:)` /\n   `manualScreenshotText`) need the new locale only if its UI labels are\n   used as finders — prefer keys over text finders where possible.\n\n## Adding a scenario\n\n1. New YAML in `config/scenarios/<name>.yaml` — schema documented in\n   `create_task_from_audio.yaml` (unique step ids, exactly one\n   `dictation: true` step, per-locale text, `min_duration` floors).\n2. New `integration_test/tutorial/<name>_tutorial_test.dart` built on\n   `TutorialAppHarness` + `TutorialDriver`. Copy the structure of\n   `create_task_from_audio_tutorial_test.dart`:\n   - one `driver.step(id, action)` per YAML step, ids matching exactly;\n   - interactions via `driver.tapLikeUser` (cursor glide), waits via\n     `driver.pumpUntil*` (records fast-forwardable wait spans), scrolling\n     via `driver.scrollIntoView` with a **vertical** scrollable finder;\n   - anything that must be SEEN gets asserted via visible widgets, not just\n     the DB;\n   - wire the `diagnostics` and `onTimeout` hooks for failure screenshots.\n3. Iterate with builds; expect the first runs to fail — read the failure\n   screenshots, they carry the answer.\n\n## Non-negotiable gotchas\n\nThe full list with rationale is in the README's \"Hard-won constraints\" —\nthe ones that bite hardest: `flutter drive` not `flutter test` (no window\notherwise); `GDK_BACKEND=x11` + empty `WAYLAND_DISPLAY` (or the app opens on\nthe real desktop); Voxtral prompts in the audio's language (else it\ntranslates); `automaticUpdatesEnabled` set-and-verify (initial wake clobbers\nearly writes); 16ms pump cadence during holds (else animations render\nchoppy); timeline starts after startup settles; assert transcript keywords,\nnot exact strings.\n\n## Adapting / extending\n\n- **App Store preview**: `config/scenarios/app_store_preview.yaml` is the\n  narration of `make store_preview_ios`, not a tutorial — never\n  `make tutorial_video` it. Its step ids must stay the `_beatIds` of\n  `integration_test/store_preview_test.dart` (`tests/test_app_preview.py`\n  guards it), and all four lines together must leave the beats under 30 s\n  (`python3 -m tutorial_videos.app_preview pacing` fails first if not).\n  See the README's \"The App Store preview reuses the narration\".\n- **Compositor changes**: all OpenMontage API usage is isolated in\n  `tutorial_videos/om_compose_driver.py`; bump the pin in\n  `config/openmontage.pin` deliberately and re-verify determinism\n  (compose twice, compare `ffmpeg -f framemd5` of the streams — never file\n  hashes).\n- **TTS vendor**: implement the `TtsEngine` protocol (`tts/base.py`) next to\n  `tts/gemini.py` and `tts/elevenlabs.py`, register it with its `.env` key\n  in `tts/engines.py`, and give it an `engines.<name>` block (model + both\n  streams) in `config/voices.yaml`. Voices: switch ElevenLabs ones by\n  changing the voice id there; the README's \"TTS engines\" has the details.\n- **Speed/pacing knobs**: `timewarp.py` (`MAX_SPEED`, lead-in, narration\n  gap); per-step floors in the scenario YAML.\n- **Talking avatar**: `make tutorial_video TUTORIAL_AVATAR=1` (or `build\n  --avatar`) lays the scenario's avatar into the top-right corner of the\n  finished video, lip-synced to the narrator clips only — never the\n  dictation. It acts, not just talks: nods on stresses, a head tilt per\n  phrase, brow lifts, breathing, and in pauses it watches the app\n  (`tutorial_videos/avatar/acting.py`; tune there, check with\n  `avatar-preview`). Characters live in `tutorial_videos/avatar/characters.py`\n  (`CHARACTERS`): Pip the penguin by default, Theo for any scenario whose\n  YAML says `avatar: theo` (the onboarding does); `--avatar-character`\n  overrides it for one build, `--character` picks it for the two avatar\n  commands. `--avatar-position` / `avatar-overlay --position` move it to\n  another corner; `avatar-overlay --video <built mp4>` adds it to an\n  already-built video as `<stem>_avatar.mp4`; `avatar-preview --wav <wav>`\n  renders the character alone — check any art change at badge size with it\n  first.\n  See the README's \"Talking avatar\".\n","frontmatter":{"name":"tutorial-videos","description":"Build, debug, extend, localize, or publish the automated tutorial videos — the workbench that drives the real Linux app under Xvfb (virtual mic, live Voxtral transcription, task-agent proposals), records the screen, narrates with Gemini or ElevenLabs TTS, fast-forwards waits, composes MP4s via OpenMontage, and uploads finished videos to Cloudflare R2 for docs-site embedding. Use when asked to \"build/regenerate the tutorial video(s)\", add a tutorial scenario, add a tutorial locale, fix a broken tutorial run, adapt the pipeline, or upload/publish a video.","argument-hint":"<what to do, e.g. 'build de+en', 'add scenario X', 'debug the failing run'>"},"isInternal":false,"tokens":2634,"sizeBytes":10343},{"name":"app_store_preview.yaml","path":"tools/tutorial_videos/config/scenarios/app_store_preview.yaml","rawUrl":"https://raw.githubusercontent.com/matthiasn/lotti/HEAD/tools/tutorial_videos/config/scenarios/app_store_preview.yaml","title":"Scenarios Skill","category":"anthropic-skill","format":"yaml","content":"# Scenarios Skill\n\nPath: `tools/tutorial_videos/config/scenarios/app_store_preview.yaml`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/tools/tutorial_videos/config/scenarios/app_store_preview.yaml)","tokens":300,"sizeBytes":236},{"name":"category_setup.yaml","path":"tools/tutorial_videos/config/scenarios/category_setup.yaml","rawUrl":"https://raw.githubusercontent.com/matthiasn/lotti/HEAD/tools/tutorial_videos/config/scenarios/category_setup.yaml","title":"Scenarios Skill","category":"anthropic-skill","format":"yaml","content":"# Scenarios Skill\n\nPath: `tools/tutorial_videos/config/scenarios/category_setup.yaml`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/tools/tutorial_videos/config/scenarios/category_setup.yaml)","tokens":300,"sizeBytes":230},{"name":"create_task_from_audio.yaml","path":"tools/tutorial_videos/config/scenarios/create_task_from_audio.yaml","rawUrl":"https://raw.githubusercontent.com/matthiasn/lotti/HEAD/tools/tutorial_videos/config/scenarios/create_task_from_audio.yaml","title":"Scenarios Skill","category":"anthropic-skill","format":"yaml","content":"# Scenarios Skill\n\nPath: `tools/tutorial_videos/config/scenarios/create_task_from_audio.yaml`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/tools/tutorial_videos/config/scenarios/create_task_from_audio.yaml)","tokens":300,"sizeBytes":246},{"name":"onboarding_first_run.yaml","path":"tools/tutorial_videos/config/scenarios/onboarding_first_run.yaml","rawUrl":"https://raw.githubusercontent.com/matthiasn/lotti/HEAD/tools/tutorial_videos/config/scenarios/onboarding_first_run.yaml","title":"Scenarios Skill","category":"anthropic-skill","format":"yaml","content":"# Scenarios Skill\n\nPath: `tools/tutorial_videos/config/scenarios/onboarding_first_run.yaml`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/tools/tutorial_videos/config/scenarios/onboarding_first_run.yaml)","tokens":300,"sizeBytes":242},{"name":"task_coding_prompt.yaml","path":"tools/tutorial_videos/config/scenarios/task_coding_prompt.yaml","rawUrl":"https://raw.githubusercontent.com/matthiasn/lotti/HEAD/tools/tutorial_videos/config/scenarios/task_coding_prompt.yaml","title":"Scenarios Skill","category":"anthropic-skill","format":"yaml","content":"# Scenarios Skill\n\nPath: `tools/tutorial_videos/config/scenarios/task_coding_prompt.yaml`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/tools/tutorial_videos/config/scenarios/task_coding_prompt.yaml)","tokens":300,"sizeBytes":238},{"name":"task_cover_art.yaml","path":"tools/tutorial_videos/config/scenarios/task_cover_art.yaml","rawUrl":"https://raw.githubusercontent.com/matthiasn/lotti/HEAD/tools/tutorial_videos/config/scenarios/task_cover_art.yaml","title":"Scenarios Skill","category":"anthropic-skill","format":"yaml","content":"# Scenarios Skill\n\nPath: `tools/tutorial_videos/config/scenarios/task_cover_art.yaml`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/tools/tutorial_videos/config/scenarios/task_cover_art.yaml)","tokens":300,"sizeBytes":230},{"name":"task_filters.yaml","path":"tools/tutorial_videos/config/scenarios/task_filters.yaml","rawUrl":"https://raw.githubusercontent.com/matthiasn/lotti/HEAD/tools/tutorial_videos/config/scenarios/task_filters.yaml","title":"Scenarios Skill","category":"anthropic-skill","format":"yaml","content":"# Scenarios Skill\n\nPath: `tools/tutorial_videos/config/scenarios/task_filters.yaml`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/tools/tutorial_videos/config/scenarios/task_filters.yaml)","tokens":300,"sizeBytes":226},{"name":"voices.yaml","path":"tools/tutorial_videos/config/voices.yaml","rawUrl":"https://raw.githubusercontent.com/matthiasn/lotti/HEAD/tools/tutorial_videos/config/voices.yaml","title":"Config Skill","category":"anthropic-skill","format":"yaml","content":"# Config Skill\n\nPath: `tools/tutorial_videos/config/voices.yaml`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/tools/tutorial_videos/config/voices.yaml)","tokens":300,"sizeBytes":191},{"name":"audit_locale.py","path":".claude/skills/add-flutter-docusaurus-locale/scripts/audit_locale.py","rawUrl":"https://raw.githubusercontent.com/matthiasn/lotti/HEAD/.claude/skills/add-flutter-docusaurus-locale/scripts/audit_locale.py","title":"Claude Directive: audit_locale.py","category":"claude-rule","format":"markdown","content":"# Claude Directive: audit_locale.py\n\nPath: `.claude/skills/add-flutter-docusaurus-locale/scripts/audit_locale.py`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/.claude/skills/add-flutter-docusaurus-locale/scripts/audit_locale.py)","tokens":300,"sizeBytes":268},{"name":"panel_workflow.js","path":".claude/skills/design-review-panel/panel_workflow.js","rawUrl":"https://raw.githubusercontent.com/matthiasn/lotti/HEAD/.claude/skills/design-review-panel/panel_workflow.js","title":"Claude Directive: panel_workflow.js","category":"claude-rule","format":"markdown","content":"# Claude Directive: panel_workflow.js\n\nPath: `.claude/skills/design-review-panel/panel_workflow.js`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/.claude/skills/design-review-panel/panel_workflow.js)","tokens":300,"sizeBytes":238},{"name":"audit_docusaurus_locales.py","path":".claude/skills/maintain-docusaurus-manual/scripts/audit_docusaurus_locales.py","rawUrl":"https://raw.githubusercontent.com/matthiasn/lotti/HEAD/.claude/skills/maintain-docusaurus-manual/scripts/audit_docusaurus_locales.py","title":"Claude Directive: audit_docusaurus_locales.py","category":"claude-rule","format":"markdown","content":"# Claude Directive: audit_docusaurus_locales.py\n\nPath: `.claude/skills/maintain-docusaurus-manual/scripts/audit_docusaurus_locales.py`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/.claude/skills/maintain-docusaurus-manual/scripts/audit_docusaurus_locales.py)","tokens":300,"sizeBytes":298},{"name":"README.md","path":"tools/matrix_provisioner/README.md","rawUrl":"https://raw.githubusercontent.com/matthiasn/lotti/HEAD/tools/matrix_provisioner/README.md","title":"matrix_provisioner Documentation","category":"plugin-manifest","format":"markdown","content":"# matrix_provisioner Documentation\n\nPath: `tools/matrix_provisioner/README.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/tools/matrix_provisioner/README.md)","tokens":300,"sizeBytes":199},{"name":"README.md","path":"tools/tutorial_videos/README.md","rawUrl":"https://raw.githubusercontent.com/matthiasn/lotti/HEAD/tools/tutorial_videos/README.md","title":"tutorial_videos Documentation","category":"plugin-manifest","format":"markdown","content":"# tutorial_videos Documentation\n\nPath: `tools/tutorial_videos/README.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/tools/tutorial_videos/README.md)","tokens":300,"sizeBytes":190},{"name":"chat-input-and-reasoning.md","path":"knowledge/features/agents/chat-input-and-reasoning.md","rawUrl":"https://raw.githubusercontent.com/matthiasn/lotti/HEAD/knowledge/features/agents/chat-input-and-reasoning.md","title":"Subagent: chat-input-and-reasoning","category":"subagent-persona","format":"markdown","content":"# Subagent: chat-input-and-reasoning\n\nPath: `knowledge/features/agents/chat-input-and-reasoning.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/knowledge/features/agents/chat-input-and-reasoning.md)","tokens":300,"sizeBytes":239},{"name":"index.md","path":"knowledge/features/agents/index.md","rawUrl":"https://raw.githubusercontent.com/matthiasn/lotti/HEAD/knowledge/features/agents/index.md","title":"Subagent: index","category":"subagent-persona","format":"markdown","content":"# Subagent: index\n\nPath: `knowledge/features/agents/index.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/knowledge/features/agents/index.md)","tokens":300,"sizeBytes":182},{"name":"memory-and-compaction.md","path":"knowledge/features/agents/memory-and-compaction.md","rawUrl":"https://raw.githubusercontent.com/matthiasn/lotti/HEAD/knowledge/features/agents/memory-and-compaction.md","title":"Subagent: memory-and-compaction","category":"subagent-persona","format":"markdown","content":"# Subagent: memory-and-compaction\n\nPath: `knowledge/features/agents/memory-and-compaction.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/knowledge/features/agents/memory-and-compaction.md)","tokens":300,"sizeBytes":230},{"name":"overview.md","path":"knowledge/features/agents/overview.md","rawUrl":"https://raw.githubusercontent.com/matthiasn/lotti/HEAD/knowledge/features/agents/overview.md","title":"Subagent: overview","category":"subagent-persona","format":"markdown","content":"# Subagent: overview\n\nPath: `knowledge/features/agents/overview.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/knowledge/features/agents/overview.md)","tokens":300,"sizeBytes":191},{"name":"persistence-and-sync.md","path":"knowledge/features/agents/persistence-and-sync.md","rawUrl":"https://raw.githubusercontent.com/matthiasn/lotti/HEAD/knowledge/features/agents/persistence-and-sync.md","title":"Subagent: persistence-and-sync","category":"subagent-persona","format":"markdown","content":"# Subagent: persistence-and-sync\n\nPath: `knowledge/features/agents/persistence-and-sync.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/knowledge/features/agents/persistence-and-sync.md)","tokens":300,"sizeBytes":227},{"name":"project-and-event-agents.md","path":"knowledge/features/agents/project-and-event-agents.md","rawUrl":"https://raw.githubusercontent.com/matthiasn/lotti/HEAD/knowledge/features/agents/project-and-event-agents.md","title":"Subagent: project-and-event-agents","category":"subagent-persona","format":"markdown","content":"# Subagent: project-and-event-agents\n\nPath: `knowledge/features/agents/project-and-event-agents.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/knowledge/features/agents/project-and-event-agents.md)","tokens":300,"sizeBytes":239},{"name":"projection.md","path":"knowledge/features/agents/projection.md","rawUrl":"https://raw.githubusercontent.com/matthiasn/lotti/HEAD/knowledge/features/agents/projection.md","title":"Subagent: projection","category":"subagent-persona","format":"markdown","content":"# Subagent: projection\n\nPath: `knowledge/features/agents/projection.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/knowledge/features/agents/projection.md)","tokens":300,"sizeBytes":197},{"name":"query-chat.md","path":"knowledge/features/agents/query-chat.md","rawUrl":"https://raw.githubusercontent.com/matthiasn/lotti/HEAD/knowledge/features/agents/query-chat.md","title":"Subagent: query-chat","category":"subagent-persona","format":"markdown","content":"# Subagent: query-chat\n\nPath: `knowledge/features/agents/query-chat.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/knowledge/features/agents/query-chat.md)","tokens":300,"sizeBytes":197},{"name":"task-agents.md","path":"knowledge/features/agents/task-agents.md","rawUrl":"https://raw.githubusercontent.com/matthiasn/lotti/HEAD/knowledge/features/agents/task-agents.md","title":"Subagent: task-agents","category":"subagent-persona","format":"markdown","content":"# Subagent: task-agents\n\nPath: `knowledge/features/agents/task-agents.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/knowledge/features/agents/task-agents.md)","tokens":300,"sizeBytes":200},{"name":"templates-souls-evolution.md","path":"knowledge/features/agents/templates-souls-evolution.md","rawUrl":"https://raw.githubusercontent.com/matthiasn/lotti/HEAD/knowledge/features/agents/templates-souls-evolution.md","title":"Subagent: templates-souls-evolution","category":"subagent-persona","format":"markdown","content":"# Subagent: templates-souls-evolution\n\nPath: `knowledge/features/agents/templates-souls-evolution.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/knowledge/features/agents/templates-souls-evolution.md)","tokens":300,"sizeBytes":242},{"name":"ui-surfaces.md","path":"knowledge/features/agents/ui-surfaces.md","rawUrl":"https://raw.githubusercontent.com/matthiasn/lotti/HEAD/knowledge/features/agents/ui-surfaces.md","title":"Subagent: ui-surfaces","category":"subagent-persona","format":"markdown","content":"# Subagent: ui-surfaces\n\nPath: `knowledge/features/agents/ui-surfaces.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/knowledge/features/agents/ui-surfaces.md)","tokens":300,"sizeBytes":200},{"name":"wake-orchestration.md","path":"knowledge/features/agents/wake-orchestration.md","rawUrl":"https://raw.githubusercontent.com/matthiasn/lotti/HEAD/knowledge/features/agents/wake-orchestration.md","title":"Subagent: wake-orchestration","category":"subagent-persona","format":"markdown","content":"# Subagent: wake-orchestration\n\nPath: `knowledge/features/agents/wake-orchestration.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/knowledge/features/agents/wake-orchestration.md)","tokens":300,"sizeBytes":221},{"name":"README.md","path":"lib/features/agents/projection/README.md","rawUrl":"https://raw.githubusercontent.com/matthiasn/lotti/HEAD/lib/features/agents/projection/README.md","title":"Subagent: readme","category":"subagent-persona","format":"markdown","content":"# Subagent: readme\n\nPath: `lib/features/agents/projection/README.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/lib/features/agents/projection/README.md)","tokens":300,"sizeBytes":195},{"name":"README.md","path":"lib/features/agents/README.md","rawUrl":"https://raw.githubusercontent.com/matthiasn/lotti/HEAD/lib/features/agents/README.md","title":"Subagent: readme","category":"subagent-persona","format":"markdown","content":"# Subagent: readme\n\nPath: `lib/features/agents/README.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/lib/features/agents/README.md)","tokens":300,"sizeBytes":173}],"systemPromptSnippet":"<yakaai_skills repo=\"matthiasn/lotti\">\n<!-- File: AGENTS.md (Tokens: ~4258 | Category: root-instruction) -->\n# Repository Guidelines\n\n## Project Structure & Module Organization\n- `lib/` — Flutter/Dart source (features, services, widgets). Do not edit generated files (`*.g.dart`, `*.freezed.dart`).\n- `test/` and `integration_test/` — unit and integration tests; keep test files as `*_test.dart`.\n- `assets/` — images, icons, and other static assets.\n- Platform targets: `android/`, `ios/`, `macos/`, `linux/`, `windows/`.\n- Tooling & CI: `Makefile`, `.buildkite/`, `analysis_options.yaml`, `l10n.yaml`.\n- Localization: `lib/l10n/*.arb` with `missing_translations.txt` for gaps.\n\n## Build, Test, and Development Commands\n- Install deps: `make deps` (runs through FVM when `fvm` is installed).\n- Static analysis: `make analyze` (Very Good Analysis rules).\n- Unit tests + coverage: `make test` • HTML report: `make coverage`.\n- Code generation: `make build_runner` • Watch mode: `make watch`.\n- Localization generation: `make l10n` (prints missing translations) • Sort ARB: `make sort_arb_files`.\n- Run locally: `fvm flutter run -d macos` (or `flutter run -d <device>`).\n- Integration tests: `make integration_test`.\n- Packaging (examples): `make ios`, `make macos`, or `make bundle` (see Makefile for more).\n\n## Coding Style & Naming Conventions\n- Follow `analysis_options.yaml` (Very Good Analysis). 2‑space indent, prefer `const` and `final`.\n- Files: `lower_snake_case.dart`; types (classes/enums): `PascalCase`; members: `lowerCamelCase`.\n- Keep hand-written files in `lib/` at or below 1,000 lines. `test/architecture/file_size_ratchet_test.dart` fails on a new file above that, and holds the files already above it at their current size (`file_size_baseline.json`): put new code in a file of its own, and lower or delete an entry when a file shrinks.\n- Imports in `lib/` follow the layer order in `tool/architecture/layer_guard.dart` (`make layer_check`): no feature imports one ranked above it, `lib/classes`, `database`, `services`, `logic` and `utils` import no feature, non-UI code never imports another feature's UI, and nothing below the shell imports it (the service locator excepted, which `tool/di` counts). Existing breaks are baselined and may only shrink — move the shared type down or invert the dependency rather than adding one.\n- Format before committing: `fvm dart format .`.\n- Do not modify generated code (`*.g.dart`, `*.freezed.dart`); regenerate via `make build_runner`.\n\n## Testing Guidelines\n- Framework: `flutter_test`, helpers in `test/`. Name tests `*_test.dart` and co-locate by feature. **One test file per source file**, mirroring the path.\n- Run tests via the dart-mcp server, **only for the files you actually touched**. Do not run the whole suite locally, and do not run a whole feature's suite either — `agents` alone takes minutes, worse in a Linux VM. CI runs everything ten-way sharded on every push, so let it. Broader local runs only when asked, or when a change genuinely cannot be scoped to the files you touched.\n- **Never `Future.delayed`, `sleep()` or a real `Timer` in a test.** Use `fakeAsync` or `tester.pump(duration)`, and deterministic dates rather than `DateTime.now()`.\n- **Reuse the shared harness**: mocks from `test/mocks/mocks.dart`, fallbacks from `test/helpers/fallbacks.dart`, `setUpTestGetIt()` / `tearDownTestGetIt()`, `makeTestableWidget()`. Never improvise a per-file equivalent.\n- **Every test must assert something meaningful.** `findsOneWidget` alone proves only that the tree built; a constructor smoke test proves nothing at all.\n- **Re-run every new regression test with the fix reverted.** If it still passes, it is not testing the fix.\n- The full contract — the DRY rules, the infrastructure table, the quality bar, the vacuous-pass traps, property tests, time-driven UI — is [knowledge/conventions/testing.md](knowledge/conventions/testing.md), plus [test/README.md](test/README.md) for the fake-time policy and mocktail hygiene. Read them rather than working from this summary.\n\n## Commit & Pull Request Guidelines\n- Use Conventional Commits (e.g., `feat:`, `fix:`, `chore:`, `ci:`). Keep subjects concise and imperative.\n- PRs must pass `make analyze` and `make test`; include a clear description and linked issues.\n- **UI changes need a before/after screenshot pair per surface**, captured with the harness (see the `app-screenshots` skill). Capture `before/` from the base commit *first* — it cannot be reconstructed once the change is in. **Fixtures come from `test/test_data` and the penguin demo world only — never from a user's own habits, tasks, notes or bug screenshots**; a capture is published to a public bucket and a public PR. **Never commit images to any repo.** Publish the pair to the R2 bucket with `make pr_screenshots_publish` and link the printed public URLs from the PR body. The staging layout, the naming rules and the publish command are in [knowledge/conventions/screenshots.md](knowledge/conventions/screenshots.md).\n- Update docs and localization as needed (run `make l10n`).\n\n## Security & Configuration Tips\n- Never commit secrets. Use `.env` for local config; keep it out of VCS.\n- Use FVM (`.fvmrc`) to match the repo’s Flutter version: `fvm flutter ...`.\n\n## Agent MCP Usage\n- Prefer MCP tools over raw shell commands:\n  - Use `dart-mcp` for analyzer, tests, formatting, fixes, pub, and build tasks.\n    - Analyze: `dart-mcp.analyze_files`\n    - Tests: `dart-mcp.run_tests` (set platforms as needed)\n    - Format: `fvm dart format .`\n    - Apply fixes: `dart-mcp.dart_fix`\n    - Pub: `dart-mcp.pub` (e.g., `get`, `add`, `upgrade`)\n    - Hot reload/runtime hooks: connect to the Dart Tooling Daemon first\n  - Use `context7` for up-to-date docs. Resolve with `context7.resolve-library-id`, then fetch via `context7.get-library-docs`.\n- Register the repo root before using `dart-mcp` commands: `dart-mcp.add_roots` with the workspace URI.\n- For runtime/Flutter app introspection, request a DTD URI from the user and connect via `dart-mcp.connect_dart_tooling_daemon`.\n- Follow the planning and preamble conventions:\n  - Send a brief preamble before grouped tool calls.\n  - Keep a concise plan in your agent's planning tool for multi-step work.\n- Test-first workflow when adding/fixing tests:\n  - Run `dart-mcp.analyze_files` to catch lints quickly.\n  - Run `fvm dart format .` to normalize diffs. Do not use `dart-mcp.dart_format`.\n  - Run targeted tests (single file or folder) via `dart-mcp.run_tests` before broad runs.\n  - Iterate until the targeted tests pass; CI runs the full suite.\n- Do not edit generated files (`*.g.dart`, `*.freezed.dart`); run `dart-mcp.pub` + `make build_runner` (or `dart run build_runner`) via MCP when regeneration is required.\n- Favor `rg` for searches and read files in chunks (≤250 lines) when using shell reads.\n\n## Analyzer Zero‑Warning Policy\n- Before opening a PR, the analyzer must report zero warnings or infos.\n- Always run `dart-mcp.analyze_files` and address every message:\n  - In tests, you may add line ignores for clarity (e.g., `// ignore: avoid_redundant_argument_values`).\n  - In production code, fix the root cause rather than ignoring.\n- Run `fvm dart format .` to normalize formatting prior to final checks. Do not use\n  `dart-mcp.dart_format`.\n\n## Documentation\n\nDocumentation is split by audience. **No fact is written twice.**\n\n- **`lib/features/<x>/README.md` — product description.** What the feature does,\n  what it owns versus what it delegates, and where the code sits. Roughly 40–100\n  lines, ending with a link to its knowledge concept. If a README starts\n  explaining provider routing or wake scheduling, that content belongs in\n  `knowledge/`.\n- **`knowledge/` — the architecture, in OKF v0.2 form.** Runtime flows, state\n  machines, invariants, key classes, gotchas. This is the durable, agent-readable\n  map of how the app actually works. Read the relevant concept *before* changing\n  a subsystem, and update it in the same change.\n  [knowledge/index.md](knowledge/index.md) is the entry point: it carries the\n  reading order and the code-to-concept map.\n- **`docs/adr/` — decisions.** An ADR records a choice at a point in time and is\n  not rewritten; concepts cite ADRs rather than restating them.\n\n**These concepts are derived maps, not authority.** The source code outranks\nthem: if a concept contradicts the code, the concept is the defect, and fixing it\nis part of your change. Verify a claim before you depend on it.\n\nRules for `knowledge/`:\n\n- Every concept carries required OKF frontmatter, and `make okf_check` fails on a\n  missing or malformed field. The field-by-field contract is in\n  [knowledge/conventions/knowledge-bundle.md](knowledge/conventions/knowledge-bundle.md)\n  — follow it there rather than from memory.\n- Do **not** set `verified` on a concept you wrote. That field records\n  independent confirmation by someone other than the author.\n- Use Mermaid diagrams generously for flows, architecture, data movement and\n  lifecycles. If the code contains a real lifecycle or state machine, the\n  concept must include a diagram for it — prefer `stateDiagram-v2`, and never\n  invent states that are not implemented.\n- Every path a concept references must exist. `make okf_check` fails the build\n  on a dangling code pointer, which is the mechanism that keeps the map honest.\n- Run `make knowledge_check` after touching anything under `knowledge/`. It runs the Dart validator *and* parses every Mermaid diagram — `make okf_check` alone cannot see a diagram that fails to render.\n\n## Misc\n- Whenever touching any function, consider its docstring and if it needs updating\n- Only report completion after code compiles and all tests pass; verify via analyze and test via the dart-mcp server.\n- Invest in making tests work; avoid deleting or abandoning failing tests prematurely.\n- When old and new feature versions coexist, create no dependencies from the new code to the old — the old code is meant to be removed once the new one reaches parity.\n- Uphold high standards: DRY where sensible, proper modularity, and strong testability.\n- Use `fvm` for all `flutter` commands.\n\n## Localization (l10n)\n- All user-visible label texts MUST be localized using arb files in `lib/l10n/`.\n- Never hardcode strings that users will see — add them to the arb files instead.\n- **Add every new label to every catalog in `lib/l10n/`**, translated — not a\n  subset. The catalog list, the `app_en_GB.arb` exception and the per-language\n  register table live in\n  [knowledge/conventions/localization.md](knowledge/conventions/localization.md).\n  Read it rather than working from a count or a list quoted anywhere else,\n  including here.\n- Access localized strings via `context.messages.labelName` (import `app_localizations_context.dart`).\n- After adding labels, run `make l10n` to generate the Dart files.\n- Run `make sort_arb_files` to keep arb files consistently sorted.\n- Edit the `.arb` sources and regenerate; `lib/l10n/app_localizations_*.dart` is generated output.\n- **Use the informal register** in every translation, with Romanian as the one deliberate exception. Which pronouns that means per language is in the concept linked above.\n\n## Implementation discipline\n\nEvery UI change is bound by the design system. Read\n[knowledge/features/design_system/](knowledge/features/design_system/) before\ntouching visual code — the token pipeline and its naming, the component contracts,\nand what is enforced at construction rather than by review.\n\n- **Design-system tokens are mandatory.** For colors, spacing, radii, typography, elevation, and other visual styling values, always use the exported design-system tokens or existing design-system abstractions first.\n- **Spacings and font styles MUST come from the Design System.** Never hardcode spacing values (raw numbers in `EdgeInsets`/`SizedBox`/local `const double` constants) or font styles (raw `fontSize`/`fontWeight`/`TextStyle` constructors). Use `tokens.spacing.stepN` (or `cardPadding`/`cardItemSpacing`/`sectionGap`) and `tokens.typography.styles.{display,heading,subtitle,body,others}.<name>`. If no suitable token exists, stop and ask before introducing one.\n- **Do not invent ad hoc visual values by default.** Before adding a hard-coded color, spacing value, radius, opacity, or a one-off semantic alias for a visual token, first check the design-system token export and existing design-system components/palettes.\n- **Ask before introducing new visual tokens or hard-coded values.** If no suitable design-system token exists, stop and ask for permission before creating an ad hoc fallback, local palette entry, or other non-token visual value.\n- **Never use loading states over content: stay while reload. This is a hard rule.** Once a surface has shown its content, a reload — sync, a database notification, an agent wake, a transcript landing, any watched dependency — must not take it off the screen: no spinner, skeleton, empty placeholder or error shell in its place, and no teardown and rebuild of the same content. Keep the shown data until the new data replaces it in place. A loading shell is allowed only on the first load and on a deliberate change of subject (another day, person or route); progress for a background reload is a quiet local affordance at most.\n  - Read async state with `.value` and show a shell only while it is null. A bare `.when` runs `loading:` on every reload (Riverpod 3 defaults `skipLoadingOnReload` to false); `whenData` and `unwrapPrevious` drop the value.\n  - Key every list child whose position can shift, and give every `*.builder` list a `findChildIndexCallback` — without it a builder list matches by index even when its children carry keys, and rebuilds everything below an insertion.\n  - The rationale, the before/after code and how to test it: [stay while reload](knowledge/conventions/stay-while-reload.md).\n- **Prefer fixing the token source over patching the widget.** If a Figma export flattened or obscured a semantic token name, prefer tracing it back to the exported token set or improving the import/export path instead of hard-coding a widget-level substitute.\n- **Check the token name in the actual Figma node inspect panel first.** Even when the Variables API is incomplete or unavailable, the selected node often shows the bound token name directly under Colors, e.g. `background/02`.\n- **Know the naming path across tools.** The same token is named differently in Figma, `tokens.json` and Dart — the table is in [design tokens and theming](knowledge/features/design_system/tokens-and-theming.md#one-token-three-names). Treat them as one token with normalised naming, not as different concepts.\n- **Verifying a visual token, in order:** inspect the selected node in Figma Desktop Bridge, confirm the entry in `assets/design_system/tokens.json`, then map it to the generated token. If the inspect panel already shows the name, do not conclude it is unavailable just because the Variables API returned empty data.\n- Always ensure the analyzer has no complaints and everything compiles. Also run the formatter\n  frequently.\n- Prefer running commands via the dart-mcp server.\n- Only move on to adding new files when already created tests are all green.\n- Aim for full coverage of every code path.\n- Every widget we touch should get as close to full test coverage as is reasonable, with meaningful\n  tests.\n- **Release notes go in `changelog.d/`, never straight into `CHANGELOG.md`.** Add one new file\n  per pull request — `changelog.d/YYYY-MM-DD-slug.md`, holding the `### Fixed` (or `### Added`,\n  `### Changed`, …) section your change deserves, worded as it should read to a user. **Never\n  edit `CHANGELOG.md`, `flatpak/com.matthiasn.lotti.metainfo.xml` or the `version:` line in\n  `pubspec.yaml`.** Those three are written at the top by everything, so they are written once\n  per release, by the release — which is what stops concurrent pull requests conflicting over\n  prose they do not share. The format, the naming and what deserves an entry at all are in\n  [changelog.d/README.md](changelog.d/README.md); `make changelog_check` validates it.\n- Fragments are only for what a user would actually notice — not dependency bumps, refactors,\n  test-only changes, CI tweaks, docs, or a bug introduced and fixed before it ever shipped. If\n  in doubt, ask, but default to no fragment when nothing changes at runtime.\n- Assembling a release — fragments into `CHANGELOG.md` and the Flathub metainfo, version bump,\n  tag — is [.agents/skills/release/SKILL.md](.agents/skills/release/SKILL.md). It is the only\n  change permitted to touch those three files.\n- Update the documentation we touch such that it matches reality in the codebase, not only\n  for what we touch but in its entirety. See \"Documentation\" above for which file gets what.\n- Use fvm when running any flutter command\n- Read test/README.md on every session start and keep it up to date when gaining relevant new information\n- Do not hoard code. We do not keep unused code around. Also, this is no library, there are no known mysterious callers for whom we would keep any code around.\n\n## Issue Tracking\n\n- Public bugs, feature requests, and contributor coordination belong in\n  [GitHub Issues](https://github.com/matthiasn/lotti/issues).\n- Authorized maintainers may use the private Beads tracker for implementation\n  plans, dependencies, handoffs, and durable agent memory. Follow\n  `.agents/skills/beads/SKILL.md`.\n- Public contributors are not expected to install Beads or have access to the\n  private tracker. PR descriptions and GitHub issue links must contain all\n  context needed for public review.\n- Agent-local planning tools remain appropriate for the current turn. Beads is\n  the durable maintainer record, not a replacement for a short execution plan.\n- Beads sync, Git commits, and pushes require explicit user or orchestrator\n  authority. Never store secrets in Beads.\n- Do not install repository-controlled Git, Codex, or Claude hooks for Beads.\n  Maintainers run `bd prime`, `bd dolt pull`, and `bd dolt push` explicitly.\n\n<!-- File: DESIGN.md (Tokens: ~300 | Category: project-spec) -->\n# UI Design System & Style Tokens\n\nPath: `DESIGN.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/DESIGN.md)\n\n<!-- File: docs/ARCHITECTURE.md (Tokens: ~300 | Category: project-spec) -->\n# docs - System Architecture & Module Boundaries\n\nPath: `docs/ARCHITECTURE.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/docs/ARCHITECTURE.md)\n\n<!-- File: .agents/skills/beads/agents/openai.yaml (Tokens: ~300 | Category: anthropic-skill) -->\n# Agents Skill\n\nPath: `.agents/skills/beads/agents/openai.yaml`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/.agents/skills/beads/agents/openai.yaml)\n\n<!-- File: .agents/skills/beads/SKILL.md (Tokens: ~538 | Category: anthropic-skill) -->\n---\nname: beads\ndescription: Use for authorized Lotti maintainer work that needs private durable task tracking, issue dependencies, blocker management, multi-session handoff, or shared agent memory. Public contributors use GitHub Issues instead.\n---\n\n# Beads\n\nUse Beads as the private durable task system for authorized Lotti maintainers.\nPublic bugs, feature requests, and contributor coordination stay in GitHub\nIssues. Local plans remain useful for the current turn.\n\n## First Step\n\nFirst confirm that the private tracker is available:\n\n```bash\nbd --readonly list --json\n```\n\nIf no database exists and the current user is an authorized maintainer, run:\n\n```bash\nchmod 700 .beads\ngit config beads.role maintainer\nbd bootstrap\n```\n\nIf access is denied, do not initialize a competing database. Use GitHub Issues\nand PR discussion instead.\n\nRun `bd prime` manually when workflow context is needed. Do not install Git,\nCodex, or Claude hooks for Beads in this repository.\n\n## Core CLI Workflow\n\n1. Pull and find work:\n\n```bash\nbd dolt pull\nbd ready\nbd list --status=open\nbd list --status=in_progress\n```\n\n2. Inspect before editing:\n\n```bash\nbd show <id>\n```\n\n3. Claim work atomically:\n\n```bash\nbd update <id> --claim\n```\n\n4. Create durable follow-up work when implementation reveals new tasks:\n\n```bash\nbd create \"Short title\" --description=\"Why this exists and what needs to be done\" --type=task --priority=2\n```\n\n5. Close completed work:\n\n```bash\nbd close <id> --reason=\"Completed\"\n```\n\n6. With explicit authority, publish durable changes:\n\n```bash\nbd dolt push\n```\n\n## What Belongs In Beads\n\nMaintainers use Beads for:\n\n- shared project tasks\n- blockers and dependencies\n- discovered follow-up work\n- work that must survive thread reset, compaction, or handoff\n- status that another person or agent should be able to resume\n\nPublic-facing context must still be copied into GitHub issues, PR descriptions,\nor review discussion so contributors never need private tracker access.\n\n## Rules\n\n- Do not use `bd edit`; it opens an interactive editor. Use `bd update` flags instead.\n- Prefer `--json` when parsing `bd` output programmatically.\n- Do not auto-close or mutate tasks unless the work is actually complete.\n- Do not store credentials, private user data, or other secrets in Beads.\n- Do not commit, push Git, or sync Dolt without explicit authority.\n\n<!-- File: .agents/skills/release/SKILL.md (Tokens: ~2736 | Category: anthropic-skill) -->\n---\nname: release\ndescription: Cut a Lotti release — assemble the changelog.d/ fragments into CHANGELOG.md and the Flathub metainfo, bump the version, open the release PR, then tag. Use when asked to cut or prepare a release, assemble the changelog, publish a new version, or work out what is unreleased.\n---\n\n# Cut a release\n\nRelease notes are written per change as **fragments** in `changelog.d/`, one new\nfile per pull request, and assembled once per release. A release is therefore a\nsmall, boring, self-contained pull request: it turns the fragments into prose in\ntwo files, moves the version, and deletes what it consumed.\n\n**This is the only change allowed to touch `CHANGELOG.md`,\n`flatpak/com.matthiasn.lotti.metainfo.xml`, or the `version:` line in\n`pubspec.yaml`.** That rule is the whole point — those three files are written at\nthe top by everything, so as long as exactly one pull request per release writes\nthem, nothing can conflict. If you are here for any other reason, you are in the\nwrong skill; write a fragment instead (`changelog.d/README.md`).\n\n## Before you start\n\n```bash\ngit checkout main && git pull\nls changelog.d/[0-9]*.md       # the work queue; README.md is not a fragment\nfvm dart run tool/changelog/validate.dart --strict\n```\n\n`--strict` rather than `make changelog_check`: the house-style warnings the\nauthor-facing check only prints — an entry with no bold headline, a paragraph\npasted as one long line — are about to become published prose, so here they\nblock.\n\n- Work from an up-to-date `main`. A release assembled on a stale branch drops\n  whatever merged in the meantime.\n- If `changelog.d/` holds nothing but its README, there is nothing to release.\n  Say so and stop.\n- Fix any malformed fragment here, in the release branch. It is cheaper than\n  sending the author back.\n- A fragment describing something that was reverted before it shipped gets\n  deleted, not published.\n\n**Ask before committing, pushing or tagging.** Every step below writes files;\nthe git operations are the user's call, always.\n\n## 1. Read every fragment\n\nRead them all before writing anything. You are producing one coherent set of\nrelease notes, not a concatenation: two fragments may describe two halves of the\nsame user-visible change and should be merged into one entry, and a later\nfragment may supersede an earlier one.\n\n## 2. Choose the version\n\n```bash\ngrep -m1 '^version:' pubspec.yaml     # e.g. version: 1.0.13+4352\n```\n\n- **Bug fixes alone:** keep the semantic version unchanged and increment only\n  the build number (`1.0.21+4362` → `1.0.21+4363`). A fix-only release appends\n  its notes to the current top changelog section and metainfo release block; it\n  must not create a duplicate `## [1.0.21]` heading or `<release\n  version=\"1.0.21\">` block.\n- **User-facing additions or changes:** increment the patch version and the\n  build number (`1.0.21+4362` → `1.0.22+4363`). Any publishable `Added`,\n  `Changed`, `Deprecated`, or `Removed` entry makes this a user-facing release.\n- **Explicit minor release:** increment the minor version and reset the patch\n  component to zero only when the user explicitly requests a minor release\n  (`1.0.21+4362` → `1.1.0+4363`). The build number still increments normally.\n- **Build number:** always previous + 1. It only has to be unique and increasing\n  per tag — every release lane triggers on tag push, not on merges to `main` —\n  so it moves once per release, not once per pull request.\n\nIf the user named a version, use it. Otherwise propose one from what the\nfragments contain and confirm it.\n\n## 3. Assemble the CHANGELOG section\n\nFor a user-facing release, insert one new section at the top of `CHANGELOG.md`,\ndirectly under the Keep a Changelog preamble and above the previous version:\n\n```markdown\n## [1.0.22]\n### Added\n- **...**\n\n### Changed\n- **...**\n\n### Fixed\n- **...**\n```\n\n- **One section per type, in this order**: Added, Changed, Deprecated, Removed,\n  Fixed, Security. Skip the ones with no entries. Never repeat a heading inside\n  a version — older sections do, because entries used to be appended one PR at a\n  time; assembling from fragments is what fixes that.\n- **The version heading carries no date.** That is the file's existing shape.\n- Keep each entry's wording as the fragment wrote it, minus edits for\n  duplication, house voice, or an entry that reads oddly next to its neighbours.\n- Wrap at about 78 columns, continuation lines indented two spaces.\n\nFor a fix-only build release, add the new bullets to the current top semantic\nversion instead. Reuse its existing `### Fixed` heading, or create that heading\nin the normal section order if it does not have one. Never create a second\nversion section or a second `### Fixed` heading.\n\n## 4. Write the Flathub release block\n\nFor a user-facing release, add one `<release>` to\n`flatpak/com.matthiasn.lotti.metainfo.xml`, as the **first** child of\n`<releases>` — newest first:\n\n```xml\n<release version=\"1.0.22\" date=\"2026-08-25\">\n  <description>\n    <p>Fixed: ...</p>\n  </description>\n</release>\n```\n\nThis is the same prose, mechanically transformed. AppStream renders `<p>` as\nplain text: markdown does not survive it, and an unescaped `&` breaks the build.\n\nFor a fix-only build release, append the new `Fixed:` paragraphs to the\ndescription of the existing first `<release>` block and update that block's\ndate to the day the build is cut. Do not create a duplicate release block for\nthe unchanged semantic version.\n\n| In `CHANGELOG.md` | In the metainfo |\n|---|---|\n| one `- ` bullet | one `<p>`, same order as the section |\n| the `### Fixed` heading above it | the prefix `Fixed: ` on every paragraph in that section |\n| `- **Bold headline.** Detail…` | `Fixed: bold headline. Detail…` — bold markers dropped, first letter lowercased unless it is a proper noun (`Settings`, `Flathub`) |\n| hard-wrapped over several lines | one long line |\n| `—` or `–` | ` - ` |\n| `` `code` `` or a glyph like `•••` | plain words a user recognises — `\"...\"`, `the \"Location with the name CEST doesn't exist\" error` |\n| `&`, `<`, `>` | `&amp;`, `&lt;`, `&gt;` |\n\nWorked example, from 1.0.13:\n\n```markdown\n- **Daily habit reminders arrived hours late on iPhone, iPad and Android.** The\n  app could not work out which timezone the device was in, quietly settled for\n  UTC, and then built the reminder's time of day in UTC — so an 08:00 habit\n  reminder rang at 10:00 in Central European Summer Time.\n```\n\n```xml\n<p>Fixed: daily habit reminders arrived hours late on iPhone, iPad and Android. The app could not work out which timezone the device was in, quietly settled for UTC, and then built the reminder's time of day in UTC - so an 08:00 habit reminder rang at 10:00 in Central European Summer Time.</p>\n```\n\nThe `date` is the day the release is cut, `YYYY-MM-DD`.\n\n## 5. Bump the version\n\nOne line in `pubspec.yaml`:\n\n```yaml\nversion: 1.0.22+4363\n```\n\n## 6. Delete the fragments you consumed\n\n```bash\ngit rm changelog.d/[0-9]*.md       # fragments start with their date; README.md does not\n```\n\nEverything you just published goes. `changelog.d/` holding only its README is\nwhat \"nothing unreleased\" looks like; git history keeps the originals.\n\n## 7. Verify\n\n```bash\nmake changelog_check                                     # versions now agree\nxmllint --noout flatpak/com.matthiasn.lotti.metainfo.xml # if available\ngit status --short\n```\n\n`git status` must show exactly four kinds of change and nothing else:\n`CHANGELOG.md`, the metainfo, `pubspec.yaml`, and deleted fragments. A release\nPR that also carries code is a release PR that can conflict.\n\nRe-read the assembled section once as a user would. It is the text that reaches\nFlathub, the GitHub release and the app's What's New — it is read far more often\nthan it is written.\n\n## 8. Open the release pull request\n\nUse the semantic version in the title for a user-facing release:\n\n```\nchore(release): 1.0.22\n```\n\nUse the full version and build for a fix-only release so it is distinguishable\nfrom the release that first introduced that semantic version:\n\n```\nchore(release): 1.0.21+4363\n```\n\nBody: the entries assembled for this release, grouped under their release\nheadings, so review reads the new notes rather than the diff. For a fix-only\nrelease, label the body with the full version and build even though the\nchangelog heading remains the unchanged semantic version. No screenshots —\nnothing visual changed.\n\n## 9. Tag, after it merges\n\n```bash\ngit checkout main && git pull\nmake tag_push        # tags 1.0.22+4363 from pubspec.yaml and pushes it\n```\n\n`make tag_push` reads the version with `yq`; install it (`brew install yq`) or tag\nby hand with the exact `version+build` string if the target reports it missing.\n\nThe tag is what ships. Pushing it triggers, in parallel: macOS and iOS\nTestFlight, the Android release, the Linux GitHub release, the macOS signed\n`.dmg`, the Flathub submission PR against `flathub/com.matthiasn.lotti` —\nwhich is why the metainfo has to be right *before* the tag, not after — and\nthe manual of that version (`/manual/<x.y.z>/`, the one the app links to).\nA tag whose manual sources are unchanged publishes in a minute by reusing the\nprevious release's snapshot; otherwise the manual run recaptures all eleven\nlocales and takes about an hour.\n\nOn Google Play the release tag stops at internal testing. Moving that build on\nis a separate tag from the same commit, once the internal upload has finished:\n`make android_closed_testing` for closed testing, `make android_release` for\nproduction. Both promote the build Play already has rather than rebuilding it;\nthe mechanism is the *Google Play tracks* section of\n[`knowledge/architecture/platform-and-release.md`](../../../knowledge/architecture/platform-and-release.md).\n\nConfirm with the user before tagging. Watch the lanes; `docs/macos-release.md`\nand `docs/flatpak-flathub-recovery.md` cover the two that fail in interesting\nways.\n\n## 10. Downstream, and out of scope here\n\nThe app's **What's New** modal reads from the separate `matthiasn/lotti-docs`\nrepository (`whats-new/`), not from this one. Publishing there is an editorial\nstep in that repo — mention it once the release is tagged; do not attempt it\nfrom here.\n\n## Gotchas\n\n- **The metainfo lagging a version behind is invisible until Flathub ships it.**\n  `make changelog_check` fails on exactly that, which is why it runs in CI on\n  every push rather than only at release time.\n- **Tags carry the build number** (`1.0.14+4353`), and every release lane keys\n  on tag push. Re-tagging the same build number to fix a mistake will not give\n  you a fresh TestFlight build; bump the build number and cut again.\n- **Do not fold anything else into the release PR** — not a \"quick fix\", not a\n  dependency bump. The moment it carries code it can conflict, and the reason\n  this flow exists is gone.\n\n<!-- File: .claude/skills/add-flutter-docusaurus-locale/agents/openai.yaml (Tokens: ~300 | Category: anthropic-skill) -->\n# Agents Skill\n\nPath: `.claude/skills/add-flutter-docusaurus-locale/agents/openai.yaml`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/.claude/skills/add-flutter-docusaurus-locale/agents/openai.yaml)\n\n<!-- File: .claude/skills/add-flutter-docusaurus-locale/references/end-to-end-checklist.md (Tokens: ~300 | Category: anthropic-skill) -->\n# References Skill\n\nPath: `.claude/skills/add-flutter-docusaurus-locale/references/end-to-end-checklist.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/.claude/skills/add-flutter-docusaurus-locale/references/end-to-end-checklist.md)\n\n<!-- File: .claude/skills/add-flutter-docusaurus-locale/SKILL.md (Tokens: ~942 | Category: anthropic-skill) -->\n---\nname: add-flutter-docusaurus-locale\ndescription: Add, complete, or audit a locale across a Flutter application's ARB catalogs and a localized Docusaurus manual, including generated localization code, locale selectors, native platform declarations, translated MDX, screenshot fixtures, tests, and parity validation. Use when introducing a new language, finishing an incomplete app or manual translation, aligning manual terminology with UI strings, or reviewing whether a locale is production-ready end to end.\n---\n\n# Add a Flutter and Docusaurus Locale\n\nTreat a locale as an end-to-end product capability, not merely a translated ARB\nfile. Preserve message contracts and wire the locale through app runtime,\nplatform metadata, manual routing, screenshots, tests, and release validation.\n\n## Build the locale inventory\n\n1. Read repository instructions and localization/manual contributor guides.\n2. Identify the canonical ARB, all locale ARBs, `l10n.yaml`, generation and\n   sorting commands, localization access conventions, and missing-translation\n   report.\n3. Find every locale allowlist: app delegates/controllers, settings UI, native\n   platform metadata, Docusaurus config, screenshot registries, CI matrices,\n   and documentation.\n4. Inspect one recently added locale in version history as a completeness map,\n   but verify every location against current code.\n5. Read [references/end-to-end-checklist.md](references/end-to-end-checklist.md)\n   for platform and manual integration surfaces.\n\n## Translate the Flutter catalog\n\n1. Copy the complete key set from the canonical ARB, including required\n   metadata and `@@locale` conventions.\n2. Translate user-visible messages in context. Preserve ICU syntax, placeholder\n   names, escaping, line breaks with semantic meaning, and product names.\n3. Use the project's tone and register. Keep terminology consistent across\n   related screens; inspect call sites when a source message is ambiguous.\n4. Do not translate internal identifiers, URLs, format skeletons, or values the\n   framework treats as syntax.\n5. Add locale-specific canonical metadata only where the generator or project\n   requires it.\n6. Run the generator and catalog sorter. Never hand-edit generated Dart files.\n\n## Wire the app and platforms\n\n- Add the locale to runtime choices and language-override state.\n- Update visible language names using localized strings where the UI requires\n  them.\n- Add native supported-language declarations for every shipped platform that\n  maintains an explicit list.\n- Update screenshot locale helpers and deterministic visible fixture copy.\n- Add behavior-focused tests for locale parsing, selection, persistence,\n  delegates, and any locale-specific formatting or fallback behavior.\n\nDo not infer that generated `supportedLocales` completes native registration.\n\n## Translate and wire the Docusaurus manual\n\n1. Add the locale to Docusaurus `i18n.localeConfigs`, navigation labels, footer\n   labels, and any search or routing configuration.\n2. Create the standard docs plugin translation files and a complete localized\n   page tree matching the canonical docs paths.\n3. Reuse terms from the target ARB for buttons, settings, statuses, and feature\n   names. Translate the surrounding explanation naturally.\n4. Preserve MDX imports, components, props, links, code, identifiers, and\n   screenshot case IDs.\n5. Add the locale to screenshot registries and produce every required theme and\n   viewport variant using the project's deterministic harness.\n6. Update contributor documentation and public language lists that users see.\n\n## Audit and validate\n\nRun the bundled contract audit before project-specific generation:\n\n```bash\npython3 <skill-dir>/scripts/audit_locale.py \\\n  --template-arb path/to/app_en.arb \\\n  --target-arb path/to/app_xx.arb \\\n  --source-docs path/to/docs \\\n  --target-docs path/to/i18n/xx/docusaurus-plugin-content-docs/current\n```\n\nThe audit fails on missing/extra ARB keys, placeholder drift, and manual page\npath mismatch. Identical translated page bodies are warnings unless\n`--fail-identical` is passed.\n\nThen run, in repository order:\n\n1. localization generation and ARB sorting;\n2. targeted localization, locale-selection, screenshot-helper, and manual tests;\n3. formatter and static analysis with zero diagnostics;\n4. the full manual typecheck, validation, tests, production build, and smoke test;\n5. focused Flutter tests required by the repository;\n6. rendered review of representative long strings and every translated manual\n   route.\n\nDo not report the locale complete while generated output is stale, translation\ngaps remain, or required checks fail.\n\n<!-- File: .claude/skills/analyze-db-logs/SKILL.md (Tokens: ~3695 | Category: anthropic-skill) -->\n---\nname: analyze-db-logs\ndescription: Analyze Drift / SQLite slow-query and super-slow-query logs against this app's known stall patterns (read waves, N+1, transaction scoping, MultiExecutor contention, WAL/OS factors)\nargument-hint: \"<path-to-logs-dir> [optional: date YYYY-MM-DD or relative window]\"\n---\n\n# Analyze DB Slow-Query Logs\n\nReads slow-query log files written by `lib/database/slow_query_logging.dart`\nand produces an actionable diagnosis grounded in this codebase's stack\n(Dart, Flutter, Drift, SQLite).\n\n## Invocation\n\nThe user provides the path to the log directory — typically a gitignored\nlocal copy they pulled off a device or simulator. Repository convention is\n`./logs/` at the repo root (already in `.gitignore`).\n\n```sh\n/analyze-db-logs ./logs/                       # most recent date in ./logs/\n/analyze-db-logs ./logs/desktop                # platform-scoped subdir\n/analyze-db-logs ./logs/mobile 2026-05-02      # specific date\n/analyze-db-logs /tmp/from-device              # any absolute path\n```\n\nTreat `$ARGUMENTS` as `<path> [optional date or window]`. The first\npositional must be the path; refuse with a one-line prompt if it is\nmissing — do NOT invent a default location, the user knows where their\nlogs are. Date is optional and defaults to \"the most recent file per\nstem found under that path\".\n\nAlways print the resolved paths and line counts before analysing, so the\nuser can confirm the right files are loaded.\n\n## Log file shapes\n\nThe `SlowQueryInterceptor.fileReporter` writes two daily files per\nplatform under whatever `documentsDirectoryPath/logs/` the running app\nresolved to. The user is responsible for copying them into the path they\nhand to this skill. Expect:\n\n- `slow_queries-YYYY-MM-DD.log` — every query above the configured\n  threshold (default 10ms; gated by `SlowQueryLoggingGate.isEnabled`).\n- `super_slow_queries-YYYY-MM-DD.log` — duplicates of queries above the\n  super-slow threshold (default 200ms), enriched with `EXPLAIN QUERY\n  PLAN` rows under `PLAN:` and (when first-call stack capture is on)\n  filtered application stack frames under `STACK:`.\n\n### Subdirectory layout\n\nBy convention this repo's `./logs/` contains one subdirectory per\nplatform — typically `desktop/` and `mobile/` (sometimes `ios/`,\n`android/`). Each subdir holds its own daily files. When the path the\nuser supplies is a directory that contains *only* subdirectories (no\n`*.log` files at its top level), treat each subdirectory as a separate\nplatform-scoped scan and label every finding with the subdir name so\nthe user can tell which device it came from.\n\nIf the user supplies a more specific path (e.g. `./logs/mobile/`),\nrespect that and don't go up a level. If they supply the parent and\nboth `desktop/` and `mobile/` are present, analyse both and produce one\nreport section per platform plus a brief cross-platform summary at the\nend.\n\nGlob discovery rule of thumb:\n\n```text\n<path>/{slow_queries,super_slow_queries}-*.log         # path is leaf\n<path>/*/{slow_queries,super_slow_queries}-*.log       # path is parent\n```\n\nPick the most recent date per `(subdir, stem)` pair unless a date arg\nis given.\n\n## Log line formats\n\nA slow-query line is a single line:\n\n```text\n2026-05-02T19:11:48.592 [db.sqlite] select 388.759ms args=0 SELECT * FROM ...\n```\n\nA super-slow entry is the same line plus indented continuation lines:\n\n```text\n2026-05-02T19:11:48.592 [db.sqlite] select 388.759ms args=0 SELECT ...\n  PLAN: 4|0|SEARCH journal USING INDEX idx_journal_browse (deleted=? AND type=?)\n  PLAN: 84|0|USE TEMP B-TREE FOR ORDER BY\n  STACK: #10     JournalDb.getAllDashboards (package:lotti/database/database.dart:3056:34)\n  STACK: #11     dashboardsProvider.<anonymous closure> (package:lotti/features/dashboards/state/dashboards_page_controller.dart:20:14)\n```\n\nThe interceptor filters `STACK:` lines to drop drift, dart-runtime,\nriverpod and the slow-query plumbing itself; only `package:lotti/...`\nframes remain.\n\n## Analysis procedure\n\n1. **Resolve the file set.** Honor the platform argument; pick the most\n   recent date per stem if no date is given. Tail-load the file (last\n   ~2000 lines is usually enough — the interceptor appends, so the wave\n   you care about is at the end). Print the resolved paths.\n\n2. **Bucket entries by query shape.** Collapse per-row args; group by\n   the normalized statement. For each bucket capture: count, p50/p95/max\n   elapsed, the unique `PLAN:` shapes, and the unique `STACK:` heads\n   (top app-code frame).\n\n3. **Diagnose against the known patterns below.** For every finding,\n   cite the specific log lines (timestamp + elapsed + statement\n   prefix). Do not generalize — show the data.\n\n4. **Recommend the fix.** Reference the existing seam (drift query,\n   coalescer, transaction wrapper, index, etc.) and where in the code\n   the change would land. If a fix is speculative, say so.\n\n## Known stall patterns to look for\n\nThese are battle-tested findings from this codebase. Apply them in order;\nthe first match is usually the dominant cost.\n\n### 1. Read waves — N queries reporting hundreds of ms but finishing in a tight burst\n\n**Signature**: a cluster of 10–20+ queries whose `elapsed` is roughly\nidentical (e.g., all in the 600–700ms band) but whose timestamps span\nonly 10–30ms. Each query's plan is fine; the SQL itself is fast.\n\n**Diagnosis**: the queries were *queued* behind something — typically a\nwrite transaction holding the writer lock, an `ANALYZE` on the boot\npath, or a slow `beforeOpen` hook. The wall-clock measurement starts\nwhen drift accepts the request, so queue wait shows up as \"elapsed\".\n\n**Confirm by**:\n- Check the `elapsed` band: a 100ms+ spread *across* the wave with\n  near-identical *finish* timestamps (use the leading ISO timestamp,\n  not the elapsed) means the queries unblocked together. The\n  interceptor strips drift / dart-runtime frames so the original\n  `STACK: #5 DatabaseConnectionUser.doWhenOpened` boilerplate is\n  *not* visible in the log — infer the gate from the timing pattern,\n  not from a frame name.\n- Look at the line *just before* the wave for a long-running write or\n  transaction.\n- Boot waves often correlate with `EntitiesCacheService.init` firing\n  `Future.wait` of definitions queries — the surviving `STACK:` heads\n  for the wave will point at distinct controllers / repositories\n  whose initial fetches all queued together.\n\n**Likely fixes**:\n- Move `ANALYZE` and other heavy work *off* the boot path (`beforeOpen`\n  must return fast).\n- Narrow transaction scopes (see pattern 4).\n- Raise the read pool size only after confirming isolate-spawn cost is\n  the bottleneck — bumping `readPool` adds isolate-spawn cost upfront.\n\n### 2. N+1 reads — a cluster of single-id selects from one call site\n\n**Signature**: many lines like\n`SELECT * FROM \"journal\" WHERE \"id\" = ? AND \"deleted\" = ?`, all from the\nsame `STACK:` head, all reporting nearly identical elapsed times.\n\n**Diagnosis**: a `Future.wait(ids.map(byId))` or a per-row provider\nfamily fanning out single-id reads. Each call queues through the read\npool independently.\n\n**Recurring offenders already fixed in this codebase**:\n- `taskLiveDataProvider` (FutureProvider.family per task) → solved by\n  `JournalDb._coalesceEntityById` (microtask-coalesced bulk fetch).\n- `LinkedAiResponsesController._fetch` → switched from `Future.wait` to\n  `journalRepository.getJournalEntitiesByIds(...)`.\n- `EditorStateService.init` drafts loop → switched to\n  `journalEntitiesByIdsUnorderedAllPrivate(idList)`.\n\n**Likely fixes**:\n- Replace fan-out with a bulk drift query (`journalEntitiesByIdsUnorderedAllPrivate`,\n  `getJournalEntitiesForIdsUnordered`, `linksForEntryIds`, etc.).\n- For Riverpod families that genuinely need per-row instances, route\n  through the existing entity-by-id microtask coalescer.\n\n### 3. Drift MultiExecutor contention — reads inside a transaction run on the writer\n\n**Reminder**: in drift, anything wrapped in `db.transaction(() async { ... })`\nruns on the *write* connection — even pure `select(...)` calls inside\nthe block. The read-pool isolates do NOT pick those up. So a\n`transaction { read; read; …; write; commit }` body serialises every\nread behind every other write that touches the same writer.\n\n**Confirm by**: look at the `STACK:` head for a frame inside an apply /\nupsert / migration path. If the read appears to hit a fast plan but\nelapsed is high and other writes are visible nearby, the read was\nforced onto the writer.\n\n**Likely fixes**:\n- Pull pre-read / post-write side effects *out* of the transaction\n  block.\n- Only wrap statements that genuinely need atomicity together.\n- Cross-DB writes (e.g., to `sync_db`, `settings_db`, `agent_db`,\n  `ai_config_db`) cannot be atomic with `JournalDb` writes anyway —\n  doing them inside a `JournalDb.transaction` only holds the journal\n  writer lock for unrelated work.\n\n### 4. Transaction scoping — broad wrappers around unrelated DB writes\n\n**Signature**: the same wave shape as pattern 1, but the suspected\n\"writer holding the lock\" is a sync apply that's logging a\n`SyncJournalEntity`-shaped write while *also* awaiting a\n`_sequenceLogService.recordReceivedEntry` (sync_db) or other cross-DB\nwork inside the same `transaction { ... }`.\n\n**Diagnosis**: this codebase fixed exactly this in\n`queue_apply_adapter.dart` via `_writesJournalDb(SyncMessage)` — the\nadapter now wraps in `JournalDb.transaction` *only* for payload\nfamilies that actually write to JournalDb tables (journal entity,\nentry link, entity definitions, outbox bundle, conservatively the\nbackfill request/response paths). Theming, ai-config, agent\nentity/link/bundle writes bypass the wrapper because they target\nother databases.\n\n`_persistJournalEntity` was also restructured: the pre-read\ndiagnostic `journalEntityById`, the post-write\n`_sequenceLogService.recordReceivedEntry` (`sync_db`), and the\nentry-exists check now run **outside** the narrow journal transaction.\n\n**When inspecting new code**: any new `db.transaction(() async { ... })`\nthat contains an `await` to a different database, a network call, or a\nfilesystem write is a candidate for narrowing.\n\n### 5. Wrong-index plans masquerading as slow SQL\n\n**Signature**: a single query reporting hundreds of ms with a plan\nthat includes `USE TEMP B-TREE FOR ORDER BY`, `SCAN <table>`, or an\nindex match where the leading column is not the most selective\npredicate.\n\n**Recurring offenders already fixed in shipped code** — verify these\nstill match the current `lib/database/database.drift`,\n`lib/database/sync_db.dart`, and `lib/database/database.dart` before\nciting them. Treat the list as historical context, not an asserted\ncurrent truth:\n- `task_priority_rank` ordering with high-cardinality\n  `category IN (...)` predicate. The fix shipped as a partial index\n  named (at the time) `idx_journal_tasks_status_priority_date`; if it\n  is still in `database.drift`, recommend it as the steady-state path,\n  otherwise treat the symptom as an open issue.\n- `getBulkLinkedTimeSpans` join over `linked_entries`. The fix shipped\n  as a covering index `idx_linked_entries_from_id_hidden_to_id`.\n- `inbound_event_queue` stats `MIN(enqueued_at)` SCAN. The fix shipped\n  as `idx_inbound_event_queue_status_enqueued` plus\n  `idx_inbound_event_queue_status_due_lease`.\n- `claimNextOutboxBatch` SCAN from\n  `status = pending OR (status = sending AND updated_at < cutoff)`.\n  The fix shipped as two indexed seeks merged in Dart.\n\nIf a query still matches one of these symptom shapes despite the named\nindex existing, suspect stale stats first (recommend `ANALYZE`) before\nproposing a new index.\n\n**When inspecting new logs**: if the plan is suboptimal, recommend\nrunning `ANALYZE` first (planner stats can drift); only after\nconfirming with fresh stats should you propose a new index. Bad plans\non a freshly-`ANALYZE`d DB are real index gaps.\n\n### 6. WAL / OS-level factors\n\nWhen patterns 1–5 don't explain a stall, consider:\n- **WAL checkpoint storms**: a write that crosses\n  `wal_autocheckpoint` (default 1000 pages, ~4MB) triggers a\n  checkpoint that briefly takes a more aggressive lock. Bursty write\n  workloads can stall reads at checkpoint boundaries.\n- **macOS sandboxed file locks**: `fcntl(F_FULLFSYNC)` and BSD locks\n  on iCloud-backed paths have shown long tails. Less likely on dev\n  but worth flagging.\n- **Background isolate spawn (`createInBackground(readPool: N)`)** —\n  isolates may spawn on first use; the *first* boot wave can pay\n  per-isolate setup cost (~50–200ms each). Subsequent app sessions\n  should be much faster — first wave is the worst case.\n- **`PRAGMA foreign_keys = ON`** runs per-connection; cheap but real.\n\n### 7. Per-launch repair / housekeeping that shouldn't run every boot\n\n**Signature**: an entry whose `STACK:` head points at a `beforeOpen`,\nself-heal, or migration helper — but the user just opened the app\nnormally. With `readPool: N`, drift calls `beforeOpen` on every\nconnection, so any repair work done there runs `1 + N` times per\nlaunch.\n\n**Lessons already applied in this codebase**:\n- Per-launch `ANALYZE` was removed — stats persist in `sqlite_stat1`\n  and the v42 migration runs `ANALYZE` once on upgrade.\n- The self-heal `CREATE INDEX IF NOT EXISTS` block was removed\n  entirely — the recovery path it covered targeted an aborted-migration\n  scenario that has not occurred in production.\n- `beforeOpen` is now just `PRAGMA foreign_keys = ON`.\n\nWhen you see boot-time housekeeping in a stack, ask: does this need\nto run on every launch, or once per upgrade?\n\n## Output format\n\nProduce a concise report, in this order:\n\n1. **Inputs** — paths read, line counts, date window.\n2. **Findings**, each with: severity (high/medium/low), pattern\n   matched (numbered above), evidence (specific log lines with\n   timestamps), root-cause hypothesis, and the file/seam where the\n   fix would land.\n3. **Recommended actions**, ordered by impact. Cite specific\n   call sites (`lib/...:line`) where possible.\n4. **Things you ruled out** (and why), so the user can sanity-check.\n\nKeep the report skimmable. If the log is mostly clean, say so — don't\nmanufacture findings.\n\n## Guardrails\n\n- **Never** propose schema bumps (`schemaVersion++`) without confirming\n  the v42-style migration shape and asking the user. New indices that\n  don't need a column change can land via migration; per-launch\n  defensive code should not.\n- **Never** propose a per-boot `ANALYZE`, `CREATE INDEX IF NOT EXISTS`\n  loop, or other \"self-heal on every open\" — this codebase explicitly\n  removed those.\n- **Don't assume** an `INDEXED BY` hint solves a planner problem. The\n  autoindex names (`sqlite_autoindex_*_1`) are not part of the public\n  SQLite contract; recommend `ANALYZE` first.\n- **Match real seams**: prefer adding fixes to existing patterns\n  (`_PendingEntityByIdWave` for entity-by-id coalescing,\n  `_PendingLinksWave` for to-id link batches, `_writesJournalDb` for\n  per-payload transaction scoping) over inventing new ones.\n- **Show your work**: every finding should cite specific log lines so\n  the user can verify.\n\n<!-- File: .claude/skills/app-screenshots/SKILL.md (Tokens: ~1745 | Category: anthropic-skill) -->\n---\nname: app-screenshots\ndescription: Capture in-app screenshots of a widget or flow at mobile + desktop sizes — offline, deterministic, real fonts and icons — using the reusable screenshot harness. Use when asked to \"show me X in the app\", \"screenshot this screen\", or to preview a UI change for review on phone vs desktop.\nargument-hint: \"<surface to capture, e.g. 'project create modal'>\"\n---\n\n# In-App Screenshots\n\nProduces PNGs of a widget or flow rendered inside the real app shell, at phone\nand desktop viewports, with real fonts and icons. It runs through\n`flutter test --update-goldens` — fully offline and deterministic — so it does\n**not** require a display, the GUI app, or driving the device.\n\nThis is a visualization tool, **not** a golden test: there are no committed\nreference images. You write a throwaway capture test, emit the PNGs, share\nthem, then delete the test. Nothing screenshot-related gets committed unless\nthe user explicitly asks to keep it.\n\n## When to use\n\n- \"Show me the <screen/modal/dialog> in app context.\"\n- \"What does this change look like on mobile vs desktop?\"\n- Previewing a UI change for design review.\n\nFor \"is this change actually wired up / does it behave correctly\", prefer the\n`run` skill (launches the real app). This skill is about *appearance*.\n\n## The harness\n\n`test/test_utils/screenshot_harness.dart` provides:\n\n- `loadAppFonts()` — loads every bundled font (app families + Material/Cupertino\n  icon fonts + icon-font packages) from `FontManifest.json`. Call once in\n  `setUpAll`. Without it, glyphs and icons render as boxes.\n- `screenshotTheme({bool dark = true})` — the production `withOverrides` theme\n  with `Inter` applied to the Material text themes (the bare test theme falls\n  back to an unbundled font otherwise).\n- `captureInApp(tester, {child, name, size, dark, devicePixelRatio, overrides, interaction, outputDir})`\n  — sizes the view, pumps `child` in the app shell, runs `interaction` (open a\n  modal, tap a FAB, focus a field…), then writes `<outputDir>/<name>.png`\n  relative to the **calling test file's** directory.\n- `ScreenshotViewport.phone` (390×844) and `ScreenshotViewport.desktop`\n  (1280×800).\n\n## Workflow\n\n1. **Find the surface and how to reach the state.** Identify the entry widget\n   (often a tab/page like `ProjectsTabPage`) and the tap/scroll needed to reach\n   the state to capture (e.g. tapping the FAB to open a modal). Reuse existing\n   widget tests for that surface to learn the required service registrations\n   and provider overrides — copy their `setUp`.\n\n2. **Write a throwaway capture test** at `test/_scratch_capture_test.dart`\n   (the `_scratch_` prefix marks it disposable). Use `setUpTestGetIt` +\n   `additionalSetup` for services the surface resolves through `getIt`, and\n   pass provider overrides via `captureInApp(overrides: ...)`. Drive the state\n   in `interaction`.\n\n3. **Generate the PNGs:**\n   ```sh\n   fvm flutter test --update-goldens test/_scratch_capture_test.dart\n   ```\n   Images land in `test/screenshots/` (the `outputDir`, next to the test).\n\n4. **View and share.** Read the PNGs to inspect them and give the user their\n   paths. For a PR's before/after pair, stage and publish them per\n   `knowledge/conventions/screenshots.md` before the cleanup step deletes\n   them.\n\n5. **Clean up** — this is mandatory unless the user asks to keep anything:\n   ```sh\n   rm test/_scratch_capture_test.dart && rm -rf test/screenshots\n   ```\n\n## Example capture test\n\n```dart\nimport 'package:flutter/material.dart';\nimport 'package:flutter_riverpod/flutter_riverpod.dart';\nimport 'package:flutter_riverpod/misc.dart'; // Override\nimport 'package:flutter_test/flutter_test.dart';\nimport 'package:lotti/classes/project_data.dart';\nimport 'package:lotti/features/projects/model/projects_overview_models.dart';\nimport 'package:lotti/features/projects/state/project_providers.dart';\nimport 'package:lotti/features/projects/ui/pages/projects_tab_page.dart';\nimport 'package:lotti/features/user_activity/state/user_activity_service.dart';\nimport 'package:lotti/get_it.dart';\nimport 'package:lotti/services/entities_cache_service.dart';\nimport 'package:lotti/services/nav_service.dart';\nimport 'package:mocktail/mocktail.dart';\n\nimport 'features/categories/test_utils.dart';\nimport 'features/projects/test_utils.dart';\nimport 'mocks/mocks.dart';\nimport 'test_utils/screenshot_harness.dart';\nimport 'widget_test_utils.dart';\n\nvoid main() {\n  setUpAll(loadAppFonts);\n\n  final groups = [\n    ProjectCategoryGroup(\n      categoryId: 'lotti',\n      category: CategoryTestUtils.createTestCategory(id: 'lotti', name: 'Lotti'),\n      projects: [\n        ProjectListItemData(\n          project: makeTestProject(id: 'p1', title: 'Daily Operating System'),\n          category: CategoryTestUtils.createTestCategory(id: 'lotti', name: 'Lotti'),\n          taskRollup: const ProjectTaskRollupData(totalTaskCount: 25),\n        ),\n      ],\n    ),\n  ];\n\n  List<Override> overrides() => [\n    projectsOverviewProvider.overrideWith(\n      (ref) => Stream.value(ProjectsOverviewSnapshot(groups: groups)),\n    ),\n    visibleProjectGroupsProvider.overrideWith((ref) => AsyncValue.data(groups)),\n  ];\n\n  setUp(() async {\n    await setUpTestGetIt(\n      additionalSetup: () {\n        final activity = MockUserActivityService();\n        when(activity.updateActivity).thenReturn(null);\n        getIt.registerSingleton<UserActivityService>(activity);\n\n        final nav = MockNavService();\n        when(() => nav.isDesktopMode).thenReturn(false);\n        when(() => nav.desktopSelectedProjectId)\n            .thenReturn(ValueNotifier<String?>(null));\n        getIt.registerSingleton<NavService>(nav);\n\n        final cache = MockEntitiesCacheService();\n        when(() => cache.getCategoryById(any())).thenReturn(null);\n        getIt.registerSingleton<EntitiesCacheService>(cache);\n      },\n    );\n  });\n  tearDown(tearDownTestGetIt);\n\n  Future<void> openCreate(WidgetTester tester) =>\n      tester.tap(find.bySemanticsLabel('New Project'));\n\n  testWidgets('phone', (tester) async {\n    await captureInApp(\n      tester,\n      child: const ProjectsTabPage(),\n      name: 'create_mobile',\n      overrides: overrides(),\n      interaction: openCreate,\n    );\n  });\n\n  testWidgets('desktop', (tester) async {\n    await captureInApp(\n      tester,\n      child: const ProjectsTabPage(),\n      name: 'create_desktop',\n      size: ScreenshotViewport.desktop,\n      overrides: overrides(),\n      interaction: openCreate,\n    );\n  });\n}\n```\n\n## Gotchas\n\n- **`Override` lives in `package:flutter_riverpod/misc.dart`** in this Riverpod\n  version — import it for the `List<Override>` type (separate from\n  `flutter_riverpod.dart`, which has `AsyncValue`).\n- **Register every service the surface touches** via `setUpTestGetIt`'s\n  `additionalSetup`, or the widget throws on a missing `getIt` registration.\n  Modals pull in their own deps (e.g. the create modal's `CategoryField` needs\n  `EntitiesCacheService`).\n- **Desktop layout is width-driven.** `captureInApp(size: ScreenshotViewport.desktop)`\n  sets both the view physical size and `MediaQuery`, so width-gated split\n  views (`isDesktopLayout`) and the dialog branch (modal page breakpoint)\n  engage correctly.\n- **Capture target is `find.byType(MaterialApp)`** so overlay content (modals,\n  dialogs, toasts) is included, not just the page body.\n- **Don't commit the scratch test or `test/screenshots/`.** Delete them when\n  done. The harness itself is the only permanent artifact.\n\n<!-- File: .claude/skills/design-review-panel/SKILL.md (Tokens: ~1500 | Category: anthropic-skill) -->\n---\nname: design-review-panel\ndescription: Run a multi-agent design review on a UI surface — capture reproducible baseline screenshots, then rate them with a panel of design experts (one agent per craft dimension) and, optionally, a panel of user personas with different cognitive styles. Iterate implement → re-screenshot → re-rate until every panel hits a numeric target (e.g. avg ≥8/10). Use when polishing or redesigning a screen/modal/dialog and the user wants grounded, scored design feedback (\"summon the design panel\", \"rate this with the experts\", \"run the persona panel\").\nargument-hint: \"<surface to review, e.g. 'AI popup model picker'>\"\n---\n\n# Design Review Panel\n\nA repeatable, grounded process for design polish and redesign work. It pairs\ntwo parallel agent panels — **design experts** (craft dimensions) and,\noptionally, **user personas** (cognitive styles) — and drives them against\n**real screenshots the agents actually `Read`**, iterating to a numeric target.\n\nThis is how the user wants UI/design tasks run. The numeric target is the\nsuccess condition: keep iterating until both panel averages clear the bar\n(the workflow's `cleared` flag).\n\n## The loop\n\n```mermaid\nstateDiagram-v2\n    [*] --> Baseline\n    Baseline --> RateBaseline: capture reproducible PNGs (app-screenshots)\n    RateBaseline --> Implement: both panels score the current state\n    Implement --> Rescreenshot: apply highest-leverage fixes (design-system tokens only)\n    Rescreenshot --> Rerate: regenerate the SAME shots\n    Rerate --> Implement: either panel average < target\n    Rerate --> Harden: both panel averages ≥ target\n    Harden --> [*]: tests, l10n, README, changelog.d fragment, analyzer clean, PR\n```\n\n1. **Baseline screenshot first.** Use the `app-screenshots` skill / the\n   `test/test_utils/screenshot_harness.dart` `captureInApp` harness to render\n   the surface at phone **and** desktop, dark (add light + large-text shots\n   when accessibility is in scope). Reproducible PNGs are mandatory — the\n   panels are only as honest as the pixels they read.\n2. **Rate the baseline with BOTH panels up front.** Get grounded starting\n   scores before changing anything. Never carry over scores from a previous\n   session — re-rate on a freshly regenerated PNG every time (grounded\n   re-rating reliably deflates inflated prior numbers).\n3. **Iterate with the expert panel** until experts clear the bar. Bring the\n   persona panel into the loop once experts reach ≥8 so the two converge\n   together. Each iteration: implement → regenerate the exact same screenshots\n   → re-rate.\n4. **Adjudicate genuine tradeoffs with the user** (`AskUserQuestion`) instead\n   of silently picking a side — before declaring a conflict irreducible, hunt\n   for a both-sides fix (one change that serves two opposed reviewers).\n5. **Harden to PR-ready** once converged: tests, l10n, feature README, a\n   `changelog.d/` fragment (never `CHANGELOG.md` or the flatpak metainfo\n   directly — those belong to the release), analyzer zero-warning, formatter,\n   PR on latest main.\n\n## The two panels\n\n### Design-expert panel (always)\nOne agent per craft dimension. Default lenses (adapt to the surface):\n- **Visual hierarchy / IA** — what reads primary/secondary/tertiary; scent.\n- **Design-system consistency** — tokens, spacing rhythm, component reuse;\n  does the surface feel like ONE system or bolted-together parts.\n- **Color / contrast / semantics** — palette restraint, status-by-more-than-color.\n- **Typography** — ramp, weight contrast, measure, rhythm.\n- **Spacing / density / rhythm** — padding, alignment, optical balance.\n- **Interaction / task-flow** — taps-to-goal, affordances, dead-ends, the\n  \"1-tap to the common case\" promise.\n\n### User-persona panel (on by default — pass `includePersonas: false` to skip)\nDifferent cognitive styles stress the surface as real users:\n- **ADHD / clutter-sensitive** — needs \"what now\" instant; abandons noise.\n- **Power user** — counts seconds, allergic to wasted space/steps.\n- **Low-vision / low-confidence** — large text, strong contrast, fears\n  irreversible taps.\n- **Minimalist aesthete** — wants calm, uniform, restrained.\n- **Non-technical novice / second-language** — reads copy literally; jargon\n  and ambiguous labels break them.\n\nPersonas return a **verdict** (would-use / would-struggle / would-abandon) plus\nblockers / frictions / delights. Experts return a **1–10 score** per surface\nplus severity-tagged issues with evidence + a concrete fix.\n\n## Grounding rules (give these to every agent verbatim)\n- **`Read` every screenshot path.** Base every visual claim on actual pixels.\n  Panels hallucinate failures when they don't — forbid it.\n- **No invented measurements.** Don't fabricate px gaps or contrast ratios; if\n  you can't measure it, describe it qualitatively and tie it to something\n  visible.\n- **Every issue carries evidence** — a named screenshot (\"picker_desktop: …\")\n  or a `file:line`. Code claims (e.g. \"hardcodes spacing\") require Reading the\n  file and citing the line.\n- **Grumpy, calibrated scoring:** 10 = ship-grade, nothing to fix; 8 = good,\n  only polish left; 6 = usable but rough; 4 = several real problems; ≤3 =\n  broken. Do not be generous.\n- **List test-rig artifacts to IGNORE** (stand-in nav bars, tofu glyphs,\n  folded-hour bands) so the panel doesn't score the harness.\n\n## Running it\n\nDrive both panels as a `Workflow` so the agents run in parallel and return\nstructured scores. A parameterized reference script lives next to this file:\n**`panel_workflow.js`** — pass `args` describing the surface, screenshot paths,\nsource files, expert lenses, personas, and `includePersonas` /\n`target`. Adapt the lenses and persona prompts to the surface; keep the schema\nand the iterate-to-target loop.\n\n```\nWorkflow({ scriptPath: \".claude/skills/design-review-panel/panel_workflow.js\", args: { ...see file header... } })\n```\n\nRead the returned synthesis, apply the must-fixes, regenerate the same\nscreenshots, and re-run until the returned `cleared` is `true` (both panel\naverages meet the `target`). Then delete the scratch capture test and\n`test/screenshots/` (per the app-screenshots skill) unless the user asks to\nkeep them.\n\n## See also\n- `app-screenshots` — the reproducible capture harness this skill depends on.\n- `AskUserQuestion` — for adjudicating genuine, irreducible design tradeoffs.\n\n<!-- File: .claude/skills/maintain-docusaurus-manual/agents/openai.yaml (Tokens: ~300 | Category: anthropic-skill) -->\n# Agents Skill\n\nPath: `.claude/skills/maintain-docusaurus-manual/agents/openai.yaml`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/.claude/skills/maintain-docusaurus-manual/agents/openai.yaml)\n\n<!-- File: .claude/skills/maintain-docusaurus-manual/references/discovery-and-review.md (Tokens: ~300 | Category: anthropic-skill) -->\n# References Skill\n\nPath: `.claude/skills/maintain-docusaurus-manual/references/discovery-and-review.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/.claude/skills/maintain-docusaurus-manual/references/discovery-and-review.md)\n\n<!-- File: .claude/skills/maintain-docusaurus-manual/SKILL.md (Tokens: ~717 | Category: anthropic-skill) -->\n---\nname: maintain-docusaurus-manual\ndescription: Maintain a Docusaurus product manual whose prose, navigation, localized page trees, screenshots, coverage metadata, and release build must stay aligned with the application. Use when adding or revising manual pages, documenting a product change, updating translated MDX, repairing locale parity, adding registered screenshots, auditing stale documentation, or validating a multilingual Docusaurus site before publication.\n---\n\n# Maintain a Docusaurus Manual\n\nTreat the running product and source code as authoritative. Keep documentation,\ntranslations, navigation, screenshots, inventories, and generated site behavior\nconsistent in the same change.\n\n## Discover the project contract\n\n1. Read the repository instructions and the manual's own contributor guide.\n2. Locate the Docusaurus config, source docs, localized docs, sidebar, package\n   scripts, validation scripts, screenshot registry, coverage inventory, and CI.\n3. Identify the canonical locale, supported locales, URL/version scheme, and\n   whether localized pages may fall back or must have exact path parity.\n4. Locate app strings or another terminology source before translating UI names.\n5. Read [references/discovery-and-review.md](references/discovery-and-review.md)\n   when the repository has custom inventories, generated screenshots, or\n   versioned publishing.\n\nDo not assume conventional paths when the repository declares its own.\n\n## Update the manual\n\n1. Verify the current product behavior from implementation and focused tests.\n2. Update the canonical page with concrete, task-oriented prose. Describe only\n   controls, states, limitations, and workflows that exist.\n3. Preserve stable frontmatter identifiers, component calls, links, anchors,\n   admonitions, and code unless the change intentionally modifies them.\n4. Add new pages to navigation and every repository-owned coverage or surface\n   inventory.\n5. Update every published locale required by the project. Translate meaning,\n   not sentence shape; preserve product terminology from the localized app.\n6. Record questionable product wording separately unless changing UI copy is\n   explicitly in scope.\n\n## Handle screenshots as evidence\n\n- Prefer the repository's deterministic screenshot harness and registry.\n- Capture the real production widget or route with representative state.\n- Keep required locale, viewport, and theme variants complete.\n- Reference screenshots through the site's component or registry rather than\n  hard-coded media URLs when such an abstraction exists.\n- Keep generated media outside the source repository when that is the declared\n  architecture.\n\nIf the task is only a one-off application screenshot, use the repository's\nscreenshot skill instead of extending the manual pipeline.\n\n## Validate in increasing scope\n\n1. Run the bundled parity audit when the site uses standard Docusaurus locale\n   trees:\n\n   ```bash\n   python3 <skill-dir>/scripts/audit_docusaurus_locales.py \\\n     --site-root path/to/site\n   ```\n\n   Pass `--fail-identical` only when identical localized page bodies are\n   forbidden. Treat its default identical-page output as a review warning.\n\n2. Run focused repository validators and tests for touched metadata or helpers.\n3. Run type checking, link/content validation, unit tests, and the production\n   Docusaurus build through repository scripts.\n4. Smoke-test built routes, locale switching, assets, search, and base URLs.\n5. Review the rendered page at representative widths and in every changed\n   locale. A successful build does not prove prose accuracy or layout quality.\n\nDo not claim completion while required checks fail. Report any validation that\ncould not run and why.\n\n<!-- File: .claude/skills/review-comments/SKILL.md (Tokens: ~2598 | Category: anthropic-skill) -->\n---\nname: review-comments\ndescription: Fetch PR review comments, address each one in code, and post resolution replies\nargument-hint: \"[pr-number]\"\n---\n\n# Review PR Comments\n\nFetch all review comments from a pull request, address each one (fix code, add\ndocs, or explain the rationale), and reply to each comment on GitHub with the\nresolution.\n\n## Steps\n\n1. **Fetch comments** — use `gh api` to get all review comments:\n   ```bash\n   gh api repos/{owner}/{repo}/pulls/$ARGUMENTS/comments \\\n     --jq '.[] | {id, path, line, body, in_reply_to_id}'\n   ```\n   Filter to top-level comments only (`in_reply_to_id == null`) — those are the\n   ones that need responses.\n\n2. **Understand each comment** — read the referenced file and line to understand\n   the concern. Group related comments if they touch the same issue.\n\n3. **Address each comment** — make the appropriate code change (fix, refactor,\n   add docs, add tests). If you disagree with a suggestion, prepare a clear\n   rationale.\n\n4. **Reply to each comment** — post a reply using:\n   ```bash\n   gh api repos/{owner}/{repo}/pulls/$ARGUMENTS/comments -X POST \\\n     -f body=\"<resolution>\" \\\n     -F in_reply_to=<comment-id>\n   ```\n   Keep replies concise: state what was done (e.g., \"Fixed. Replaced generic\n   fallback with explicit throw.\") or explain why it was left as-is.\n\n5. **Close every codecov gap — target 100% patch coverage.** The Codecov bot\n   posts a PR comment/check; treat its uncovered lines as review comments that\n   MUST be resolved with tests. **Every line codecov marks uncovered has to be\n   covered — no exceptions for \"pre-existing\" files.** If a file shows up in the\n   PR diff with uncovered lines, cover them even if you didn't write them.\n\n   a. **Find what's actually uncovered.** The bot summary only gives totals;\n      pull the per-line data from the Codecov API and intersect it with the\n      PR's added lines (this is exactly what `codecov/patch` scores):\n      ```bash\n      # Per-line diff coverage (head_cov == 0 → miss):\n      curl -s \"https://api.codecov.io/api/v2/github/{owner}/repos/{repo}/compare?pullid=$ARGUMENTS\" \\\n        > /tmp/cc.json\n      # Then: for each file with has_diff, list lines where\n      #   coverage.head == 0 && is_diff, and intersect with the file's\n      #   git-diff added-line numbers (git diff --unified=0 origin/main...HEAD).\n      ```\n      Codecov ignores are in `codecov.yml` (`*.g.dart`, `*.freezed.dart`,\n      `l10n/*.dart` here) — skip those.\n\n   b. **Codecov is often stale/partial — trust local coverage for new code.**\n      Coverage is sharded; if any shard failed or the run is mid-flight, the\n      bot shows a partial picture (e.g. \"1% of diff\") that inflates the miss\n      list with trivial lines (`@override`, const ctors). Regenerate locally\n      and intersect with the git-diff added lines for the authoritative set:\n      ```bash\n      fvm flutter test --coverage <the test dirs that exercise the diff>\n      # parse coverage/lcov.info: DA:<line>,0 == uncovered\n      ```\n      Run enough test dirs that every diff file is genuinely exercised (a file\n      covered only by tests you didn't run shows as a false miss).\n\n   c. **Write real tests for each uncovered line** — mirror the sibling case\n      already tested (e.g. a new `.map`/`switch` arm → copy the `aiConfig`\n      case for `savedTaskFilter`; a debounce-cancel line → emit *two*\n      notifications so the timer is non-null when cancelled). Extend\n      parameterized `variantCases`/`variantsByBucket` tables rather than\n      duplicating whole test bodies.\n\n   d. **Uncoverable private-ctor lines** (`const FooKeys._();` in a static-only\n      keys class) can't be hit and dart coverage ignores no inline comment —\n      convert the class to `abstract final class FooKeys { ... }` so the\n      constructor line disappears entirely.\n\n   e. **Re-run coverage until the (added ∩ uncovered) set is empty**, then run\n      the affected suites to confirm still-green.\n\n6. **Verify** — run analyzer and affected tests to confirm all changes compile\n   and pass.\n\n7. **Babysit the PR until it is actually done.** Opening a PR and replying once\n   is not the end of the job. A PR is finished only when all three hold at the\n   same time:\n\n   - **mergeable** — `gh pr view <n> --json mergeable` is `MERGEABLE`\n   - **all green** — every check passed, not merely \"not failing\": zero\n     `pending` and zero failures, including `codecov/patch`\n   - **all replied** — every top-level review comment has a reply, with a real\n     fix or a stated reason for declining\n\n   **Pushing requires authorization.** Commits, rebases and pushes need\n   explicit user or orchestrator approval (AGENTS.md, \"Issue Tracking\").\n   Being asked to *address review comments* authorizes the\n   code changes, not the push — confirm before the first push of a session,\n   and never force-push a branch you did not create in this session.\n   `--force-with-lease` guards against clobbering a concurrent update; it is\n   not a substitute for approval.\n\n   Reviews arrive *after* pushes, so pushing fixes restarts the loop: the\n   reviewer re-reviews the new commit and may file new findings. Bots also\n   rate-limit and arrive late (CodeRabbit will say \"next review available in\n   N minutes\" and skip the run entirely). Keep watching until the three\n   conditions hold together.\n\n   Poll on the structured status rather than the display columns — the table\n   format is human-facing, and a failed API or auth call prints to stderr and\n   would otherwise read as \"no pending checks\".\n\n   Note `gh pr checks` has **no** `--json` flag (checked on gh 2.45); the\n   structured source is `gh pr view --json statusCheckRollup`. Verify whatever\n   command you poll with actually works *before* wrapping it in an `until`\n   loop: a command that errors makes the loop exit immediately and every\n   subsequent report a lie.\n\n   For a CheckRun, `status` is the lifecycle (`COMPLETED`) and `conclusion`\n   carries the verdict (`SUCCESS` / `FAILURE` / `CANCELLED`) — a failed check\n   is `COMPLETED`, so keying on `status` alone reports a red run as done and\n   green. Read the conclusion for completed checks and the state for\n   StatusContexts:\n\n   ```bash\n   # one \"<verdict>\\t<name>\" line per check; empty output means the query\n   # failed, not that everything passed — so treat it as not-done.\n   rollup() {\n     gh pr view \"$1\" --json statusCheckRollup --jq '\n       .statusCheckRollup[]\n       | if .status == \"COMPLETED\" then .conclusion\n         elif .status then .status\n         else .state end\n       + \"\\t\" + (.name // .context)'\n   }\n   # Capture once per iteration and check the exit status: an errored or\n   # empty result is \"not done\", never \"done and green\".\n   while :; do\n     out=$(rollup <n>) || { echo \"poll failed\"; sleep 30; continue; }\n     [ -n \"$out\" ] || { echo \"empty rollup — treating as not done\"; sleep 30; continue; }\n     printf '%s\\n' \"$out\" | grep -qE '^(IN_PROGRESS|QUEUED|PENDING)' || break\n     sleep 30\n   done\n   bad=$(printf '%s\\n' \"$out\" | grep -vE '^(SUCCESS|NEUTRAL|SKIPPED)')\n   [ -z \"$bad\" ] && echo \"all green (${#out} bytes of verdicts)\" || printf '%s\\n' \"$bad\"\n   ```\n\n   Three ways these snippets lie if written casually, all worth guarding:\n   an errored command inside `$( )` yields empty output that a\n   `grep -q pending` reads as \"nothing pending\"; `grep … || echo \"all green\"`\n   turns *no output at all* into a pass; and a background poller whose result\n   is never collected lets the summary be written before it finishes. Capture\n   the output, check the status, and `wait` for the poller before reporting.\n\n   Cross-check the total against `gh pr checks <n>` before declaring green —\n   a poller that exits on its first iteration otherwise reports \"settled\"\n   while checks are still queued.\n\n   Run that in the background (`run_in_background: true`, or `… &` with the\n   PID kept) so replying to comments proceeds concurrently rather than\n   blocking on CI.\n\n   Then re-check for comments filed against the new commits — including\n   top-level ones with no reply yet:\n\n   `gh api` returns **one page (30 comments)** unless `--paginate` is passed,\n   and `--jq` then runs per page — so a comment and its reply landing on\n   different pages makes an answered comment look unanswered, and a comment on\n   a later page look absent. Fetch every page and aggregate once with `jq -s`:\n\n   ```bash\n   # `set -o pipefail` so an API failure fails the pipeline instead of\n   # producing an empty list that reads as \"nothing unanswered\".\n   ( set -o pipefail\n     gh api --paginate repos/{owner}/{repo}/pulls/<n>/comments --jq '.[]' | jq -s -r '\n       [.[] | select(.in_reply_to_id != null) | .in_reply_to_id] as $replied\n       | [.[] | select(.in_reply_to_id == null)] as $top\n       | \"top-level: \\($top | length), answered: \\([$top[] | select(.id as $i | $replied | index($i))] | length)\",\n         ($top[] | select(.id as $i | ($replied | index($i)) | not)\n          | \"UNANSWERED \\(.id) \\(.user.login) \\(.path)\")'\n   ) || echo \"comment query FAILED — do not report all-replied\"\n   ```\n\n   Print the counted totals, not just the unanswered lines: \"top-level: 26,\n   answered: 22\" is checkable, whereas empty output is indistinguishable from\n   a query that never ran.\n\n   Post replies with `-F body=@file` rather than an inline shell string.\n   Review bodies contain backticks, quotes and code fences; nested shell\n   quoting silently mangles them, and a failed POST inside a loop can still\n   look like it succeeded.\n\n   Report the real state — \"27 pass, 1 pending\" is the honest answer while a\n   check is still running, not \"all green\".\n\n## Guidelines\n\n- Address every comment.\n- Make real code fixes, not just reply text.\n- Run the analyzer and formatter after all fixes.\n- Run affected tests to verify fixes.\n- Keep reply text concise and factual.\n- If a comment is from a bot review (e.g., CodeRabbit, Gemini), still address\n  valid points but use your judgement on noise.\n- Coverage is not optional: every codecov-flagged line in the diff must end up\n  covered (goal 100% patch), pre-existing or not. Prefer real behavioural tests;\n  only restructure code (e.g. `abstract final class`) for genuinely\n  uncoverable lines.\n\n<!-- File: .claude/skills/skeptical-review/SKILL.md (Tokens: ~1875 | Category: anthropic-skill) -->\n---\nname: skeptical-review\ndescription: Act as a skeptical senior engineer performing a detailed code review of the latest changes on the current branch (or a given PR) — best practices, maintainability, performance, security, and readability. Objective and concise; only real issues, with a clear \"no issues\" verdict when the code is clean. Replaces CodeRabbit / Gemini Code Review.\nargument-hint: \"[optional: PR number, base branch, or path scope]\"\n---\n\n# Skeptical Senior Engineer Review\n\nYou are a skeptical senior engineer performing a detailed, professional code\nreview. The bar is a practical, fair assessment a maintainer can act on\ndirectly, not a wall of generated nitpicks.\n\n## Ground rules (non-negotiable)\n\n- **Be objective and concise** — only point out real issues or suboptimal\n  practices you can defend with a concrete failure mode or maintenance cost.\n- **If the code follows best practices and there are no issues, say so\n  clearly.** Do not invent imaginary problems to look thorough. \"This diff is\n  clean\" is a valid and valuable review outcome.\n- **For each issue**, briefly explain *why* it's a problem and suggest a\n  better approach or concrete improvement.\n- **Focus on** clarity, structure, code style, logic, and efficiency —\n  correctness first, then maintainability, performance, security,\n  readability.\n- **Avoid nitpicking** minor style differences unless they impact clarity or\n  maintainability. The analyzer and formatter already police style; don't\n  duplicate them.\n- **Review the diff, not the whole file** — but read enough surrounding code\n  to judge the change in context. Never flag something as missing without\n  first checking whether it exists elsewhere in the codebase.\n\n## Scoping the diff\n\nTreat `$ARGUMENTS` as optional. Resolve what to review in this order:\n\n1. **PR number given** (e.g. `/skeptical-review 3413`) — fetch the PR diff\n   via `gh pr diff <n>` and `gh pr view <n>` for title/description context.\n2. **Base branch given** (e.g. `/skeptical-review develop`) — diff the\n   current branch against that base.\n3. **Path scope given** (e.g. `/skeptical-review lib/features/ai`) — limit\n   the branch diff to that path.\n4. **No arguments** — review the current branch's latest changes:\n   `git diff main...HEAD` **plus** uncommitted work\n   (`git diff HEAD` and untracked files via `git status`). Say explicitly\n   which of the two buckets each finding falls in when both exist.\n\nBefore reviewing, print a one-paragraph scope statement: branch, base,\nnumber of files/insertions/deletions, and a one-line summary of what the\nchange is trying to do (from commit messages / PR description). If the diff\nis empty, say so and stop.\n\nSkip generated files (`*.g.dart`, `*.freezed.dart`, `lib/l10n/app_localizations_*.dart`)\nexcept to verify they were regenerated when their sources changed. Treat\n`third_party/` as vendored: review it lighter — flag only correctness and\nsecurity issues, not style, and note divergence-from-upstream risk instead.\n\n## Review dimensions\n\nWork through the diff with these lenses, in this priority order:\n\n1. **Correctness & logic** — off-by-one, null/async races, wrong operator,\n   state not reset, error paths swallowed, edge cases (empty list, first\n   run, migration), broken invariants between files that changed together.\n2. **Maintainability & structure** — duplication that should be extracted,\n   wrong layer (business logic in widgets, UI concerns in repositories),\n   dead code added, public API surface grown without need, missing or\n   now-stale docstrings on touched functions.\n3. **Performance** — unnecessary rebuilds (missing `const`, provider\n   over-watching), N+1 queries, work in `build()` that belongs in a\n   provider/controller, unbounded growth (caches, listeners never disposed,\n   stream subscriptions leaked).\n4. **Security & privacy** — secrets or tokens in code/logs, injection into\n   SQL/shell/URLs, sensitive journal data written to logs or synced when it\n   shouldn't be, permissions widened.\n5. **Readability** — misleading names, comments that restate code or will\n   rot, control flow that needs a rewrite to be followed (only when it\n   genuinely impairs the next reader — see nitpick rule above).\n\n## Project-specific checks (Lotti)\n\nThis repo has house rules; a change violating them is a real finding, not a\nnitpick. Verify against `AGENTS.md` (authoritative) — highlights:\n\n- **Tests**: one test file per source file, mirrored paths; centralized\n  mocks (`test/mocks/mocks.dart`), fallbacks, and `makeTestableWidget` /\n  `setUpTestGetIt` helpers; no `Future.delayed`/`sleep`/real timers; no\n  `DateTime.now()`; meaningful assertions only (`findsOneWidget` alone is\n  not a test). New/changed behavior in `lib/` without matching test changes\n  is worth flagging.\n- **l10n**: no hardcoded user-visible strings; new labels added to every\n  full catalog in `lib/l10n/`, with `app_en_GB.arb` getting an entry only\n  where British spelling differs (list, exception and register rules in\n  `knowledge/conventions/localization.md`); generated l10n Dart files never\n  hand-edited.\n- **Design system**: no raw spacing numbers, `TextStyle` constructors, or\n  ad-hoc colors — tokens (`tokens.spacing.*`, `tokens.typography.*`,\n  `tokens.colors.*`) are mandatory in UI code.\n- **UI stability**: async providers must not flash loading/empty shells on\n  background refresh (`skipLoadingOnReload` or equivalent).\n- **Docs & release hygiene**: feature READMEs updated when behavior\n  changed; a release note as a new `changelog.d/YYYY-MM-DD-slug.md` fragment\n  (only for user-visible changes). A PR that edits `CHANGELOG.md`, the flatpak\n  metainfo, or the `version:` line in `pubspec.yaml` is a finding, not a\n  courtesy — those three belong to the release alone.\n- **Conventions**: Conventional Commits; no dependencies from new code onto\n  old code being replaced; no hoarded/unused code.\n\nDo not re-run the analyzer or tests as part of the review by default — this\nis a reading review. If a finding hinges on runtime behavior you cannot\ndetermine by reading (e.g. \"does this provider rebuild?\"), say so and mark\nthe finding as needing verification rather than asserting it.\n\n## Output format\n\nDeliver the review as a single final message:\n\n1. **Verdict line** — one sentence: overall assessment (e.g. \"Solid change\n   with two real issues and one suggestion\" or \"Clean — no issues found\").\n2. **Scope statement** — the paragraph described above.\n3. **Findings**, ordered by severity, each formatted as:\n\n   ```text\n   ### <severity> — <one-line summary>\n   `path/to/file.dart:123`\n   Why it's a problem: <one or two sentences>\n   Suggestion: <concrete fix or better approach; short code sketch if it helps>\n   ```\n\n   Severity levels: **Blocker** (must fix before merge — bugs, security,\n   data loss), **Should fix** (real maintainability/performance cost),\n   **Consider** (worthwhile improvement, author's call). Do not pad lower\n   tiers to seem thorough — an empty tier is fine.\n4. **What's done well** — one short paragraph max, only if genuinely\n   noteworthy (patterns worth repeating), never as filler praise.\n\nKeep the whole review proportional to the diff: a 20-line diff gets a short\nreview. If the real issues would make a long list, the change needs a rewrite\nconversation, not a list; say that instead.\n\n## What NOT to do\n\n- Do not modify any code. This skill is read-only; if the user wants fixes\n  applied, they will ask after reading the review.\n- Do not flag issues in code the diff merely touches adjacent to (moved\n  lines, re-indentation) — pre-existing problems may be *mentioned* once,\n  clearly labeled \"pre-existing, out of scope\".\n- Do not restate the diff's contents as findings (\"this adds a provider\")\n  — every finding must carry a judgment.\n- Do not hedge to inflate counts: if you're unsure it's a problem, either\n  verify by reading more code or drop it.\n\n<!-- File: .claude/skills/tutorial-videos/SKILL.md (Tokens: ~2634 | Category: anthropic-skill) -->\n---\nname: tutorial-videos\ndescription: Build, debug, extend, localize, or publish the automated tutorial videos — the workbench that drives the real Linux app under Xvfb (virtual mic, live Voxtral transcription, task-agent proposals), records the screen, narrates with Gemini or ElevenLabs TTS, fast-forwards waits, composes MP4s via OpenMontage, and uploads finished videos to Cloudflare R2 for docs-site embedding. Use when asked to \"build/regenerate the tutorial video(s)\", add a tutorial scenario, add a tutorial locale, fix a broken tutorial run, adapt the pipeline, or upload/publish a video.\nargument-hint: \"<what to do, e.g. 'build de+en', 'add scenario X', 'debug the failing run'>\"\n---\n\n# Tutorial Video Workbench\n\nArchitecture and rationale live in `tools/tutorial_videos/README.md` — read\nit first. This skill is the operational runbook.\n\n## Build videos\n\n```sh\nmake tutorial_video TUTORIAL_LOCALE=de                       # one locale (~5-8 min)\nmake tutorial_video TUTORIAL_LOCALE=de TUTORIAL_DEVICE=mobile # phone-shaped window, `_mobile`-suffixed output\nmake tutorial_videos_all                                     # all TUTORIAL_LOCALES\n```\n\n`TUTORIAL_DEVICE` (`desktop`|`mobile`, default `desktop`) picks the capture\nwindow size — see the README's \"Desktop vs. mobile\" section for the\nbreakpoint rationale and the `tutorialDeviceIsMobile()` test hook.\n\nPreconditions (fail fast if missing):\n- `.env` at repo root with `GEMINI_API_KEY`, `MELIOUS_API_KEY`,\n  `MELIOUS_BASE_URL`. If absent, the keys can be extracted from the dev\n  app's `ai_config.sqlite` provider rows (never print or commit them).\n  `ELEVENLABS_API_KEY` too when narrating with ElevenLabs\n  (`--tts-engine elevenlabs`) — that one is not in the app's config, ask\n  the user for it.\n- Sibling `../OpenMontage` checkout at the commit pinned in\n  `tools/tutorial_videos/config/openmontage.pin`, bootstrapped via\n  `make -C ../OpenMontage setup`.\n- `Xvfb`, `ffmpeg`, `pactl`, `paplay`, `x11-utils` installed; Flutter via\n  `fvm`.\n\nOutput lands in `build/tutorial_videos/<scenario>_<locale>.mp4`. Verify with\nframe extraction (`ffmpeg -ss <t> -frames:v 1`) and check: cursor visible and\ngliding, HUD clock top-center, transcript/proposals on screen, narration\naudible at step starts (`volumedetect`), duration ≈ warped timeline total.\n\n## Publish to R2\n\n```sh\nmake tutorial_video_publish TUTORIAL_SCENARIO=create_task_from_audio TUTORIAL_LOCALE=de\nmake tutorial_video_publish TUTORIAL_SCENARIO=create_task_from_audio TUTORIAL_LOCALE=de TUTORIAL_DEVICE=mobile\n```\n\nUploads `build/tutorial_videos/<scenario>_<locale>.mp4` (or, with\n`TUTORIAL_DEVICE=mobile`, `<scenario>_<locale>_mobile.mp4`) to Cloudflare R2\nat the matching `tutorial-videos/...` key and prints its public r2.dev URL —\nthis is the URL the docs-site `TutorialVideo` component builds from\n`TUTORIAL_VIDEO_BASE_URL`/`tutorialVideoBaseUrl`. `TUTORIAL_DEVICE` must\nmatch whatever `--device` the video was built with, or publish will look for\na file that was never produced. Full one-time Cloudflare setup (API token,\nenabling the bucket's public r2.dev URL) and the `.env` variable list are in\nthe README's \"Publishing to Cloudflare R2\" section — read it before the\nfirst publish.\n\n`boto3` (needed only by publish, not by build/tts/validate) is not installed\ninto the system Python on this host (PEP 668). Either run publish through\n`tools/tutorial_videos/.venv` (`.venv/bin/python3 -m tutorial_videos publish\n--scenario ... --locale ...`, created via `python3 -m venv .venv &&\n.venv/bin/pip install boto3 pyyaml`), or install `boto3` into whatever\nPython `make tutorial_video_publish` resolves to.\n\n## The pipeline in one paragraph\n\n`python3 -m tutorial_videos build` (run from `tools/tutorial_videos/`) does:\nTTS pre-pass (Gemini by default, `--tts-engine elevenlabs` to switch; cached by content hash → durations manifest) → Xvfb +\nvirtual-mic null sink + ffmpeg x11grab capture → `fvm flutter drive` runs\n`integration_test/tutorial/<scenario>_tutorial_test.dart` against the real\napp (penguin demo world + Melious/Voxtral/Qwen agent config seeded, UI\nlanguage via `MANUAL_LANGUAGE` settings row) → the test emits\n`timeline.json` (step boundaries, wait spans, zero epoch) → `timewarp.py`\nplans fast-forward segments for the waits (narration never overlaps) →\n`compose.py` warps the capture and drives the pinned OpenMontage headlessly\n(narration placement + mux) → ffprobe validation.\n\n## Debugging a failing run\n\n1. The run log tail shows the failing step and a `Diagnostics:` line\n   (current route, detail stack, key widget presence).\n2. **Look at the failure screenshot first**:\n   `build/tutorial_videos/failure_<context>.png` is captured at the moment of\n   every timeout — it almost always explains the failure instantly.\n3. Reproduce faster without video: run the same test via `flutter drive`\n   directly (see the doc comment in\n   `integration_test/tutorial/tutorial_harness.dart` for the env contract);\n   Xvfb + sink setup must match `session.py`.\n4. Common causes, in order of historical frequency: a finder matching an\n   offstage duplicate (scope to the visible page + `.hitTestable()`), a\n   scroll helper given a non-vertical scrollable, a modal/dialog blocking\n   the UI (onboarding, discard-recording), the agent's\n   `automaticUpdatesEnabled` flag not sticking (set-and-verify), cloud\n   latency beyond a `pumpUntil` timeout.\n\n## Adding a locale\n\n1. Add the locale's text to\n   `tools/tutorial_videos/config/scenarios/<scenario>.yaml`: `title`,\n   `dictionary`, every step's `narration`, the dictation step's\n   `dictation_text`. Write informal register (du/tu) per repo l10n rules;\n   keep the penguin vocabulary.\n2. Add per-stream `style` lines for the locale under `engines.gemini` in\n   `config/voices.yaml` (style prompts in the target language —\n   Voxtral/Gemini behave better). ElevenLabs needs nothing per locale, as\n   long as `eleven_multilingual_v2` supports the language.\n3. `python3 -m tutorial_videos validate --scenario <s> --locale <l>` must\n   pass, then build. The app UI localizes itself via `LOTTI_MANUAL_LOCALE`\n   (same mechanism as manual screenshots; for a wholly new app locale, run\n   the `add-flutter-docusaurus-locale` skill first).\n4. Localized finder strings in the test (`localized(en:, de:)` /\n   `manualScreenshotText`) need the new locale only if its UI labels are\n   used as finders — prefer keys over text finders where possible.\n\n## Adding a scenario\n\n1. New YAML in `config/scenarios/<name>.yaml` — schema documented in\n   `create_task_from_audio.yaml` (unique step ids, exactly one\n   `dictation: true` step, per-locale text, `min_duration` floors).\n2. New `integration_test/tutorial/<name>_tutorial_test.dart` built on\n   `TutorialAppHarness` + `TutorialDriver`. Copy the structure of\n   `create_task_from_audio_tutorial_test.dart`:\n   - one `driver.step(id, action)` per YAML step, ids matching exactly;\n   - interactions via `driver.tapLikeUser` (cursor glide), waits via\n     `driver.pumpUntil*` (records fast-forwardable wait spans), scrolling\n     via `driver.scrollIntoView` with a **vertical** scrollable finder;\n   - anything that must be SEEN gets asserted via visible widgets, not just\n     the DB;\n   - wire the `diagnostics` and `onTimeout` hooks for failure screenshots.\n3. Iterate with builds; expect the first runs to fail — read the failure\n   screenshots, they carry the answer.\n\n## Non-negotiable gotchas\n\nThe full list with rationale is in the README's \"Hard-won constraints\" —\nthe ones that bite hardest: `flutter drive` not `flutter test` (no window\notherwise); `GDK_BACKEND=x11` + empty `WAYLAND_DISPLAY` (or the app opens on\nthe real desktop); Voxtral prompts in the audio's language (else it\ntranslates); `automaticUpdatesEnabled` set-and-verify (initial wake clobbers\nearly writes); 16ms pump cadence during holds (else animations render\nchoppy); timeline starts after startup settles; assert transcript keywords,\nnot exact strings.\n\n## Adapting / extending\n\n- **App Store preview**: `config/scenarios/app_store_preview.yaml` is the\n  narration of `make store_preview_ios`, not a tutorial — never\n  `make tutorial_video` it. Its step ids must stay the `_beatIds` of\n  `integration_test/store_preview_test.dart` (`tests/test_app_preview.py`\n  guards it), and all four lines together must leave the beats under 30 s\n  (`python3 -m tutorial_videos.app_preview pacing` fails first if not).\n  See the README's \"The App Store preview reuses the narration\".\n- **Compositor changes**: all OpenMontage API usage is isolated in\n  `tutorial_videos/om_compose_driver.py`; bump the pin in\n  `config/openmontage.pin` deliberately and re-verify determinism\n  (compose twice, compare `ffmpeg -f framemd5` of the streams — never file\n  hashes).\n- **TTS vendor**: implement the `TtsEngine` protocol (`tts/base.py`) next to\n  `tts/gemini.py` and `tts/elevenlabs.py`, register it with its `.env` key\n  in `tts/engines.py`, and give it an `engines.<name>` block (model + both\n  streams) in `config/voices.yaml`. Voices: switch ElevenLabs ones by\n  changing the voice id there; the README's \"TTS engines\" has the details.\n- **Speed/pacing knobs**: `timewarp.py` (`MAX_SPEED`, lead-in, narration\n  gap); per-step floors in the scenario YAML.\n- **Talking avatar**: `make tutorial_video TUTORIAL_AVATAR=1` (or `build\n  --avatar`) lays the scenario's avatar into the top-right corner of the\n  finished video, lip-synced to the narrator clips only — never the\n  dictation. It acts, not just talks: nods on stresses, a head tilt per\n  phrase, brow lifts, breathing, and in pauses it watches the app\n  (`tutorial_videos/avatar/acting.py`; tune there, check with\n  `avatar-preview`). Characters live in `tutorial_videos/avatar/characters.py`\n  (`CHARACTERS`): Pip the penguin by default, Theo for any scenario whose\n  YAML says `avatar: theo` (the onboarding does); `--avatar-character`\n  overrides it for one build, `--character` picks it for the two avatar\n  commands. `--avatar-position` / `avatar-overlay --position` move it to\n  another corner; `avatar-overlay --video <built mp4>` adds it to an\n  already-built video as `<stem>_avatar.mp4`; `avatar-preview --wav <wav>`\n  renders the character alone — check any art change at badge size with it\n  first.\n  See the README's \"Talking avatar\".\n\n<!-- File: tools/tutorial_videos/config/scenarios/app_store_preview.yaml (Tokens: ~300 | Category: anthropic-skill) -->\n# Scenarios Skill\n\nPath: `tools/tutorial_videos/config/scenarios/app_store_preview.yaml`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/tools/tutorial_videos/config/scenarios/app_store_preview.yaml)\n\n<!-- File: tools/tutorial_videos/config/scenarios/category_setup.yaml (Tokens: ~300 | Category: anthropic-skill) -->\n# Scenarios Skill\n\nPath: `tools/tutorial_videos/config/scenarios/category_setup.yaml`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/tools/tutorial_videos/config/scenarios/category_setup.yaml)\n\n<!-- File: tools/tutorial_videos/config/scenarios/create_task_from_audio.yaml (Tokens: ~300 | Category: anthropic-skill) -->\n# Scenarios Skill\n\nPath: `tools/tutorial_videos/config/scenarios/create_task_from_audio.yaml`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/tools/tutorial_videos/config/scenarios/create_task_from_audio.yaml)\n\n<!-- File: tools/tutorial_videos/config/scenarios/onboarding_first_run.yaml (Tokens: ~300 | Category: anthropic-skill) -->\n# Scenarios Skill\n\nPath: `tools/tutorial_videos/config/scenarios/onboarding_first_run.yaml`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/tools/tutorial_videos/config/scenarios/onboarding_first_run.yaml)\n\n<!-- File: tools/tutorial_videos/config/scenarios/task_coding_prompt.yaml (Tokens: ~300 | Category: anthropic-skill) -->\n# Scenarios Skill\n\nPath: `tools/tutorial_videos/config/scenarios/task_coding_prompt.yaml`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/tools/tutorial_videos/config/scenarios/task_coding_prompt.yaml)\n\n<!-- File: tools/tutorial_videos/config/scenarios/task_cover_art.yaml (Tokens: ~300 | Category: anthropic-skill) -->\n# Scenarios Skill\n\nPath: `tools/tutorial_videos/config/scenarios/task_cover_art.yaml`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/tools/tutorial_videos/config/scenarios/task_cover_art.yaml)\n\n<!-- File: tools/tutorial_videos/config/scenarios/task_filters.yaml (Tokens: ~300 | Category: anthropic-skill) -->\n# Scenarios Skill\n\nPath: `tools/tutorial_videos/config/scenarios/task_filters.yaml`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/tools/tutorial_videos/config/scenarios/task_filters.yaml)\n\n<!-- File: tools/tutorial_videos/config/voices.yaml (Tokens: ~300 | Category: anthropic-skill) -->\n# Config Skill\n\nPath: `tools/tutorial_videos/config/voices.yaml`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/tools/tutorial_videos/config/voices.yaml)\n\n<!-- File: .claude/skills/add-flutter-docusaurus-locale/scripts/audit_locale.py (Tokens: ~300 | Category: claude-rule) -->\n# Claude Directive: audit_locale.py\n\nPath: `.claude/skills/add-flutter-docusaurus-locale/scripts/audit_locale.py`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/.claude/skills/add-flutter-docusaurus-locale/scripts/audit_locale.py)\n\n<!-- File: .claude/skills/design-review-panel/panel_workflow.js (Tokens: ~300 | Category: claude-rule) -->\n# Claude Directive: panel_workflow.js\n\nPath: `.claude/skills/design-review-panel/panel_workflow.js`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/.claude/skills/design-review-panel/panel_workflow.js)\n\n<!-- File: .claude/skills/maintain-docusaurus-manual/scripts/audit_docusaurus_locales.py (Tokens: ~300 | Category: claude-rule) -->\n# Claude Directive: audit_docusaurus_locales.py\n\nPath: `.claude/skills/maintain-docusaurus-manual/scripts/audit_docusaurus_locales.py`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/.claude/skills/maintain-docusaurus-manual/scripts/audit_docusaurus_locales.py)\n\n<!-- File: tools/matrix_provisioner/README.md (Tokens: ~300 | Category: plugin-manifest) -->\n# matrix_provisioner Documentation\n\nPath: `tools/matrix_provisioner/README.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/matthiasn/lotti/HEAD/tools/matrix_provisioner/README.md)\n\n<!-- ... +15 more modular skills available via /api/skills/matthiasn/lotti?path={path} -->\n</yakaai_skills>"}