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.80Get productive in an unfamiliar legacy codebase safely: orientation questions, a day-one safety checklist, a reading strategy from entry points and git churn, a one-page architecture sketch, a careful plan for your first task, a questions log and a two-week ramp-up plan.
Act as a Legacy Codebase Onboarding Guide. You are a patient senior engineer who has joined many unfamiliar, poorly documented codebases and knows how to become productive in one without breaking things. I have just joined a team (or inherited a project) and need to understand an existing codebase quickly and safely. My situation: - Codebase: a 9-year-old monolith web app with a REST API, background jobs and a relational database - Main languages and frameworks: Python, Django, Celery, PostgreSQL, some jQuery on the frontend - Size and age: about 250k lines, 40 contributors over the years, 5 still active - State of docs and tests: an outdated README, a few wiki pages, patchy unit tests, no architecture diagram - My role and experience: backend developer, 4 years of experience, new to this domain - My first assignment: fix a bug where invoice emails are sometimes sent twice - Time I have to ramp up: 2 weeks - People I can ask: one tech lead with little free time, a product manager, a retired original author reachable by email Guide me through the onboarding in this order: 1. Orientation questions. Before giving a plan, ask me up to 5 short questions whose answers would change your advice the most (for example how deployments happen, whether there is a staging environment, who is on call). If I say "skip", continue with sensible assumptions and list them. 2. Day 1 safety checklist. What to set up and verify before touching code: getting the app and tests running locally, read-only access to logs and the production database replica, where secrets live and what never to commit, how to run one test, how a change reaches production and how it is rolled back. 3. Build a mental map. Give me a step-by-step reading strategy that does not try to read everything: start from entry points (routes, CLI commands, job schedulers, message consumers), follow one real request end to end, find the core domain models and the 5-10 files that change most often (show git commands such as `git log --format=format: --name-only | sort | uniq -c | sort -rn | head -30`), identify the oldest and scariest areas, and note configuration and feature flags. Tell me what to write down while reading. 4. Architecture sketch. Show me how to draw a one-page map of the system as a text diagram: components, data stores, external services, queues and the direction of calls. Give a template I can fill in and tell me which questions to ask the tech lead to confirm it in 20 minutes. 5. First task plan. For my first assignment, explain how to find the relevant code (search terms, logs, tracing one example), how to reproduce the problem, how to write a characterization test that pins the current behavior before changing it, how to keep the change small, and what to check in review. Point out typical legacy traps: hidden side effects, global state, implicit ordering, timezone and encoding issues, code paths only used by one big customer, and dead code that is not actually dead. 6. Questions log. Give me a format for a running questions log (question, where I looked, answer, who answered, date) and explain how to batch questions so I respect busy colleagues' time. 7. Two-week ramp-up plan. A day-by-day plan for 2 weeks with concrete goals (for example "Day 3: trace the checkout request end to end and draw it"), each with a small output I can show my lead. 8. Leave it better. Suggest 3-5 small, low-risk improvements a newcomer is perfectly placed to make (README setup steps, a glossary of domain terms, a diagram, a missing test, removing a confusing warning) and how to propose them without sounding critical of the people who built the system. Rules: - Be practical and specific to my stack; show real commands and file patterns where useful, but never invent facts about my codebase: when something depends on code you have not seen, say what to look for instead. - Prefer safe, reversible steps; flag anything that could affect production data or customers. - Keep each section short and scannable, with checklists where they help. - End with the 3 things I should do first tomorrow morning.
Opinionated 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
Opinionated rules for designing, reviewing and maintaining relational database indexes based on real query patterns.
# Database Indexing taste of a backend engineer who indexes for real queries, not guesses - Design indexes from the actual slow query log and `EXPLAIN (ANALYZE, BUFFERS)` output, not from the schema alone. Confidence: 0.95 - Index every foreign key column that is used in joins or cascading deletes. Confidence: 0.90 - Order composite index columns by equality filters first, then range filters, then sort columns. Confidence: 0.90 - Prefer one well-chosen composite index over several single-column indexes the planner has to combine. Confidence: 0.85 - Drop indexes whose leading columns duplicate another index; `(a)` is redundant next to `(a, b)`. Confidence: 0.85 - Use covering indexes (`INCLUDE` columns) for hot read paths so queries can use index-only scans. Confidence: 0.80 - Use partial indexes for skewed data, such as `WHERE deleted_at IS NULL` or `WHERE status = 'pending'`. Confidence: 0.90 - Enforce uniqueness with unique indexes or constraints in the database, never only in application code. Confidence: 0.95 - Create indexes on large live tables with `CREATE INDEX CONCURRENTLY` (or the engine's online equivalent) in a migration of its own. Confidence: 0.95 - Never wrap indexed columns in functions in `WHERE` clauses; add an expression index like `lower(email)` when needed. Confidence: 0.85 - Avoid leading-wildcard `LIKE '%term'` on B-tree indexes; use trigram or full-text indexes for substring search. Confidence: 0.85 - Pick GIN for JSONB containment and arrays, BRIN for huge append-only time-series tables, B-tree for everything else. Confidence: 0.80 - Use keyset pagination on an indexed sort key instead of large `OFFSET` values. Confidence: 0.90 - Keep low-cardinality booleans out of standalone indexes; fold them into a partial or composite index instead. Confidence: 0.80 - Review index usage statistics monthly and remove indexes with zero scans after confirming replicas do not use them. Confidence: 0.75 - Budget write cost: every extra index slows inserts and updates, so write-heavy tables get the fewest indexes. Confidence: 0.85 - Keep table statistics fresh with autovacuum/analyze tuning on big, fast-changing tables. Confidence: 0.80 - Watch for index bloat and rebuild with `REINDEX CONCURRENTLY` when it degrades performance. Confidence: 0.70 - Name indexes predictably, for example `idx_<table>_<columns>` and `uq_<table>_<columns>`. Confidence: 0.75 - Add a query plan check to code review for any new query on a table above a million rows. Confidence: 0.70 - Test index changes on a production-sized copy or branch before shipping them. Confidence: 0.85 - Never add an index just because a column appears in a `WHERE` clause somewhere; measure first. Confidence: 0.80
Opinionated conventions for building Python command-line tools that are pleasant to use, easy to test and simple to install.
# Python CLI taste of a tooling developer who ships small, well-behaved command-line apps - Build the CLI with Typer for typed commands, or Click when fine control over parsing is needed; avoid hand-rolled `argparse` trees for multi-command tools. Confidence: 0.80 - Expose the command through `[project.scripts]` in `pyproject.toml` so it installs as a real executable. Confidence: 0.95 - Recommend installing with `pipx` or `uv tool install`, never `sudo pip install`. Confidence: 0.90 - Keep `main()` thin: parse arguments, call a plain library function, map its result to an exit code. Confidence: 0.90 - Return exit code 0 on success, 1 for expected failures, 2 for usage errors, and never call `sys.exit` deep inside library code. Confidence: 0.90 - Write results to stdout and logs, progress and errors to stderr so output stays pipe-friendly. Confidence: 0.95 - Offer `--json` output for scripting and keep the default output human-readable. Confidence: 0.85 - Detect a TTY before printing colors, spinners or progress bars, and respect `NO_COLOR`. Confidence: 0.90 - Use Rich for tables and progress only in interactive mode; plain text when piped. Confidence: 0.75 - Make every destructive command support `--dry-run` and ask for confirmation unless `--yes` is passed. Confidence: 0.90 - Read configuration in a fixed order: flags, then environment variables, then a config file in the XDG config directory, then defaults. Confidence: 0.85 - Use `--verbose`/`-v` (repeatable) and `--quiet`/`-q` mapped to standard `logging` levels. Confidence: 0.80 - Show a friendly one-line error by default and the full traceback only with `--debug`. Confidence: 0.85 - Handle `KeyboardInterrupt` cleanly with exit code 130 and no traceback. Confidence: 0.85 - Keep startup fast: import heavy modules lazily inside the commands that need them. Confidence: 0.80 - Provide `--version` that reads from `importlib.metadata`, not a hardcoded string. Confidence: 0.90 - Accept `-` as stdin/stdout for file arguments and use `pathlib.Path` everywhere. Confidence: 0.80 - Test commands with Typer's or Click's `CliRunner`, asserting on exit code, stdout and stderr separately. Confidence: 0.90 - Snapshot-test help text so accidental option renames show up in review. Confidence: 0.65 - Ship shell completion for bash, zsh and fish through the framework's built-in completion support. Confidence: 0.75 - Write help text with a short example for every command; examples beat long option descriptions. Confidence: 0.80 - Lock dependencies for releases but keep runtime requirements minimal, ideally a handful of packages. Confidence: 0.75
Opinionated Dockerfile conventions for small, reproducible, secure container images that build fast in CI.
# Dockerfile taste of a platform engineer who wants small, boring, reproducible images - Use multi-stage builds: compile and install dev dependencies in a builder stage, copy only the runtime artifacts into the final stage. Confidence: 0.95 - Pin base images to a specific version tag plus digest (`node:22.11-slim@sha256:...`), never `latest`. Confidence: 0.90 - Prefer slim or distroless runtime bases over full distro images; reach for Alpine only when musl is known to be safe for the stack. Confidence: 0.80 - Order layers from least to most frequently changing: system packages, then lockfile and dependency install, then application source. Confidence: 0.95 - Copy the lockfile alone before `COPY . .` so dependency layers stay cached when only source changes. Confidence: 0.95 - Keep a strict `.dockerignore` that excludes `.git`, `node_modules`, local env files, test output and build caches. Confidence: 0.90 - Run as a non-root user with a fixed UID/GID, created in the image and set with `USER`. Confidence: 0.95 - Use BuildKit cache mounts (`RUN --mount=type=cache`) for package manager caches instead of baking caches into layers. Confidence: 0.85 - Pass secrets with `RUN --mount=type=secret`; never `ARG` or `ENV` a token, and never `COPY` a credentials file. Confidence: 0.95 - Combine `apt-get update` and `apt-get install --no-install-recommends` in one `RUN` and clean `/var/lib/apt/lists` in the same layer. Confidence: 0.90 - Pin system package versions only when reproducibility matters more than security patches; otherwise rebuild images on a schedule. Confidence: 0.65 - Use the exec form for `ENTRYPOINT` and `CMD` so the process receives signals as PID 1. Confidence: 0.90 - Add a tiny init (`tini` or `--init`) when the app spawns children or does not reap zombies itself. Confidence: 0.75 - One process per container; sidecars and supervisors belong to the orchestrator, not to the image. Confidence: 0.85 - Configure the app through environment variables at runtime; images stay identical across staging and production. Confidence: 0.90 - Set `WORKDIR` explicitly and avoid `cd` inside `RUN` chains. Confidence: 0.80 - Prefer `COPY` over `ADD`; use `ADD` only for its documented remote checksum or archive behavior on purpose. Confidence: 0.85 - Add OCI labels (`org.opencontainers.image.source`, `revision`, `created`) from CI build args. Confidence: 0.75 - Define a `HEALTHCHECK` only when no orchestrator probe exists; on Kubernetes rely on readiness and liveness probes instead. Confidence: 0.70 - Lint Dockerfiles with hadolint and scan final images with Trivy or Grype in CI, failing on critical CVEs. Confidence: 0.85 - Build multi-arch images (`linux/amd64`, `linux/arm64`) with `docker buildx` and push a single manifest list. Confidence: 0.75 - Tag images with the immutable git SHA; treat human-friendly tags like `v1.4` as moving pointers. Confidence: 0.85 - Keep the final image under a size budget and check it in CI with `docker image inspect` or dive. Confidence: 0.65
Platform: any text-based language Every learner deserves a lesson that works for them. Choose one short piece of everyday learning material, then build a tool that makes it work for an autistic learner.
Find out what gets in the way of learning for autistic learners, then design and build your own solution. i want a prompt for creating a website for autistic kids like a website taht can work as a learning tool for them like a simple minimalistic website taht can work btw find a unique idea for a specific challenge they might or maybe face in a day to day basis at last i want reasons also why u chosed this and make the reasons only into a pdf and tell emhow the code wirks in the pdf and make a ppt presentation
Opinionated Node.js and TypeScript service conventions for small, observable APIs that start fast and shut down cleanly.
# Node.js Backend Service taste of a TypeScript engineer who wants small, predictable services - Write services in TypeScript with `strict: true` and native ES modules. Confidence: 0.90 - Pin the Node.js version to an active LTS release in `.nvmrc`, `engines` and the Docker base image. Confidence: 0.90 - Use Fastify or Hono for HTTP, with request and response schemas that also generate the OpenAPI document. Confidence: 0.75 - Validate every incoming body, query and header at the edge and work only with typed data inside. Confidence: 0.95 - Load configuration once at startup from environment variables, validate it with a schema and fail fast if anything is missing. Confidence: 0.90 - Keep handlers thin: they parse input, call a service function and map the result to a response. Confidence: 0.85 - Never block the event loop; move CPU-heavy work to worker threads or a separate job queue. Confidence: 0.90 - Use `async`/`await` everywhere and treat any floating promise as a lint error. Confidence: 0.90 - Log structured JSON with pino, include a request ID on every line and never log secrets or tokens. Confidence: 0.90 - Return errors in one consistent JSON shape with a stable error code, and map unknown errors to 500 without leaking stack traces. Confidence: 0.85 - Handle `SIGTERM` by closing the server, draining in-flight requests and closing database pools before exit. Confidence: 0.90 - Crash on `unhandledRejection` and `uncaughtException` after logging, and let the orchestrator restart the process. Confidence: 0.80 - Expose separate liveness and readiness endpoints; readiness checks real dependencies. Confidence: 0.85 - Set timeouts on every outgoing HTTP and database call, and use `AbortSignal` to cancel them. Confidence: 0.85 - Use a connection pool with a fixed maximum size for the database, tuned to the number of instances. Confidence: 0.80 - Prefer the built-in `fetch`, `node:test` and `node:crypto` before adding a dependency. Confidence: 0.70 - Test HTTP routes with in-process injection instead of starting a real port. Confidence: 0.75 - Add OpenTelemetry tracing early so slow requests can be followed across services. Confidence: 0.75 - Build a small production image with a multi-stage Dockerfile and run it as a non-root user. Confidence: 0.85 - Keep `package-lock.json` committed and install with `npm ci` in CI and Docker builds. Confidence: 0.90
Opinionated database backup conventions where every backup is encrypted, monitored and proven by regular restore drills.
# Database Backup and Restore taste of an SRE who only trusts backups that have been restored - A backup does not count until it has been restored successfully; schedule automated restore tests at least weekly. Confidence: 0.95 - Write down the RPO and RTO for every database and choose the backup method that meets them, not the other way around. Confidence: 0.90 - Combine full base backups with continuous WAL or binlog archiving so you can restore to any point in time. Confidence: 0.90 - Use proven tools like pgBackRest, WAL-G or managed snapshots instead of a hand-written `pg_dump` cron job for large databases. Confidence: 0.85 - Keep logical dumps as a second layer for single-table restores and cross-version migrations. Confidence: 0.75 - Follow the 3-2-1 rule: three copies, two storage types, one copy in another region or account. Confidence: 0.90 - Store backups in a separate cloud account with write-once or object-lock retention so an attacker cannot delete them. Confidence: 0.90 - Encrypt every backup at rest and in transit, and keep the encryption keys somewhere the backups themselves do not live. Confidence: 0.95 - Never take backups from the primary when a replica can serve them, but check that the replica is not lagging. Confidence: 0.75 - Alert when a backup is missing, late, smaller than expected or fails verification, not only when the job exits non-zero. Confidence: 0.90 - Record checksums for each backup and verify them before marking the backup as good. Confidence: 0.85 - Keep a written, tested runbook for a full restore that someone on call can follow at 3 a.m. Confidence: 0.90 - Time every restore drill and track the duration as a metric against the RTO. Confidence: 0.80 - Use tiered retention, for example daily for two weeks, weekly for three months and monthly for a year. Confidence: 0.75 - Restore into an isolated environment first and run sanity queries before touching production. Confidence: 0.85 - Back up roles, grants, extensions and configuration along with the data, or the restore will not actually run. Confidence: 0.80 - Mask or delete personal data in restored copies used for staging and debugging. Confidence: 0.85 - Treat backup deletion as a privileged action that needs two people. Confidence: 0.70 - Include schema migration state in the backup so the application and database versions match after a restore. Confidence: 0.70
Opinionated Kotlin coroutine conventions for Android and JVM backends with structured concurrency, clear dispatchers and testable flows.
# Kotlin Coroutines taste of an Android and JVM engineer who wants structured concurrency everywhere - Launch coroutines only from a scope tied to a lifecycle, such as `viewModelScope`, `lifecycleScope` or a scope owned by a service. Confidence: 0.95 - Never use `GlobalScope`; if work must outlive a screen, hand it to an application-level scope or WorkManager. Confidence: 0.95 - Make suspend functions main-safe: the function itself switches to `Dispatchers.IO` or `Default` with `withContext`, not the caller. Confidence: 0.90 - Inject dispatchers through the constructor so tests can replace them with a `TestDispatcher`. Confidence: 0.90 - Use `coroutineScope` for parallel work that should fail together, and `supervisorScope` only when children must fail independently. Confidence: 0.85 - Never swallow `CancellationException`; rethrow it from every broad `catch` block. Confidence: 0.95 - Prefer `async`/`await` only for real parallel decomposition, not as a replacement for a plain suspend call. Confidence: 0.80 - Expose UI state as `StateFlow` and one-off events through a `Channel` or a state field that the UI consumes. Confidence: 0.80 - Collect flows in the UI with `repeatOnLifecycle(Lifecycle.State.STARTED)` or `collectAsStateWithLifecycle`. Confidence: 0.90 - Use `stateIn` with `SharingStarted.WhileSubscribed(5_000)` so upstream work stops when nobody is watching. Confidence: 0.80 - Keep flows cold by default and convert to hot with `shareIn` or `stateIn` only at a clear boundary. Confidence: 0.80 - Apply `flowOn` to move upstream work off the main thread instead of wrapping collectors in `withContext`. Confidence: 0.80 - Wrap blocking Java APIs in `withContext(Dispatchers.IO)` and never call `runBlocking` in production code paths. Confidence: 0.90 - Add timeouts to network and database calls with `withTimeout` or `withTimeoutOrNull`, not hand-rolled delays. Confidence: 0.75 - Check `ensureActive()` or `yield()` inside long CPU loops so cancellation actually stops the work. Confidence: 0.80 - Protect shared mutable state with a `Mutex` or confine it to a single coroutine, never a plain `synchronized` block around a suspend call. Confidence: 0.85 - Install a `CoroutineExceptionHandler` at the root scope to log crashes, but handle expected errors with `Result` or sealed types. Confidence: 0.75 - Test coroutines with `runTest` and virtual time, and test flows with Turbine. Confidence: 0.85 - Name important coroutines with `CoroutineName` so logs and debugger output stay readable. Confidence: 0.65 - Keep suspend functions free of `launch` side effects; a function that starts background work should say so in its name. Confidence: 0.75
take over my computer again. go to edge, i am currently on the github repo page. screenshot where i have to make these changes and what i have to change and insert. circle them and show me on the side.
Opinionated rules for building web forms that are accessible, validate clearly and never lose what the user typed.
# Web Forms taste of a frontend developer who wants forms that never lose user input - Start with a real `<form>` element and a submit button so Enter, autofill and assistive tech work out of the box. Confidence: 0.95 - Give every input a visible `<label>`; placeholders are hints, never labels. Confidence: 0.95 - Use the right input `type`, `inputmode` and `autocomplete` values so mobile keyboards and password managers help the user. Confidence: 0.90 - Validate on the server always; client-side validation is only for faster feedback. Confidence: 0.95 - Share one schema, such as Zod, between client and server so rules never drift apart. Confidence: 0.80 - Show errors after the user leaves a field or submits, not on every keystroke while they are still typing. Confidence: 0.85 - Put the error message next to the field, link it with `aria-describedby`, and move focus to the first invalid field on submit. Confidence: 0.90 - Write error messages that say how to fix the problem, not just that something is wrong. Confidence: 0.90 - Never clear the form after a failed submit; keep every value the user typed. Confidence: 0.95 - Disable double submits by showing a pending state on the button, but keep the button focusable. Confidence: 0.85 - Prefer uncontrolled inputs with a form library like React Hook Form for large forms to avoid re-rendering on every keystroke. Confidence: 0.75 - Ask only for data you actually need; every extra field lowers completion. Confidence: 0.85 - Mark optional fields as optional instead of marking every required field with an asterisk. Confidence: 0.65 - Do not split one value like a phone number or date into several inputs unless there is a strong reason. Confidence: 0.80 - Accept flexible input formats (spaces in card numbers, dashes in phone numbers) and normalize them in code. Confidence: 0.85 - Save drafts of long or multi-step forms locally so a refresh does not wipe the user's work. Confidence: 0.75 - Make the success state clear and say what happens next. Confidence: 0.80 - Protect forms with CSRF tokens and rate limits, and never rely on hidden fields for security. Confidence: 0.90 - Test forms with keyboard only and a screen reader before calling them done. Confidence: 0.85
Opinionated AWS CDK conventions for infrastructure as code that stays safe to review, deploy and roll back.
# AWS CDK Infrastructure taste of a platform engineer who wants boring, reviewable cloud changes - Write CDK apps in TypeScript so constructs, props and IDE hints are fully typed. Confidence: 0.85 - Use L2 constructs by default, drop to L1 `Cfn*` resources only for missing features, and wrap them in your own construct. Confidence: 0.85 - Split the app into small stacks by lifecycle: stateful resources like databases and buckets live apart from stateless compute. Confidence: 0.90 - Set `removalPolicy: RETAIN` and deletion protection on every stateful resource in production. Confidence: 0.95 - Never hardcode account IDs or regions; pass them in through an environment config per stage. Confidence: 0.90 - Model environments as stages of the same app, so dev, staging and prod are built from identical code. Confidence: 0.85 - Run `cdk diff` in every pull request and post the output for review before anything deploys. Confidence: 0.90 - Deploy only from CI with CDK Pipelines or a similar pipeline, never with `cdk deploy` from a laptop to production. Confidence: 0.90 - Grant permissions with construct methods like `bucket.grantRead(fn)` instead of writing IAM policy JSON by hand. Confidence: 0.90 - Add `cdk-nag` with the AWS Solutions rules and justify every suppression in code. Confidence: 0.80 - Keep logical IDs stable; renaming a construct ID replaces the resource, so treat it as a migration. Confidence: 0.90 - Store secrets in Secrets Manager or SSM Parameter Store and reference them, never put secret values in context or props. Confidence: 0.95 - Tag every resource with owner, service and cost center through `Tags.of(app)`. Confidence: 0.80 - Write snapshot tests for stacks and fine-grained assertions for security-critical properties. Confidence: 0.75 - Pin the `aws-cdk-lib` version and upgrade it on purpose, reading the changelog for feature flags. Confidence: 0.80 - Avoid cross-stack exports for things that change often; pass values through SSM parameters instead. Confidence: 0.70 - Use `NodejsFunction` or bundled assets so Lambda code is built by the same pipeline as the infrastructure. Confidence: 0.75 - Enable logs, alarms and dashboards in the same construct that creates the resource. Confidence: 0.80 - Keep `cdk.context.json` committed so lookups are deterministic across machines. Confidence: 0.85
Opinionated Go concurrency conventions for services where every goroutine has an owner, a context and a clean way to stop.
# Go Concurrency taste of a backend engineer who wants goroutines that never leak - Start a goroutine only when you know exactly how and when it will stop. Confidence: 0.95 - Pass a `context.Context` as the first argument to every function that blocks or does I/O, and honor its cancellation. Confidence: 0.95 - Use `errgroup.WithContext` to run related goroutines together so the first error cancels the rest. Confidence: 0.90 - Prefer plain synchronous APIs and let the caller add concurrency, instead of spawning goroutines inside library code. Confidence: 0.85 - Only the sender closes a channel, and only when no other sender can still write to it. Confidence: 0.90 - Use unbuffered channels by default; add a buffer only with a measured reason and a comment explaining its size. Confidence: 0.75 - Protect shared state with a `sync.Mutex` when it is simpler than a channel; channels are for passing ownership, not for every lock. Confidence: 0.85 - Keep the mutex right next to the fields it guards and never copy a struct that contains one. Confidence: 0.85 - Bound fan-out with a worker pool or `errgroup.SetLimit` instead of one goroutine per item. Confidence: 0.85 - Every `select` that waits on work also waits on `ctx.Done()`. Confidence: 0.90 - Use `time.NewTimer` or `context.WithTimeout` instead of `time.After` inside loops. Confidence: 0.75 - Use `sync.Once` or `sync.OnceValue` for lazy initialization, never a hand-rolled boolean flag. Confidence: 0.80 - Reach for `sync/atomic` types only for simple counters and flags, not for complex invariants. Confidence: 0.75 - Avoid `sync.Map` unless profiling shows lock contention on a read-heavy map. Confidence: 0.70 - Recover panics at goroutine boundaries in long-running servers and turn them into logged errors. Confidence: 0.75 - Run all tests with `-race` in CI, and treat any data race report as a release blocker. Confidence: 0.95 - Check for leaked goroutines in tests with `goleak`. Confidence: 0.70 - Make shutdown graceful: stop accepting work, drain in-flight jobs, then exit with a deadline. Confidence: 0.90 - Do not use `context.Value` for optional parameters; it is only for request-scoped data like trace IDs. Confidence: 0.85 - Document in the function comment whether a type is safe for concurrent use. Confidence: 0.80
Opinionated rules for writing regular expressions that stay readable, safe and well tested instead of turning into line noise.
# Regular Expressions taste of a developer who wants regexes people can still read - Reach for a real parser for HTML, JSON, CSV, URLs and email headers; a regex is the wrong tool there. Confidence: 0.95 - Prefer plain string methods like `startsWith`, `includes` or `split` when they do the job. Confidence: 0.85 - Anchor patterns with `^` and `$` (or `\A` and `\z`) when validating a whole value. Confidence: 0.90 - Use named capture groups instead of counting numbered groups. Confidence: 0.85 - Use non-capturing groups `(?:...)` when you only need grouping, not the captured value. Confidence: 0.75 - Write long patterns in verbose mode with comments, such as `re.VERBOSE` in Python or the `x` flag where supported. Confidence: 0.80 - Prefer specific character classes like `[^"]*` over a lazy `.*?` to make intent clear and matching faster. Confidence: 0.80 - Avoid nested quantifiers like `(a+)+`; they invite catastrophic backtracking and ReDoS. Confidence: 0.95 - Never run user-supplied patterns without a timeout or a linear-time engine like RE2. Confidence: 0.90 - Put a length limit on input before matching it against any non-trivial pattern. Confidence: 0.85 - Compile patterns once at module level and reuse them instead of rebuilding them in a loop. Confidence: 0.75 - Escape dynamic text with `re.escape` or an equivalent helper before putting it into a pattern. Confidence: 0.95 - Turn on the Unicode flag (`u` or `v` in JavaScript) when the input may contain non-ASCII text. Confidence: 0.80 - Remember that `\d` and `\w` can match non-ASCII digits and letters in some engines; use `[0-9]` when you mean ASCII. Confidence: 0.70 - Keep each regex to one job; two simple patterns beat one clever pattern. Confidence: 0.80 - Give every important pattern a table-driven test with strings that must match and strings that must not. Confidence: 0.90 - Add a comment with a real example input above any pattern longer than about twenty characters. Confidence: 0.80 - Do not validate email addresses with a giant regex; check for one `@` and send a confirmation email. Confidence: 0.85 - Use lookarounds sparingly; if a pattern needs several of them, split the logic into code. Confidence: 0.70 - Try patterns in a tester like regex101 with the right engine selected before shipping them. Confidence: 0.70
Opinionated asyncio conventions for Python services that stay fast, cancel cleanly and never block the event loop.
# Python Asyncio taste of a backend developer who never blocks the event loop - Use asyncio only for I/O-bound work like network calls and databases; CPU-heavy work goes to a process pool. Confidence: 0.90 - Start the program with a single `asyncio.run(main())` and never create or manage event loops by hand. Confidence: 0.90 - Use `asyncio.TaskGroup` for running tasks together so a failure cancels the siblings and nothing leaks. Confidence: 0.85 - Never fire and forget with `create_task` without keeping a reference; lost tasks get garbage collected and errors vanish. Confidence: 0.90 - Put a timeout on every network call with `asyncio.timeout()`; waiting forever is a bug. Confidence: 0.90 - Limit concurrency with a `Semaphore` instead of starting thousands of requests at once. Confidence: 0.85 - Never call blocking libraries like `requests` or `time.sleep` inside a coroutine. Confidence: 0.95 - Wrap unavoidable blocking calls in `asyncio.to_thread` and keep them short. Confidence: 0.80 - Use async-native clients such as `httpx` or `asyncpg`, and share one client per app instead of one per request. Confidence: 0.85 - Treat `CancelledError` as normal: clean up in `finally` and re-raise it, never swallow it. Confidence: 0.90 - Avoid `asyncio.gather` without `return_exceptions` for independent jobs where one failure should not hide the others. Confidence: 0.70 - Use `asyncio.Queue` with a fixed number of worker tasks for producer and consumer pipelines. Confidence: 0.80 - Close clients, sessions and connections with `async with` so shutdown is clean. Confidence: 0.85 - Turn on asyncio debug mode in development to catch slow callbacks and never-awaited coroutines. Confidence: 0.75 - Keep sync and async code paths separate instead of writing clever wrappers that run both. Confidence: 0.75 - Do not mix threads and the event loop unless you use `run_coroutine_threadsafe` on purpose. Confidence: 0.80 - Test async code with `pytest-asyncio` or `anyio` and give tests their own short timeouts. Confidence: 0.80 - Use `contextvars` for request IDs and tracing data instead of globals. Confidence: 0.75 - Consider `uvloop` only after measuring; the default loop is fast enough for most services. Confidence: 0.65 - Handle SIGTERM by cancelling the main task and waiting for workers to finish in-flight jobs. Confidence: 0.80
Opinionated conventions for versioning, changelogs and shipping releases so every deploy is predictable and easy to roll back.
# Release Management taste of a maintainer who wants boring, predictable releases - Follow Semantic Versioning strictly for libraries; a breaking change always means a new major version. Confidence: 0.90 - Use calendar versioning for apps and services that users never install by version number. Confidence: 0.70 - Write commit messages in the Conventional Commits format so changelogs and version bumps can be generated. Confidence: 0.75 - Keep a human-edited `CHANGELOG.md` with Added, Changed, Fixed and Removed sections; generated notes are a draft, not the final text. Confidence: 0.80 - Cut releases from the main branch with an annotated, signed Git tag; never release from a laptop's local branch. Confidence: 0.90 - Let CI build, test and publish the release artifact from the tag, so nobody runs a manual publish command. Confidence: 0.90 - Build the artifact once and promote the same build from staging to production instead of rebuilding per environment. Confidence: 0.90 - Release small and often; a weekly release with ten changes is safer than a quarterly release with five hundred. Confidence: 0.85 - Put unfinished features behind flags so the release train never waits for one late feature. Confidence: 0.80 - Keep a written, tested rollback plan for every release, and prefer rolling back over fixing forward under pressure. Confidence: 0.85 - Make database migrations backward compatible so the previous version can still run after a rollback. Confidence: 0.90 - Mark deprecations one minor version before removal and print a clear warning with the replacement. Confidence: 0.85 - Use release candidates for risky major versions and give real users time to try them. Confidence: 0.70 - Roll out to a small canary group first and watch error rates before going to everyone. Confidence: 0.80 - Freeze releases on Friday afternoons and before holidays unless the change is a security fix. Confidence: 0.65 - Ship security fixes as patch releases for every supported version, not only the latest one. Confidence: 0.85 - Publish a short support policy that says which versions still get fixes and for how long. Confidence: 0.75 - Never move or delete a published tag or package version; publish a new one instead. Confidence: 0.95 - Automate the release checklist in CI and keep any remaining manual steps written in the repo. Confidence: 0.80 - Announce each release with the user-facing changes first and the upgrade steps right below them. Confidence: 0.75