More in this categoryCoding Prompts
11 / 12
2-phase workflowFeatured
Function Draft to Production-Ready
Draft a working function, then harden it for production.
Published · Updated

Workflow · 2 phases
Phase 1: Phase 1 — Function draft
Write a [LANGUAGE] function that [DESCRIBE TASK, e.g. fetches user data from an API and caches it]. Keep it simple and readable first — just make it work.
Phase 2: Phase 2 — Error handling
Now harden that function for production: add try/catch error handling, input validation, timeout handling, retry logic with exponential backoff, and logging. Explain each addition with a one-line comment.
Related prompts
Coding Prompts2 phasesLegacy Code Modernization
Analyze legacy risks, then modernize safely.
- Amazon Q Developer
By Rahul Verma
Coding Prompts
Coding Prompts2 phases
Coding Prompts