Guidelines

333 documents

Cookbook

Behavioral Requirements

Requirements use RFC 2119 keywords correctly, are independently testable, and describe behavior rather than implementation.

csharpioskotlintypescriptwebwindows

Completeness

No section is empty without explanation, all gaps are tracked with NEEDS REVIEW, and edge cases and test vectors provide comprehensive coverage.

csharpioskotlintypescriptwebwindows

Cookbook Compliance

Recipe aligns with applicable cookbook guidelines and does not contradict platform-wide principles for security, accessibility, and error handling.

csharpioskotlintypescriptwebwindows

Cross-Recipe Consistency

Naming, structure, and depth are consistent across sibling recipes so the cookbook reads as a coherent whole.

csharpioskotlintypescriptwebwindows

Source Fidelity

Recipe accurately captures what the source code does without invention, idealization, or omission of documented quirks.

csharpioskotlintypescriptwebwindows

Template Conformance

Recipe follows the standard template structure with valid frontmatter and all required sections in correct order.

csharpioskotlintypescriptwebwindows

Agent Lint Checklist

Comprehensive lint checklist for validating Claude Code agent structure, content quality, and best practices

Agent Structure Reference

Reference for Claude Code agent file format, frontmatter fields, tool access patterns, and permission modes

Authoring Skills and Rules

Best practices for creating Claude Code skills, agents, and rule files.

Rule Lint Checklist

Comprehensive lint checklist for validating Claude Code rule file content quality, best practices, and optimization

Rule Structure Reference

Reference for Claude Code rule file format, quality criteria, optimization guidelines, and comparison with skills and agents

Skill Lint Checklist

Comprehensive lint checklist for validating Claude Code skill structure, content quality, and best practices

Skill Structure Reference

Reference for Claude Code skill directory layout, frontmatter fields, string substitutions, and invocation control

Properties of Good Tests

Properties that test vectors in cookbook artifacts (ingredients, recipes) should exhibit — adapted from Kent Beck's Test Desiderata.

Unit Test Patterns

How to write test vectors in cookbook artifacts — use AAA structure, one concept per vector, descriptive names.

Platform Design Languages

Canonical platform design sources that cookbook artifacts MUST reference when specifying UI behavior, spacing, and appearance.

kotlinwebwindows

Implementing

Accessibility from day one

All components MUST integrate with platform accessibility APIs from initial implementation:

csharpkotlinswifttypescriptwebwindows

Dynamic Type

Layouts MUST NOT break at larger text sizes. Use Dynamic Type throughout — avoid fixed font sizes. Custom fonts must ...

Font Scaling

Layouts MUST NOT break at 2x font size. Check `Configuration.fontScale` and test with large font settings enabled.

Architecture

