A Windows-wide AI spell checker. Select text in any app, press the hotkey, and the corrected text replaces the selection in place. It is a native Rust tray app with a small dashboard, shipped through Velopack and GitHub Releases. The user is Elliot, who runs it all day.
Speed is the product. The hotkey path must feel instant. Prefer the simplest, lowest-level implementation that measurably improves the complete correction path while staying correct. Question unnecessary work before tuning it. Every PR is gated on request size and end-to-end latency (see Verifying).
Collaboration: speed first, simplicity second, minimal UI third. Be concise and decide fast.
Prod and Dev run side by side from the same code:
| Prod | Dev | |
|---|---|---|
| Build | --no-default-features |
default (dev feature) |
| Hotkey | Ctrl+Alt+U | Ctrl+Alt+D |
| Settings and API keys | %LocalAppData%\UniversalSpellCheck.Data |
%LocalAppData%\UniversalSpellCheck.Dev |
| Logs (shared) | %LocalAppData%\UniversalSpellCheck.Data\logs |
same |
- Channel constants live in
rust/src/channel.rs. Never hardcode a hotkey, mutex, data folder or display string elsewhere. - Logs are shared, settings are isolated. Both channels append to one daily JSONL corpus, stamped per line with
channel,app_versionandpid. Never split logs by channel; the unified corpus is the fine-tune dataset. - User data never lives in Velopack's install root (
%LocalAppData%\UniversalSpellCheck), which reinstalls replace. Keep the legacy-data migration intact. - One update flow. Launch, periodic, tray and dashboard checks all go through the single
Updaterworker inrust/src/update.rs. - Releases ship via tag. A
v*.*.*tag triggers.github/workflows/release.yml. Use thedeployskill for Dev pushes and Prod releases, including its closeout checklist. Never tag or runvpkby hand. - Never mix model parameter families. Standard models take
temperature; reasoning models takereasoning.effort. Seedocs/model-config.md. - Debug before fixing. When the cause is unclear, add logging, reproduce, read the log, then fix.
- A change is not running until it is rebuilt and relaunched.
- A failed correction never pastes over the user's selection. Rich formatting may fall back to plain text; a completed correction is never dropped just because formatting failed.
- The dashboard never blocks the hotkey. Log I/O and scans stay off the UI thread, and the first render is one 30-row page.
rust/src/is the app.runtime.rsruns a correction (capture, protect, request, post-process, rich mapping, paste);app.rsowns the tray, hotkey and lifetime;dashboard.rsis the GUI;http.rsis WinHTTP;core.rsholds the prompt, payload, literal protection and replacements;rich.rs,rich_links.rsanddocs_native.rsrebuild formatting;bench.rsis the end-to-end harness.rust/vendor/native-windows-gui/is a patched dependency; see itsPROVENANCE.mdbefore touching it.bench/holds the frozen cases (cases.json), recorded model answers (replay.json), the request-size budget (perf-budget.json) andperf.py.replacements.jsonis the user's brand and casing fixes, applied after the model..agents/skills/holdsdeploy,read-logsandformatting-troubleshoot._archive/holds retired code kept for history (AHK app, fine-tune tooling). It is not built or maintained.
Read the matching doc before working in its area:
docs/architecture.md: the correction pipeline, threading, clipboard, updates and the dashboard, plus traps that broke before.docs/formatting.md: literal protection, replacements, terminal normalization and rich-text (CF_HTML, Google Docs) reconstruction.docs/logging.md: the JSONL format,spellcheck_detailfields, timings and developer evidence.docs/testing.md: the--benchharness, the performance gate and how to verify a change.docs/model-config.md: models, payloads and API keys.DESIGN.mdandPRODUCT.md: read before any dashboard or visual change.
For runtime logs, use the read-logs skill (python .agents/skills/read-logs/scripts/logs.py --help); never parse log files by hand.
cargo test --manifest-path rust/Cargo.toml(Dev) and the same with--no-default-features(Prod). Addcargo clippy --all-targets -- -D warningsandcargo fmt --checkbefore pushing.- Processing changes: run
--transform-jsonor--rich-jsonover stdin for a deterministic replay, and extend the existing table tests (formatting-contracts.jsonl,bench/replay.json) rather than adding new ones. - Hot-path changes: build
--releaseand rununiversal-spell-check.exe --bench. It takes the foreground for about 10 seconds, so run it on an idle desktop. Compare builds withpython bench/perf.py --base <old.exe> --candidate <new.exe>. - If you change the prompt or payload, run
USC_UPDATE_BUDGET=1 cargo test perf_budgetand expect CI to fail if requests grow. Only Elliot accepts that, with theperf-regression-acceptedlabel. - After changing docs, structure or config, update the doc that owns the fact in the same change. Don't add a doc when an existing one can own it.
Maintenance: this file is a letter — short, intent-only, grown one earned
line at a time. Agent: as you work, watch for things this letter should
learn — new or ambiguous vocabulary (glossary candidates), corrections the
user has had to repeat, anything that changes the intent, rules, or routing
written here. When you notice one, invoke the estack-claude-md-optimizer
skill (quick capture): ask the user in one line whether to add it, and if yes do
it right then — under 5 minutes, do it now — then return to your task.
Never silently append, and never let a noticed improvement get lost. For
humans: run the skill directly — refine to audit, session-capture after
working sessions, scale-check before adding any routing.