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.

csharpioskotlintypescriptwebwindows

App Interactions

Characterize how components communicate within the application — delegation, pub/sub, shared state, and other in-process coordination patterns.

csharpioskotlintypescriptwebwindows

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.

csharp

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.

windowscsharp

Cross-Cutting Detection

Distinguish concerns that span all scope groups (cross-cutting — do not isolate) from shared infrastructure that is itself a coherent group.

csharpioskotlintypescriptwebwindows

Dependency Clusters

Identify scope groups by measuring internal coupling density versus external coupling — files that import each other heavily belong together.

csharpioskotlintypescriptwebwindows

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.

csharpioskotlintypescriptwebwindows

Interface Cohesion

Group files by their shared public API surface — types, protocols, and exported symbols that define a coherent contract.

csharpioskotlintypescriptwebwindows

Kotlin Multiplatform

Share domain and data logic broadly across platforms with KMP; choose shared vs native UI per platform maturity.

kotlin

Lifecycle Patterns

Identify scope group boundaries by finding groups of objects that are created, owned, and destroyed together as a unit.

csharpioskotlintypescriptwebwindows

Module Boundaries

Identify scope group candidates by locating explicit build targets, package manifests, and declared module boundaries.

csharpioskotlintypescriptwebwindows

Purpose Classification

Classify every file by its primary reason for existing, and verify that each candidate scope group has a single coherent purpose.

csharpioskotlintypescriptwebwindows

Runtime Conditions

Identify permissions, entitlements, environment checks, and configuration prerequisites that constrain when and where code can execute.

csharpioskotlintypescriptwebwindows

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.

csharpioskotlintypescriptwebwindows

System Interactions

Characterize how the code communicates with the operating system — IPC, lifecycle callbacks, background execution, and OS-level integration points.

csharpioskotlintypescriptwebwindows

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.

sqlitepostgresql

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.

swiftiosmacos

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.

sqlitepostgresql

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.

sqlitepostgresql

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.

python

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.

sqlitepostgresql

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.

sqlitepostgresql

Normalization and denormalization

Start normalized (3NF), denormalize only measured hotspots. SQLite-specific tradeoffs and sync-safe denormalization guidance.

sqlitepostgresql

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.

sqlitepostgresql

Primary key strategies

Choosing between INTEGER PRIMARY KEY, AUTOINCREMENT, UUID, and WITHOUT ROWID — including sync compatibility and cross-database PK design.

sqlitepostgresql

Relationship patterns

One-to-many, many-to-many, polymorphic FKs, self-referential tables, and tree hierarchy patterns with tradeoffs and SQLite-specific guidance.

sqlitepostgresql

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.

sqlitepostgresql

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.

sqlitepostgresql

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.

sqlitepostgresql

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.

sqlitepostgresql

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.

sqlitepostgresql

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.

Networking

Ui