💻 Coding
Refactor to production-ready
Refactor the following code for readability, performance, and error handling. Explain each change with rationale.
```
{code}
```Prompts that ship
Search, filter and copy production-tested prompts. Organized by workflow, not hype.
Refactor the following code for readability, performance, and error handling. Explain each change with rationale.
```
{code}
```Design a REST endpoint for {feature}. Include route, request/response schema (Zod), auth, edge cases, and example curl.Write thorough unit tests for the following function using {framework}. Cover happy path, edge cases, and failure modes.
```
{code}
```Design an AI agent that {goal}. Return system prompt, tool definitions with JSON schemas, memory strategy, guardrails, failure handling, evaluation set and cost estimate per run.Here is an error and the relevant code. Give the most likely root cause, two alternative hypotheses, the minimal fix, and a regression test.
{error}
```
{code}
```Act as GPT-6 Astra senior lead engineer. Review the following code, refactor it for production readiness, implement type safety with Zod/TypeScript, handle edge cases, and generate complete unit tests using {framework}.
```
{code}
```