Coding Prompts
Last updated: June 19, 2026
Code prompts fail when the model has to guess your stack, your style, and your edge cases. NexaPrompt locks those down so Claude and GPT generate code you can actually merge.
What good looks like
- States language, runtime, and framework versions
- Includes the relevant existing code or interface
- Defines success criteria and tests up front
- Calls out edge cases and forbidden patterns
Before & after
Rough
fix this function it's broken
Upgraded
Stack: TypeScript 5.5, Node 20, Vitest. File: src/lib/parse.ts (pasted below). Problem: parseRange('1-3,5') returns [1,3,5] instead of [1,2,3,5]. Constraints: No new deps. Keep the public signature. Add 3 Vitest cases including empty input. Output: Full file + tests, then a 2-line explanation.
Pro tips
- Always paste the actual code, not a description of it.
- Ask for tests first — they pin down behavior.
- Use Claude for long refactors, GPT for quick edits.
© 2026 NexaPrompt.io