Use MVVM with [CommunityToolkit.Mvvm](https://learn.microsoft.com/en-us/dotnet/communitytoolkit/mvvm/) — source-gener...

Completeness: finish the work, don't defer by default

Deliver the full agreed scope. Don't silently mark work out of scope, declare done prematurely, or invoke YAGNI to skip required work.

Dependency Injection

Constructor injection via `Microsoft.Extensions.DependencyInjection`. Use interface types for dependencies, not concr...

File paths

Use `pathlib.Path`, not `os.path`. All path manipulation should go through `pathlib`.

python

Hilt dependency injection for Android

Use Hilt with KSP and constructor injection for Android DI; scope bindings to the correct Hilt component and reserve @Singleton for app-scoped state.

kotlin

Linting before the first PR

All projects MUST have linting configured and passing before the first pull request.

csharpkotlinswifttypescriptweb

Naming

- `PascalCase` for types, methods, properties, public fields, constants, namespaces

No external dependencies in core libraries

`roadmap_lib` uses the standard library only. Do not add PyYAML, requests, or other third-party packages to core libr...

Nullable Reference Types

Enable `<Nullable>enable</Nullable>` in all projects. Treat warnings as design signals — `string` means non-null, `st...

Scope discipline

Only modify what was requested. State the goal before starting. Note but do not fix adjacent issues.

Shell scripts

Shell script `main()` functions must only call other functions — no inline logic. Keep scripts composable and testable.

Small, atomic commits

One logical change per commit. A change may touch multiple files if they are part of the same concept. Commits should...

Type hints

Type hints are welcome but not required. Maintain Python 3.9 compatibility — use `from __future__ import annotations`...

python

TypeScript strictness configuration

Set strict: true on every new TypeScript project and adopt the stricter index/module flags incrementally.

typescript

Use roadmap_lib

Use functions from `roadmap_lib` for all roadmap operations (reading state, parsing frontmatter, finding steps, etc.)...

Value objects over primitive obsession

Wrap domain primitives that carry invariants in small immutable value objects so validation lives in one place and invalid instances cannot be constructed.

Verification harnesses as agent guardrails

Give every agent a runnable pass/fail check it can run on itself, and enforce correctness through deterministic gates rather than prompt text.

Writing code for the AI reader

Favor explicit, greppable, locally-readable code so AI agents can find and modify behavior on the first pass — without sacrificing human readability.

YAML frontmatter

Parse YAML frontmatter with the built-in frontmatter parser in `roadmap_lib`. Do not add a PyYAML dependency. The par...

Adopt Swift 6 strict concurrency incrementally

Migrate to Swift 6 data-race safety module by module, making every type that crosses an isolation boundary Sendable.

swiftiosmacos

Immutability

Mutable shared state is the root cause of most concurrency bugs. Default to immutable values; introduce mutability on...

kotlintypescript

Kotlin Flow and StateFlow: lifecycle-aware state exposure

Expose UI state as StateFlow via stateIn and collect it lifecycle-aware, injecting dispatchers for testability.

kotlin

No blocking the main thread

All lengthy work must run on background threads/tasks using platform async primitives:

csharpkotlinpythonswifttypescriptwebwindows

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

Advanced database indexing

Match the Postgres index type to the access pattern, build on live tables with CONCURRENTLY, and validate with EXPLAIN ANALYZE.

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

Connection pooling for server and serverless backends

Front Postgres with a transaction-mode pooler for serverless or many-instance backends, and never depend on session-scoped state.

Constraints and validation

CHECK constraints for SQLite: evaluation rules, enum-like constraints, boolean enforcement, range and pattern validation, NULL truthiness, and limitations.

sqlitepostgresql

Data retention and deletion

Define a retention schedule per data category and automate deletion or anonymization that cascades to every derived store.

Data types and type affinity

SQLite type affinity rules, the STRING gotcha, STRICT tables, and type mapping between SQLite and PostgreSQL for cross-database compatibility.

sqlitepostgresql

Database

Use SQLite with WAL mode for concurrent read access. No ORM — use direct SQL via the `sqlite3` standard library module.

python

Database backup and recovery

Prescriptive rules for SQLite backup methods, corruption prevention, integrity checking, recovery procedures, VACUUM strategy, and database size management.

sqlitepostgresql

Database naming conventions

Snake_case naming rules for tables, columns, primary keys, foreign keys, indexes, constraints, and triggers — including reserved word avoidance.

sqlitepostgresql

Deterministic IDs

Always use the roadmap file's own UUID from its YAML frontmatter. Never generate random UUIDs. IDs must be determinis...

Foreign keys and referential integrity

Enabling and declaring foreign keys in SQLite, ON DELETE/UPDATE actions, deferred constraints, indexing FK columns, and common pitfalls.

sqlitepostgresql

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

Query Optimization

Rules for writing efficient SQLite and PostgreSQL queries, including query planner behavior, anti-patterns that cause full table scans, JSON query performance, subquery elimination, and CTE vs subquery tradeoffs.

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

Room persistence on Android

Use Room with KSP, Flow-returning observable reads, suspend writes, and @Transaction-wrapped multi-step operations on Android.

kotlin

Schema evolution and migrations

Migration strategies for SQLite: PRAGMA user_version, ALTER TABLE limitations, the 12-step recreate procedure, and sync-compatible migration rules.

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

Table partitioning and time-series data

Partition large tables only when a measured size or retention need justifies the operational cost, and apply time-series patterns deliberately.

Transaction isolation and serialization-failure retry

Choose an isolation level per transaction and retry serialization failures with bounded, idempotent backoff.

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

Zero-downtime migrations: expand and contract

Migrate a live database with expand-and-contract: every step backward-compatible with the running app, indexes built concurrently.

A/B testing

Features that may need experimentation SHOULD support variant assignment via an `ExperimentProvider` interface (`vari...

Debug mode

Apps MUST include a debug-only configuration panel (not in release builds):

ioskotlinmacostypescriptwebwindows

Feature flags

All features MUST be gated behind feature flags from initial implementation. Define a `FeatureFlagProvider` interface...

csharpkotlinswifttypescript

Containerization

Build small, secure container images with multi-stage builds, pinned slim bases, non-root users, cache-ordered layers, and no baked-in secrets.

Kubernetes configuration and secrets

Externalize Kubernetes config via ConfigMaps and treat Secrets as unencrypted base64 — encrypt at rest, tighten RBAC, and prefer external secret managers.

Kubernetes workloads

Run Kubernetes workloads with explicit resource requests/limits, health probes, hardened pod security, and safe rollout strategies.

Twelve-factor configuration

Read config that varies between deploys from the environment and promote one immutable build artifact unchanged across every environment.

Localizability

All user-facing strings MUST be localizable — no hardcoded strings:

csharpkotlinswifttypescriptwebwindows

RTL layout support

All layouts MUST support right-to-left languages:

csharpkotlinswifttypescriptwebwindows

AI Cost Management

AI API calls cost $0.01-$0.10+ each. Systems MUST treat AI calls as a managed resource with budgets, caching, and fallback strategies.

API Design

Use REST with consistent conventions. Follow the platform API guidelines (Microsoft, Google,

Be strict and maintain: Postel reconsidered (RFC 9413)

Parse protocol and API inputs strictly, reject violations loudly, and actively co-evolve spec and implementation instead of tolerating drift.

Caching

Use HTTP caching headers. The server controls cache policy; the client honors it.

typescriptweb

Error Responses

Use [RFC 9457 Problem Details](https://www.rfc-editor.org/rfc/rfc9457) format with

HTTP conditional requests and optimistic concurrency

Use ETags with If-None-Match for efficient reads and If-Match for optimistic concurrency on writes to prevent lost updates.

Idempotency keys for write APIs

Accept a client-supplied Idempotency-Key on write endpoints so retries are safe, and reject key reuse with different parameters.

MCP server design

Design MCP servers by choosing the right primitive and giving each tool a precise name, output schema, and annotations.

Offline and Connectivity

For apps that must work offline, design for local-first with background sync.

web

Pagination

Prefer **cursor pagination** for most APIs — stable under concurrent mutations, consistent

Rate Limiting

Respect server rate limits. Handle 429 responses gracefully.

Real-Time Communication

Choose the simplest technique that meets your needs.

web

Retry and Resilience

Not every failure is permanent. Retry transient failures with exponential backoff and jitter.

typescriptweb

Timeouts

Always set both connection and read timeouts. Never use infinite timeouts.

Web services

Use Flask for web services. The dashboard service runs on Flask with a REST API and SSE/polling for live updates.

pythonweb

AI Provider Observability

Every call to an AI provider API MUST be logged with structured metadata for cost attribution, debugging, and performance monitoring.

Analytics

All significant user actions MUST be instrumented via an `AnalyticsProvider` interface (`track(event, properties)`). ...

csharpkotlinswifttypescript

Continuous profiling

Adopt always-on, low-overhead production profiling correlated with traces only when measured perf/cost debugging justifies the pipeline.

Distributed tracing and context propagation

Propagate W3C trace context across every service hop and async boundary, and correlate logs/metrics/traces via a shared trace_id.

Instrumented logging

Every component and flow must be instrumented with structured logging using the platform's best-in-class framework:

csharpkotlinpythonswifttypescriptwebwindows

Metrics instrumentation: RED and USE

Instrument services with RED metrics and resources with USE so signals correlate and feed SLIs/SLOs.

Service-level objectives and error budgets

Define user-centric SLIs, set SLOs, derive an error budget, and alert on multi-window burn rate rather than resource thresholds.

App Intents

Expose key app actions and data as App Intents so Siri, Shortcuts, Spotlight, widgets, and the system can invoke them.

swiftiosmacos

Background tasks

Apps that sync data, process uploads, or maintain state SHOULD use platform background execution APIs rather than relying on foreground presence.

iosmacosandroidwindowsweb

Deep linking

All significant feature points and views MUST be deep linkable using the platform's native URL/deep link mechanism:

kotlinswifttypescriptwebwindows

Handoff and continuity

Apps available on multiple devices SHOULD support continuity features so users can start work on one device and resume on another.

iosmacosandroidweb

Notifications

Apps SHOULD use the platform notification system for timely, actionable alerts that respect user preferences.

iosmacosandroidwindowsweb

Scriptable and automatable

Components and flows SHOULD be scriptable where the platform supports it:

csharpioskotlinmacosswiftwebwindows

Search integration

App content SHOULD be discoverable through the platform's system search, enabling users to find content without opening the app.

iosmacosandroidwindowsweb

Share and inter-app data flow

Apps SHOULD participate in the platform's share and inter-app data exchange mechanisms to integrate with other apps and workflows.

iosmacosandroidwindowsweb

Use AppKit and UIKit, not SwiftUI

Use AppKit (macOS) and UIKit (iOS) for all UI. Use SwiftUI only where Apple requires it.

iosmacos

Widgets and glanceable surfaces

Apps with time-sensitive or frequently checked data SHOULD provide widgets and glanceable surfaces on platforms that support them.

iosmacosandroidweb

Agent guardrails

Wrap agents in deterministic input/output guardrails, least-privilege tool access, human confirmation for irreversible actions, and a kill switch.

Authentication

Use OAuth 2.0 / OpenID Connect with PKCE for all public clients. The Implicit flow is

csharpioskotlintypescriptwebwindows

Authorization

**Server-side authorization is the only real authorization.** Client-side checks (hiding

typescriptweb

Consent management

Capture granular, versioned, withdrawable consent in an auditable log and gate all non-essential processing on it.

Content Security Policy

Prevent XSS and injection with a strict CSP. Web apps only.

typescriptweb

CORS

Cross-Origin Resource Sharing — get it right or don't enable it.

web

Data subject rights (DSAR)

Architect every personal-data store to be enumerable, exportable, and deletable by subject id so DSARs are satisfied within the legal SLA.

Dependency Security

Your dependencies are your attack surface. Manage them actively.

pythontypescript

Input Validation

**Never trust client input.** Client-side validation is a UX feature, not a security control.

typescriptweb

LLM and agentic application security

Treat all model output as untrusted, defend against direct and indirect prompt injection, and constrain tool agency.

MCP server security

Harden MCP servers against tool poisoning, rug-pulls, token passthrough, confused-deputy, session hijacking, and SSRF.

MCP tool input validation

Treat every MCP tool argument as untrusted model-supplied input: schema-validate, authorize per call, and bound resource access.

Passkeys and WebAuthn

Implement phishing-resistant passwordless auth with passkeys/WebAuthn, prefer them over passwords and SMS-OTP, and plan recovery.

PII handling and classification

Classify PII at the schema level, minimize collection, encrypt at rest and in transit, and never write it to logs.

Privacy and security by default

Collect only what is needed. Prefer on-device processing.

kotlinswifttypescript

Secure Storage

Tokens, credentials, and any sensitive data MUST use platform secure storage. Never store secrets in plaintext config...

kotlinswiftwindows

Security Headers Checklist

Every web application should set these response headers:

web

Sender-constrained access tokens

Bind access tokens to the client with DPoP or mTLS so a stolen token cannot be replayed by another party.

Sensitive Data

Minimize what you collect, encrypt what you keep, never log what you shouldn't.

typescriptweb

Token Handling

Short-lived (5-15 min). Include only necessary claims — no PII in JWTs

kotlintypescriptwebwindows

Transport Security

**TLS 1.2 minimum**, prefer TLS 1.3. Disable TLS 1.0 and 1.1 entirely.

typescriptweb

Agent Structure Reference

Reference for Claude Code agent file format, frontmatter fields, tool access patterns, and permission modes

Authoring Skills and Rules

Best practices for creating Claude Code skills, agents, and rule files.

Context and memory management for agents

Treat context as a finite budget you curate: prune aggressively, isolate large subtasks to subagents, and persist what must survive across sessions.

Performance: Speed and Token Efficiency

Optimize Claude Code extensions for speed and token efficiency through shell scripts, model selection, and progressive disclosure.

Rule Structure Reference

Reference for Claude Code rule file format, quality criteria, optimization guidelines, and comparison with skills and agents

Skill Structure Reference

Reference for Claude Code skill directory layout, frontmatter fields, string substitutions, and invocation control

Comprehensive unit testing

Prioritize unit tests over integration tests. Test state transitions, edge cases, serialization round-trips. Every im...

csharppythontypescript

Property-Based Testing

When to use: parsers, serializers, data transformers, encoders/decoders, validators — anything

csharpkotlinpythonswifttypescript

Swift Testing

Use Swift Testing (@Test, #expect/#require, parameterized arguments, suites, traits) for new Swift unit tests.

swift

Test Data

**Construct what you need, per test.** Large shared fixture files SHOULD be avoided.

Test Doubles

Use [Martin Fowler's taxonomy](https://martinfowler.com/bliki/TestDouble.html):

csharpkotlinpythonswifttypescriptweb

Unit Test Patterns

**Structure — Arrange, Act, Assert (AAA):**

Always show progress

When the UI is waiting on an async task:

Android edge-to-edge and window insets

Render Android apps edge-to-edge and consume WindowInsets so content is never hidden behind the status bar, navigation bar, or IME.

kotlin

Android navigation in Compose

Use type-safe Navigation Compose with serializable routes, single-activity architecture, and hoisted nav state.

kotlin

Android predictive back

Migrate off deprecated back handling to OnBackPressedDispatcher and support the predictive back gesture with progress-driven animations.

kotlin

Animation & Motion

Motion should be purposeful — guide attention, show spatial relationships, and provide

windows

Apple design language and widgets

Adopt the system Apple design language and materials over custom chrome, and version-gate brand-new design APIs like Liquid Glass.

swiftiosmacos

Color

Use color with intention — never as the sole means of conveying information.

typescriptwebwindows

Core Web Vitals and performance budgets

Target LCP <= 2.5s, INP <= 200ms, CLS <= 0.1 at field p75, and enforce a performance budget in CI.

webtypescript

Cross-platform token adaptation

Share one semantic token source across platforms, then render values in each platform's native units, type scale, and idioms.

swiftkotlintypescriptcsharpweb

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 token distribution

Generate per-platform token artifacts from one source via a build step; never hand-edit the generated outputs.

swiftkotlintypescriptcsharpweb

Design-Time Data

- Use `d:DataContext` and `d:DesignInstance` for XAML designer preview data

csharpwindows

Feedback Patterns

Every user action should have visible feedback. The weight of the feedback should match

Fluent Design

Use built-in WinUI 3 controls — they implement Fluent 2 natively. Never custom-draw what a standard control can do.

csharpwindows

Form Design

Forms are where users do real work. Reduce friction at every step.

web

High DPI / Display Scaling

XAML layout uses effective pixels (epx) — scaling is automatic for all XAML-rendered content.

csharpwindows

Iconography

Icons supplement text — they do not replace it (except for universally understood symbols

windows

Jetpack Compose performance and stability

Minimize Compose recomposition with stable types, deferred state reads, lazy-list keys, and release-build measurement.

kotlin

Jetpack Compose side effects

Run side effects through the correct keyed Compose effect API, never directly inside composition.

kotlin

Jetpack Compose: state hoisting and unidirectional data flow

Hoist UI state to its lowest common owner or the ViewModel, keep composables stateless, and enforce state-down/events-up unidirectional flow.

kotlin

Layout

Design for the content, not a fixed screen size. Layouts should adapt gracefully from

typescriptwebwindows

Material 3 theming on Android

Theme Compose UIs with Material 3 color roles, ColorScheme, type and shape scales, and full dark support.

kotlin

Modern CSS layout and Baseline-driven adoption

Adopt modern interoperable CSS features (container queries, @layer, :has(), subgrid, nesting, view transitions) gated on Baseline status with fallbacks.

web

Platform Design Languages

Defer to these canonical sources before applying the defaults in this file:

kotlinwebwindows

Previews

All UI components MUST include preview declarations for rapid visual verification during development. Previews should...

kotlinswift

Progressive Web App installability

Ship a Web App Manifest plus a service worker with an explicit caching strategy, and account for iOS install/push/storage limits.

webtypescript

Spacing

Use a consistent spatial scale based on a **4px base unit** (8px primary grid). All spacing,

windows

State Design

Every view that loads data or can be empty must handle all four states explicitly. Never

typescriptweb

Theming

WinUI 3 supports tri-state theming: Light, Dark, and High Contrast.

csharpwindows

Theming with tokens

Implement themes as alternate value sets for the same semantic tokens; swap the active set, never the component code.

swiftkotlintypescriptcsharpweb

Touch & Click Targets

Interactive elements MUST be large enough to tap or click accurately. Defer to the platform

ioskotlintypescriptwebwindows

Typography

Use the platform's system font. Establish a type scale with clear roles — don't invent

ioskotlinmacostypescriptwebwindows

Visual Hierarchy

Establish clear importance through size, weight, color, and spacing. Every screen should

windows

Windows 11 materials (Mica and Acrylic)

Apply Mica as the backdrop of long-lived windows and Acrylic for transient surfaces, honoring user theme and system settings.

windowscsharp

Planning

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

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.

Feature flags

Plan for feature flag architecture from the start: define a FeatureFlagProvider interface, choose storage backend, and identify which features need gating.

csharpkotlinswifttypescript

Immutable infrastructure

Never mutate running servers in place; build a versioned image artifact and replace instances to deploy or roll back.

Infrastructure as code

Define infrastructure declaratively in version control and apply it through a reviewed plan, never by hand.

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.

typescriptweb

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.

web

Pagination

Prefer **cursor pagination** for most APIs — stable under concurrent mutations, consistent

Real-Time Communication

Choose the simplest technique that meets your needs.

web

Authentication

Use OAuth 2.0 / OpenID Connect with PKCE for all public clients. The Implicit flow is

csharpioskotlintypescriptwebwindows

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.

kotlinswifttypescript

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.

Test Pyramid

Projects SHOULD follow the Google SWE Book ratio: **80% unit / 15% integration / 5% E2E**.

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.

webtypescript

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.

swiftkotlintypescriptcsharpweb

Platform Design Languages

Defer to these canonical sources before applying the defaults in this file:

kotlinwebwindows

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.

webtypescript

Reviewing

Accessibility from day one

All components MUST integrate with platform accessibility APIs from initial implementation:

csharpkotlinswifttypescriptwebwindows

Bulk operation verification

After any operation touching 5+ files, run a verification pass for stale references before marking complete.

Code hygiene: remove the old thing

When you replace or refactor code, delete what it supersedes. Leave no dead code, orphaned files, or commented-out blocks behind.

Dependency Injection

Constructor injection via `Microsoft.Extensions.DependencyInjection`. Use interface types for dependencies, not concr...

File paths

Use `pathlib.Path`, not `os.path`. All path manipulation should go through `pathlib`.

python

Law of Demeter and Tell, Don't Ask

Talk only to immediate collaborators and tell objects to act rather than asking for their internals, except across documented boundary, builder, and pipeline cases.

Naming

- `PascalCase` for types, methods, properties, public fields, constants, namespaces

No external dependencies in core libraries

`roadmap_lib` uses the standard library only. Do not add PyYAML, requests, or other third-party packages to core libr...

Scope discipline

Only modify what was requested. State the goal before starting. Note but do not fix adjacent issues.

Shell scripts

Shell script `main()` functions must only call other functions — no inline logic. Keep scripts composable and testable.

Type hints

Type hints are welcome but not required. Maintain Python 3.9 compatibility — use `from __future__ import annotations`...

python

Use roadmap_lib

Use functions from `roadmap_lib` for all roadmap operations (reading state, parsing frontmatter, finding steps, etc.)...

YAML frontmatter

Parse YAML frontmatter with the built-in frontmatter parser in `roadmap_lib`. Do not add a PyYAML dependency. The par...

Query Optimization

Query review checklist: anti-patterns to flag, EXPLAIN QUERY PLAN red flags, and common performance issues in SQLite queries.

sqlitepostgresql

Container image security

Scan, pin, sign, and slim container images so they ship without known-exploited vulnerabilities, embedded secrets, or root runtimes.

Localizability

All user-facing strings MUST be localizable — no hardcoded strings:

csharpkotlinswifttypescriptwebwindows

RTL layout support

All layouts MUST support right-to-left languages:

csharpkotlinswifttypescriptwebwindows

Hyrum's Law: all observable behavior becomes contract

Treat every observable behavior of an interface as a contract a consumer may depend on: document guarantees, constrain incidental behavior, and never depend on the unspecified.

MCP server review checklist

Pre-merge checklist a reviewer runs over an MCP server's primitive design, tool contracts, and authorization.

Rate Limiting

Respect server rate limits. Handle 429 responses gracefully.

Timeouts

Always set both connection and read timeouts. Never use infinite timeouts.

Analytics

All significant user actions MUST be instrumented via an `AnalyticsProvider` interface (`track(event, properties)`). ...

csharpkotlinswifttypescript

Instrumented logging

Every component and flow must be instrumented with structured logging using the platform's best-in-class framework:

csharpkotlinpythonswifttypescriptwebwindows

Deep linking

All significant feature points and views MUST be deep linkable using the platform's native URL/deep link mechanism:

kotlinswifttypescriptwebwindows

Use AppKit and UIKit, not SwiftUI

Use AppKit (macOS) and UIKit (iOS) for all UI. Use SwiftUI only where Apple requires it.

iosmacos

Authentication

Use OAuth 2.0 / OpenID Connect with PKCE for all public clients. The Implicit flow is

csharpioskotlintypescriptwebwindows

Authorization

**Server-side authorization is the only real authorization.** Client-side checks (hiding

typescriptweb

Content Security Policy

Prevent XSS and injection with a strict CSP. Web apps only.

typescriptweb

CORS

Cross-Origin Resource Sharing — get it right or don't enable it.

web

Dependency Security

Your dependencies are your attack surface. Manage them actively.

pythontypescript

Input Validation

**Never trust client input.** Client-side validation is a UX feature, not a security control.

typescriptweb

LLM red teaming

Adversarially test LLM and agent systems against the OWASP LLM Top 10 and gate releases on a tracked attack-success-rate threshold.

Privacy and security by default

Collect only what is needed. Prefer on-device processing.

kotlinswifttypescript

Secure Storage

Tokens, credentials, and any sensitive data MUST use platform secure storage. Never store secrets in plaintext config...

kotlinswiftwindows

Security Headers Checklist

Every web application should set these response headers:

web

Sensitive Data

Minimize what you collect, encrypt what you keep, never log what you shouldn't.

typescriptweb

Token Handling

Short-lived (5-15 min). Include only necessary claims — no PII in JWTs

kotlintypescriptwebwindows

Transport Security

**TLS 1.2 minimum**, prefer TLS 1.3. Disable TLS 1.0 and 1.1 entirely.

typescriptweb

Vulnerability prioritization by exploitability

Triage CVEs by exploitability — CISA KEV and high EPSS first, deprioritize unreachable transitive findings — not raw CVSS.

Agent Lint Checklist

Comprehensive lint checklist for validating Claude Code agent structure, content quality, and best practices

Performance: Speed and Token Efficiency

Optimize Claude Code extensions for speed and token efficiency through shell scripts, model selection, and progressive disclosure.

Rule Lint Checklist

Comprehensive lint checklist for validating Claude Code rule file content quality, best practices, and optimization

Skill Lint Checklist

Comprehensive lint checklist for validating Claude Code skill structure, content quality, and best practices

Flaky Test Prevention

Flaky tests destroy confidence. Quarantine them immediately — fix or delete, never ignore.

typescriptweb

Post-generation verification

Every generated artifact MUST be verified:

ioskotlintypescript

Security Testing

Run security scans as part of post-generation verification (agenticdevelopercookbook://guidelines/testing/post-generation-verification). These a...

csharpkotlinpythonswifttypescriptweb

Color

Use color with intention — never as the sole means of conveying information.

typescriptwebwindows

Touch & Click Targets

Interactive elements MUST be large enough to tap or click accurately. Defer to the platform

ioskotlintypescriptwebwindows

Shipping

A/B testing

Pre-ship A/B test verification: ensure experiment variants are configured, defaults are safe, and the debug panel override works.

Bulk operation verification

After any operation touching 5+ files, run a verification pass for stale references before marking complete.

Continuous delivery

Keep main always releasable via an automated build-test-deploy pipeline; releasing is a business decision, not a manual scramble.

Database backup and recovery

Pre-deployment backup verification: ensure backups run before migrations, WAL files are handled during restore, and integrity checks pass before shipping.

sqlitepostgresql

Dependency Security

Your dependencies are your attack surface. Manage them actively.

pythontypescript

Ephemeral preview environments

Provision a disposable per-PR environment from IaC, seed it with throwaway data, test against it, and auto-destroy on merge or close.

Feature flags

Pre-ship feature flag verification: ensure all new features are gated, defaults are correct, and flag keys are documented.

csharpkotlinswifttypescript

Incident response and blameless postmortems

Run production incidents with defined command roles and severity tiers, then close them with blameless, tracked-to-completion postmortems.

MSIX Packaging

- Use the single-project MSIX packaging model

windows

Progressive delivery

Decouple deploy from release and limit blast radius with canary, rings, blue-green, flags, and health-based automated rollback.

Schema evolution and migrations

Pre-deploy migration verification: ensure version tracking, idempotency, sync compatibility, and rollback strategy before shipping schema changes.

sqlitepostgresql

Ship a privacy manifest and declare required-reason APIs

Ship a PrivacyInfo.xcprivacy manifest declaring data collection and required-reason API usage, or App Store submission is rejected.

iosmacosswift

Small, atomic commits

One logical change per commit. A change may touch multiple files if they are part of the same concept. Commits should...

Software supply-chain integrity

Emit an SBOM and signed SLSA provenance per build, then verify both signatures and provenance at deploy time.

Transport Security

Pre-deploy transport security verification: TLS 1.2+, HSTS enabled, cipher suites audited, certificate pinning validated.

typescriptweb

Trunk-based development

Integrate to one shared trunk in small daily increments behind feature flags, keeping trunk releasable instead of trading rigor for long branches.

Windows ARM64 and Native AOT

Ship native ARM64 builds for Windows on ARM; adopt Native AOT and trimming only when a measured need justifies their constraints.

windowscsharp

Testing

Agent evaluation and safety

Gate every agent/LLM release on two checks: a quality eval gate and a safety gate, both run in CI on every model and prompt change.

Comprehensive unit testing

Prioritize unit tests over integration tests. Test state transitions, edge cases, serialization round-trips. Every im...

csharppythontypescript

Contract testing for services

Verify that independently deployed services agree on the shape of their interactions before they ship.

Database testing

Prescriptive rules for testing SQLite-backed code: in-memory vs file-based databases, test isolation strategies, migration testing, sync logic testing, and conflict resolution testing.

sqlitepostgresql

Design-Time Data

Use design-time data contexts for visual preview testing — verify UI renders correctly without running the app.

csharpwindows

Eval-driven development for agent behavior

When the unit under test is agent or LLM behavior, build a calibrated eval harness instead of relying on ordinary unit tests.

Flaky Test Prevention

Flaky tests destroy confidence. Quarantine them immediately — fix or delete, never ignore.

typescriptweb

Flaky test quarantine lifecycle

Detect, quarantine with an owner and deadline, fix the root cause, then return flaky tests to the gating suite.

Fuzz testing

Fuzz untrusted-input parsing surfaces — especially in memory-unsafe code — with coverage-guided fuzzers; adopt elsewhere only on measured need.

Groundedness and hallucination checks

Evaluate RAG groundedness with verified citations, calibrated LLM judges, and retrieval metrics, and abstain when context is insufficient.

Linting from day one

Run linting as part of your automated test and verification suite — it catches bugs that unit tests miss.

csharpkotlinswifttypescriptweb

Mutation Testing

Mutation testing validates that your tests actually catch bugs — not just achieve coverage.

csharpkotlinpythonswifttypescript

Post-generation verification

Every generated artifact MUST be verified:

ioskotlintypescript

Previews

All UI components MUST include preview declarations for rapid visual verification during development. Previews should...

kotlinswift

Properties of Good Tests

From Kent Beck's Test Desiderata — tests should be:

Property-Based Testing

When to use: parsers, serializers, data transformers, encoders/decoders, validators — anything

csharpkotlinpythonswifttypescript

Security Testing

Run security scans as part of post-generation verification (agenticdevelopercookbook://guidelines/testing/post-generation-verification). These a...

csharpkotlinpythonswifttypescriptweb

Snapshot testing discipline

Keep snapshots small and deterministic, and deliberately review every snapshot diff before accepting it.

Test Data

**Construct what you need, per test.** Large shared fixture files SHOULD be avoided.

Test Doubles

Use [Martin Fowler's taxonomy](https://martinfowler.com/bliki/TestDouble.html):

csharpkotlinpythonswifttypescriptweb

Test Pyramid

Projects SHOULD follow the Google SWE Book ratio: **80% unit / 15% integration / 5% E2E**.

The Testing Workflow

The recommended Claude Code testing workflow, combining all tools:

pythonswifttypescriptweb

Tool-call evaluation

Evaluate agent tool use for selection, argument correctness, ordering, and stopping against a fixed trajectory suite with error-recovery cases.

Unit Test Patterns

**Structure — Arrange, Act, Assert (AAA):**