20 ChatGPT Prompts for Developers
20 practical ChatGPT prompts for developers — covering code review, debugging, architecture decisions, documentation, and testing.
These aren't "write me a todo app" prompts. These are prompts for the real work of software development — the architecture decisions, code reviews, debugging sessions, and documentation tasks that determine whether a codebase is maintainable or a liability.
Each prompt is designed to produce structured, actionable output.
Architecture and Design (1-5)
1. System Design Review "Review this system design for [describe what you're building]. Architecture: [describe components, data flow, tech choices]. Expected scale: [users, requests/sec, data volume]. Identify: the 3 biggest scalability risks, the component most likely to become a bottleneck, and the architectural change that would have the highest impact if we did it now vs. later."
2. Database Schema Design "Design a database schema for [describe the domain]. Entities: [list main entities and their relationships]. Key queries: [describe the 5 most common read and write operations]. Use [PostgreSQL/MongoDB/etc.]. Provide the schema, explain your design decisions, and flag any normalization tradeoffs."
3. API Endpoint Design "Design a REST API for [resource/feature]. Consumers: [who calls this API]. Operations needed: [CRUD + any custom operations]. Include: endpoint paths, HTTP methods, request/response schemas (JSON), status codes, error responses, pagination approach, and authentication requirements."
4. Tech Stack Evaluation "Compare [option A] vs [option B] for [project type]. Requirements: [list]. Team: [size, expertise level]. Timeline: [MVP deadline]. Evaluate: developer experience, ecosystem maturity, performance characteristics, hosting costs, hiring pool, and long-term maintenance. Give a recommendation with reasoning, not just pros/cons."
5. Migration Strategy "Plan a migration from [current system/pattern] to [target system/pattern]. Current state: [describe]. Constraints: zero downtime, [other constraints]. Provide: a phased migration plan, rollback strategy at each phase, data migration approach, testing strategy, and the risks at each step."
Code Review and Quality (6-10)
6. Code Review Checklist "I'm about to submit this code for review: [paste code]. Review it for: correctness (does it do what it should?), edge cases (what inputs break it?), performance (any O(n²) hiding in there?), security (injection, auth, data exposure), readability (naming, structure, comments), and testing (what tests should exist?)."
7. Refactoring Plan "This function/module has grown too complex: [paste code]. Create a refactoring plan: identify the distinct responsibilities mixed together, suggest how to extract them into separate functions/modules, show the target function signatures, and describe how to verify the refactor doesn't break anything."
8. Error Handling Audit "Audit the error handling in this code: [paste code]. For each error path: is the error caught? Is it logged with enough context? Is it exposed to the user appropriately? Are there missing error cases? Suggest an improved error handling approach."
9. Security Review "Conduct a security review of this code: [paste code]. Check for: SQL injection, XSS, CSRF, insecure deserialization, authentication bypass, authorization gaps, sensitive data exposure, and dependency vulnerabilities. For each finding, rate severity (critical/high/medium/low) and provide the fix."
10. Performance Optimization "This code is slow: [paste code]. Context: [what it does, how often it runs, data volumes]. Profile it mentally: identify the performance bottlenecks, explain why they're slow, and suggest optimizations ranked by impact. Include Big-O analysis where relevant."
Debugging (11-14)
11. Structured Debugging "I have a bug. Expected behavior: [describe]. Actual behavior: [describe]. Error message: [paste full error + stack trace]. Code: [paste relevant code]. Environment: [runtime, OS, versions]. What I've tried: [list]. Diagnose the root cause and provide the fix."
12. Intermittent Bug Investigation "I have a bug that only happens sometimes. It occurs when [describe conditions]. Frequency: [rough percentage]. Symptoms: [describe]. Relevant code: [paste]. I suspect it's related to [your hypothesis]. Design a systematic investigation plan to isolate and reproduce this bug."
13. Production Issue Triage "We have a production issue. Symptom: [describe what users see]. Started: [when]. Impact: [how many users/what's broken]. Recent changes: [list recent deployments]. Infrastructure: [describe]. Provide a triage plan: immediate mitigation steps, diagnostic commands to run, and a ranked list of likely root causes to investigate."
14. Memory Leak Investigation "I suspect a memory leak in [language/framework] application. Symptoms: [describe — growing memory, OOM kills, slow degradation]. The application does: [describe]. Provide: diagnostic steps to confirm the leak, tools to use for [language], common leak patterns in [framework] to check, and how to fix each pattern."
Documentation and Testing (15-18)
15. API Documentation "Generate API documentation for this endpoint: [paste route handler/controller code]. Include: description, HTTP method, URL, request headers, request body schema with examples, response schema with examples for success and each error case, and usage example with curl."
16. README Generator "Generate a README for this project: [describe project purpose, tech stack, key features]. Include: project description (2-3 sentences), prerequisites, installation steps, configuration (environment variables), running locally, running tests, project structure overview, and contributing guidelines."
17. Test Case Generation "Generate test cases for this function: [paste code]. Use [Jest/Vitest/pytest/etc.]. Cover: happy path with typical inputs, edge cases (empty, null, boundary values, max values), error scenarios, and any async behavior. Write the actual test code, not just descriptions."
18. Architecture Decision Record "Write an ADR for this decision: we chose [decision] over [alternatives] for [context/problem]. Include: title, status (accepted), context (the problem and constraints), decision (what we chose), consequences (positive and negative), and alternatives considered with reasons for rejection."
Productivity (19-20)
19. Git Workflow Design "Design a git workflow for a team of [X] developers working on [project type]. Include: branching strategy (feature branches, release branches, etc.), naming conventions, commit message format, PR process, merge strategy (rebase/squash/merge), CI/CD trigger points, and how to handle hotfixes."
20. Developer Onboarding Checklist "Create a developer onboarding checklist for a new engineer joining our team. Stack: [describe]. Team size: [X]. Include: day 1 setup (tools, access, local dev environment), week 1 (codebase orientation, first PR), month 1 (ownership area, key systems to understand), and ongoing (meetings, processes, resources)."
Tips for Better Development Prompts
- Paste real code. AI is dramatically better when it can see the actual code, not your description of it.
- Include versions. Node 22 behaves differently from Node 18. React 19 is not React 17. Always specify.
- One problem per prompt. Don't ask for a code review AND a refactoring plan AND tests. Chain them sequentially.
- Verify everything. AI-generated code is a first draft. Read it, understand it, test it.
- Include constraints. "Design an API" is too open. "Design an API that handles 10K req/sec with sub-100ms latency on a $500/mo infrastructure budget" is actionable.
For ready-to-use development prompts, check out PromptRepo's Development category.