50 Best ChatGPT Prompts for Developers in 2024
Copy-paste ready prompts for debugging, code review, documentation, testing, and more. Save hours every week with these battle-tested developer prompts.
50 Best ChatGPT Prompts for Developers in 2024
Introduction
As a developer, you know that productivity is everything. The right prompts can save you hours of debugging, research, and boilerplate code writing. This comprehensive collection of 50 battle-tested ChatGPT prompts will supercharge your development workflow.
Each prompt is categorized and includes examples of how to use them effectively. Copy, paste, and customize these prompts to fit your specific needs.
Code Generation & Implementation
1. Function Implementation
Write a [LANGUAGE] function that [FUNCTIONALITY]. Include: - Input validation - Error handling - Type hints (if applicable) - Comprehensive docstring - Unit test examples Function signature: [DESIRED_SIGNATURE] Edge cases to handle: [EDGE_CASES]
2. API Endpoint Creation
Create a REST API endpoint for [RESOURCE] using [FRAMEWORK]. Include:
GET /[resource] - List all resources
POST /[resource] - Create new resource
GET /[resource]/{id} - Get specific resource
PUT /[resource]/{id} - Update resource
DELETE /[resource]/{id} - Delete resource
Include:
- Request/response schemas
- Authentication middleware
- Input validation
- Error handling
- Database integration example3. Database Schema Design
Design a database schema for [APPLICATION_TYPE]. Include: Tables: [LIST_TABLES] Relationships: [DESCRIBE_RELATIONSHIPS] Constraints: [LIST_CONSTRAINTS] Indexes: [LIST_INDEXES] Generate SQL DDL statements for [DATABASE_SYSTEM]. Include migration scripts and seed data examples.
Debugging & Troubleshooting
4. Error Analysis
Analyze this error message and provide solutions: Error: [PASTE_ERROR_MESSAGE] Code context: [PASTE_RELEVANT_CODE] Environment: [LANGUAGE/FRAMEWORK/VERSION] Steps I've tried: [LIST_ATTEMPTED_SOLUTIONS] Provide: 1. Root cause analysis 2. Step-by-step fix 3. Prevention strategies 4. Alternative approaches
5. Performance Optimization
Optimize this [LANGUAGE] code for performance: [PASTE_CODE] Current performance issues: [DESCRIBE_ISSUES] Target improvements: [SPECIFY_GOALS] Constraints: [LIST_LIMITATIONS] Provide optimized version with: - Time/space complexity analysis - Benchmarking suggestions - Trade-off considerations
6. Security Code Review
Review this code for security vulnerabilities: [PASTE_CODE] Context: [APPLICATION_TYPE] Authentication method: [AUTH_METHOD] Data sensitivity: [HIGH/MEDIUM/LOW] Check for: - Injection vulnerabilities - Authentication bypasses - Data exposure risks - Input validation issues - Secure coding practices
Testing & Quality Assurance
7. Unit Test Generation
Write comprehensive unit tests for this function: [PASTE_FUNCTION_CODE] Testing framework: [FRAMEWORK] Mocking library: [LIBRARY] Coverage requirements: [PERCENTAGE] Include tests for: - Happy path scenarios - Edge cases - Error conditions - Boundary values - Integration points
8. Integration Test Suite
Create integration tests for [FEATURE/MODULE]. Include: Test scenarios: 1. [SCENARIO_1] 2. [SCENARIO_2] 3. [SCENARIO_3] Test data setup: [DESCRIBE_FIXTURES] External dependencies: [LIST_APIS/DATABASES] Assertion strategy: [DESCRIBE_CHECKS] Generate test code using [FRAMEWORK].
9. Load Testing Strategy
Design a load testing strategy for [APPLICATION/SERVICE]. Include: System specifications: - Concurrent users: [NUMBER] - RPS: [REQUESTS_PER_SECOND] - Data volume: [SIZE] Load testing tools: [LIST_TOOLS] Test scenarios: [DESCRIBE_SCENARIOS] Success criteria: [DEFINE_METRICS] Generate test scripts and monitoring setup.
Documentation & Communication
10. Technical Documentation
Write technical documentation for [FEATURE/COMPONENT]. Include: Overview: [BRIEF_DESCRIPTION] Architecture: [SYSTEM_DESIGN] API Reference: [ENDPOINTS/METHODS] Configuration: [SETUP_INSTRUCTIONS] Usage Examples: [CODE_SAMPLES] Troubleshooting: [COMMON_ISSUES] Format as [MARKDOWN/WIKI/CONFLUENCE]. Audience: [DEVELOPERS/USERS/BOTH]
11. Code Comments & Docstrings
Add comprehensive comments and docstrings to this code: [PASTE_CODE] Comment style: [JSDOC/DOXYGEN/ETC] Include: - Function/class purpose - Parameter descriptions - Return value documentation - Exception handling - Usage examples - Algorithm explanations
12. API Documentation
Generate OpenAPI/Swagger documentation for this API: Base URL: [URL] Authentication: [METHOD] Endpoints: 1. [ENDPOINT_1_DESCRIPTION] 2. [ENDPOINT_2_DESCRIPTION] 3. [ENDPOINT_3_DESCRIPTION] Include: - Request/response schemas - Error codes - Authentication examples - Rate limiting details
Architecture & Design
13. System Architecture Design
Design the architecture for [SYSTEM/APPLICATION]. Requirements: Scale: [USER_LOAD] Availability: [UPTIME_REQUIREMENT] Data consistency: [LEVEL] Security requirements: [SPECIFICATIONS] Budget constraints: [LIMITS] Technology stack: [SUGGEST_TECHNOLOGIES] Deployment strategy: [APPROACH] Monitoring solution: [TOOLS] Provide detailed diagrams and component descriptions.
14. Microservices Design
Design a microservices architecture for [DOMAIN]. Include: Bounded contexts: [LIST_SERVICES] Service responsibilities: [DESCRIBE_EACH] Communication patterns: [SYNC/ASYNC/BOTH] Data ownership: [DEFINE_OWNERSHIP] Cross-cutting concerns: [LOGGING/SECURITY/MONITORING] Technology choices: [LANGUAGES/FRAMEWORKS] Deployment: [CONTAINERS/ORCHESTRATION] API Gateway: [DESIGN_PATTERN]
15. Database Optimization
Optimize database performance for [APPLICATION]. Current issues: Slow queries: [LIST_QUERIES] High load tables: [LIST_TABLES] Connection pooling: [CURRENT_SETUP] Indexing strategy: [CURRENT_INDEXES] Provide: - Query optimization suggestions - Index recommendations - Schema refactoring ideas - Caching strategies - Connection pooling improvements
DevOps & Deployment
16. CI/CD Pipeline Design
Design a CI/CD pipeline for [APPLICATION_STACK]. Include: Source control: [GIT/GITHUB] Build process: [TOOLS] Testing strategy: [UNIT/INTEGRATION/E2E] Artifact management: [NEXUS/ARTIFACTORY] Deployment: [KUBERNETES/DOCKER/AWS] Environments: [DEV/STAGING/PROD] Security scanning: [SAST/DAST] Monitoring: [TOOLS] Rollback strategy: [APPROACH] Generate pipeline configuration files.
17. Docker Configuration
Create optimized Dockerfile for [APPLICATION]. Requirements: Base image: [IMAGE] Application type: [LANGUAGE/FRAMEWORK] Dependencies: [LIST] Security hardening: [REQUIREMENTS] Performance optimization: [GOALS] Multi-stage build: [YES/NO] Image size target: [SIZE] Security scanning: [TOOLS] Include docker-compose.yml for local development.
18. Kubernetes Deployment
Create Kubernetes manifests for [APPLICATION]. Include: Deployment strategy: [ROLLING/CANARY/BLUE-GREEN] Resource limits: [CPU/MEMORY] Health checks: [READINESS/LIVENESS] Service mesh: [ISTIO/LINKERD] Secrets management: [VAULT/KUBERNETES] Monitoring: [PROMETHEUS/GRAFANA] Horizontal Pod Autoscaling: [CONFIGURATION] Network policies: [SECURITY_RULES] ConfigMaps: [APPLICATION_CONFIG]
Code Review & Collaboration
19. Code Review Checklist
Review this pull request for [FEATURE]. Checklist: Functionality: - [ ] Requirements met - [ ] Edge cases handled - [ ] Error conditions tested Code Quality: - [ ] Naming conventions followed - [ ] Documentation complete - [ ] Tests included - [ ] Security considerations addressed Performance: - [ ] No performance regressions - [ ] Resource usage optimized - [ ] Scalability considerations [PASTE_CODE_CHANGES] Provide specific feedback and improvement suggestions.
20. Git Strategy & Workflow
Design a Git workflow for [TEAM_SIZE] developers. Include: Branching strategy: [GIT_FLOW/GITHUB_FLOW] Release process: [AUTOMATED/MANUAL] Code review requirements: [APPROVALS] Merge strategy: [MERGE/SQUASH/REBASE] Tools: [GITHUB/GitLab] Automation: [HOOKS/ACTIONS] Release versioning: [SEMVER/CALVER] Document the complete workflow with examples.
Mobile Development
21. React Native Component
Create a reusable React Native component for [FUNCTIONALITY]. Include: Props interface: [DEFINE_PROPS] State management: [REDUX/CONTEXT/HOOKS] Styling: [STYLED_COMPONENTS/NATIVE_STYLES] Platform considerations: [IOS/ANDROID/BOTH] Features: - [LIST_FEATURES] - [LIST_FEATURES] Include TypeScript definitions and usage examples.
22. iOS Swift Implementation
Implement [FEATURE] in Swift for iOS. Requirements: Architecture: [MVC/MVVM/VIPER] UI Framework: [UIKIT/SWIFTUI] Data persistence: [CORE_DATA/REALM] Network layer: [URLSESSION/ALAMOFIRE] Include: - ViewController implementation - Model definitions - Network service layer - Unit tests - UI snapshots
23. Android Kotlin Implementation
Build [FEATURE] in Kotlin for Android. Architecture: Pattern: [MVVM/MVP/MVI] UI: [VIEWS/COMPOSE] Dependency injection: [DAGGER/HILT] Database: [ROOM/SQLITE] Include: - Activity/Fragment implementation - ViewModel with LiveData/Flow - Repository layer - Data entities - Integration tests
Web Development
24. React Component Architecture
Design a React component architecture for [FEATURE]. Include: Component hierarchy: [TREE_STRUCTURE] State management: [REDUX/ZUSTAND/CONTEXT] Styling approach: [CSS_MODULES/STYLED_COMPONENTS] Performance optimization: [MEMO/CALLBACK/REACT.QUERY] Features: - [LIST_FEATURES] - [LIST_FEATURES] Generate component files with TypeScript interfaces.
25. Next.js API Route
Create a Next.js API route for [ENDPOINT]. Include: HTTP Method: [GET/POST/PUT/DELETE] Authentication: [JWT/SESSION/NONE] Validation: [ZOD/YUP/JOI] Database: [PRISMA/MONGOOSE] Caching: [REDIS/MEMORY] Request handling: - Input validation - Business logic - Error handling - Response formatting Include middleware for authentication and rate limiting.
26. Vue.js Composition API
Implement [FEATURE] using Vue 3 Composition API. Include: Reactive state: [REF/REACTIVE] Computed properties: [DEFINITIONS] Lifecycle hooks: [ONMOUNT/ONUNMOUNT] Component communication: [PROPS/EMITS/PROVIDE/INJECT] Features: - [LIST_FEATURES] - [LIST_FEATURES] Include TypeScript definitions and testing setup.
Data Science & ML
27. Data Analysis Pipeline
Create a data analysis pipeline in Python. Steps: Data sources: [LIST_SOURCES] Preprocessing: [CLEANING/TRANSFORMATION] Analysis: [STATISTICAL/MACHINE_LEARNING] Visualization: [PLOTS/CHARTS] Output: [REPORTS/DASHBOARDS] Libraries: [PANDAS/NUMPY/SCIKIT-LEARN] Deployment: [STREAMLIT/FASTAPI/FLASK] Include error handling and logging.
28. Machine Learning Model
Build a [TYPE] model for [PROBLEM]. Dataset: [DESCRIPTION] Preprocessing: - Feature engineering - Handling missing values - Encoding categorical variables Model selection: [ALGORITHMS_TO_TRY] Evaluation metrics: [ACCURACY/PRECISION/RECALL] Hyperparameter tuning: [GRID/RANDOM/BAYESIAN] Include model serialization and inference code.
29. ETL Pipeline Design
Design an ETL pipeline for [DATA_SOURCE] to [DESTINATION]. Requirements: Data volume: [SIZE/FREQUENCY] Transformations: [LIST_TRANSFORMS] Quality checks: [VALIDATION_RULES] Error handling: [STRATEGIES] Monitoring: [METRICS] Technology stack: [AIRFLOW/PREFECT/SPARK] Storage: [S3/REDSHIFT/SNOWFLAKE] Scheduling: [CRON/EVENT-DRIVEN] Generate pipeline code and documentation.
Security & Compliance
30. Authentication System
Implement secure authentication for [APPLICATION]. Features: Methods: [PASSWORD/OAUTH/SAML] Multi-factor: [SMS/TOTP/BIOMETRIC] Session management: [JWT/SESSIONS] Password policies: [COMPLEXITY/EXPIRY] Rate limiting: [BRUTE_FORCE_PROTECTION] Framework: [LANGUAGE/FRAMEWORK] Database: [STORAGE_METHOD] Encryption: [ALGORITHMS] Include password reset and account recovery.
Conclusion
These 50 prompts represent the most valuable tools in a developer's arsenal. Start with the ones most relevant to your current projects, then expand to others as your needs grow.
Remember: the key to effective prompting is specificity. The more detailed your instructions, the better the results.
Additional Resources
Turn this guide into a workflow
Use FindMePrompt as your prompt operating system: pick a related prompt, customize the placeholders, run it in your LLM, then save the version that works for your team.
Browse copyable prompts