📝 Prompt Library
Hand-picked prompts for real work, plus the full community collection — copy, fill the brackets, go.
# Secrets Management taste of a security-minded platform engineer - Never commit secrets to git, including in tests, examples or old branches; treat any secret that touched a repo as compromised and rotate it. Confidence: 1.00 - Run secret scanning (gitleaks, trufflehog or the platform's built-in scanner) as a pre-commit hook and in CI on every push. Confidence: 0.90 - Keep a committed `.env.example` with names and dummy values, and gitignore every real `.env` file. Confidence: 0.90 - Store production secrets in a dedicated manager such as Vault, AWS Secrets Manager, GCP Secret Manager or 1Password, never in wikis or chat. Confidence: 0.95 - Prefer short-lived, workload-issued credentials (OIDC federation, IAM roles, Vault dynamic secrets) over long-lived static keys. Confidence: 0.90 - Use OIDC from CI to cloud providers instead of storing cloud access keys as CI secrets. Confidence: 0.90 - Scope every credential to one service, one environment and the least privilege it needs. Confidence: 0.95 - Never share secrets between staging and production, so a leak in one cannot unlock the other. Confidence: 0.95 - Inject secrets at runtime through the platform (mounted files or environment variables) rather than baking them into images or build artifacts. Confidence: 0.90 - Prefer mounted secret files over environment variables for highly sensitive values, since env vars leak into crash dumps, child processes and debug pages. Confidence: 0.70 - Automate rotation on a schedule and design apps to reload credentials without a redeploy. Confidence: 0.80 - Support two valid versions of a secret during rotation so it can happen without downtime. Confidence: 0.80 - Redact secrets in logs, traces and error reports with explicit filters, and test that the redaction works. Confidence: 0.90 - Use envelope encryption with a KMS for application-level encryption keys and keep the key-encryption key out of the app. Confidence: 0.80 - Encrypt secrets that must live in git (for example GitOps manifests) with SOPS or Sealed Secrets, never as plain Kubernetes Secrets. Confidence: 0.85 - Audit-log every secret read and alert on unusual access patterns. Confidence: 0.75 - Maintain a written revoke-and-rotate runbook for each critical credential so a leak response takes minutes, not days. Confidence: 0.85 - Give humans access through SSO and time-limited elevation instead of shared admin passwords. Confidence: 0.90 - Validate required secrets at startup and fail fast with a clear message that names the missing key but never prints its value. Confidence: 0.85 - Do not roll your own encryption or token formats; use well-reviewed libraries and the provider's primitives. Confidence: 0.95
# Python Type Hints taste of a typed-Python maintainer - Run a type checker (pyright or mypy) in CI on every pull request and treat new errors as build failures. Confidence: 0.95 - Start strict on new code with `strict = true` and loosen per module only with a written reason, instead of starting loose and tightening never. Confidence: 0.80 - Use modern built-in generics like `list[str]` and `dict[str, int]` and `X | None` instead of importing `List`, `Dict` and `Optional` from `typing`. Confidence: 0.90 - Annotate every public function signature, including the return type; let local variables be inferred unless inference is wrong. Confidence: 0.90 - Accept abstract types in parameters (`Iterable`, `Mapping`, `Sequence`) and return concrete types (`list`, `dict`). Confidence: 0.85 - Prefer `Protocol` for structural interfaces over abstract base classes when callers should not have to inherit anything. Confidence: 0.75 - Model fixed-shape records with `dataclass` (or `pydantic` at I/O boundaries) instead of passing raw dicts around. Confidence: 0.90 - Use `TypedDict` only for dict-shaped data you do not control, such as JSON payloads and legacy APIs. Confidence: 0.75 - Represent a closed set of string options with `Literal` or an `Enum`, never a bare `str`. Confidence: 0.85 - Treat `Any` as a bug report: confine it to the boundary where untyped data enters and narrow it immediately. Confidence: 0.85 - Prefer `object` over `Any` when a value is truly unknown, so the checker forces a narrowing step before use. Confidence: 0.70 - Narrow with `isinstance`, `match` statements and `TypeGuard`/`TypeIs` helpers instead of `cast()`. Confidence: 0.80 - Every `# type: ignore` must name the error code and carry a short comment explaining why it is safe. Confidence: 0.90 - Use `NewType` for IDs and units (`UserId`, `Cents`) that are easy to mix up but share an underlying type. Confidence: 0.70 - Ship a `py.typed` marker in libraries and keep stubs for untyped dependencies in a pinned `types-*` package or a local `stubs/` folder. Confidence: 0.85 - Use `@overload` only when the return type truly depends on argument types; otherwise simplify the API. Confidence: 0.70 - Prefer PEP 695 syntax (`def first[T](xs: list[T]) -> T`) on Python 3.12+ instead of module-level `TypeVar` declarations. Confidence: 0.75 - Annotate `self`-returning builder methods with `Self` rather than a bound `TypeVar`. Confidence: 0.80 - Mark constants with `Final` and override methods with `@override` so refactors surface mistakes. Confidence: 0.70 - Do not add runtime type checks that duplicate the static checker; validate only untrusted input at the edges. Confidence: 0.80 - Keep annotations import-cheap: put heavy imports under `if TYPE_CHECKING:` to avoid circular imports and slow startup. Confidence: 0.75
# API Rate Limiting taste of a backend platform engineer - Rate limit every public endpoint from day one, including authenticated ones; abuse rarely announces itself in advance. Confidence: 0.90 - Key limits on the authenticated identity (API key, user or tenant) first and fall back to client IP only for anonymous traffic. Confidence: 0.90 - Use a token bucket or sliding-window counter instead of a fixed window, so clients cannot burst twice the limit at window edges. Confidence: 0.85 - Keep limiter state in a shared store like Redis with atomic operations (Lua script or `INCR` plus `EXPIRE`), never in per-instance memory behind a load balancer. Confidence: 0.90 - Return HTTP 429 with a `Retry-After` header and a machine-readable error code in the body. Confidence: 0.95 - Send `RateLimit-Limit`, `RateLimit-Remaining` and `RateLimit-Reset` headers on every response so clients can pace themselves. Confidence: 0.80 - Set separate, tighter limits for expensive operations (search, exports, login, password reset) than for cheap reads. Confidence: 0.90 - Weight requests by cost when endpoints differ a lot, for example a bulk call spending 10 tokens instead of 1. Confidence: 0.70 - Fail open on limiter outages for ordinary traffic, but fail closed on authentication and payment endpoints. Confidence: 0.75 - Apply a coarse global limit at the edge (CDN or gateway) and finer per-tenant limits in the application. Confidence: 0.85 - Publish the limits in the API docs and changelog, and give advance notice before lowering them. Confidence: 0.85 - Offer higher limits through plans or explicit allowlists instead of silent exceptions hardcoded in the limiter. Confidence: 0.75 - Ship official SDKs with automatic retries on 429 using exponential backoff with jitter and respect for `Retry-After`. Confidence: 0.85 - Distinguish rate limits (requests over time) from quotas (monthly usage) and concurrency limits, and report each with its own error code. Confidence: 0.75 - Log and meter every throttled request by key and route, and alert when a single tenant suddenly dominates rejections. Confidence: 0.85 - Run new limits in shadow mode first, logging what would be blocked, before enforcing them. Confidence: 0.80 - Never include the reason a login was throttled in a way that reveals whether the account exists. Confidence: 0.80 - Add per-account login throttling on top of per-IP throttling to slow credential stuffing from rotating IPs. Confidence: 0.85 - Keep limiter configuration in code or config files with review, not in an ad hoc admin toggle. Confidence: 0.70 - Load test the limiter itself; it sits on the hot path and must add only a millisecond or two of latency. Confidence: 0.75
# Internationalization taste of a product engineer shipping to many locales - Externalize every user-facing string from the first commit; retrofitting i18n later costs far more than starting with it. Confidence: 0.90 - Use ICU MessageFormat (via `formatjs`, `i18next` with ICU, or similar) so plurals, gender and select rules live in the message, not in code. Confidence: 0.90 - Never build sentences by concatenating fragments; translators need the whole sentence with named placeholders. Confidence: 0.95 - Use semantic message keys like `checkout.payButton` instead of using the English text as the key. Confidence: 0.75 - Give translators context: a description for every message and screenshots for ambiguous ones. Confidence: 0.85 - Format dates, numbers, currencies and lists with `Intl` APIs and the user's locale, never with hand-written format strings. Confidence: 0.95 - Store timestamps in UTC and convert to the user's time zone only at display time. Confidence: 0.95 - Store money as integer minor units plus an ISO 4217 currency code, and let the locale decide symbol placement. Confidence: 0.90 - Use BCP 47 locale tags (`pt-BR`, `zh-Hant`) everywhere and define an explicit fallback chain down to the default language. Confidence: 0.85 - Support right-to-left languages with CSS logical properties (`margin-inline-start`) and `dir="auto"` instead of left and right. Confidence: 0.85 - Design layouts to absorb text that runs 30 to 40 percent longer than English, and test with pseudo-localization in CI. Confidence: 0.85 - Fail the build on missing keys in the default locale, but fall back gracefully for missing translations in other locales. Confidence: 0.80 - Keep translation files in the repo and sync them with a translation platform through automation, not manual copy and paste. Confidence: 0.80 - Put the locale in the URL path (`/de/pricing`) for public pages and emit `hreflang` alternates for SEO. Confidence: 0.80 - Detect the initial locale from `Accept-Language`, then let the user override it and remember the choice. Confidence: 0.85 - Sort and compare user-visible strings with `Intl.Collator`, and lowercase or uppercase with locale-aware methods (think Turkish dotted i). Confidence: 0.80 - Lazy-load translation bundles per locale and per route so users do not download every language. Confidence: 0.75 - Translate emails, push notifications, PDFs and error messages too, not only the web UI. Confidence: 0.85 - Avoid text inside images and icons; when unavoidable, provide localized variants. Confidence: 0.75 - Accept names, addresses and phone numbers in flexible formats instead of forcing a US-centric form layout. Confidence: 0.80
# Angular App taste of a frontend lead on large enterprise apps - Use standalone components everywhere and skip NgModules on new code. Confidence: 0.90 - Use signals for local and shared state, and keep RxJS for event streams, HTTP composition and cancellation. Confidence: 0.85 - Prefer `computed()` over manual subscriptions for derived state, and keep `effect()` for side effects only. Confidence: 0.80 - Set `ChangeDetectionStrategy.OnPush` on every component, or go zoneless on new apps. Confidence: 0.85 - Use the built-in control flow (`@if`, `@for` with `track`, `@switch`) instead of the old structural directives. Confidence: 0.90 - Lazy load every feature route with `loadComponent` or `loadChildren`, and use `@defer` blocks for heavy widgets below the fold. Confidence: 0.85 - Inject dependencies with the `inject()` function rather than long constructor parameter lists. Confidence: 0.75 - Use typed reactive forms; avoid template-driven forms for anything with validation logic. Confidence: 0.85 - Keep components thin: put data access and business logic in injectable services, and keep templates free of complex expressions. Confidence: 0.85 - Split components into smart containers and presentational components that talk through `input()` and `output()`. Confidence: 0.75 - Organize the code by feature folders, not by file type (all components, all services). Confidence: 0.80 - Reach for NgRx (Store or SignalStore) only when several features share complex state; services with signals cover most apps. Confidence: 0.70 - Handle auth headers, errors and retries in functional HTTP interceptors, not in each service call. Confidence: 0.85 - Never subscribe manually without cleanup; use the `async` pipe, `toSignal()` or `takeUntilDestroyed()`. Confidence: 0.90 - Turn on `strict` mode and strict template checking in `tsconfig.json`. Confidence: 0.90 - Use the Angular CLI and its esbuild-based builder, and keep `angular.json` customizations to a minimum. Confidence: 0.80 - Write component tests with Angular Testing Library, and cover critical user flows with Playwright end-to-end tests. Confidence: 0.75 - Enforce an initial bundle size budget in `angular.json` so the build fails when it is exceeded. Confidence: 0.80 - Use server-side rendering with hydration for public, SEO-relevant pages and keep internal dashboards client-only. Confidence: 0.70 - Upgrade with `ng update` one major version at a time, staying no more than one major behind. Confidence: 0.85 - Run ESLint with `angular-eslint` and format with Prettier in a pre-commit hook. Confidence: 0.80
# Pytest taste of a Python developer who wants fast, honest test suites - Use plain `assert` statements and let pytest's assertion rewriting explain failures instead of `unittest`-style assert methods. Confidence: 0.95 - Keep tests in a top-level `tests/` directory that mirrors the package layout, with the package installed in editable mode. Confidence: 0.85 - Configure pytest in `pyproject.toml` under `[tool.pytest.ini_options]` rather than a separate `pytest.ini` or `setup.cfg`. Confidence: 0.85 - Turn on `--strict-markers` and `--strict-config` so typos in markers or settings fail loudly. Confidence: 0.85 - Set `filterwarnings = ["error"]` and allowlist known third-party warnings explicitly, so deprecations are caught early. Confidence: 0.75 - Prefer small, composable fixtures over one giant fixture that builds the whole world. Confidence: 0.90 - Use the narrowest fixture scope that keeps tests fast; reach for `session` scope only for genuinely expensive, read-only resources. Confidence: 0.80 - Put shared fixtures in the nearest `conftest.py`, not one root conftest that every test imports implicitly. Confidence: 0.75 - Use `@pytest.mark.parametrize` with readable `ids` instead of loops inside a single test. Confidence: 0.90 - Use the built-in `tmp_path` and `monkeypatch` fixtures before writing custom temp-dir or env-var helpers. Confidence: 0.90 - Mock at the boundary (HTTP, clock, filesystem) and avoid patching internals of the code under test. Confidence: 0.85 - Use `respx`, `responses` or a fake server for HTTP instead of hand-rolled `MagicMock` chains. Confidence: 0.75 - Freeze time with `time-machine` or `freezegun` rather than sleeping or comparing against `datetime.now()`. Confidence: 0.80 - Assert on exceptions with `pytest.raises(..., match=...)` so the message is checked, not just the type. Confidence: 0.85 - Mark slow and integration tests with custom markers and run them in a separate CI job. Confidence: 0.80 - Run the suite in parallel with `pytest-xdist` once it takes more than a minute, and keep tests order-independent so that works. Confidence: 0.80 - Use `pytest-randomly` or random ordering to flush out hidden test coupling. Confidence: 0.65 - Measure coverage with `pytest-cov` and branch coverage on, but treat the number as a signal, not a target. Confidence: 0.75 - Use Hypothesis for parsers, serializers and pure functions where property-based tests find edge cases examples miss. Confidence: 0.70 - Never let tests hit real external services by default; block network access and opt in explicitly. Confidence: 0.80 - Use `pytest-asyncio` or `anyio` in strict mode for async code, never `asyncio.run` inside tests. Confidence: 0.75 - Keep each test focused on one behavior with an Arrange, Act, Assert shape and a name that reads like a sentence. Confidence: 0.85
# Electron App taste of a desktop developer who takes security seriously - Keep `contextIsolation: true` and `nodeIntegration: false` on every `BrowserWindow`; these are non-negotiable defaults. Confidence: 0.98 - Enable `sandbox: true` for renderers and give each window the smallest preload script it needs. Confidence: 0.90 - Expose a narrow, typed API from the preload with `contextBridge.exposeInMainWorld` instead of passing `ipcRenderer` through. Confidence: 0.95 - Use `ipcMain.handle` and `ipcRenderer.invoke` for request and response calls, and validate every argument in the main process. Confidence: 0.90 - Check the sender frame on IPC messages so only your own pages can call privileged handlers. Confidence: 0.80 - Set a strict Content Security Policy and never load remote code into a window with privileged preload access. Confidence: 0.90 - Block unexpected navigation with `will-navigate` and `setWindowOpenHandler`, and open external links in the system browser with `shell.openExternal` after allowlisting the URL. Confidence: 0.90 - Serve local content through a custom protocol instead of `file://` so origin rules and CSP behave predictably. Confidence: 0.75 - Write the main, preload and renderer code in TypeScript, sharing IPC channel types from one module. Confidence: 0.85 - Use Electron Forge or electron-builder with Vite for building and packaging rather than a hand-rolled script. Confidence: 0.80 - Keep heavy work out of the main process; use utility processes or worker threads so the UI never freezes. Confidence: 0.85 - Track the latest supported Electron major and upgrade at least every quarter, since each release carries Chromium security fixes. Confidence: 0.85 - Sign and notarize macOS builds and sign Windows installers before anyone outside the team installs them. Confidence: 0.95 - Ship auto-updates through `autoUpdater` or electron-updater with signed releases and a staged rollout. Confidence: 0.80 - Enable Electron fuses to disable `RunAsNode` and Node CLI inspection in production builds. Confidence: 0.75 - Persist settings and window state in the user data directory, and store secrets with `safeStorage` or the OS keychain, never in plain JSON. Confidence: 0.85 - Restore window size and position on launch and handle multiple displays gracefully. Confidence: 0.70 - Respect platform conventions: the macOS app menu, Windows tray behavior and native keyboard shortcuts. Confidence: 0.75 - Watch bundle size and startup time, lazy-load heavy modules and avoid shipping dev dependencies in the app archive. Confidence: 0.75 - Collect crash reports with `crashReporter` or Sentry and log main-process errors to a rotating file. Confidence: 0.75 - Run end-to-end tests with Playwright's Electron support against the packaged app, not only the dev build. Confidence: 0.70
You are a senior API platform engineer. Turn the information I give you into a complete, realistic deprecation and sunset plan for an API (an endpoint, a field, a version, or an SDK method), returned as a single YAML document that follows the schema below exactly. Inputs I will provide (ask for anything critical that is missing before writing the plan, at most 4 questions): - what is being deprecated and what replaces it - who calls it (internal teams, public customers, partners, mobile apps with slow upgrade cycles) - current usage data, if any (requests per day, number of distinct API keys or clients) - hard constraints (contracts, compliance dates, a platform migration deadline) Rules: - Output only valid YAML (2-space indentation, no tabs, quote strings that contain colons). Do not copy the schema comments into the output. - Never invent usage numbers, customer names or contract terms: use "unknown" and add an item to open_questions. - Use ISO dates (YYYY-MM-DD). If I give no start date, use T0, T0+30d, etc. - Default minimum notice: 90 days for internal-only callers, 6 months for public APIs, 12 months for partners or mobile apps, unless I give a stricter rule. - Prefer standard signals: the Deprecation and Sunset HTTP response headers, a Link header to the migration guide, changelog entries, SDK warnings and the API reference. - Include brownouts (short planned periods where the old API returns errors) only after at least two direct notices and only if usage is still above the threshold you define. - Keep a rollback path until the final removal. Schema: ```yaml deprecation_plan: summary: target: "" # e.g. "GET /v1/invoices/{id}/pdf" target_type: "" # endpoint | field | api_version | sdk_method | webhook_event replacement: "" reason: "" owner_team: "" audience: [] # internal | public | partners | mobile_apps timeline: - phase: "" # announce | warn | brownout | freeze | sunset | removal date: "" actions: [] exit_criteria: "" signals: http_headers: deprecation: "" # example header value sunset: "" link: "" changelog_entry: "" api_reference_note: "" sdk_warning: "" dashboard_banner: "" usage_tracking: metrics: [] # e.g. daily calls, distinct keys, top callers data_source: "" removal_threshold: "" # e.g. "< 50 calls/day from < 3 keys for 14 days" review_cadence: "" communications: - when: "" channel: "" # email | changelog | status_page | in_app | account_manager | slack audience: "" message_outline: [] migration_guide: steps: [] before_after_example: before: "" after: "" breaking_differences: [] test_checklist: [] brownouts: - date: "" duration: "" error_response: "" # status code and body callers will see condition: "" exceptions: process: "" max_extension: "" approver: "" risks: - risk: "" likelihood: "" # low | medium | high mitigation: "" rollback: trigger: "" steps: [] final_removal: code_cleanup: [] docs_cleanup: [] monitoring_after_removal: "" open_questions: [] notes: "" ``` After the YAML, add nothing else. If I only give a one-line description, still produce the full plan with "unknown" values and a thorough open_questions list. My deprecation details:
# Makefile taste of a developer who uses make as the project's front door - Treat the Makefile as a thin task runner that calls real scripts and tools, not as a place to hide hundreds of lines of shell logic. Confidence: 0.90 - Put a `help` target first and make it the default goal, generated from `## description` comments next to each target. Confidence: 0.85 - Declare every non-file target in `.PHONY` so a stray file named `test` or `build` never silently skips a task. Confidence: 0.95 - Set `SHELL := bash` and `.SHELLFLAGS := -eu -o pipefail -c` so recipes fail on errors, unset variables and broken pipes. Confidence: 0.85 - Add `.DELETE_ON_ERROR:` so a failed recipe never leaves a half-written target that looks up to date. Confidence: 0.80 - Use `MAKEFLAGS += --warn-undefined-variables --no-builtin-rules` to catch typos and drop surprising implicit rules. Confidence: 0.75 - Keep target names short, lowercase and verb-like: `setup`, `build`, `test`, `lint`, `fmt`, `run`, `clean`. Confidence: 0.85 - Make `make setup` the single command a new contributor needs to go from fresh clone to working environment. Confidence: 0.90 - Use `?=` for user-overridable variables like `PORT`, `ENV` or `IMAGE_TAG`, so `make run PORT=4000` just works. Confidence: 0.85 - Prefer `:=` over `=` for internal variables to avoid repeated, surprising lazy evaluation of shell commands. Confidence: 0.80 - Use real file targets and prerequisites for generated artifacts so make only rebuilds what actually changed. Confidence: 0.85 - Use order-only prerequisites (`| build/`) for output directories so touching a directory does not trigger rebuilds. Confidence: 0.70 - Prefix only genuinely noisy commands with `@`; keep the important commands visible so CI logs show what ran. Confidence: 0.75 - Never use `-` to ignore errors unless the reason is documented in a comment on the same line. Confidence: 0.85 - Run the same `make lint test` targets in CI that developers run locally, instead of duplicating steps in workflow YAML. Confidence: 0.90 - Split very large Makefiles into `include`d files under `mk/` grouped by concern, such as docker, db and release. Confidence: 0.65 - Use tabs for recipe lines and set `.editorconfig` accordingly so editors never turn them into spaces. Confidence: 0.90 - Keep recipes portable across GNU make versions found on macOS and Linux, or document that GNU make 4+ is required. Confidence: 0.70 - Make `clean` remove only generated files and keep a separate `distclean` for caches, dependencies and local databases. Confidence: 0.75 - Check required tools at the top with a small `require` macro that prints a clear install hint when something is missing. Confidence: 0.70 - Avoid recursive `$(MAKE) -C` across many subdirectories when one non-recursive Makefile can express the whole graph. Confidence: 0.65 - Keep `make` with no arguments safe: it should print help, never deploy, migrate or delete anything. Confidence: 0.95
# Storybook taste of a frontend developer who builds components in isolation - Write stories in Component Story Format 3 with a typed `Meta` and `StoryObj`, not the legacy `storiesOf` API. Confidence: 0.95 - Colocate each story file next to its component, as `Button.stories.tsx` beside `Button.tsx`. Confidence: 0.90 - Give every component a `Default` story plus one story per meaningful state: loading, empty, error, disabled and long content. Confidence: 0.90 - Use `args` for props so controls, docs and tests all reuse the same story definitions. Confidence: 0.90 - Keep default `args` realistic, with real-looking names, prices and dates instead of "foo" and "lorem ipsum". Confidence: 0.75 - Put shared providers such as theme, router, i18n and query client in global decorators in `preview.tsx`. Confidence: 0.85 - Mock network requests with MSW handlers per story rather than wiring components to fake service modules. Confidence: 0.85 - Use `play` functions with Testing Library queries to exercise interactions such as opening menus and submitting forms. Confidence: 0.80 - Run stories as tests in CI with the Storybook test runner or Vitest integration so broken stories fail the build. Confidence: 0.85 - Enable the accessibility addon and treat new violations as failures, not as optional warnings. Confidence: 0.85 - Add visual regression snapshots for design-system components, and keep them focused to avoid flaky noise. Confidence: 0.75 - Organize the sidebar by product domain and design-system layer, such as `Foundations/`, `Components/` and `Patterns/`. Confidence: 0.70 - Use autodocs with JSDoc comments on props instead of hand-maintained MDX tables that drift out of date. Confidence: 0.80 - Reserve MDX pages for usage guidelines, do-and-don't examples and design decisions that code cannot express. Confidence: 0.70 - Keep stories free of business logic and data fetching; containers get thin stories with mocked data only when useful. Confidence: 0.80 - Use the viewport and theme toolbar globals to check mobile layouts and dark mode, rather than duplicating stories for each. Confidence: 0.75 - Keep Storybook's builder aligned with the app, using the Vite builder when the app uses Vite, so behavior matches production. Confidence: 0.80 - Publish a static Storybook for every pull request so designers and reviewers can check changes without running code. Confidence: 0.85 - Upgrade Storybook regularly with its automigration tool instead of letting major versions pile up. Confidence: 0.70 - Delete stories for removed components in the same pull request; a stale story is worse than no story. Confidence: 0.75 - Avoid hard-coded story IDs in links and tests; reference stories by their exported names. Confidence: 0.65
# MongoDB taste of a backend engineer who models documents around queries - Design each collection around the application's read patterns first, then decide what to embed and what to reference. Confidence: 0.90 - Embed data that is always read together and bounded in size; reference data that grows without limit or is shared widely. Confidence: 0.90 - Never let an array grow unbounded inside a document; move comments, events or logs to their own collection. Confidence: 0.90 - Define a `$jsonSchema` validator on every collection so bad writes fail at the database, not in a report weeks later. Confidence: 0.80 - Store dates as BSON `Date` and money as `Decimal128` or integer minor units, never as strings or doubles. Confidence: 0.90 - Build compound indexes following the equality, sort, range rule and check every hot query with `explain("executionStats")`. Confidence: 0.85 - Treat a `COLLSCAN` on a production query path as a bug, and alert on slow queries from the profiler or Atlas. Confidence: 0.80 - Drop unused and redundant indexes regularly, because each one slows every write and eats memory. Confidence: 0.75 - Use projections in every query so services fetch only the fields they need. Confidence: 0.80 - Paginate with a range on an indexed field such as `_id` or `createdAt`, not with large `skip` values. Confidence: 0.85 - Use `w: "majority"` write concern for important data and `majority` read concern where stale reads would hurt. Confidence: 0.80 - Reach for multi-document transactions only when the model truly needs them; a well-shaped document usually makes the write atomic. Confidence: 0.80 - Prefer atomic update operators like `$inc`, `$set` and `$push` with `$slice` over read-modify-write loops in application code. Confidence: 0.85 - Use the aggregation pipeline for reporting, and put `$match` and `$project` as early as possible so indexes can help. Confidence: 0.80 - Add a `schemaVersion` field and migrate documents lazily on read or with a background job, instead of one risky big-bang script. Confidence: 0.70 - Use TTL indexes for sessions, tokens and temporary data rather than cron jobs that delete old documents. Confidence: 0.85 - Choose shard keys with high cardinality that match the main query filter, and avoid monotonically increasing keys alone. Confidence: 0.75 - Create indexes and validators through versioned migration code in the repo, not by hand in a shell. Confidence: 0.80 - Run local development and tests against a real MongoDB in a container or replica set, not an in-memory fake. Confidence: 0.75 - Keep a single shared client per process with a tuned connection pool instead of opening connections per request. Confidence: 0.90 - Enable authentication, TLS and least-privilege roles everywhere, and never expose port 27017 to the public internet. Confidence: 0.95 - Test restores from backups on a schedule, because a backup nobody has restored is only a hope. Confidence: 0.85
# Gradle Build taste of a JVM developer who wants fast and boring builds - Use the Kotlin DSL (`build.gradle.kts`) for build scripts so editors give real completion and type checking. Confidence: 0.85 - Always commit the Gradle wrapper and run builds with `./gradlew`, never a globally installed Gradle. Confidence: 0.95 - Verify the wrapper distribution with `distributionSha256Sum` so a tampered download never runs in CI. Confidence: 0.75 - Keep every dependency and plugin version in a `gradle/libs.versions.toml` version catalog. Confidence: 0.90 - Share build logic through convention plugins in `build-logic`, not through `allprojects` or `subprojects` blocks. Confidence: 0.85 - Set the Java version with a toolchain (`java { toolchain { languageVersion = ... } }`) instead of relying on whatever JDK is installed. Confidence: 0.90 - Enable the build cache and configuration cache, and treat any task that breaks them as a bug to fix. Confidence: 0.80 - Turn on `org.gradle.parallel=true` and a sensible `org.gradle.jvmargs` in `gradle.properties` checked into the repo. Confidence: 0.80 - Register tasks lazily with `tasks.register` and the Provider API; avoid `tasks.create` and eager configuration. Confidence: 0.85 - Declare task inputs and outputs properly so up-to-date checks and caching work for custom tasks. Confidence: 0.85 - Use `implementation` by default and expose `api` only for types that are truly part of a module's public interface. Confidence: 0.90 - Lock or verify dependencies with dependency locking or `verification-metadata.xml` for builds that ship to production. Confidence: 0.70 - Never use dynamic versions like `1.+` or `latest.release` in anything that gets released. Confidence: 0.90 - Use a platform or BOM to align versions of related libraries such as Jackson, Netty or Spring. Confidence: 0.80 - Keep modules small and focused, with a clear dependency direction and no cycles between them. Confidence: 0.80 - Publish build scans or keep profiling output for slow CI builds, and look at them before guessing what to optimize. Confidence: 0.70 - Make `./gradlew check` the single command that runs tests, static analysis and formatting checks locally and in CI. Confidence: 0.90 - Keep secrets like signing keys and repository passwords in environment variables or CI secrets, never in `gradle.properties` in the repo. Confidence: 0.95 - Avoid running shell scripts from the build when a typed Gradle task or plugin can do the job. Confidence: 0.70 - Upgrade Gradle regularly and fix deprecation warnings before they become errors in the next major version. Confidence: 0.80 - Keep the root build script almost empty; real configuration lives in convention plugins and module scripts. Confidence: 0.75
# Jupyter Notebook taste of a data scientist who wants notebooks that rerun cleanly - Make every notebook run top to bottom with "Restart and Run All" before sharing or committing it. Confidence: 0.95 - Put imports, configuration and constants in the first cells, never scattered through the notebook. Confidence: 0.85 - Move reusable logic into a normal Python package in the repo and import it, keeping notebooks for exploration and storytelling. Confidence: 0.90 - Use `%load_ext autoreload` and `%autoreload 2` while developing that package alongside the notebook. Confidence: 0.75 - Pin the environment with a lock file such as `uv.lock`, `poetry.lock` or a conda lock, and name the kernel after the project. Confidence: 0.85 - Strip outputs before committing with `nbstripout` or a pre-commit hook, unless the notebook is a published report. Confidence: 0.85 - Pair notebooks with plain-text versions through Jupytext so diffs and code reviews stay readable. Confidence: 0.70 - Read data paths and parameters from one config cell or Papermill parameters, not hard-coded absolute paths. Confidence: 0.85 - Never store credentials in a notebook; load them from environment variables or a secrets manager. Confidence: 0.95 - Set random seeds for NumPy, Python and any ML library in one place so results can be reproduced. Confidence: 0.85 - Give each notebook one clear question, and start it with a short markdown cell that states the goal and data sources. Confidence: 0.80 - Use markdown cells to explain decisions and findings, not just to label code. Confidence: 0.80 - Keep cells short and focused, with the final expression showing a result instead of long `print` chains. Confidence: 0.70 - Avoid relying on hidden state from cells run out of order; if a variable is redefined, restart and rerun. Confidence: 0.90 - Cache expensive steps to Parquet files with clear names rather than recomputing them on every run. Confidence: 0.80 - Sample large datasets during exploration and run the full data only once the analysis is settled. Confidence: 0.75 - Label every chart with a title, axis names and units so it makes sense when pasted into a slide. Confidence: 0.85 - Add small `assert` checks on row counts, nulls and key uniqueness after each major data transformation. Confidence: 0.80 - Name notebooks with a number and topic like `03-churn-features.ipynb` so the order of work is obvious. Confidence: 0.70 - Turn notebooks that run on a schedule into scripts or Papermill jobs with tests, instead of opening them by hand. Confidence: 0.80 - Clean up dead experiments before sharing; keep only the path that leads to the conclusion. Confidence: 0.75
Act as a Supplier Negotiation Coach for small businesses. I run a small business (for example a cafe, restaurant, salon, online shop, cleaning company, workshop, agency or small manufacturer) and I buy from suppliers: ingredients, stock, packaging, materials, software, equipment, delivery or services. I want better prices and terms without damaging relationships I depend on. Your job is to help me prepare, run and follow up a supplier negotiation, and to tell me plainly where I have leverage and where I don't. Start by asking me, in one short numbered list, for: 1. Which supplier and what I buy from them: items, volumes per month, current prices and payment terms. 2. How long we have worked together and how the relationship feels (good, strained, new). 3. What I want to change: price, payment terms, minimum order, delivery schedule, quality, returns, or a price rise they announced. 4. Alternatives I have or could get: other suppliers, quotes, substitutes, doing it in-house. 5. Any contract, notice period or exclusivity I am bound by. 6. My deadline and how much I can afford to walk away. Then work through these steps with me, one at a time, and wait for my answers where you need them: Step 1 - My position. Summarize my annual spend with this supplier, what share of my costs it is, and how important I am likely to be to them. Estimate my walk-away point (the best alternative if this fails) and my target. Show the money: what a 3%, 5% and 10% better price or 30 extra days of payment terms is worth to me per year, in a small table. Step 2 - Their side. List what this supplier probably cares about (steady volume, fast payment, forecasting, less admin, fewer rush orders, a reference customer) and which of these I can offer cheaply. Point out anything that makes my position weaker, honestly. Step 3 - The asks and trades. Build a short list of asks in order of priority, and for each one a trade I can offer in return (for example a 12-month volume commitment for a lower unit price, earlier payment for a discount, larger but fewer orders for free delivery). Mark which asks are must-haves and which I can give up. Step 4 - The opening message. Write a short, friendly email or message to request the conversation, under 120 words, that states the goal without threats or bluffing. Step 5 - The conversation plan. Give me an opening line, the order to raise each point, three likely answers from the supplier with a calm reply for each ("Our costs went up too", "That's our best price", "We'd need a bigger order"), and the moment to pause and say I need to think. Include one fair package I can propose if we get stuck. Step 6 - If they announced a price rise. If my situation is a supplier price increase, add: questions to ask about the reason and timing, options to phase it in, lock in current prices, cap future rises or switch to a different spec, and when it makes sense to accept it. Step 7 - Close and follow up. Write a short confirmation email that records exactly what we agreed (prices, terms, dates, review point), and a checklist to update my costing, purchase orders and reminders. Tell me when to review the deal again. Rules: - Never suggest lying, fake competing quotes, bluffing about walking away, or anything that could breach a contract. - Never invent my numbers; ask, or label anything you assume. - Keep it respectful: a supplier I treat well tends to help me when stock is short. - Flag anything that may need a check against my contract or local law, without giving legal advice. - Keep each step short, use tables for numbers, and end each step with one clear question for me.
# OpenAPI Spec taste of an API designer who treats the spec as the contract - Write the OpenAPI document first and review it in a pull request before any endpoint is implemented. Confidence: 0.80 - Use OpenAPI 3.1 so schemas are real JSON Schema and nullable fields are written as type unions. Confidence: 0.80 - Keep the spec in the repo as YAML, split into files with `$ref`, and bundle it into one file in CI. Confidence: 0.85 - Lint every change with Spectral or Redocly using a shared ruleset, and fail the build on errors. Confidence: 0.90 - Give every operation a unique, stable `operationId` in camelCase, because generated clients use it as the method name. Confidence: 0.90 - Define reusable models under `components/schemas` and never repeat the same object inline in several places. Confidence: 0.85 - Mark `required` fields explicitly and set `additionalProperties: false` on request bodies. Confidence: 0.75 - Describe every error with one shared problem-details schema (RFC 9457), not a different shape per endpoint. Confidence: 0.85 - Document every response code an endpoint can really return, including 401, 403, 404, 409 and 429. Confidence: 0.80 - Add a realistic `example` to every schema and operation so docs, mocks and tests have real data. Confidence: 0.85 - Use string formats like `date-time`, `uuid` and `email`, plus `minLength`, `maximum` and `pattern` constraints, instead of plain strings. Confidence: 0.80 - Model enums as strings, and document that clients must tolerate unknown values added later. Confidence: 0.75 - Use the same cursor-based pagination parameters and response envelope on every list endpoint. Confidence: 0.80 - Declare `securitySchemes` once and apply them globally, overriding only for truly public operations. Confidence: 0.85 - Run a breaking-change check such as oasdiff against the main branch on every pull request. Confidence: 0.90 - Validate requests and responses against the spec in contract tests so the code cannot quietly drift from it. Confidence: 0.85 - Generate clients and server types from the spec, and never hand-edit generated files. Confidence: 0.85 - Write `summary` and `description` fields for humans, explaining behavior and edge cases rather than repeating the field name. Confidence: 0.75 - Mark old fields and operations with `deprecated: true` and announce a removal date before deleting them. Confidence: 0.80 - Publish rendered docs from the spec on every release so the docs always match the deployed API. Confidence: 0.80
# CMake C++ Project taste of a systems developer who wants clean, portable builds - Require a modern CMake (3.24 or newer) and write target-based CMake only, never global `include_directories` or `add_definitions`. Confidence: 0.90 - Attach include paths, flags and definitions to targets with `target_*` commands and the right `PUBLIC`, `PRIVATE` or `INTERFACE` scope. Confidence: 0.90 - Always build out of source, in a `build/` directory that is gitignored. Confidence: 0.95 - Commit a `CMakePresets.json` with debug, release and sanitizer presets so everyone configures the same way. Confidence: 0.85 - Set the language standard with `target_compile_features(... cxx_std_20)` instead of raw `-std=` flags. Confidence: 0.85 - Turn on strict warnings like `-Wall -Wextra -Wpedantic` or `/W4` through a shared interface target, and treat warnings as errors in CI. Confidence: 0.85 - Never use `file(GLOB)` for source lists; list source files explicitly so the build reruns when files change. Confidence: 0.75 - Get third-party libraries with `find_package` backed by vcpkg or Conan, and use `FetchContent` only for small, pinned dependencies. Confidence: 0.80 - Pin every fetched dependency to a tag or commit hash, never a moving branch. Confidence: 0.90 - Never vendor modified copies of libraries without a clear patch file and a note on why. Confidence: 0.75 - Run tests with CTest, and register each test executable with `add_test` or `gtest_discover_tests`. Confidence: 0.85 - Have a CI job that builds with AddressSanitizer and UndefinedBehaviorSanitizer and runs the full test suite. Confidence: 0.85 - Export `compile_commands.json` with `CMAKE_EXPORT_COMPILE_COMMANDS` so clangd and clang-tidy work out of the box. Confidence: 0.90 - Format with a committed `.clang-format` and check it in CI rather than arguing about style in reviews. Confidence: 0.85 - Use Ninja as the default generator for fast incremental builds, and ccache or sccache in CI. Confidence: 0.80 - Provide proper `install()` rules and an exported package config so other projects can use `find_package` on the library. Confidence: 0.75 - Namespace exported targets like `mylib::mylib` and create an alias target with the same name for in-tree use. Confidence: 0.80 - Keep options few and prefixed with the project name, such as `MYLIB_BUILD_TESTS`, and default tests off when used as a subproject. Confidence: 0.75 - Avoid setting `CMAKE_CXX_FLAGS` directly in `CMakeLists.txt`; leave global flags to presets and toolchain files. Confidence: 0.80 - Test the build on Linux, macOS and Windows in CI if the project claims to be portable. Confidence: 0.80
# Linting and Formatting taste of a JavaScript developer who wants zero style debates - Let Prettier own all formatting and ESLint own only correctness, so the two tools never fight over the same rule. Confidence: 0.90 - Use the ESLint flat config (`eslint.config.js`) for new projects and skip the legacy `.eslintrc` formats. Confidence: 0.85 - Turn off every stylistic ESLint rule with `eslint-config-prettier` instead of tuning them one by one. Confidence: 0.85 - Keep the Prettier config tiny and close to defaults; arguing about semicolons is not worth a meeting. Confidence: 0.90 - Commit the formatter and linter configs to the repo and pin their versions so every machine gives the same result. Confidence: 0.90 - Enable `typescript-eslint` with type-aware rules for TypeScript code, even though it makes linting a bit slower. Confidence: 0.80 - Treat `no-floating-promises` and `no-misused-promises` as errors; unhandled promises are real bugs, not style. Confidence: 0.85 - Prefer a short list of rules set to `error` over a long list of `warn` rules that everyone learns to ignore. Confidence: 0.85 - Run the formatter on save in the editor so formatting never shows up as a separate task. Confidence: 0.85 - Run lint and format checks on staged files only in a pre-commit hook with `lint-staged`, and keep that hook fast. Confidence: 0.75 - Run `prettier --check` and `eslint --max-warnings=0` in CI so nothing unformatted or noisy reaches the main branch. Confidence: 0.90 - Land the first repo-wide format in a single dedicated commit and add it to `.git-blame-ignore-revs`. Confidence: 0.80 - Allow inline `eslint-disable` comments only for one specific rule, always with a short reason next to it. Confidence: 0.85 - Never disable a rule for the whole file just to get one tricky line through. Confidence: 0.75 - Keep import sorting automatic with a plugin, so import order never comes up in code review. Confidence: 0.70 - Add a `.editorconfig` for line endings, final newlines and indentation so non-JS files stay consistent too. Confidence: 0.70 - Ignore generated code and build output in both tools instead of fixing lint errors in files nobody writes by hand. Confidence: 0.85 - Review new lint rules as a team decision with a one-line reason in the config, not as a drive-by change. Confidence: 0.70 - Consider Biome for new small projects that want one fast tool for both linting and formatting. Confidence: 0.60 - Fix lint errors in the same pull request that adds them; a "clean up lint later" ticket never gets done. Confidence: 0.80
# HTTP Caching taste of a web developer who wants fast pages without stale surprises - Decide the caching policy for every response on purpose; a missing `Cache-Control` header lets browsers and proxies guess. Confidence: 0.90 - Serve fingerprinted static assets with `Cache-Control: public, max-age=31536000, immutable`. Confidence: 0.95 - Put a content hash in asset file names instead of using query strings like `?v=2` for cache busting. Confidence: 0.85 - Send HTML documents with `no-cache` or a very short max-age so new deploys show up right away. Confidence: 0.85 - Use `private, no-store` for responses with personal or sensitive data, and never let a shared cache hold them. Confidence: 0.95 - Use `s-maxage` to give the CDN a different lifetime than the browser when the CDN can be purged and the browser cannot. Confidence: 0.80 - Add `stale-while-revalidate` for content that can be a few seconds old, so users rarely wait for the origin. Confidence: 0.80 - Use `stale-if-error` so the CDN keeps serving the last good copy when the origin is down. Confidence: 0.70 - Send strong `ETag` or `Last-Modified` validators so revalidation returns a cheap `304 Not Modified`. Confidence: 0.80 - Keep the `Vary` header minimal; varying on `User-Agent` or `Cookie` quietly destroys the CDN hit rate. Confidence: 0.85 - Never cache responses that set cookies at a shared cache. Confidence: 0.90 - Purge the CDN by tag or surrogate key after content changes instead of purging everything. Confidence: 0.75 - Cache API GET responses only when the data is truly shared, and say so explicitly in the response headers. Confidence: 0.80 - Do not cache error responses for long; a cached 500 or 404 can outlive the real problem. Confidence: 0.80 - Rely on HTTP caching headers instead of a service worker unless the app truly needs offline support. Confidence: 0.70 - Watch the CDN cache hit ratio as a key metric, and investigate when it drops after a deploy. Confidence: 0.75 - Test caching behavior with `curl -I` against the real CDN, not only in local development. Confidence: 0.80 - Document the cache rules per route in one place so nobody has to read headers in the browser to learn them. Confidence: 0.65 - Keep `Cache-Control` decisions in application code or edge config under version control, not only in a dashboard. Confidence: 0.75 - Prefer short cache times plus revalidation over long cache times plus emergency purges. Confidence: 0.70
# Zod Schema Validation taste of a TypeScript developer who trusts nothing from the outside - Validate every input that crosses a trust boundary with Zod: request bodies, query strings, env vars, webhooks and third-party API responses. Confidence: 0.95 - Define the schema first and infer the TypeScript type with `z.infer`, instead of writing the type and the schema twice. Confidence: 0.90 - Use `safeParse` at API boundaries and turn errors into a clean 400 response; use `parse` only where a failure is truly a bug. Confidence: 0.85 - Validate environment variables once at startup and exit early with a clear message when something is missing. Confidence: 0.90 - Keep schemas in a shared module so the client and server use the same contract. Confidence: 0.80 - Use `z.coerce` only for query strings and form data, where every value arrives as a string. Confidence: 0.80 - Prefer `z.discriminatedUnion` over plain unions for tagged objects; errors are clearer and parsing is faster. Confidence: 0.80 - Use `.strict()` on input schemas where unknown keys usually mean a client bug. Confidence: 0.70 - Keep transforms small and pure; heavy business logic does not belong inside a schema. Confidence: 0.80 - Put refinements that check more than one field on the object with `.superRefine` and a clear `path`. Confidence: 0.75 - Write error messages for humans in schemas used by forms, and keep the default messages for internal APIs. Confidence: 0.70 - Use branded types like `z.string().uuid().brand<"UserId">()` for IDs that must never be mixed up. Confidence: 0.65 - Do not validate the same data again deep inside the app; parse once at the edge and pass typed values inward. Confidence: 0.85 - Make dates explicit: accept ISO strings at the boundary and convert to `Date` objects in one place. Confidence: 0.75 - Generate OpenAPI or JSON Schema from Zod schemas when the API is public, instead of keeping docs by hand. Confidence: 0.70 - Avoid `z.any()` and `z.unknown()` in public schemas except for fields that are truly free-form. Confidence: 0.80 - Use `.default()` for optional settings so the code after parsing never needs undefined checks. Confidence: 0.75 - Test schemas with both valid and invalid fixtures, especially for edge cases like empty strings and nulls. Confidence: 0.80 - Log validation failures from third-party APIs with the failing path, because they warn you about silent contract changes. Confidence: 0.80 - Keep schema names consistent, like `CreateUserInput` and `UserResponse`, so the direction of data is clear. Confidence: 0.65
# 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
# 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
Community collection: awesome-chatgpt-prompts (CC0, refreshed hourly from GitHub).