qor Tech Spec

The core functionality of qor: what every feature gets, and how it works underneath. As of November 29, 2026.

Overview

qor is a local desktop app (Electron, React, TypeScript) whose core lets drop-in features share storage, theming, backups, a dashboard and Claude access. It has no server or database. All state is files in one data directory.

This is an as-built spec: it describes qor as the code works today.

In scope (core)Out of scope
Feature and theme contract, discovery, hostingThe internals of the 9 features (To Do, Health, Job Tracker and others)
Storage, enablement, dashboard layout, backupsThe styling of the 10 themes
Claude providers, background jobs, email intakeThe vendored Go job-hunter tool
Shared services: metrics, PDF and email export, web fetchGmail, Google Health and Oura sync behaviour, beyond how core uses them

Design rules

  • Drop-in extensions. Adding a folder under features/ or themes/ registers it at build time. There is no manifest to edit.
  • Content and presentation are separate. Features build UI only from the theme's components.
  • Disabling never touches content. It writes one flag to config/features.json.
  • Claude is swappable. Features call one interface and don't choose the provider.

Architecture

qor has two main layers. The renderer runs all UI and extension code, and the main process owns files, credentials, subprocesses and most network access.

Renderer process (React, no Node access)features/ and themes/Drop-in code, imports only @qor/theme-kitShellSidebar, dashboard grid, SettingsRenderer coreRegistry, FeatureHost, ThemeProvider, IntakeProvideruseFeatureData, job queue, Claude and metrics clientsPreload bridge: window.qorcontextIsolation onMain process (Node): IPC handlers and timersStorage and backupAtomic JSON writesConfig, scheduled snapshotsClaude serviceCLI or API providerUsage and timing recordsShared servicesIntake, Gmail, PDF and emailWeb fetch, feature adaptersData directoryJSON files on local diskClaudeclaude binary or Anthropic APIExternal servicesGoogle, Oura, web pagesIPC invoke
The renderer reaches disk and network only through the main process.
LayerPathResponsibility
Mainsrc/main/Files, backups, Claude transport, PDF export, IPC handlers, timers
Preloadsrc/preload/The only bridge into the renderer. contextIsolation is on, nodeIntegration off
Renderer coresrc/renderer/core/Extension contract, discovery, hosting, storage hook, jobs, theming
Sharedsrc/shared/Types and IPC channel names used by both sides
Extensionsfeatures/, themes/Found by import.meta.glob at build time

At startup, main creates the data folders, registers IPC and starts the backup timers. It also starts two other tasks:

  • A scan of local Claude Code transcripts, every 5 minutes.
  • A Job Tracker reply check. Main polls every 15 minutes and runs it when enabled and due (default once a day).

Data Model

All state sits in one directory, and a feature's id is also its content filename. The directory is $QOR_DATA_DIR if set. Otherwise it is .qor-dev-data/ in development or userData/qor-data/ when packaged.

config/content/app.json: theme, Claude, backup, timesfeatures.json: enabled flag per feature iddashboard.json: ordered widget layoutsintake.json: mailbox, senders, checkpointgmail.json, gmail-2.json: OAuth secretsgooglehealth.json, oura.json: OAuth secretsOne file per feature id: todo.json, and so onEach feature defines its own shapeLoaded as a shallow merge over initialDatabackups/config/Every 12 hours by default, keeps 20backups/content/Every 15 minutes by default, keeps 48folder copyfolder copyNot backed upmetrics/runs.jsonl: one line per timed run or eventintake/queue.json: emailed items waiting for a feature
One data directory, with config and content backed up separately.
TypeKey fieldsNotes
AppConfigthemeId, claude, backup, manualTimes, manualBaselinesStored values are merged over defaults, so new keys appear on upgrade
FeatureStatesid → enabled, changedAtA missing entry means enabled
WidgetLayoutfeatureId, w, h, collapsed, hidden24-column grid, 50 px rows, layout version 2. Version 1 values are doubled on load
IntakeMessageid, receivedAt, from, subject, bodyIgnored after 30 days
MetricRecordfeature, process, startedAt, durationMs, ok, error, counts, stepsMsRebuilt and validated in main before it is appended
BackupEntrykind, id, createdAt, sizeBytesid is the kind plus a sortable timestamp

Storage guarantees

  • Atomic replace. writeJson writes a .tmp file, then renames it over the target.
  • Ordering. Writes are queued per file, and readJson waits for pending writes.
  • Id safety. Content reads and writes require ids of 1–64 lowercase letters, digits or hyphens, not starting with a hyphen.

Core Flows

FeatureHost gives every view the same context, and the renderer queues slow or emailed work so features can apply it.

Hosting and persistence

A feature has a required Page and optional Widget and Settings views. FeatureHost mounts each one inside an error boundary, so a render crash stays within that view.

Feature viewuseFeatureDataMain storagecontent fileon mount: data.read(id)read JSONmerged with initialDatasetData(updater)400 ms later: data.writetmp, renameunmount or window closeflush: data.write
Edits are saved after a 400 ms pause, and again on unmount.

