Planning
63 documents
Code Quality
Agent instruction files (AGENTS.md / CLAUDE.md)
Ship a lean machine-targeted instruction file at the repo root that states build/test/run commands, conventions, and what is out of scope.
Algorithmic Complexity
Characterize the computational profile of each candidate scope group by identifying dominant algorithms, data structures, and complexity characteristics.
App Interactions
Characterize how components communicate within the application — delegation, pub/sub, shared state, and other in-process coordination patterns.
Architecture
Use MVVM with [CommunityToolkit.Mvvm](https://learn.microsoft.com/en-us/dotnet/communitytoolkit/mvvm/) — source-gener...
Choosing a .NET target framework
Pick a .NET target framework from the documented support cadence: LTS for apps, multi-target libraries, pin the SDK.
Choosing a Windows UI framework and deployment model
Decide a Windows UI framework and deployment model deliberately and early; package identity is mandatory for notifications and background tasks.
Cross-Cutting Detection
Distinguish concerns that span all scope groups (cross-cutting — do not isolate) from shared infrastructure that is itself a coherent group.
Dependency Clusters
Identify scope groups by measuring internal coupling density versus external coupling — files that import each other heavily belong together.
Essential vs accidental complexity
Separate the irreducible complexity of the problem from incidental complexity, then spend agents on the incidental and design review on the essential.
Framework Conventions
Identify the architectural patterns imposed by the chosen framework and use those conventional units as primary scope group candidates.
Interface Cohesion
Group files by their shared public API surface — types, protocols, and exported symbols that define a coherent contract.
Kotlin Multiplatform
Share domain and data logic broadly across platforms with KMP; choose shared vs native UI per platform maturity.
Lifecycle Patterns
Identify scope group boundaries by finding groups of objects that are created, owned, and destroyed together as a unit.
Module Boundaries
Identify scope group candidates by locating explicit build targets, package manifests, and declared module boundaries.
Purpose Classification
Classify every file by its primary reason for existing, and verify that each candidate scope group has a single coherent purpose.
Runtime Conditions
Identify permissions, entitlements, environment checks, and configuration prerequisites that constrain when and where code can execute.
Scope discipline
Only modify what was requested. State the goal before starting. Note but do not fix adjacent issues.
Search for existing solutions before building
Before writing new code, check the platform, your existing dependencies, your own codebases, and proven open source — and verify any candidate dependency is real.
Spec-driven development (plan before code)
For non-trivial agent work, write a self-contained spec before code, separating planning from execution and ending with a verification step.
System Dependencies
Characterize which external libraries, OS frameworks, and system services the code reaches for, and what that implies about scope boundaries.
System Interactions
Characterize how the code communicates with the operating system — IPC, lifecycle callbacks, background execution, and OS-level integration points.
Data
Access Pattern Analysis
Rules for analyzing query access patterns to drive schema and index decisions, covering read-heavy vs write-heavy tradeoffs, designing for WHERE/JOIN/ORDER BY, identifying missing indexes, and sync-specific batch sizing and transaction patterns.
Choose SwiftData vs Core Data
Pick SwiftData or Core Data for Apple persistence by OS-version floor, model complexity, and migration needs — not by novelty.
Choosing a primary datastore
Default to a relational database for a server backend; adopt a specialist store only for a concrete, measured requirement.
Clock Systems for Sync
How to choose the right clock system for distributed sync: physical clocks, Lamport timestamps, vector clocks, Hybrid Logical Clocks, and server-assigned monotonic versions.
Conflict Resolution
How to choose and implement a conflict resolution strategy for sync: LWW, server-wins, field-level merge, CRDTs, Operational Transformation, and manual conflict queues.
CQRS and event sourcing
Adopt CQRS or event sourcing ONLY when audit/replay or independent read/write scaling justifies their substantial complexity cost.
Database
Use SQLite with WAL mode for concurrent read access. No ORM — use direct SQL via the `sqlite3` standard library module.
Indexing
Rules for creating effective indexes in SQLite and PostgreSQL, covering B-tree fundamentals, composite ordering, covering indexes, partial and expression indexes, sync metadata indexes, and when not to index.
JSON columns and generated columns
JSON storage and extraction in SQLite, json_each for array iteration, generated columns for indexing JSON fields, and when JSON is a schema design smell.
Normalization and denormalization
Start normalized (3NF), denormalize only measured hotspots. SQLite-specific tradeoffs and sync-safe denormalization guidance.
Offline-First Architecture
Design rules for offline-first apps: WAL as the foundation, operation queues, optimistic UI updates, rollback on rejection, offline schema migrations, data expiry, and connectivity-aware sync scheduling.
Primary key strategies
Choosing between INTEGER PRIMARY KEY, AUTOINCREMENT, UUID, and WITHOUT ROWID — including sync compatibility and cross-database PK design.
Relationship patterns
One-to-many, many-to-many, polymorphic FKs, self-referential tables, and tree hierarchy patterns with tradeoffs and SQLite-specific guidance.
SQLite Sync Tooling
Comparison and selection guide for SQLite sync tools: Session Extension, cr-sqlite, Litestream, ElectricSQL, PowerSync, Turso/libSQL, and sqlite-sync — with a decision matrix and selection criteria.
Sync Engine Design
How to design a client-side sync engine: layered architecture, entity-agnostic Syncable interface, the six-step sync cycle, scheduling strategies, snapshot rebuilding, and error handling with circuit breakers.
Sync Protocol
Rules for designing the sync protocol between client and server: push/pull direction, full vs incremental sync, change tracking, batching, idempotency, the outbox pattern, and retry with backoff.
Sync Schema Design
Schema design rules for databases that sync across devices: UUID primary keys, timestamp columns, soft deletes, dirty tracking, version columns, and sync metadata tables.
Transactions and Concurrency
Rules for transaction management and concurrency in SQLite, covering WAL mode, journal mode selection, BEGIN IMMEDIATE vs DEFERRED, connection strategies, busy_timeout, PRAGMA tuning, and WAL benefits for sync workloads.
Vector search and retrieval
Plan RAG retrieval on pgvector with an HNSW index and hybrid dense+lexical+rerank scoring before reaching for a dedicated vector DB.
Infrastructure
Networking
API Design
Use REST with consistent conventions. Follow the platform API guidelines (Microsoft, Google,
API versioning and deprecation
Evolve APIs additively; when versioning is unavoidable pick one scheme and run a header-driven deprecation lifecycle.
Caching
Use HTTP caching headers. The server controls cache policy; the client honors it.
Choosing an API style (REST, gRPC, GraphQL)
Select an API style from consumer needs and traffic shape: REST for resource CRUD, gRPC for internal RPC, GraphQL for client-driven aggregation.
Design-first API development with OpenAPI
Author the OpenAPI document before implementing endpoints and treat it as the linted, machine-readable contract.
Offline and Connectivity
For apps that must work offline, design for local-first with background sync.
Pagination
Prefer **cursor pagination** for most APIs — stable under concurrent mutations, consistent
Real-Time Communication
Choose the simplest technique that meets your needs.
Security
Authentication
Use OAuth 2.0 / OpenID Connect with PKCE for all public clients. The Implicit flow is
Data privacy regulations
Identify the privacy regimes that apply and confirm a lawful basis before collecting any personal data.
Privacy and security by default
Collect only what is needed. Prefer on-device processing.
Privacy by design
Map personal-data flows, minimize collection, default to the most private setting, and run a DPIA before building high-risk processing.
Threat modeling
Model trust boundaries and ask the four Manifesto questions before building so point security controls trace to a why.
Ui
Choose a rendering strategy per route, minimize client JS
Pick a rendering strategy per route to minimize how much JavaScript reaches the client and when, treating it as an architecture decision not a framework mandate.
Dashboard service is display-only
The dashboard service is a generic API and UI layer. It has no knowledge of git, files, or roadmap structure. Agents ...
Data Display
Choose the right pattern for the content type and user task.
Design tokens
Express UI design decisions once as named, tiered design tokens in one platform-agnostic source; reference semantic tokens, never raw values.
Platform Design Languages
Defer to these canonical sources before applying the defaults in this file:
Separate server state from client state
Keep remote server state in a query/cache layer and UI client state in lightweight local state; never hand-cache server data in a global store.