Coding & Development
Debugging, refactoring, docs, test scaffolding.
Prompts that turn an LLM into a useful pair programmer. Refactor patterns, bug isolation playbooks, code review templates, regex generation, SQL query design.
Binary-search a bug across recent changes
When a bug appeared 'sometime in the last week' and you have N suspects, binary search beats reading every diff. This prompt structures the search.
Extract a function with explicit boundary contract
Most 'refactor this' prompts produce noisy diffs. This one extracts one function with a written contract you can sanity-check before applying.
Translate a fuzzy business question into a runnable SQL query
Business stakeholders rarely ask precise questions. This prompt makes the model state its assumptions before writing the query, which catches misunderstandings cheaply.
Generate a regex with a built-in test matrix
Regex without test cases is a bug waiting to land. This prompt forces the model to produce a test matrix alongside the expression.
Run a PR through a 7-axis code review checklist
Code reviews drift when reviewers each check different things. This prompt produces a uniform review across correctness, security, performance, readability, testability, observability, and rollback.
Flatten deeply nested conditionals into readable logic
Deeply nested if/else chains are a common source of bugs and reviewer complaints. This prompt walks an LLM through systematically flattening them using guard clauses and early returns.
Diagnose a slow SQL query using EXPLAIN output
When a query is running slow and you have an EXPLAIN or EXPLAIN ANALYZE output, it's not always obvious which node is the culprit. This prompt helps you interpret the plan and get concrete index or rewrite suggestions.
Write unit tests from a function signature and spec
Writing tests after the fact is tedious and often incomplete. This prompt generates a structured test suite from a function signature and its intended behavior, covering happy paths, edge cases, and known failure modes.
Convert a raw API response into a typed data schema
When integrating a third-party API, turning a raw JSON response into a typed schema (TypeScript interface, Pydantic model, Go struct) saves hours and prevents runtime errors. This prompt does it systematically.
Audit error handling gaps in async or promise-based code
Async code is where error handling silently fails most often — unhandled rejections, swallowed exceptions, and missing fallbacks cause production incidents. This prompt audits a code block specifically for these gaps.
Design a normalized database schema from product requirements
Turning a product spec into a database schema involves decisions that are hard to reverse — normalization level, foreign keys, indexing strategy. This prompt walks through the design systematically and flags the tradeoffs.
Migrate code from a deprecated library version to a new API
Library major versions often break APIs in ways that require mechanical but error-prone find-and-replace across a codebase. This prompt handles a specific file or module at a time, mapping old calls to new ones explicitly.
Generate precise documentation for an undocumented function
Undocumented functions slow down every engineer who touches them later. This prompt generates accurate, specific documentation — not boilerplate — by reasoning through what the code actually does before writing a single word.
Spot and fix race conditions in concurrent code
Race conditions are notoriously hard to reproduce and diagnose. This prompt walks an LLM through auditing a concurrent code block for shared-state hazards and proposing safe alternatives.
Reverse-engineer a contract from undocumented API calls
When you inherit integration code with no docs, reconstructing the implicit API contract from raw requests and responses saves hours of trial-and-error. This prompt systematizes that process.
Plan a safe zero-downtime database migration step by step
Schema changes on live production databases are high-risk. This prompt produces an ordered migration plan that keeps the app running throughout, including rollback checkpoints at each phase.
Break a god class into smaller cohesive modules
God classes accumulate responsibilities until they become untestable. This prompt guides an LLM to identify responsibility boundaries and produce a concrete extraction plan without rewriting everything at once.
Convert imperative loops into a readable functional pipeline
Nested for-loops with accumulator variables are error-prone and hard to review. This prompt converts them to a functional style step-by-step while preserving exact behavior and flagging cases where the rewrite would hurt performance.
Generate realistic seed data that covers edge cases
Test databases filled with 'John Doe' and '[email protected]' miss the edge cases that break production. This prompt generates a seed data script targeting the boundaries that matter for a given schema.
Audit a package manifest for dependency risks and bloat
package.json or requirements.txt files quietly accumulate outdated, redundant, and risky dependencies. This prompt does a structured audit without needing to run a scanner tool.
Design a feature flag implementation and rollout strategy
Shipping a feature flag without a clear structure leads to permanent flags, untested flag removal paths, and messy conditional logic. This prompt designs both the code-level implementation and the lifecycle plan.