The Problem
When engineers jump across multiple AI coding environments (Claude Code, OpenAI Codex, Cursor, Google Antigravity, OpenCode), Claude Web, and their terminal, active tasks, minute-budget daily plans, focus timers, and worklogs remain scattered across isolated transcripts. Switching assistants forces repetitive re-briefing, invites duplicate task creation on retries, and leaves unestimated tasks or missing worklogs invisible until week's end.
Daymark Agent Toolkit applies Shared Core, Multiple Interfaces: one deterministic TypeScript engine (@daymark/core) and one local SQLite database (daymark.sqlite) shared simultaneously across a standalone CLI (daymark), local STDIO MCP (daymark-mcp), a standalone React 19 + Node HTTP Web Dashboard (daymark-web on 127.0.0.1), and a Remote Streamable HTTP MCP server (/mcp) designed for Claude Web via Cloudflare Tunnel.
My Role & Constraints
I designed and built the entire 10-workspace monorepo (9 @daymark/* packages plus apps/web), strict ESM TypeScript contracts, Drizzle ORM SQLite schema/migrations, security hardening, cross-platform bundle generator, and verification matrix.
Key technical constraints:
- Local-first privacy and zero telemetry: all projects, tasks, focus sessions, and worklogs live locally in
daymark.sqliteunder strict POSIX permissions (0700data directories,0600database, config, and backups) with symlink traversal blocked and zero browser SQLite access. - Honest deterministic planning without LLM guesswork: daily minute-budget prioritization, IANA timezone/DST weekly rollups, and explicit data-gap warnings run in pure domain TypeScript; unset estimates or due dates stay
nulland surface explicitly rather than being fabricated. - Strict multi-surface parity and permission boundaries: CLI, local STDIO MCP, loopback Web UI, and Remote
/mcpinvoke the exact same guarded use cases with centralizedread/write/backuppolicy checks and local filesystem path redaction (dataDir: null) for browser and remote clients.
Key Decisions
1. Three-layer @daymark/core shared across CLI, Web UI, and Remote HTTP /mcp
Rather than letting each transport or UI re-implement task rules, @daymark/core cleanly isolates three internal boundaries: pure domain/ (planner.ts, reviews.ts, rules.ts, time.ts, records.ts) with zero Node fs, path, or Buffer dependencies; storage/ ports offering both synchronous DaymarkStore and cloud-ready AsyncDaymarkStore with TenantContext; and application/ (use-cases.ts, policy.ts) wrapping every operation in createGuardedDaymarkService. On top of this core sit daymark CLI, daymark-mcp (STDIO and /mcp Streamable HTTP with SHA-256 Bearer / OAuth verification, RFC 9728 metadata, and sliding-window RateLimiter), and daymark-web (127.0.0.1 loopback HTTP API enforcing Host, Origin/Sec-Fetch-Site, HttpOnly; SameSite=Strict cookies, and HMAC X-CSRF-Token).
One @daymark/core engine serving CLI, Local Web UI, and Remote /mcp
Domain rules, permission policies, and storage ports live in TypeScript rather than client adapters.
domain/ · storage/ ports · createGuardedDaymarkService() -> daymark.sqlite
Pure deterministic planner, DST-aware IANA reviews, PermissionPolicy (read | write | backup), and Drizzle SQLite.
daymark CLI + STDIO MCP
16 MCP tools, --json script mode, 3 portable skills, and 6 bundles across 5 AI coding hosts.
React 19 Web Dashboard (127.0.0.1)
Loopback HTTP server enforcing Host/Origin checks, HttpOnly cookie, HMAC X-CSRF-Token, and dataDir redaction.
Streamable HTTP (/mcp) + Tunnel
SHA-256 Bearer & OAuth verifier, RFC 9728 metadata, 429 rate limiter, and Cloudflare Tunnel configs.
2. Transactional single-active focus invariant, idempotency, and WAL crash recovery
Concurrent AI agents and UI tabs easily collide when starting focus timers or retrying task capture calls. @daymark/storage-sqlite enforces a single active focus timer directly in SQLite via a forward-only partial unique index (WHERE status = 'active') paired with WAL mode and synchronous ACID transactions in better-sqlite3, returning a typed FOCUS_SESSION_ALREADY_ACTIVE error with actionable recovery guidance instead of corrupting timers. Furthermore, idempotency keys deduplicate retried captures/worklogs, while checkSqliteIntegrity() powers daymark doctor (DATABASE_CORRUPT) alongside automated SIGTERM/SIGKILL mid-write WAL recovery tests and dry-run backup restores.
Replacing fragmented chat transcripts with transactional SQLite truth
How single-active focus constraints, idempotency keys, and honest data gaps stay consistent.
Trapped context & conflicting timers
Switching IDEs lost task priority, duplicated tasks on retries, and left untracked time gaps.
Manual re-briefing on every agent switch
ACID constraints & honest data gaps
Every CLI, Web UI, and MCP client shares one WAL database with 0700/0600 permissions.
3. Canonical platform packaging with honest verification boundaries
Instead of hand-maintaining separate manifests and skill copies across five coding tools, @daymark/platform-adapters emits 6 platform bundles (antigravity, opencode, claude-code, codex, cursor-agent-plugin, cursor-native) from one canonical model and validates relative paths, symlinks, and secret hygiene via pnpm verify:packages. To avoid overstated marketing claims, pnpm verify:matrix strictly separates verified live runs from smoke-tested automated transport runs when proprietary CLIs are absent.
Separating what passed live host runs (
Antigravity,OpenCode,Web UI) from automatedStdioClientTransportandStreamableHTTPClientTransportchecks (Claude Code,Codex,Cursor,Claude Web) keeps compatibility claims auditable.
The Build
Every surface executes against the shared OPERATION_POLICY and createGuardedDaymarkService boundary (packages/core/src/application/policy.ts) backed by Drizzle SQLite tables (packages/storage-sqlite/src/schema.ts):
// Verified centralized operation policy & redaction context in @daymark/core
export type PermissionScope = "read" | "write" | "backup";
export interface ExecutionContext {
principalId: string;
tenantId: string;
source: AgentSource;
scopes: readonly PermissionScope[];
allowDestructive?: boolean;
redactLocalPaths?: boolean;
}
export function isOperationAllowed(
operation: DaymarkOperation,
context: ExecutionContext,
): boolean {
const rule = OPERATION_POLICY[operation];
if (!context.scopes.includes(rule.requiredScope)) return false;
if (rule.sensitivity === "destructive" && context.allowDestructive === false) {
return false;
}
return true;
}# Full verification & cross-platform evidence matrix
pnpm test && pnpm test:integration && pnpm verify:packages && pnpm verify:matrixOutcome
- Built 10 workspace projects (9
@daymark/*npm-ready packages +apps/web) exposing 16 MCP tools (6 Read, 8 Write, 2 Review), 3 portable skills, CLI (daymark), React 19 Web Dashboard (daymark-web), and Remote Streamable HTTP/mcpwith validatedcloudflaredtunnel templates. - Passed 29 automated Vitest tests across 11 suites: 4 unit suites (11 tests) completing in ~230ms plus 7 integration suites (18 tests) verifying tri-surface DB sharing (STDIO MCP + Web Dashboard + Remote HTTP
/mcp), OAuth/Bearer scope matrix,429rate limiting,SIGTERM/SIGKILLcrash recovery, backup restore, and 5-platform adapter handoffs. - Honest Platform Matrix (
2026-11-26): Verified live on Google Antigravity (agy 1.5.17strict plugin validation + live MCP session), OpenCode (v2.2.5standalone run sharing SQLite with Antigravity), and Standalone Web Dashboard (Chromium captures across Overview, Daily Plan, Weekly Review); Smoke-tested via automatedStdioClientTransport/StreamableHTTPClientTransportsuites on Claude Code, OpenAI Codex, Cursor, and Claude Web (host CLIs/cloud account outside build host).
Reflection
Expanding Daymark from a CLI + STDIO toolkit to also power a loopback React Web Dashboard and a Remote Streamable HTTP /mcp endpoint showed the payoff of keeping domain/ free of Node I/O from day one: adding two entirely new transports and security layers required zero rewrites to planning or review logic.



