DDeftTask
Private beta · iPhone, iPad & Mac

Your tasks live where your thinking does.

DeftTask is a native Swift productivity app for iPhone, iPad, and Mac. Tasks, notes, and calendar — stored locally in SQLite, synced privately through CloudKit. Works offline. No app-owned server required.

Native Swift · SwiftUI · iOS 17+ · macOS 14+

Features

One app. Every surface of your work.

Notes + Tasks

Tasks embedded in your thinking

Write a meeting note, a project spec, a daily log — and drop tasks inline with a checkbox. DeftTask converts standard markdown checkbox lines into first-class persistent tasks, synced to SQLite and visible in Today, Do Mode, and Apple Reminders. The note is the context. The task carries the metadata.

Smart vs dumb: lines with an HTML-comment UUID anchor are smart tasks that sync, appear in task counts, and project to Reminders. Bare checkboxes in ordinary notes stay as lightweight dumb checklists — never polluting your task backlog.

Markdown anchor format (ADR-005/ADR-011)

- [ ] Follow up with design <!-- task:550e8400
         priority:high plan:2026-06-15 -->
- [x] Set up repo <!-- task:6ba7b810 created:2026-03-20 -->
- [ ] Write tests  <!-- task:6ba7b811 tags:testing -->

Workspaces + Files

Your filesystem. No rearranging required.

Connect a local folder and DeftTask shows your real directory hierarchy as the primary navigation surface — markdown files, PDFs, images, and all other file types, side by side. No import step that clones your content into an opaque database.

On macOS, an always-on file watcher keeps task state in bidirectional sync between SQLite and .md files. Edit a task in Vim or VS Code; the app sees it. Complete a task in the app; the file updates in under a second. LLM agents can manage your tasks by editing .md files directly — no MCP server, no API.

Data flow (ADR-009)

File changed on disk
  → NoteFileWatcher (debounced)
  → PendingWriteTokenRegistry check
  → WorkspaceTaskSyncService
  → GRDB upsert → CloudKit sync
  → other devices

Planning + Calendar

Plan your day from inside your notes

Set a plan date, duration, and priority on any task. DeftTask assembles your scheduled view from those signals. Google Calendar integration (direct OAuth, no backend) brings events alongside tasks so you can time-block realistically.

Do Mode focuses you on one task at a time, tracking session completions and elapsed time. Quick Add captures inbox tasks instantly — no note required. Routines handle recurring commitments with RRULE recurrence and per-instance state overrides.

Task schema (ADR-007)

tasks (
  planAt       TEXT,  -- ISO 8601 date
  deadlineAt   TEXT,
  durationMins INTEGER,
  priority     TEXT,  -- none/low/medium/high
  inbox        INTEGER -- 0/1
)

Architecture

Built on decisions, not defaults

Every major architectural choice has a written rationale. Here is what the system is made of and why each component was selected over its alternatives.

External edit (.md)
NoteFileWatcher
SQLiteData/GRDB
CKSyncEngine
CloudKit Private DB

Echo suppression at each transition · Write tokens · Origin flags · CloudKit sync guard

SQLiteData / GRDB

Why

Full SQL with no limitations: JOINs, aggregates, window functions, FTS5 full-text search, STRICT mode type safety. PowerSync and SwiftData both had unacceptable constraints; GRDB has 10+ years of production use.

One local SQLite database stores tasks, notes, projects, areas, routines, and note bodies. Every write is a transaction. Every query is a prepared statement. FTS5 enables fast search across all notes without a separate index service.

SELECT * FROM tasks
WHERE planAt < date('now', '+1 day')
  AND status = 'todo'
ORDER BY priority DESC, planAt ASC

CloudKit Private Database

Why

$0 backend cost — all data lives in the user's private iCloud database. No Supabase billing, no PowerSync monthly fee, no per-request charges. CKSyncEngine handles conflict resolution, push delivery, and retry with backoff.

End-to-end encrypted by default. CloudKit fields can never be removed after production deployment — the schema was designed upfront for that immutability. Every field is optional to handle CKSyncEngine conflict scenarios safely.

Markdown Anchors

Why

Tasks embedded in notes need stable identity that survives external editing, copy-paste, and round-trips through other editors or LLM agents. HTML comments are invisible in rendered markdown but machine-readable.

