Developers don't need 100 prompts. They need 20 that earn their keep on a Tuesday afternoon when the build is broken and the standup is in 90 minutes. This list is that — 25 prompts grouped by job, tested against real workflows in Claude Code and ChatGPT.
This guide gives you the prompts and a one-line note on when each one shines, plus the context-staging pattern that makes any of them work harder.
What changed in 2026
Long context, agentic loops, and tool use changed what "prompt" even means for developers. You're not pasting snippets into a chat anymore — you're scripting an agent.
- 1M-token context means whole-repo prompts work without crashes.
- Tool use means the model can run tests and read its own output.
- Sub-agents let one prompt fan out into parallel tasks.
How to use these
- Lead with constraints — language, framework, version, deps.
- Paste the test if you have one; the model writes to it.
- Ask for the plan first before code.
- Use sub-agents for research, tests, and review in parallel.
- Save the keepers as snippets in your editor.
1. Debugging prompts — best for stuck moments
- Stack trace read. "Here's the trace and the function. What's the most likely cause? Three hypotheses, ranked."
- Bisect helper. "Diff: [paste]. Tests started failing here. Which hunk is the most suspect?"
- Heisenbug hunt. "This bug happens 1 in 100 runs. Suggest 5 things that could cause flakiness here."
- Reproduction script. "Given this bug report, write the smallest script that reproduces it."
- Logs to root cause. "Here are 200 lines of logs. Cluster the errors. What's the underlying cause?"
2. Refactoring prompts — best for cleanup
- Extract function. "Refactor this 80-line function. Extract pure helpers. Keep behavior identical."
- Type tighten. "Replace every
any with the narrowest type that compiles."
- Dead code find. "Read this module. List symbols that aren't referenced anywhere."
- Naming pass. "Suggest better names for these 10 variables. Preserve semantics."
- Pattern apply. "Refactor this to use the strategy pattern. Show before/after."
3. Review prompts — best as a second pair of eyes
- PR review. "Here's the diff. Flag bugs, perf issues, and unclear naming. Be terse."
- Security review. "Audit this endpoint for OWASP top 10 issues. Specific not generic."
- Edge case sweep. "What inputs would break this function? List 10."
- Test gap. "Here's the function and its tests. What cases are missing?"
- Doc check. "Does the docstring match the actual behavior?"
4. Architecture prompts — best for design moments
- Trade-off matrix. "Three options for problem X. Compare on cost, latency, complexity, vendor lock."
- ADR draft. "Write an ADR for adopting X. Include alternatives considered."
- Failure mode brainstorm. "What can go wrong with this design? Rank by likelihood."
- Capacity sketch. "100K req/day, 10KB payload, 50ms p99. Sketch a system that handles this."
- Migration plan. "We're moving from X to Y. Suggest a phased migration. No big-bang."
5. Boilerplate prompts — best for grind work
- CRUD scaffold. "Generate Express + Postgres CRUD for entity X with the schema [paste]."
- Test stubs. "Generate failing tests for this function that I'll fill in."
- Type from JSON. "Here's a JSON sample. Generate a Zod schema and TS type."
- Migration writer. "Schema diff: old [paste], new [paste]. Write the migration both directions."
- README scaffold. "Generate a README for this repo. Use the package.json and src/index.ts."
Comparison: AI dev tools in April 2026
| Tool |
Cost |
Key strength |
Best for |
| Claude Code |
$20-200/mo |
Agent loops + long context |
Whole-feature work |
| Cursor |
$20/mo + API |
IDE-native edits |
Inline workflow |
| Copilot |
$10/mo |
Cheap autocomplete |
Suggestions |
| Aider |
API only |
Git-native CLI |
Power users |
Common mistakes to avoid
No constraints. "Write a function" gets you a generic function. Specify language, version, style.
Ignoring the plan step. Asking for code first means the model commits to a path before thinking.
Trusting AI tests. AI-generated tests often pass for the wrong reason. Read them.
FAQ
Should I use Claude or ChatGPT for code?
Claude has the edge for long-context, agentic work. ChatGPT is fine for snippets.
Do these prompts work in Cursor and Copilot?
Yes. They're model-agnostic. Copilot is weaker at the planning prompts.
Can I trust AI for security review?
Use it as a first pass, never the only pass. AI misses chained vulnerabilities.
Where to go next
For related guides see Best AI coding assistants in 2026, Best AI code review tools in 2026, and How to use Claude for coding in 2026.