Coding Taste Profiles
143 foundTastes are single markdown files that define your coding style and preferences. They help AI coding agents learn how you write code, so they can match your conventions, patterns, and taste.
Opinionated React Router v7 framework-mode preferences: loaders and actions, typed routes, progressive forms, server-only modules, error boundaries and URL state.
# React Router App taste of a full-stack developer who wants routes to own their data
- Use React Router v7 in framework mode with Vite and TypeScript for new apps, not the old data-router setup by hand. Confidence: 0.90
- Define routes in app/routes.ts with explicit route() and layout() calls instead of relying only on file-name magic. Confidence: 0.75
- Load data in route loaders and mutate in route actions; never fetch page data in useEffect. Confidence: 0.95
- Use the generated Route types (./+types/route-name) for loaderData, actionData and params in every route module. Confidence: 0.90
- Render on the server by default and switch a route to prerender or SPA mode only when there is a clear reason. Confidence: 0.80
- Use <Form> and useFetcher for mutations so the app works before JavaScript loads and revalidates automatically. Confidence: 0.90
- Validate form data and params in actions with Zod and return field errors with data(..., { status: 400 }). Confidence: 0.85
- Throw redirect() after a successful POST to avoid double submits on refresh. Confidence: 0.90
- Keep server-only code in .server.ts files so secrets and database clients never reach the client bundle. Confidence: 0.95
- Read the session in a shared helper used by loaders and actions; protect routes with a parent layout loader that redirects. Confidence: 0.80
- Export an ErrorBoundary from the root and from risky routes, and throw data() responses for 404 and 403. Confidence: 0.85
- Use URL search params as state for filters, sorting and pagination so views are shareable and back-button safe. Confidence: 0.90
- Show pending UI with useNavigation and fetcher.state, and add optimistic UI for quick actions like toggles. Confidence: 0.80
- Return promises from loaders for slow, non-critical data and render them with Suspense and Await. Confidence: 0.70
- Set cache headers per route with the headers export instead of one global policy. Confidence: 0.75
- Define meta and links exports per route for titles, descriptions and preloaded assets. Confidence: 0.75
- Keep a thin route module and move business logic into plain functions in app/lib that are easy to unit test. Confidence: 0.85
- Do not add a client data cache library by default; the router's revalidation is enough for most apps. Confidence: 0.70
- Use nested routes and <Outlet /> for shared layouts instead of repeating headers and sidebars. Confidence: 0.85
- Prefetch likely next pages with <Link prefetch="intent">. Confidence: 0.75
- Test loaders and actions as functions with Vitest, and cover the main flows with Playwright against a built server. Confidence: 0.80
- Deploy with an official adapter for the target (Node, Vercel, Cloudflare) and keep environment access behind one typed config module. Confidence: 0.75Opinionated ClickHouse preferences for fast analytics: MergeTree table design, batch ingestion, materialized view rollups, TTLs, quotas and monitoring.
# ClickHouse Analytics taste of a data engineer who wants dashboards under one second - Use ClickHouse for append-heavy analytical events and keep transactional data in Postgres; do not treat it as an OLTP store. Confidence: 0.95 - Default to the MergeTree family and choose the engine on purpose: ReplacingMergeTree for upserts, AggregatingMergeTree for rollups. Confidence: 0.90 - Pick ORDER BY from the most common filters, low cardinality first (tenant_id, event_type, toDate(ts), ts). Confidence: 0.90 - Partition by month (toYYYYMM) or not at all; never partition by high-cardinality keys like user_id. Confidence: 0.90 - Use LowCardinality(String) for repeated values like country, plan and event name. Confidence: 0.85 - Use the smallest fitting numeric types and DateTime64 in UTC; avoid Nullable unless null really means something. Confidence: 0.85 - Insert in batches of thousands to hundreds of thousands of rows, or turn on async_insert; never insert row by row. Confidence: 0.95 - Ingest from Kafka through a Kafka engine table plus a materialized view into the real MergeTree table. Confidence: 0.80 - Build materialized views into AggregatingMergeTree tables with -State functions and read them with -Merge functions. Confidence: 0.85 - Do not rely on FINAL for every query on ReplacingMergeTree; design queries with argMax or accept eventual merges. Confidence: 0.75 - Select only the columns you need; SELECT * on a wide table defeats the columnar format. Confidence: 0.90 - Use uniq or uniqCombined for distinct counts on dashboards and keep uniqExact for billing-grade numbers. Confidence: 0.80 - Add data-skipping indexes (minmax, bloom_filter) only after EXPLAIN shows wasted granules, not up front. Confidence: 0.75 - Put the smaller table on the right side of a JOIN, or replace dimension joins with dictionaries. Confidence: 0.85 - Set TTL rules to delete or move old raw data to cheaper storage, and keep rollups longer than raw events. Confidence: 0.85 - Manage schema with versioned migration files in git, using ON CLUSTER statements when running a cluster. Confidence: 0.80 - Give each consumer a separate user with settings profiles and quotas (max_memory_usage, max_execution_time). Confidence: 0.85 - Watch system.query_log, system.parts and merge activity; alert on too many parts per partition. Confidence: 0.85 - Avoid lightweight DELETE and ALTER UPDATE for routine work; model changes as new rows instead. Confidence: 0.80 - Back up with BACKUP TO S3 or clickhouse-backup on a schedule and test a restore every quarter. Confidence: 0.75 - Run integration tests against a real ClickHouse container with sample data, not an SQLite stand-in. Confidence: 0.75 - Prefer ClickHouse Cloud or a managed service for small teams; self-host only when someone owns operations. Confidence: 0.65
Opinionated Pydantic v2 preferences for validating data at the edges of Python backends: separate input and output models, strict settings, discriminated unions and safe serialization.
# Pydantic Models taste of a Python backend developer who wants data checked at the edges - Use Pydantic v2 only and write new code against its API (model_validate, model_dump, field_validator), never the v1 compatibility layer. Confidence: 0.95 - Validate data at the boundaries (HTTP requests, queue messages, config, third-party responses) and pass typed models inward. Confidence: 0.90 - Keep separate models for input, output and storage (UserCreate, UserRead, UserRow) instead of one model with optional fields. Confidence: 0.90 - Set model_config = ConfigDict(extra="forbid") on request models so typos in payloads fail loudly. Confidence: 0.85 - Make value objects and events immutable with frozen=True. Confidence: 0.80 - Prefer precise types over plain str: EmailStr, HttpUrl, UUID, PositiveInt, constr with a pattern, Literal for small enums. Confidence: 0.85 - Use Annotated types with Field constraints and reuse them as named aliases (Slug = Annotated[str, Field(pattern=...)]). Confidence: 0.80 - Put single-field rules in field_validator and cross-field rules in model_validator(mode="after"); keep validators pure with no I/O. Confidence: 0.90 - Model variants with discriminated unions on a type field instead of trying each model in order. Confidence: 0.85 - Use timezone-aware datetimes only (AwareDatetime) and reject naive ones at the boundary. Confidence: 0.85 - Store money as Decimal with fixed places, never float. Confidence: 0.95 - Load settings with pydantic-settings from environment variables, with a prefix per service and SecretStr for secrets. Confidence: 0.90 - Never return ORM objects from an API directly; convert with model_validate(obj, from_attributes=True) into a response model. Confidence: 0.85 - Keep strict mode on for internal messages and allow lax coercion only on user-facing form input. Confidence: 0.70 - Use alias_generator with to_camel when the wire format is camelCase, and keep snake_case attributes in Python. Confidence: 0.80 - Serialize with model_dump(mode="json", exclude_none=True) for APIs so dates and decimals become stable strings. Confidence: 0.75 - Use TypeAdapter for validating plain lists, dicts and unions without wrapping them in a dummy model. Confidence: 0.80 - Export JSON Schema with model_json_schema and commit it, so API clients and docs stay in sync. Confidence: 0.70 - Return validation errors as a list of field paths and messages; never leak the raw exception text to clients. Confidence: 0.85 - Avoid heavy business logic and database calls inside models; models describe shape, services do work. Confidence: 0.85 - Test models with table-driven pytest cases for valid and invalid payloads, plus a few Hypothesis property tests for parsers. Confidence: 0.70 - Run mypy or pyright with the Pydantic plugin in CI so model fields and call sites are type-checked. Confidence: 0.80
Opinionated preferences for reliable RabbitMQ messaging: quorum queues, publisher confirms, manual acks, dead lettering, retries and idempotent consumers.
# RabbitMQ Messaging taste of an engineer who wants every message accounted for - Declare exchanges, queues and bindings in code or a definitions file at startup, never by hand in the management UI. Confidence: 0.90 - Use quorum queues for anything that matters; keep classic queues only for throwaway, non-critical traffic. Confidence: 0.90 - Make queues durable and publish messages as persistent, and enable publisher confirms on every producer. Confidence: 0.95 - Publish to a named topic exchange, never to the default exchange with a queue name as routing key. Confidence: 0.80 - Use routing keys shaped like domain.entity.event (orders.order.created) so consumers bind with wildcards. Confidence: 0.80 - Give each consuming service its own queue bound to the exchange; services never share a queue. Confidence: 0.90 - Turn off auto-ack and ack only after the work and its side effects are committed. Confidence: 0.95 - Set a prefetch (basic.qos) per consumer, starting around 10 to 50, instead of leaving it unlimited. Confidence: 0.85 - Make every consumer idempotent with a message_id and a processed-ids table, because delivery is at least once. Confidence: 0.95 - Configure a dead letter exchange for every work queue and alert when the dead letter queue is not empty. Confidence: 0.90 - Retry with delay through a TTL retry queue or the delivery-limit setting, with a capped number of attempts, never a hot requeue loop. Confidence: 0.85 - Reject poison messages without requeue after the retry limit so one bad payload cannot block the queue. Confidence: 0.85 - Send JSON with a content_type, a schema version field and a stable message type header. Confidence: 0.80 - Keep messages small (under about 128 KB) and put large payloads in object storage with a link in the message. Confidence: 0.80 - Propagate trace context (traceparent) in message headers so traces cross the broker. Confidence: 0.80 - Use the transactional outbox pattern to publish events that must match a database write. Confidence: 0.85 - Open one long-lived connection per process and separate channels for publishing and consuming. Confidence: 0.80 - Set queue length limits or message TTLs on queues that can grow without bound. Confidence: 0.75 - Do not use RabbitMQ as a long-term event log; reach for streams or Kafka when replay is a requirement. Confidence: 0.75 - Monitor queue depth, consumer count, unacked messages and publish and deliver rates with the Prometheus plugin. Confidence: 0.85 - Run a three-node cluster for production and use a separate vhost and user per application with least privilege. Confidence: 0.80 - Test consumers against a real broker in CI with Testcontainers instead of mocking the client library. Confidence: 0.75
Opinionated preferences for Zig projects: pinned toolchain, build.zig, explicit allocators, error handling, tests and cross-compilation.
# Zig Project taste of a systems developer who likes boring, explicit builds
- Pin the Zig version per project (a .zig-version file or mise/zigup) because the language still breaks between releases. Confidence: 0.90
- Drive everything through build.zig: build, test, run and install steps, with no Makefile or shell wrappers. Confidence: 0.90
- Declare dependencies in build.zig.zon with content hashes and fetch them with zig fetch --save. Confidence: 0.90
- Use b.standardTargetOptions and b.standardOptimizeOption so any target and release mode work from the command line. Confidence: 0.85
- Pass allocators explicitly into every function that allocates; never hide a global allocator. Confidence: 0.95
- Use std.testing.allocator in tests so leaks and double frees fail the test. Confidence: 0.90
- Pair every allocation with defer or errdefer on the very next line. Confidence: 0.90
- Prefer an ArenaAllocator for short-lived request or frame work instead of freeing many small objects. Confidence: 0.80
- Use the GeneralPurposeAllocator (DebugAllocator) in debug builds and check its leak report on exit. Confidence: 0.80
- Return error unions and propagate with try; reserve catch unreachable for cases you can prove. Confidence: 0.90
- Define small, specific error sets for public APIs instead of anyerror. Confidence: 0.80
- Write tests in the same file as the code with test blocks, and run them all with zig build test. Confidence: 0.90
- Keep comptime for real needs such as generics and lookup tables, not for clever metaprogramming. Confidence: 0.80
- Use slices and sentinel-terminated types instead of raw many-item pointers wherever possible. Confidence: 0.85
- Ship ReleaseSafe by default and use ReleaseFast only for measured hot paths. Confidence: 0.75
- Use @import("std").log with scoped loggers instead of std.debug.print in library code. Confidence: 0.75
- Wrap C libraries through @cImport in one small module and expose a Zig-style API from it. Confidence: 0.80
- Use zig cc and zig build to cross-compile C and Zig code from one machine instead of separate toolchains. Confidence: 0.85
- Run zig fmt in CI and fail the build when it would change any file. Confidence: 0.90
- Test in CI on Linux, macOS and Windows, plus at least one cross-compiled target. Confidence: 0.80
- Keep public library APIs in one root.zig and mark everything else non-pub. Confidence: 0.80
- Generate API docs with -femit-docs and publish them with each release. Confidence: 0.65
Opinionated preferences for structured JSON logging in backend services: fields, levels, trace correlation, redaction and retention.
# Structured Logging taste of a backend engineer who greps logs at 3 a.m. - Emit every log line as a single JSON object on stdout and let the platform ship it; never write log files from the app. Confidence: 0.90 - Use the same core fields everywhere: timestamp, level, service, environment, version, message. Confidence: 0.90 - Write timestamps in UTC as RFC 3339 with milliseconds, never in local time. Confidence: 0.95 - Keep the message a short constant string and put variable data in fields, so "payment failed" stays searchable. Confidence: 0.90 - Use only four levels in practice: debug, info, warn, error; error means someone should look at it. Confidence: 0.80 - Set the log level from an environment variable and allow changing it at runtime without a redeploy. Confidence: 0.75 - Attach trace_id and span_id from OpenTelemetry context to every line so logs join traces. Confidence: 0.90 - Generate or accept a request_id at the edge, return it in a response header, and log it on every line for that request. Confidence: 0.90 - Use a context-bound child logger (request, job, user) instead of passing ids into every log call. Confidence: 0.85 - Log errors with error.type, error.message and error.stack as separate fields, not one interpolated string. Confidence: 0.85 - Log an error once, where it is handled; do not log and rethrow at every layer. Confidence: 0.90 - Never log secrets, tokens, passwords, full card numbers or session cookies; redact them in the logger, not by convention. Confidence: 0.95 - Treat emails, phone numbers and IPs as personal data: hash or drop them unless there is a documented need. Confidence: 0.85 - Write one canonical summary line per request with route, status, duration_ms and user or tenant id. Confidence: 0.80 - Keep durations in a numeric field with the unit in its name (duration_ms), never as "1.2s" text. Confidence: 0.85 - Follow a shared field naming scheme such as OpenTelemetry semantic conventions or ECS instead of inventing names per team. Confidence: 0.75 - Sample noisy success logs (health checks, polling) and never sample errors. Confidence: 0.80 - Use a fast structured logger with no reflection in hot paths: pino in Node, slog or zap in Go, structlog in Python. Confidence: 0.80 - Pretty-print logs only in local development, behind an env flag, and keep production output raw JSON. Confidence: 0.85 - Make logging non-blocking and bounded; dropping debug lines under pressure is better than stalling requests. Confidence: 0.70 - Set retention per level and environment, for example 7 days for debug and 30 days for info and above. Confidence: 0.70 - Alert on metrics derived from logs, not on single log lines, so one bad request does not page anyone. Confidence: 0.80 - Add a test that asserts key log lines and their fields, so a refactor cannot silently break dashboards. Confidence: 0.65
Opinionated conventions for shipping iOS and Android apps: release trains, automated signing, staged rollouts, crash thresholds and remote kill switches.
# Mobile App Release taste of a developer who ships iOS and Android apps on a calm, regular train - Release on a fixed schedule (weekly or every two weeks) instead of shipping whenever a feature feels done. Confidence: 0.85 - Automate builds, signing and store uploads with fastlane or an equivalent CI pipeline; never upload from a laptop. Confidence: 0.95 - Keep signing keys and certificates in a secrets manager or match repository, never in the app repo. Confidence: 0.95 - Use Play App Signing on Android so a lost upload key is recoverable. Confidence: 0.90 - Use semantic version names for users and an automatically incremented build number from CI. Confidence: 0.85 - Cut a release branch at code freeze and only merge fixes into it after that. Confidence: 0.80 - Ship every build to internal testers first through TestFlight and the Play internal testing track. Confidence: 0.95 - Use staged rollouts: start at 1 to 5 percent on Google Play and use phased release on the App Store. Confidence: 0.90 - Define crash-free sessions and ANR thresholds up front and pause the rollout automatically when they are crossed. Confidence: 0.85 - Upload dSYMs and R8 mapping files on every build so crash reports are symbolicated. Confidence: 0.95 - Put risky features behind remote feature flags so they can be turned off without a new binary. Confidence: 0.90 - Support a minimum-version check that can show a soft or forced update prompt for broken old versions. Confidence: 0.85 - Keep the backend compatible with at least the last few app versions, since users update slowly. Confidence: 0.90 - Write short, human release notes for the store and avoid "bug fixes and improvements" every time. Confidence: 0.70 - Localize store listings and release notes for the main markets the app is sold in. Confidence: 0.70 - Generate store screenshots automatically from UI tests so they never go stale. Confidence: 0.70 - Run a short manual smoke test on a real low-end Android device and an older iPhone before promoting a build. Confidence: 0.80 - Keep the privacy nutrition label and the Data safety form in version control and update them with each SDK change. Confidence: 0.85 - Audit third-party SDKs before each release for size, permissions and privacy manifest requirements. Confidence: 0.80 - Track app size per build and fail CI when it grows past an agreed budget. Confidence: 0.70 - Keep a written checklist for store review rejections and expedited review requests. Confidence: 0.65 - Tag every released commit in git with the version and build number. Confidence: 0.90 - Use over-the-air JavaScript updates (for React Native or Expo) only for fixes that follow store rules, never to ship big features. Confidence: 0.75
Opinionated habits for keeping cloud bills under control: tagging, unit costs, right-sizing, commitments, storage lifecycles and cost checks in code review.
# Cloud Cost Optimization taste of an engineer who treats the cloud bill as a production metric - Tag every resource with owner, team, service and environment, and block untagged resources with policy. Confidence: 0.95 - Turn on the provider's cost and usage export to a warehouse and build dashboards from it, not from the billing console. Confidence: 0.85 - Show each team its own monthly cost and unit cost per request, customer or job, not one company total. Confidence: 0.90 - Set budget alerts per account and per team at 50, 80 and 100 percent of the forecast. Confidence: 0.90 - Turn on cost anomaly detection and route its alerts to the owning team's channel, not a shared inbox. Confidence: 0.85 - Right-size instances from at least two weeks of real CPU and memory data before buying any commitment. Confidence: 0.85 - Buy Savings Plans or committed-use discounts only for the steady baseline, and leave the spiky part on demand. Confidence: 0.85 - Run stateless, interruption-tolerant workloads (CI runners, batch jobs, dev clusters) on spot or preemptible capacity. Confidence: 0.80 - Scale non-production environments to zero outside working hours on a schedule. Confidence: 0.90 - Prefer ARM instance types (Graviton, Ampere, Axion) for new services after a quick benchmark. Confidence: 0.75 - Add lifecycle rules to every object storage bucket: move to infrequent-access tiers, then expire. Confidence: 0.90 - Set log retention explicitly on every log group; never keep debug logs forever by default. Confidence: 0.90 - Sample traces and drop high-cardinality metric labels before they reach the observability vendor bill. Confidence: 0.80 - Watch data transfer: keep chatty services in the same zone and use VPC endpoints instead of NAT for cloud APIs. Confidence: 0.85 - Put a CDN in front of public assets and downloads to cut egress from origin. Confidence: 0.80 - Delete unattached volumes, old snapshots, idle load balancers and unused elastic IPs with a weekly automated sweep. Confidence: 0.90 - Show the cost diff in pull requests for infrastructure code with a tool like Infracost. Confidence: 0.75 - Prefer managed serverless only while traffic is low or spiky; revisit when steady load makes containers cheaper. Confidence: 0.70 - Set autoscaling minimums from real traffic, not from a guess made at launch. Confidence: 0.80 - Give every experiment or sandbox account an expiry date and a hard spending cap. Confidence: 0.85 - Review the top ten cost lines every month with the owning teams and record one action for each. Confidence: 0.80 - Never trade away reliability or security controls (backups, multi-AZ for critical data) just to save money. Confidence: 0.95 - Treat a cost regression like a performance regression: find the commit, fix it, and add a check. Confidence: 0.75
Opinionated conventions for publishing small, stable Java libraries with Maven: pinned plugins, tiny dependency trees, API compatibility checks and Central releases.
# Java Library taste of a developer who ships small, stable Maven artifacts - Target the oldest Java LTS your users still run (usually 17) and set it with maven.compiler.release, not source/target. Confidence: 0.90 - Use the Maven Wrapper (mvnw) and commit it so every build uses the same Maven version. Confidence: 0.90 - Pin every plugin version in pluginManagement; never rely on Maven's default plugin versions. Confidence: 0.95 - Keep runtime dependencies near zero; a library should not drag Guava or Commons into every consumer. Confidence: 0.85 - Mark compile-only and annotation-processor dependencies as provided or optional so they do not leak transitively. Confidence: 0.80 - Ship a module-info.java, or at least an Automatic-Module-Name in the manifest, so JPMS users get a stable module name. Confidence: 0.85 - Put everything not meant for users in an internal package and do not export it from the module. Confidence: 0.85 - Prefer immutable value types (records or final classes with builders) for the public API. Confidence: 0.85 - Never return null from public methods; return Optional for single values and empty collections for lists. Confidence: 0.85 - Throw unchecked exceptions with clear messages, and define one library-specific base exception type. Confidence: 0.75 - Annotate nullability with JSpecify (@NullMarked at package level) so Kotlin and static analysis tools see the contract. Confidence: 0.75 - Use SLF4J as the only logging dependency and never configure a logging backend inside the library. Confidence: 0.90 - Test with JUnit 5 and AssertJ, and keep unit tests runnable with a plain mvn verify and no network. Confidence: 0.90 - Run integration tests with the Failsafe plugin and Testcontainers instead of shared test databases. Confidence: 0.80 - Enforce formatting with Spotless (google-java-format or palantir-java-format) and fail CI on drift. Confidence: 0.80 - Run Error Prone or SpotBugs in CI and treat new warnings as build failures. Confidence: 0.70 - Use japicmp or revapi to block accidental binary-incompatible changes in minor and patch releases. Confidence: 0.85 - Follow semantic versioning strictly; breaking changes wait for a major version with a migration note. Confidence: 0.90 - Publish a BOM when the project has more than one artifact so users can align versions in one place. Confidence: 0.75 - Generate and publish sources and Javadoc jars, and write Javadoc for every public type and method. Confidence: 0.85 - Publish to Maven Central through the Central Portal with signed artifacts, released from CI, never from a laptop. Confidence: 0.85 - Make builds reproducible by setting project.build.outputTimestamp. Confidence: 0.70 - Test the library in CI on every supported Java version with a matrix build. Confidence: 0.85 - Keep a CHANGELOG.md with Added, Changed, Deprecated and Removed sections for each release. Confidence: 0.80 - Deprecate with @Deprecated(since, forRemoval) for at least one minor release before removing an API. Confidence: 0.80
Opinionated conventions for keyboard-first terminal UI apps: TUI frameworks, responsive rendering, accessible colors and scriptable modes.
# Terminal UI App taste of a developer who builds fast, keyboard-first terminal interfaces - Pick a mature TUI framework (Bubble Tea, Ratatui, Textual, Ink) instead of writing raw escape codes. Confidence: 0.90 - Use an Elm-style model, update and view architecture so state changes are easy to test without a terminal. Confidence: 0.80 - Render in the alternate screen buffer and always restore the terminal on exit, panic or Ctrl+C. Confidence: 0.95 - Make every action reachable by keyboard and show the main shortcuts in a footer bar. Confidence: 0.90 - Offer a ? key that opens a full help overlay listing all key bindings for the current view. Confidence: 0.85 - Support both arrow keys and vim-style hjkl navigation, and never require a mouse, though mouse support is welcome. Confidence: 0.80 - Use q or Esc to go back or quit, and ask for confirmation only before destructive actions. Confidence: 0.85 - Never block the render loop on I/O; run network and disk work in the background and show a spinner or progress bar. Confidence: 0.90 - Redraw only on state changes or at a capped frame rate, not in a busy loop. Confidence: 0.80 - Handle terminal resize events and lay out with flexible constraints that still work at 80x24. Confidence: 0.90 - Respect NO_COLOR, detect color depth, and fall back gracefully from truecolor to 256 and 16 colors. Confidence: 0.85 - Never use color as the only signal; pair it with symbols, labels or bold text. Confidence: 0.85 - Use a small, consistent palette tied to the terminal theme instead of hard-coded bright colors. Confidence: 0.75 - Provide a non-interactive mode (flags, --json output) for every important action so the tool works in scripts and CI. Confidence: 0.90 - Detect when stdout is not a TTY and switch to plain output automatically. Confidence: 0.90 - Add fuzzy filtering with / to any list longer than one screen. Confidence: 0.80 - Write logs to a file (opt-in with --debug), never to the screen the UI is drawing on. Confidence: 0.85 - Store config in the XDG config directory as TOML or YAML, and let users remap key bindings there. Confidence: 0.75 - Test views with golden snapshot files of rendered output at fixed terminal sizes. Confidence: 0.75 - Test in the common terminals (iTerm2, Windows Terminal, GNOME Terminal, tmux) before a release, including Unicode width cases. Confidence: 0.70 - Keep startup under about 100 ms so opening the app feels instant. Confidence: 0.70 - Ship a single static binary or a pipx/npm install path, with a short animated demo GIF in the README. Confidence: 0.70
Opinionated conventions for building and releasing Swift packages: Package.swift setup, strict concurrency, Swift Testing, DocC and semver.
# Swift Package taste of a developer who ships small, well-tested Swift libraries - Use Swift Package Manager as the only distribution method for new libraries, and skip CocoaPods and Carthage specs unless users ask. Confidence: 0.85 - Set the swift-tools-version to the oldest toolchain you really test on, and raise it on purpose in a minor release. Confidence: 0.80 - Declare explicit platform minimums in Package.swift (.iOS, .macOS, .watchOS, .tvOS, .visionOS) instead of relying on defaults. Confidence: 0.85 - Keep one focused library product per package; split optional integrations into separate targets users can opt into. Confidence: 0.80 - Use the standard layout (Sources/<Target>, Tests/<Target>Tests) and avoid custom path settings. Confidence: 0.90 - Enable Swift 6 language mode and strict concurrency checking, and mark public types Sendable where it is true. Confidence: 0.80 - Keep the public API small: default to internal, and make each public symbol a deliberate decision. Confidence: 0.90 - Prefer value types and protocols with small requirements over class hierarchies in public APIs. Confidence: 0.80 - Offer async/await APIs first, and add completion-handler or Combine wrappers only when users need them. Confidence: 0.75 - Avoid third-party dependencies in a library; when one is needed, use a version range from: a major version, never a branch or exact revision. Confidence: 0.85 - Write tests with Swift Testing (@Test, #expect) for new code and keep XCTest only where it is already used. Confidence: 0.75 - Run CI on macOS and Linux with swift build and swift test, plus xcodebuild for each Apple platform you claim to support. Confidence: 0.85 - Write DocC documentation for every public symbol and include at least one article showing the main use case. Confidence: 0.80 - Host the docs on the Swift Package Index and keep a .spi.yml so builds and documentation stay green there. Confidence: 0.70 - Follow semantic versioning with plain tags like 1.4.0, without a v prefix, so SPM resolves them. Confidence: 0.90 - Use @available and deprecation messages with a renamed: hint one minor release before removing an API. Confidence: 0.85 - Keep resources in a Resources folder declared with .process and access them only through Bundle.module. Confidence: 0.75 - Format with swift-format or SwiftFormat and lint with SwiftLint in CI, using a config committed to the repo. Confidence: 0.70 - Avoid build plugins and macros unless they remove real boilerplate, because they slow builds and need extra trust prompts. Confidence: 0.65 - Ship a privacy manifest (PrivacyInfo.xcprivacy) when the library touches required-reason APIs. Confidence: 0.75 - Keep Package.resolved out of library repositories, but commit it in apps and example projects. Confidence: 0.80 - Include a runnable example app or snippet in the README that compiles in CI. Confidence: 0.70 - Keep a CHANGELOG.md with Added, Changed, Deprecated and Fixed sections for every release. Confidence: 0.80
Opinionated habits for safe, incremental refactoring: characterization tests, small green steps, strangler fig and clean pull requests.
# Refactoring taste of an engineer who changes structure without changing behavior
- Never mix a refactor and a behavior change in the same commit; reviewers should be able to verify each one alone. Confidence: 0.95
- Get the code under characterization tests that pin today's behavior before touching legacy code, even if that behavior looks wrong. Confidence: 0.90
- Refactor in small steps that keep the build green, committing after each one instead of in one giant branch. Confidence: 0.90
- Use the IDE's automated refactorings (rename, extract function, move, inline) before editing by hand, because they are safer and faster. Confidence: 0.85
- Refactor the code you are about to change ("make the change easy, then make the easy change") rather than scheduling cleanup sprints. Confidence: 0.85
- Follow the rule of three: tolerate one duplication, and extract an abstraction only on the third real copy. Confidence: 0.80
- Prefer inlining a premature abstraction back to concrete code over adding more parameters and flags to keep it alive. Confidence: 0.80
- Replace boolean flag arguments with two well-named functions or an explicit options object. Confidence: 0.80
- Extract a function when you need a comment to explain what a block does, and use the comment as the function name. Confidence: 0.75
- Replace nested conditionals with guard clauses and early returns. Confidence: 0.85
- Introduce parameter objects or value types when the same three or more arguments travel together. Confidence: 0.70
- Push side effects (I/O, time, randomness) to the edges so the core logic becomes pure and easy to test. Confidence: 0.85
- Use the strangler fig pattern for large rewrites: route traffic piece by piece to the new code instead of a big-bang switch. Confidence: 0.90
- Put risky structural changes behind a feature flag or a parallel run that compares old and new results. Confidence: 0.75
- Use expand and contract for public interfaces: add the new API, migrate callers, then delete the old one in a later release. Confidence: 0.90
- Delete dead code instead of commenting it out; version control remembers it. Confidence: 0.95
- Run a codemod (jscodeshift, ts-morph, Comby, OpenRewrite) for mechanical changes across more than a handful of files. Confidence: 0.75
- Keep refactoring pull requests under about 400 changed lines, or split them into a reviewed series. Confidence: 0.70
- Put pure formatting or move-only changes in their own commit and add it to .git-blame-ignore-revs. Confidence: 0.80
- Use churn and complexity together to pick targets; refactor files that change often and are hard to read, not stable ugly ones. Confidence: 0.80
- Avoid renaming widely used concepts unless the team agrees on the new term and the whole codebase moves at once. Confidence: 0.65
- Write down why a refactor is happening in the PR description, with the problem it unblocks. Confidence: 0.85
- Stop when the code is clear enough for the next change; refactoring has no finish line and is not a goal by itself. Confidence: 0.80Opinionated habits for measuring and fixing performance problems: profilers, benchmarks, percentiles and evidence-backed optimizations.
# Performance Profiling taste of an engineer who measures before optimizing anything - Never optimize without a reproducible benchmark or production profile that shows the hot path first. Confidence: 0.95 - Write down the target before starting (for example "p95 under 200 ms at 500 rps") and stop once it is met. Confidence: 0.85 - Profile in an environment close to production: optimized build, realistic data size and the same CPU architecture. Confidence: 0.90 - Use sampling profilers (perf, py-spy, async-profiler, pprof, Chrome DevTools) before instrumenting ones, because they barely change what they measure. Confidence: 0.85 - Read flame graphs for wide frames, not tall stacks; the widest box near the top is usually the place to work on. Confidence: 0.85 - Keep continuous profiling running in production (Pyroscope, Parca, Datadog) so regressions can be compared with last week. Confidence: 0.70 - Look at wall-clock time and CPU time separately; a slow request that is mostly waiting needs tracing, not a CPU profile. Confidence: 0.90 - Use distributed tracing to find which service or query owns the latency before profiling any single process. Confidence: 0.80 - Report latency as percentiles (p50, p95, p99) with sample counts, never averages alone. Confidence: 0.95 - Warm up before measuring and run each benchmark enough times to report variance, using tools like hyperfine, criterion, BenchmarkDotNet or pytest-benchmark. Confidence: 0.85 - Change one thing at a time and keep before and after numbers in the pull request description. Confidence: 0.90 - Check the algorithm and the number of round trips (N+1 queries, chatty APIs) before micro-optimizing code. Confidence: 0.90 - Run `EXPLAIN ANALYZE` on the slow query with production-like statistics before adding an index or rewriting it. Confidence: 0.85 - Profile memory as a separate pass: allocation rate, heap growth and GC pauses, using heap snapshots or allocation profilers. Confidence: 0.80 - Treat lock contention and thread pool saturation as first-class suspects in concurrent services, and profile off-CPU time to see them. Confidence: 0.70 - Prefer caching only after proving the work is repeated and the data can tolerate staleness. Confidence: 0.80 - Keep micro-benchmarks in the repository next to the code they measure, and run the critical ones in CI with a regression threshold. Confidence: 0.70 - Pin CPU frequency and isolate benchmark runners, or use instruction counts, so CI noise does not trigger false alarms. Confidence: 0.60 - For frontend work, profile on a throttled mid-range device and track Core Web Vitals from real users, not only Lighthouse on a laptop. Confidence: 0.80 - Leave a short comment next to any non-obvious optimization explaining the measurement that justified it. Confidence: 0.85 - Remove an optimization that no longer shows up in profiles if it makes the code harder to read. Confidence: 0.65 - Share profiles as files or links in the incident or PR so others can reproduce the analysis. Confidence: 0.75
Opinionated Deno conventions for secure, zero-config TypeScript servers and tools: permissions, JSR imports, testing and publishing.
# Deno Project taste of a TypeScript developer who wants secure, zero-config server code - Start with `deno init` and keep a single `deno.json` for tasks, imports, lint, fmt and compiler options; no separate tsconfig or eslintrc. Confidence: 0.90 - Pin dependencies in the `imports` map of `deno.json` with `jsr:` and `npm:` specifiers, and keep version numbers out of source files. Confidence: 0.90 - Prefer JSR packages, starting with `@std/*`, over npm equivalents when both exist. Confidence: 0.80 - Commit `deno.lock` and run CI with `--frozen` so a dependency can never change silently. Confidence: 0.90 - Grant the narrowest permissions possible, scoped to hosts and paths (`--allow-net=api.example.com`, `--allow-read=./data`); never `-A` outside quick local experiments. Confidence: 0.95 - Write the permission flags into the `deno.json` tasks so every developer runs the app with the same sandbox. Confidence: 0.85 - Use `Deno.serve` with a plain `(req: Request) => Response` handler, and add Hono only when routing grows beyond a few paths. Confidence: 0.80 - Stick to Web standard APIs (`fetch`, `Request`, `URL`, `crypto.subtle`, streams) before reaching for Deno-only or Node-compat APIs. Confidence: 0.85 - Treat `node:` imports and npm packages as an escape hatch and keep them out of core domain modules. Confidence: 0.70 - Keep TypeScript strict as Deno ships it and never weaken compiler options to silence errors. Confidence: 0.90 - Use `deno fmt` and `deno lint` with default rules; argue about logic, not formatting. Confidence: 0.85 - Write tests with `Deno.test` and `@std/assert` next to the code as `*_test.ts` files. Confidence: 0.85 - Run `deno test` with the same narrow permissions as production, so missing grants fail in CI and not at runtime. Confidence: 0.75 - Use `t.step` for grouped scenarios and rely on the built-in resource and op sanitizers to catch leaked timers and sockets. Confidence: 0.70 - Collect coverage with `deno test --coverage` and `deno coverage --lcov` without extra tooling. Confidence: 0.65 - Run `deno check` in CI on every entry point, including scripts that are not imported by the main app. Confidence: 0.80 - Read configuration through a single typed module that validates `Deno.env` once at startup and fails fast on missing values. Confidence: 0.85 - Use the `--env-file` flag for local `.env` files instead of a dotenv dependency. Confidence: 0.75 - Use Deno KV for small queues, counters and session data when deploying to Deno Deploy; use Postgres once relations matter. Confidence: 0.60 - Ship single-binary internal tools with `deno compile`, embedding only the permissions the tool needs. Confidence: 0.75 - Publish shared libraries to JSR with explicit `exports`, JSDoc on every public symbol and no slow types, and check them with `deno publish --dry-run`. Confidence: 0.85 - Handle shutdown by listening for `SIGTERM` with `Deno.addSignalListener` and awaiting `server.shutdown()`. Confidence: 0.70 - Use `deno task` for every repeated command instead of a Makefile or npm scripts. Confidence: 0.80
Opinionated conventions for building, testing and releasing small, dependable Ruby gems with clean gemspecs and safe publishing.
# Ruby Gem taste of a maintainer who ships small, dependable gems with boring releases - Scaffold new gems with `bundle gem <name> --test=rspec --ci=github --linter=rubocop` and keep the generated layout instead of inventing a custom one. Confidence: 0.80 - Keep the gemspec as the single source of truth for metadata, required Ruby version and runtime dependencies; the Gemfile only adds development tools. Confidence: 0.90 - Set `required_ruby_version` explicitly and support only Ruby versions that still receive security fixes. Confidence: 0.85 - Build `spec.files` from `git ls-files` filtered to `lib`, `sig`, `exe`, LICENSE, README and CHANGELOG so tests and fixtures never ship in the package. Confidence: 0.85 - Add as few runtime dependencies as possible and give each one a pessimistic constraint like `~> 2.3`, never an unbounded `>=`. Confidence: 0.90 - Do not commit `Gemfile.lock` for a library; let CI resolve fresh dependencies so breakage shows up early. Confidence: 0.65 - Namespace everything under one top-level module that matches the gem name, and never monkey-patch core classes from a library. Confidence: 0.95 - Use Zeitwerk for gems with many files, and plain `require_relative` for small ones. Confidence: 0.70 - Expose configuration through a `configure` block that yields a plain configuration object with documented defaults. Confidence: 0.80 - Define a base `<GemName>::Error < StandardError` and raise specific subclasses so callers can rescue the whole family. Confidence: 0.90 - Add `# frozen_string_literal: true` to every Ruby file. Confidence: 0.80 - Write tests in RSpec with `--require spec_helper`, random order and `disable_monkey_patching!` turned on. Confidence: 0.80 - Run CI on a matrix of all supported Rubies plus `head`, with `head` allowed to fail. Confidence: 0.85 - Enforce style with RuboCop (or Standard) in CI, and keep project-wide disables in `.rubocop.yml` instead of inline comments. Confidence: 0.75 - Ship RBS signatures in `sig/` for the public API, or at least YARD types, so editors and Steep can check callers. Confidence: 0.60 - Document every public method with YARD and keep a runnable quick-start example at the top of the README. Confidence: 0.80 - Follow Semantic Versioning strictly and keep `VERSION` in `lib/<gem>/version.rb` as the only place the version lives. Confidence: 0.95 - Maintain a CHANGELOG in Keep a Changelog format and update it in the same pull request as the change. Confidence: 0.85 - Deprecate before removing: warn through `Kernel#warn` with `category: :deprecated` for at least one minor release. Confidence: 0.85 - Publish from CI with RubyGems trusted publishing on a tagged release instead of running `gem push` from a laptop. Confidence: 0.85 - Require MFA for every owner by setting `rubygems_mfa_required` to "true" in the gemspec metadata. Confidence: 0.95 - Set `source_code_uri`, `changelog_uri` and `bug_tracker_uri` in the metadata so rubygems.org links back to the repository. Confidence: 0.75 - Keep optional integrations (Rails, Sidekiq) behind separate requires such as `require "<gem>/rails"` so they never load by default. Confidence: 0.80 - Test the packaged gem, not only the repo: build it in CI, install it into a clean bundle and run a smoke script. Confidence: 0.70
Opinionated preferences for naming variables, functions and files, and for writing useful code comments.
# Naming and Code Comments taste of a senior engineer who reviews a lot of code - Name things for what they mean in the domain (`invoiceDueDate`), not for their type (`dateString`). Confidence: 0.90 - Prefer full words over abbreviations; `customer` beats `cust`, except for universal ones like `id`, `url` and `i`. Confidence: 0.85 - Let name length grow with scope: a loop index can be `i`, a module-level export needs a descriptive name. Confidence: 0.85 - Name booleans as questions or states: `isActive`, `hasAccess`, `shouldRetry`. Confidence: 0.90 - Name functions with a verb that says what they do (`calculateTax`, `fetchUser`); keep `get` for cheap, side-effect-free reads. Confidence: 0.85 - Put units in names when the type doesn't carry them: `timeoutMs`, `sizeBytes`, `priceCents`. Confidence: 0.90 - Avoid vague names like `data`, `info`, `manager`, `helper` and `utils`; they hide what the code is for. Confidence: 0.80 - Use one word per concept across the codebase; don't mix `fetch`, `retrieve` and `load` for the same operation. Confidence: 0.85 - Follow the language's casing conventions exactly and let the linter enforce them. Confidence: 0.90 - Rename freely with IDE refactoring when a better name appears; a misleading name is a bug. Confidence: 0.80 - Write comments that explain why, not what; the code already says what. Confidence: 0.95 - Delete a comment that just restates the next line. Confidence: 0.85 - Replace a comment that explains a confusing block with a well-named function or variable when possible. Confidence: 0.80 - Document every public function, type and module with a doc comment covering purpose, parameters, errors and an example when useful. Confidence: 0.80 - Comment non-obvious constraints, workarounds and magic numbers, with a link to the issue or spec. Confidence: 0.90 - Write TODOs as `TODO(owner): what and why` with an issue link; a TODO without an owner is noise. Confidence: 0.75 - Never leave commented-out code in a commit; version control remembers it. Confidence: 0.95 - Update or delete comments in the same change that makes them stale. Confidence: 0.90 - Keep comments in plain English, short and in complete sentences. Confidence: 0.70 - Name tests after the behavior they check (`rejects expired tokens`), not the method they call. Confidence: 0.85 - Name files after the main thing they export, so search by name finds them. Confidence: 0.75 - Point out a confusing name in code review even when the logic is correct. Confidence: 0.80
Opinionated preferences for tenant isolation, data modeling and operations in a multi-tenant B2B SaaS.
# Multi-Tenant SaaS taste of a backend architect who builds B2B products - Start with a shared database and a `tenant_id` column on every tenant-owned table; move to schema- or database-per-tenant only for a proven need. Confidence: 0.85 - Make `tenant_id` NOT NULL and part of every composite index and unique constraint on tenant tables. Confidence: 0.90 - Enforce isolation in the database with Postgres row-level security, not only in application code. Confidence: 0.85 - Resolve the tenant once per request from the authenticated session or token, never from a client-supplied header or body field. Confidence: 0.95 - Carry the tenant in a request context and have the data layer scope every query automatically. Confidence: 0.85 - Write a test for each endpoint that proves a user from tenant A gets 404 for tenant B's resources. Confidence: 0.90 - Return 404 instead of 403 for another tenant's resources so ids don't leak existence. Confidence: 0.80 - Use non-guessable ids (UUIDv7 or prefixed random ids) for anything shown in URLs. Confidence: 0.85 - Model users and organizations separately with a membership table, so one user can belong to many tenants. Confidence: 0.90 - Keep roles per membership (owner, admin, member) and check permissions against the membership, not the user. Confidence: 0.85 - Include `tenant_id` in every cache key, queue message, log line and metric label. Confidence: 0.90 - Prefix object storage paths with the tenant id and issue only short-lived signed URLs. Confidence: 0.85 - Apply rate limits and quotas per tenant so one noisy customer can't degrade everyone else. Confidence: 0.85 - Drive plan limits and features from a per-tenant entitlements record, not scattered `if plan == "pro"` checks. Confidence: 0.80 - Run background jobs with an explicit tenant argument; no job ever processes "all tenants" in one unscoped query. Confidence: 0.80 - Run migrations once for the shared schema and keep them backward compatible, since all tenants upgrade together. Confidence: 0.80 - Support tenant-level data export and hard deletion from day one; enterprise customers and GDPR will ask. Confidence: 0.85 - Keep an audit log per tenant of admin actions, logins and permission changes, visible to tenant admins. Confidence: 0.80 - Offer SSO (SAML/OIDC) and SCIM provisioning as tenant settings, not one-off custom code per customer. Confidence: 0.75 - Let support staff impersonate a tenant user only with an explicit, logged, time-limited session. Confidence: 0.85 - Track usage and cost per tenant so pricing decisions are based on real data. Confidence: 0.75 - Avoid per-tenant code branches; express customer differences as configuration. Confidence: 0.80
Opinionated preferences for sending reliable, secure transactional email from a product backend.
# Transactional Email taste of a backend engineer who owns product email delivery
- Send transactional email through a dedicated provider (Postmark, SES, Resend), never from the app server's own SMTP. Confidence: 0.90
- Keep transactional and marketing email on separate sending domains or subdomains so a campaign never hurts password-reset delivery. Confidence: 0.90
- Publish SPF, DKIM and a DMARC policy before the first send, and move DMARC to `p=quarantine` once reports look clean. Confidence: 0.90
- Enqueue every email from a background job; a request handler never waits on the email API. Confidence: 0.95
- Give each send an idempotency key derived from the event (e.g. `order-confirmed:{orderId}`) so retries never send twice. Confidence: 0.85
- Store templates in the repo as code (React Email or MJML), reviewed in pull requests, not edited in the provider dashboard. Confidence: 0.80
- Always send a plain-text part alongside the HTML part. Confidence: 0.85
- Render templates with typed data and fail the build when a template references a missing variable. Confidence: 0.80
- Keep subject lines specific and under about 60 characters; put the key action in the first line of the body. Confidence: 0.70
- Use a no-reply address only when replies truly can't be handled; prefer a monitored reply-to. Confidence: 0.70
- Process bounce and complaint webhooks and suppress those addresses automatically. Confidence: 0.95
- Verify webhook signatures from the provider before trusting any event. Confidence: 0.90
- Log a message id per send and link it to the user and the triggering event for support lookups. Confidence: 0.85
- Never put secrets, full card numbers or raw reset tokens in logs; log only the message id and template name. Confidence: 0.90
- Make magic links and reset links single-use, short-lived (15-60 minutes) and bound to the account. Confidence: 0.90
- Route all email in development and staging to a catcher like Mailpit; real addresses never receive non-production mail. Confidence: 0.95
- Snapshot-test rendered HTML for each template and send a test batch to Gmail, Outlook and Apple Mail before big template changes. Confidence: 0.75
- Respect user notification preferences for every non-critical email; security and billing emails are the only exceptions. Confidence: 0.85
- Add `List-Unsubscribe` and one-click unsubscribe headers to any email that isn't strictly transactional. Confidence: 0.85
- Localize templates by the user's saved locale, with an English fallback, and format dates in the user's time zone. Confidence: 0.80
- Rate-limit per recipient so a bug can't send hundreds of emails to one person. Confidence: 0.85
- Monitor delivery, bounce and complaint rates with alerts; a complaint rate above 0.1% is an incident. Confidence: 0.80
- Warm up a new sending domain or dedicated IP gradually instead of switching all traffic at once. Confidence: 0.75Opinionated preferences for designing and publishing Rust library crates: API shape, errors, features, docs and release checks.
# Rust Library Crate taste of a maintainer who publishes reusable crates - Keep the public API small and re-export the important types from the crate root. Confidence: 0.85 - Define one error enum per crate with `thiserror`, and never return `anyhow::Error` from a library. Confidence: 0.90 - Mark public enums and config structs `#[non_exhaustive]` when new variants or fields are likely. Confidence: 0.80 - Accept flexible inputs like `impl AsRef<str>` or `impl Into<String>` and return concrete types. Confidence: 0.80 - Use the builder pattern for types with more than a few optional settings. Confidence: 0.80 - Put optional integrations behind additive cargo features; never make a feature remove functionality. Confidence: 0.90 - Keep the default feature set minimal and support `no_std` when the domain allows it. Confidence: 0.70 - Gate `serde` derives behind a `serde` feature instead of making it a hard dependency. Confidence: 0.85 - Declare `rust-version` in Cargo.toml and test the MSRV in CI. Confidence: 0.85 - Run `cargo clippy -- -D warnings`, `cargo fmt --check` and `cargo test --all-features` on every PR. Confidence: 0.90 - Check semver breakage with `cargo-semver-checks` before each release. Confidence: 0.85 - Write doc comments with runnable examples on every public item; doctests are part of the test suite. Confidence: 0.90 - Add `#![deny(missing_docs)]` and `#![forbid(unsafe_code)]` unless the crate truly needs unsafe. Confidence: 0.80 - When unsafe is needed, wrap it in a tiny module with `// SAFETY:` comments and run Miri in CI. Confidence: 0.85 - Implement common traits like `Debug`, `Clone`, `PartialEq` and `Default` on public types where they make sense. Confidence: 0.85 - Make public types `Send` and `Sync` when possible and assert it in a test. Confidence: 0.75 - Avoid forcing an async runtime on users; keep core logic runtime-agnostic. Confidence: 0.80 - Add property tests with `proptest` for parsers and encoders. Confidence: 0.75 - Benchmark hot paths with `criterion` before claiming performance improvements. Confidence: 0.75 - Release with `cargo-release` or release-plz and keep a CHANGELOG.md in Keep a Changelog format. Confidence: 0.80 - Dual-license under MIT OR Apache-2.0 to match the Rust ecosystem. Confidence: 0.80
Opinionated preferences for building offline-first Progressive Web Apps: service workers, caching strategies, installability and sync.
# Progressive Web App taste of a frontend engineer who builds offline-first web apps - Treat the network as optional: the app shell must load and render from cache with no connection. Confidence: 0.90 - Generate the service worker with Workbox instead of hand-writing caching logic for every route. Confidence: 0.80 - Precache only the versioned app shell; cache API responses and images at runtime. Confidence: 0.90 - Use cache-first for hashed static assets, stale-while-revalidate for images and network-first for HTML. Confidence: 0.85 - Never cache authenticated API responses in a shared cache without a per-user key and an expiry. Confidence: 0.90 - Cap runtime caches by entry count and age so storage doesn't grow without bounds. Confidence: 0.85 - Show an "update available" prompt when a new service worker is waiting; don't call `skipWaiting()` silently. Confidence: 0.80 - Serve the service worker file with `Cache-Control: no-cache` so updates are picked up quickly. Confidence: 0.90 - Keep user data in IndexedDB through a small wrapper such as `idb`, never in `localStorage`. Confidence: 0.85 - Queue writes made offline and replay them with Background Sync, falling back to a retry on next launch. Confidence: 0.75 - Show clear offline and syncing states in the UI instead of failing requests silently. Confidence: 0.90 - Provide a complete manifest: name, short_name, start_url, display, theme_color and maskable icons. Confidence: 0.90 - Trigger the install prompt from a user action at a useful moment, not on first page load. Confidence: 0.85 - Ask for notification permission only after the user opts in to a feature that needs it. Confidence: 0.95 - Call `navigator.storage.persist()` for apps that keep important offline data. Confidence: 0.70 - Test offline mode, slow 3G and service worker updates in Playwright, not only by hand in DevTools. Confidence: 0.80 - Keep the initial JavaScript bundle small enough for a fast first load on mid-range phones. Confidence: 0.85 - Version cache names and delete old caches in the `activate` event. Confidence: 0.90 - Include an offline fallback page for navigations that aren't cached. Confidence: 0.85 - Check iOS Safari separately; its storage limits and install flow differ from Chromium. Confidence: 0.80 - Audit with Lighthouse in CI and fail the build when PWA or performance scores drop. Confidence: 0.65
Opinionated preferences for building and publishing TypeScript libraries to npm: exports maps, type checks, releases and package hygiene.
# TypeScript Library Publishing taste of a maintainer who ships small, well-typed npm packages - Publish ESM first and add a CommonJS build only when real consumers still need `require()`. Confidence: 0.80 - Define entry points with the `exports` map and keep `main`/`types` only as fallbacks for old tooling. Confidence: 0.90 - Put `types` conditions first inside each `exports` entry so TypeScript resolves declarations correctly. Confidence: 0.85 - Build with tsup or tsdown for bundles and plain `tsc --emitDeclarationOnly` for `.d.ts` files. Confidence: 0.75 - Turn on `strict`, `noUncheckedIndexedAccess` and `exactOptionalPropertyTypes` in the library's own tsconfig. Confidence: 0.85 - Check the published package with `publint` and `@arethetypeswrong/cli` in CI before every release. Confidence: 0.90 - Whitelist shipped files with the `files` field instead of maintaining an `.npmignore`. Confidence: 0.90 - Set `"sideEffects": false` when it is true so bundlers can tree-shake unused exports. Confidence: 0.85 - Export named functions only; avoid default exports so imports stay consistent across ESM and CJS. Confidence: 0.80 - Keep runtime dependencies near zero and move framework packages to `peerDependencies`. Confidence: 0.90 - Declare a supported Node.js range in `engines` and test that range in a CI matrix. Confidence: 0.80 - Treat exported types as public API: changing or removing them is a breaking change under semver. Confidence: 0.95 - Mark internal helpers with `@internal` and strip them with `stripInternal` so they don't leak into declarations. Confidence: 0.70 - Write TSDoc comments on every public export, including an `@example` that compiles. Confidence: 0.80 - Test against the built output, not only the source, so broken `exports` paths fail in CI. Confidence: 0.85 - Add type-level tests with `expectTypeOf` or `tsd` for generics and overloads. Confidence: 0.80 - Manage versions and changelogs with Changesets, and release from CI rather than a laptop. Confidence: 0.85 - Publish with npm provenance enabled and use a granular automation token scoped to the package. Confidence: 0.85 - Ship source maps and declaration maps so "go to definition" lands on real TypeScript source. Confidence: 0.75 - Never rely on `postinstall` scripts; a library should install without running code. Confidence: 0.90 - Keep the README's first screen to install, a minimal example and a link to full docs. Confidence: 0.80
Opinionated preferences for building, testing and shipping fast, script-friendly command-line tools in Go.
# Go CLI taste of a developer who ships single-binary command-line tools - Use Cobra for tools with subcommands; use the standard `flag` package for single-purpose tools. Confidence: 0.80 - Keep `main.go` tiny: build the root command, run it, and map the returned error to an exit code. Confidence: 0.90 - Put command wiring in `cmd/` and real logic in `internal/` packages that know nothing about flags or the terminal. Confidence: 0.85 - Return errors from `RunE` instead of calling `os.Exit` or `log.Fatal` inside commands. Confidence: 0.90 - Exit with 0 on success, 1 for runtime failures and 2 for usage errors. Confidence: 0.85 - Write results to stdout and diagnostics to stderr; never mix progress output into data streams. Confidence: 0.95 - Offer `--output json` for scripting and keep the JSON shape stable across minor versions. Confidence: 0.85 - Detect a TTY before using colors, spinners or interactive prompts, and respect `NO_COLOR`. Confidence: 0.90 - Read configuration in a clear order: flags, then environment variables, then config file, then defaults. Confidence: 0.85 - Store config files under `os.UserConfigDir()` and caches under `os.UserCacheDir()`, not in the home directory root. Confidence: 0.80 - Pass `context.Context` through every operation and cancel it on SIGINT/SIGTERM with `signal.NotifyContext`. Confidence: 0.90 - Use `log/slog` for debug logging behind a `--verbose` flag; keep default output quiet. Confidence: 0.80 - Inject `io.Writer`s and the environment into commands so they can be tested without touching the real terminal. Confidence: 0.85 - Write table-driven tests for logic and golden-file tests for command output, with an `-update` flag to refresh goldens. Confidence: 0.85 - Build static binaries with `CGO_ENABLED=0` and `-trimpath` whenever the tool doesn't need cgo. Confidence: 0.85 - Embed version, commit and build date via `-ldflags` or `debug.ReadBuildInfo`, and expose them in a `version` command. Confidence: 0.90 - Release with GoReleaser: cross-compiled archives, checksums and a Homebrew tap from one tagged commit. Confidence: 0.80 - Ship shell completions for bash, zsh and fish generated from the command tree. Confidence: 0.80 - Make destructive commands ask for confirmation in a TTY and require `--yes` or `--force` in scripts. Confidence: 0.90 - Keep dependencies few and run `go vet`, `staticcheck` and `govulncheck` in CI. Confidence: 0.85 - Keep startup fast: no network calls or heavy initialization before a command actually needs them. Confidence: 0.80
Opinionated preferences for building framework-agnostic, accessible custom elements with the Web Components standards.
# Web Components taste of a frontend developer who builds framework-agnostic UI libraries - Use native Custom Elements for shared, framework-agnostic widgets; keep app-specific UI in the app's own framework. Confidence: 0.80 - Use Lit for components with real state and templating; write vanilla custom elements only for very small leaf widgets. Confidence: 0.75 - Prefix every tag name with a short library namespace (`acme-button`) and register each one exactly once, guarded by `customElements.get`. Confidence: 0.90 - Write the source in TypeScript and ship standard ES modules, with no bundler required by consumers. Confidence: 0.85 - Use Shadow DOM for style encapsulation, but expose theming through CSS custom properties and `::part()`. Confidence: 0.85 - Prefer slots over string attributes for rich content, so consumers can pass their own markup. Confidence: 0.85 - Reflect simple primitive properties to attributes; keep objects and arrays as properties only. Confidence: 0.80 - Communicate outward with `CustomEvent`s that use `bubbles: true` and `composed: true` and have clearly namespaced names. Confidence: 0.85 - Never mutate attributes or children of the host in the constructor; do DOM work in `connectedCallback`. Confidence: 0.90 - Clean up listeners, observers and timers in `disconnectedCallback` so elements can be moved and removed safely. Confidence: 0.90 - Make form controls form-associated with `ElementInternals` so they work with native `<form>`, validation and reset. Confidence: 0.80 - Use native elements inside the shadow root (`<button>`, `<input>`) to keep keyboard and screen reader support. Confidence: 0.95 - Set ARIA roles and states through `ElementInternals` instead of sprinkling attributes on the host. Confidence: 0.70 - Delegate focus with `delegatesFocus: true` for components that wrap a single focusable control. Confidence: 0.75 - Support declarative shadow DOM when server rendering matters, and make sure content is readable before JavaScript loads. Confidence: 0.65 - Publish a Custom Elements Manifest (`custom-elements.json`) to power docs, IDE autocompletion and framework wrappers. Confidence: 0.80 - Generate thin React wrappers only where needed; don't fork component logic per framework. Confidence: 0.75 - Document every attribute, property, event, slot, part and CSS custom property in Storybook or a similar catalog. Confidence: 0.85 - Test components in a real browser with Web Test Runner or Playwright, not only in jsdom. Confidence: 0.85 - Keep the public API small and versioned with semver; renaming a tag, attribute or event is a breaking change. Confidence: 0.90 - Avoid global styles and global side effects in component modules beyond element registration. Confidence: 0.90
Opinionated rules for storing, parsing, formatting and testing dates, times and time zones in application code.
# Date and Time Handling taste of a backend developer who has debugged too many off-by-one-hour bugs
- Store instants as UTC timestamps (`timestamptz` in PostgreSQL), never as local wall-clock time without an offset. Confidence: 0.95
- Keep "instant" and "calendar date" as different types: a birthday or due date is a plain date, not midnight UTC. Confidence: 0.90
- Store the user's IANA time zone name (`Europe/Istanbul`), never a fixed offset like `+03:00`, because offsets change with DST and politics. Confidence: 0.90
- Convert to the user's zone only at the edges: rendering, parsing user input and scheduling. Confidence: 0.90
- Serialize timestamps in APIs as ISO 8601 / RFC 3339 strings with an explicit `Z` or offset; avoid bare epoch numbers in public payloads. Confidence: 0.85
- Never parse dates with ad-hoc regexes or `new Date(string)` on non-ISO input; use a strict parser with an explicit format. Confidence: 0.90
- Prefer the Temporal API (or a polyfill) for new JavaScript/TypeScript code; fall back to date-fns or Luxon, not Moment.js. Confidence: 0.80
- Format for humans with `Intl.DateTimeFormat` and the user's locale instead of hand-built strings. Confidence: 0.85
- Store future local events (meetings, reminders) as local date-time plus zone, and compute the UTC instant when needed, so DST rule changes don't shift them. Confidence: 0.85
- Model ranges as half-open intervals `[start, end)` to avoid overlap and double-counting at boundaries. Confidence: 0.90
- Do day arithmetic in calendar terms ("add 1 day" in the user's zone), not by adding 86,400 seconds. Confidence: 0.85
- Use a monotonic clock (`performance.now()`, `time.monotonic()`) for measuring durations and timeouts, never wall-clock time. Confidence: 0.95
- Inject a clock dependency instead of calling `Date.now()` directly in business logic, so tests can freeze and advance time. Confidence: 0.90
- Add tests around DST transitions, leap days, month ends and the year boundary for any scheduling code. Confidence: 0.85
- Run the test suite at least once with a non-UTC `TZ` environment variable to catch hidden local-time assumptions. Confidence: 0.75
- Keep server, database and container clocks in UTC and synced with NTP. Confidence: 0.90
- Never compare or sort dates as formatted strings unless they are fixed-width ISO 8601 in the same zone. Confidence: 0.80
- Keep the time zone database (tzdata) up to date in runtimes and container images. Confidence: 0.75
- Show relative times ("3 hours ago") only alongside an absolute timestamp available on hover or in detail views. Confidence: 0.65
- Name fields with their meaning and unit: `createdAt`, `expiresAt`, `timeoutMs`, never just `time` or `date`. Confidence: 0.85
- Treat leap seconds as the platform's problem; don't build application logic that depends on them. Confidence: 0.70