Coding Prompts
Ready-to-use prompts for writing, refactoring, debugging, and reviewing code. Paste one in, fill the variables, and get a focused result instead of a blank chat.
You are helping me find which change introduced a regression. Known good: {{good_ref}} Known bad: {{bad_ref}} Symptom: {{symptom}} What I can run to test a commit (the bisect predi...
You are a type-system expert in {{language}} (e.g. TypeScript, Rust, Kotlin). Loosely typed code: {{code}} Domain rules that the types should enforce: {{domain_rules}} Refactor the...
You are a DevOps engineer writing a pipeline for {{ci_platform}} (e.g. GitHub Actions, GitLab CI). Project: {{project_description}} ({{language}}/{{framework}}). Steps needed: {{st...
You are an algorithms specialist. Current implementation: {{code}} What it computes: {{purpose}} Input sizes in production: {{input_size}} Constraints: {{constraints}} (memory cap,...
You are a data modeler for {{database}}. Domain to model: {{domain}} Key access patterns (reads/writes by frequency): {{access_patterns}} Scale and growth: {{scale}} Design the sch...
You are a release engineer. Design a feature-flag rollout for: {{feature}}. Blast radius if it breaks: {{risk}} User segments: {{segments}} Metrics that define success and failure:...
You are a debugging strategist. I have a bug that reproduces only sometimes. Bug description: {{bug}} What triggers it (as far as I know): {{triggers}} Environment: {{environment}}...
You are an infrastructure-as-code reviewer for {{iac_tool}} on {{cloud}}. Config: {{config}} Review for: 1. Security: open security groups, public buckets, missing encryption, over...
You are a CLI tooling engineer writing in {{language}}. Tool purpose: {{purpose}} Commands/flags needed: {{commands}} Inputs/outputs: {{io}} Build it with production-grade UX: 1. A...
You are a domain-driven-design and event-sourcing expert. Aggregate to model: {{aggregate}} Business rules / invariants: {{invariants}} Queries the read side must answer: {{queries...
You are a code archaeologist. I inherited this undocumented {{language}} code and must understand it before changing it. Code: {{code}} Produce: 1. A high-level summary: what this...
You are a backend engineer implementing rate limiting for {{scenario}}. Limits: {{limits}} (e.g. 100 req/min per API key). Deployment: {{deployment}} (single node, multi-node, serv...
You are writing a pull request description that respects reviewers' time. What the change does: {{change}} Why (problem/ticket): {{why}} Files/areas touched: {{scope}} Risk and rol...
You are a database migration specialist for {{database}}. Migration goal: {{goal}} Table size: {{table_size}} Constraints: zero downtime, must be re-runnable safely, must be revers...
You are a test architect. Help me design the test strategy for: {{component}}. Dependencies it has: {{dependencies}} (db, external APIs, queues, time). Risk areas: {{risks}} Speed...
You are a backend performance engineer. This {{stack}} resolver/ORM code triggers N+1 queries. Code: {{code}} Schema/relations: {{schema}} Query log showing the N+1: {{query_log}}...
You are a software architect designing error handling for a {{language}} {{app_type}}. Current pain: {{pain}} (swallowed errors, inconsistent shapes, lost context). Layers in the a...
You are a fuzzing engineer using {{fuzzer}} (e.g. libFuzzer, AFL++, go-fuzz, cargo-fuzz). Code that parses/decodes input: {{code}} Input format: {{input_format}} Deliver: 1. A fuzz...
You are a caching specialist. Design caching for: {{data_description}}. Read/write ratio: {{rw_ratio}} Staleness tolerance: {{staleness}} Consistency requirement: {{consistency}} C...
You are an expert in both {{source_language}} and {{target_language}}. Source code: {{code}} Port it to {{target_language}} idiomatically, not line-for-line: 1. Use {{target_langua...
You are an observability engineer. Instrument this {{language}} service for production. Service and critical paths: {{service_description}} Key code: {{code}} Stack: {{telemetry_st...
You are a software engineer implementing a finite state machine in {{language}}. Process to model: {{process}} States: {{states}} Allowed transitions and their triggers: {{transiti...
You are a web platform expert. My browser requests fail with: {{error}}. Setup: - Frontend origin: {{frontend_origin}} - API origin: {{api_origin}} - Auth method: {{auth_method}} (...
You are an SRE writing an on-call runbook for: {{incident_type}}. Service: {{service}} How it usually manifests / alert: {{symptom}} Known causes: {{causes}} Tools and dashboards a...
You are an engineer planning a major upgrade: {{dependency}} from {{from_version}} to {{to_version}}. Codebase usage: {{usage}} Risk tolerance and timeline: {{constraints}} Changel...
You are a shell scripting expert. Harden this script for production use. Script: {{script}} Where it runs: {{environment}} Fix it to be robust: 1. Add strict mode (set -euo pipefai...
You are a platform engineer designing outbound webhooks for: {{events}}. Consumers: {{consumers}} Volume: {{volume}} Delivery guarantees needed: {{guarantees}} (at-least-once, orde...
You are a frontend performance engineer for a {{framework}} app. Bundle analysis / current sizes: {{bundle_report}} Key routes and their weight: {{routes}} Constraints: {{constrain...
You are a backend engineer making a critical write endpoint idempotent: {{endpoint}}. What duplicates would cause: {{duplicate_harm}} (e.g. double charge). Store available: {{store...
You are a refactoring expert reviewing this {{language}} code. Code: {{code}} Identify code smells (long method, large class, feature envy, primitive obsession, shotgun surgery, du...
You are a performance test engineer. Design a load test for: {{service}}. Expected production load: {{expected_load}} Critical user journeys: {{journeys}} Tool: {{tool}} (e.g. k6,...
You are a platform architect designing a plugin system for: {{application}}. What plugins should be able to do: {{capabilities}} What they must NOT be able to do: {{constraints}} L...
You are a distributed systems debugger. We get intermittent timeouts: {{symptom}}. Architecture: {{architecture}} (services, proxies, DB, connection pools). When it happens: {{patt...
You are a technical writer documenting a {{language}} library: {{library_name}}. What it does: {{purpose}} Public API: {{api}} Common use cases: {{use_cases}} Write docs with: a on...
You are a SaaS architect. Design multi-tenancy for: {{product}}. Tenant count and size distribution: {{tenants}} Isolation requirements: {{isolation}} (compliance, noisy-neighbor,...
You are a performance measurement expert in {{language}}. I want to compare these implementations: {{implementations}} Workload to benchmark: {{workload}} Benchmark tool/library av...
You are a reliability engineer. Design the resilience policy for calls to: {{dependency}}. Failure modes observed: {{failures}} (timeouts, 5xx, throttling). Call context: {{context...
You are a senior engineer doing a careful code review of this {{language}} pull request. What the PR claims to do: {{intent}} Diff: {{diff}} Review in priority order: 1. Correctnes...
You are a search engineer. Design search for: {{what_to_search}}. Data characteristics: {{data}} (volume, update rate, fields, languages). Query needs: {{query_needs}} (typo tolera...
You are an implementation engineer. Turn this algorithm description into working {{language}} code. Description / pseudocode / formula: {{description}} Input and output spec: {{io_...
You are a numerical-computing expert. This {{language}} code produces wrong or unstable numbers. Code: {{code}} Expected vs actual: {{expected_vs_actual}} Domain: {{domain}} (money...
You are a backend architect designing background processing for: {{workload}}. Job types and their characteristics: {{job_types}} (duration, frequency, priority, retryability). Vol...
You are a test reliability engineer. A test is flaky. Test code: ```{{language}} {{test_code}} ``` Symptoms / failure logs: {{failure_logs}} Test framework: {{framework}} Do the fo...
You are a regex expert for the {{flavor}} engine. Must MATCH these strings: {{should_match}} Must NOT match these strings: {{should_not_match}} Produce: 1. A single regex that matc...
You are a database performance specialist for {{database}}. Slow query: ```sql {{query}} ``` Relevant table schema and existing indexes: {{schema_and_indexes}} Execution plan / EXP...
You are a senior systems debugger. I have a heisenbug: it manifests in production but disappears when I attach a debugger or add print statements. Code under suspicion: ```{{langua...
You are an expert in property-based testing using {{library}} for {{language}}. Function to test: ```{{language}} {{function_code}} ``` Identify and encode as properties: 1. Invari...
You are a shell scripting expert focused on portability and safety. Script: ```bash {{script}} ``` Target environments: {{targets}} Rewrite it to: 1. Be safe (set -euo pipefail or...
You are a container image optimization expert. Current Dockerfile: ```dockerfile {{dockerfile}} ``` Stack: {{stack}} Current image size: {{current_size}} Produce an improved Docker...
You are a memory profiling expert for {{runtime}}. Symptom: memory grows {{growth_pattern}} and is not reclaimed. Heap snapshot diff / retained-size summary: {{heap_data}} Suspect...