Topic

Coding prompts for developers

Writing a good prompt for a coding assistant takes more than "fix my code." This collection gives developers ready-to-use prompts for the tasks that come up every day: finding bugs and explaining their root cause, writing unit tests that cover edge cases, reviewing a diff for readability and performance, and breaking down unfamiliar code line by line. Every prompt is free, works with any language or framework, and uses {{variable}} placeholders so you can drop in your own code and get a useful answer immediately — no prompt engineering required. Whether you're debugging a production issue, prepping a pull request, or just want a second pair of eyes on a function, start here.

53 prompts · page 3 of 6

Coding

Error Handling Audit

Paste a diff to catch the error-handling bugs that trigger 2am incidents — the ones that don't throw or log, just quietly corrupt state or return wrong data. It scans for swallowed exceptions, unchecked error returns, missing error paths, and logged-but-ignored failures, then rates overall error handling 1-10 with the reasoning behind the score so you know whether to approve or request changes.

Coding

Existing Code Optimization Request

Feed in a slow or clunky piece of code and get back concrete optimization options instead of a rewritten version to trust blindly. - The specific change and where it applies - The expected performance improvement - Any trade-offs it introduces, such as readability, memory, or complexity - Useful as a first pass before profiling, or as a sanity check on optimizations you're already considering

Coding

Framework and Database Migration Assistant

Plans a framework, database, or API migration from your current setup to a target one, honoring the compatibility window, downtime limit, and behavior you say must be preserved. - Takes old/new stack, current and target setup, and hard constraints as input - Outputs an ordered migration checklist, tackling the riskiest changes first - Generates code transformations for common patterns and lists breaking changes - Includes a rollback plan and validation tests to confirm the migration worked

Coding

General Code Review and Improvement

A broad first-pass review for a pasted code block that hasn't been looked at by anyone else yet, no special setup or context required beyond the code itself. It checks quality and best practices, likely bugs and edge cases, performance, readability, and security in one sweep, then explains the reasoning behind every suggestion so it teaches as much as it fixes.

Coding

Maintainability Cost Scorecard

Scores a pull request on long-term maintenance cost rather than just correctness, useful for code that works today but already smells expensive to keep. - Rates readability, complexity, dependency risk, and change isolation from 1-10 - Surfaces the top 3 maintainability concerns behind those scores - Suggests concrete ways to simplify each one before merge

Coding

Missing Unit Test Generator

Reads a pasted diff and writes the unit tests it's missing, in your stated test framework, as runnable code rather than a bulleted test plan. - Covers the happy path, the top 3 edge cases, and at least one failure scenario - Uses realistic sample data instead of placeholder strings like "foo" - Tip: ask it to also write a test that would have caught the bug, if the diff is a fix

Coding

Onboarding Code Explainer

Explains a pasted code block the way you'd brief a competent new hire who has zero context on this codebase: what it does, why it exists, and any non-obvious decisions or gotchas baked into it. The output is formatted as a comment block ready to paste directly above the function, making it useful as living documentation and not just a one-off explanation.

Coding

Opinionated Senior Engineer Review

Reviews a pasted diff through the lens of a senior engineer who has owned this codebase for two years and has strong opinions about pragmatic architecture. Instead of hedged, generic notes, it calls out whether abstractions sit at the right level, flags trade-offs that will bite in six months, and says so directly rather than diplomatically. Swap in your real stack and values for a sharper persona.

Coding

Performance Bottleneck Profiler

Profiles a pasted code block for real performance issues, using its execution frequency, typical data size, and your current pain point to prioritize what actually matters. - Flags O(n²) loops, N+1 queries, missing indexes, and memory/caching gaps - Ranks each finding High/Medium/Low impact with a suggested fix and expected gain - Focuses on the 20% of changes likely to deliver 80% of the speedup - Confirm suggestions with real profiling before shipping