The design assumes one hook per content file at a time.

Claude requests

Features call ask or askJson and don't choose a provider. ask() rejects empty prompts, and rejects skill requests unless the CLI provider is active.

FeatureClaude clientask() in mainProviderask or askJsonIPC, adds featureIdread config, check requestCLI or API callreply and usagerecord timing;record usage if okClaudeAskResultvalue, or throws
Every Claude request goes through one function in main.
BehaviourCLI provider (default)API provider
Transportclaude -p --output-format json, prompt on stdin, run from the temp directory@anthropic-ai/sdk, optional and loaded on first use
AuthThe user's Claude Code sign-inANTHROPIC_API_KEY, else the key in config
Structured outputSchema added to the prompt, JSON extracted from the replyNative json_schema format, then parsed
web, skill, toolsPassed as allowed toolsSkills rejected. web and tools ignored
Local filesRead tool plus the files' foldersAttached as PNG, JPEG or PDF blocks
Limits180 s default timeout, 32 MB output16,000 max tokens by default. timeoutMs is not applied
RefusalsReported only if the CLI returns an errorOptional server-side fallback, retried without it if the call fails
  • Lean mode. lean: true keeps only the web or file tools needed and a short system prompt. It skips MCP servers, skills and user settings. It is ignored when skill or tools is set, and by the API provider. Project notes record an email-parse batch falling from about 41k to 2.3k tokens.
  • File access. Only main can set files. The IPC handler strips it from renderer requests.

Email intake

Intake lets a feature take instructions by email, and mail is fetched only when the user presses Check Email. Subjects must start with qor. The mailbox's own address is always accepted, and other senders must be on the allow-list.

GmailIntake in mainIntakeProviderFeatureHostCheck Email pressedsearch new mailmessagesfilter subject, senderqueue, then checkpointread queuequeued itemsmatching subjectintake.handle,then setDataack on successremove from queue
Main queues emailed items, and the mounted feature applies them.
  • A feature opts in with intake: { subject, handle }. It applies mail only while its page or widget is mounted.
  • If handle throws, the batch stays queued. The host retries on the next check or visit, so handlers must be all-or-nothing.
  • Concurrent checks share one run. Queue changes are serialised, and the last 500 message ids are remembered.

Background jobs

ctx.jobs.start queues slow work that continues after the user leaves the page. One job runs at a time across all features, in start order. A key already queued or running is ignored.

work returns a data update. Core applies it through the mounted feature's setData, or reads and writes the file if the feature is closed. A thrown error changes nothing. The queue is in memory, so it doesn't survive a reload or quit.

Interfaces and Configuration

Extensions have one public import, @qor/theme-kit, and reach main through services that core hands them.

Feature contract

FeatureModule memberRequiredPurpose
manifestYesid, name, description, optional icon and version
initialDataYesDefault content, and the base for the load merge
PageYesFull view with its own sidebar route
Widget, widgetDefaultsNoDashboard view and starting size
SettingsNoSection in the app's Settings page, mounted when expanded
intakeNoEmail subject and handler
FeatureContext groupMembers
Own datadata, setData, loading, saving
Cross-featurereadFeatureData, writeFeatureData, openFeature, openFullPage
Core servicesclaude, jobs, metrics, intake, exportPdf, emailDocument, webFetch
Feature-specific adaptersjobSearch, jobTracker, gmail, googleHealth, oura, digest, bodyScan, claudeUsage

Discovery, theming and dashboard

  • Discovery. The registry skips a feature with no Page, no manifest id or an unsafe id. It skips a theme with no id or components.
  • Themes. A theme supplies tokens, components and optional CSS and effects. Missing required components (32 listed) come from the default theme, and Settings marks the theme as partial.
  • Enablement. Disabled features leave the sidebar and dashboard. Their content and widget slot are kept.
  • Dashboard. New widgets are added automatically, and slots for removed features are dropped. Main clamps sizes and removes duplicates.
  • Reports. Features describe a PrintDocument, and core renders it as a PDF or an email body. Email goes only to the intake mailbox.

Backups

Content and config are snapshotted as plain folder copies on separate timers (see Data Model). By default, qor also backs up both on quit. Restore first snapshots the current state, then replaces the live folder, and the UI reloads.

Configuration and dependencies

ItemDetail
claude settingsprovider cli, cliPath claude, API model claude-opus-5, effort high, refusalFallback on
EnvironmentQOR_DATA_DIR moves the data directory. ANTHROPIC_API_KEY overrides the stored key
Runtime and buildElectron 31, React 18, TypeScript 5.5, electron-vite 2. dev and build also compile the job-hunter tool with Go
Optional@anthropic-ai/sdk for the API provider
Commandsnpm run dev, npm run demo, npm run typecheck, npm run build
MetricsAppended to metrics/runs.jsonl on a best-effort basis. A failed write never fails the run