PlaybookPrompts

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.

Coding & Development debugginggit

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.

4 variables • 3 suggested tools
Coding & Development refactorreview

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.

2 variables • 2 suggested tools
Coding & Development sqldata

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.

3 variables • 3 suggested tools
Coding & Development regextesting

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.

2 variables • 2 suggested tools
Coding & Development reviewchecklist

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.

2 variables • 2 suggested tools
Coding & Development refactoringcode-quality

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.

2 variables • 3 suggested tools
Coding & Development sqlperformance

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.

4 variables • 3 suggested tools
Coding & Development testingunit-tests

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.

4 variables • 3 suggested tools
Coding & Development apitypes

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.

3 variables • 3 suggested tools
Coding & Development asyncerror-handling

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.

3 variables • 3 suggested tools
Coding & Development databaseschema-design

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.

3 variables • 3 suggested tools
Coding & Development migrationrefactoring

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.

5 variables • 3 suggested tools
Coding & Development documentationcode-quality

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.

3 variables • 4 suggested tools
Coding & Development concurrencydebugging

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.

2 variables • 3 suggested tools
Coding & Development apireverse-engineering

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.

2 variables • 3 suggested tools
Coding & Development databasemigrations

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.

4 variables • 3 suggested tools
Coding & Development refactoringarchitecture

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.

3 variables • 3 suggested tools
Coding & Development refactoringfunctional

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.

3 variables • 3 suggested tools
Coding & Development testingdatabase

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.

4 variables • 3 suggested tools
Coding & Development securitydependencies

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.

3 variables • 3 suggested tools
Coding & Development feature-flagsdeployment

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.

4 variables • 3 suggested tools