UUID anchors carry compact metadata: priority, scheduled date, deadline, duration, tags. Stripped UUIDs create new tasks rather than silently corrupting existing records. The task_note_anchors table persists source context across app restarts.

- [ ] Follow up <!-- task:550e8400
         priority:high plan:2026-06-15
         tags:design -->

Apple Reminders Projection

Why

Users already live in Reminders. DeftTask can sync any task to a Reminder — but Reminders is a read projection, not the source of truth. Deleting a Reminder disables sync; it never cascades to delete the DeftTask task.

Three-way shadow merge: DeftTask wins on conflicts. The task_external_links table tracks the 1:1 binding and a JSON shadow of the last-synced field set, enabling reliable change detection without polling all fields.

Echo Suppression

Why

Bidirectional sync across three surfaces (SQLite ↔ .md files ↔ Apple Reminders) can loop. No single edit may traverse more than one directed edge synchronously — three independent suppression mechanisms enforce this invariant.

Write token tagging prevents the file watcher from re-ingesting self-writes. An origin flag on the DB observer prevents re-entrancy on file-sourced changes. CloudKit's _isSynchronizingChanges guard prevents blocking the sync engine thread.

WriteTokenFileWriter.write()
→ PendingWriteTokenRegistry.register(token)
→ NoteFileWatcher.isTagged() → skip

Always-On Workspace Sync

Why

LLM agents and external tools need file-level task access without an API or MCP server. Making .md files a first-class sync target means any tool that can read and write files can manage DeftTask tasks.

TaskFileIndex maps UUIDs to file paths in memory. NoteFileWatcher detects external edits using DispatchSource filesystem events (one source per directory). TaskDBObserver renders DB changes back to files within 300ms of a GRDB write observation.

File edit in Vim → NoteFileWatcher
→ WorkspaceTaskSyncService
→ GRDB upsert
→ CloudKit → other devices

Architecture decisions documented in version-controlled ADRs · ADR-007 through ADR-011

Methodology

Built like a product, not a prototype

Generic SaaS wrappers trade architecture for speed. DeftTask made the opposite trade — native performance and local-first reliability over a simpler backend stack.

Native Swift, not Electron

SwiftUI and native Apple APIs throughout. The note editor is Lexical in a WKWebView with a postMessage bridge — not a wrapped web app. Mac Catalyst gives genuine macOS behavior: menu bar, keyboard shortcuts, system sidebars. Minimum target: iOS 17, macOS 14.

$0 backend cost by design

No Supabase, no PowerSync, no proprietary sync backend, no monthly infrastructure bill. CloudKit's private database is free — storage counts against the user's own iCloud quota. No per-request charges. No vendor lock-in. The architecture was chosen to eliminate cost risk at scale, not to minimize initial effort.

Offline-first without exceptions

SQLite is the canonical store. Every operation — create, complete, reschedule, tag — works without a network connection. CKSyncEngine delivers changes to other devices when connectivity returns. There is no degraded mode, no spinner, no 'requires internet.'

Architecture decisions are version-controlled

Every major technical decision has an Architecture Decision Record: why SQLiteData over SwiftData or CloudKit-only, why markdown anchors use HTML comments, why three-way shadow merge for Reminders conflicts. The rationale lives alongside the code and survives team changes.

DeftTask vs. generic SaaS productivity tools

AspectDeftTaskTypical SaaS tool
StorageLocal SQLite (GRDB) + CloudKit private DBRemote Postgres / backend database
Sync cost$0 — user's iCloud quotaPer-seat or usage-based billing
OfflineFull functionality, alwaysDegraded or unavailable
PrivacyE2E encrypted, private CloudKit DBData on third-party servers
File accessBidirectional .md sync on macOSAPI or export only
LLM agent accessEdit .md files directlyRequires MCP server or custom API
PlatformNative Swift / SwiftUIElectron or React Native
Private beta

Get early access to DeftTask

DeftTask is in private beta for iPhone, iPad, and Mac. Request access and help shape the product. Early testers get direct input into features, architecture, and priorities.

Request beta access →

[email protected] · Apple platforms only

iPhone (iOS 17+)iPad (iPadOS 17+)Mac (macOS 14+)