Skip to main content

Dev Prompts

Prompts for software development

Review
Code Review

Get a thorough code review

Review the following code for:
1. Bugs and potential issues
2. Performance optimizations
3. Security vulnerabilities
4. Code style and best practices
5. Readability improvements

Provide specific suggestions with examples.

```[language]
[code]
```
Testing
Write Unit Tests

Generate comprehensive unit tests

Write comprehensive unit tests for the following code using [testing framework].

Include:
- Happy path tests
- Edge cases
- Error handling tests
- Mock setup if needed

Code to test:
```[language]
[code]
```
Refactoring
Refactor Code

Improve code structure and quality

Refactor the following code to:
1. Improve readability
2. Follow [language] best practices
3. Apply SOLID principles where applicable
4. Optimize performance
5. Add proper error handling

Explain each change you make.

```[language]
[code]
```
Debugging
Debug Helper

Help identify and fix bugs

Help me debug this issue:

Expected behavior: [expected]
Actual behavior: [actual]
Error message (if any): [error]

Code:
```[language]
[code]
```

Provide:
1. Likely cause of the bug
2. Step-by-step debugging approach
3. Suggested fix with explanation
Architecture
API Design

Design RESTful API endpoints

Design a RESTful API for [feature/resource].

Include:
- Endpoint URLs and HTTP methods
- Request/response schemas (JSON)
- Authentication requirements
- Error response formats
- Rate limiting considerations

Follow REST best practices and include OpenAPI/Swagger documentation format.
Database
SQL
SQL Query Builder

Generate optimized SQL queries

Write an optimized SQL query for the following requirement:

[Requirement]

Tables available:
[Table schemas]

Include:
- The query
- Explanation of the approach
- Index recommendations
- Performance considerations
Utilities
Regex Generator

Create and explain regex patterns

Create a regex pattern to [requirement].

Provide:
1. The regex pattern
2. Explanation of each part
3. Test cases that should match
4. Test cases that should NOT match
5. Common edge cases to consider

Language/flavor: [language]
TypeScript
TypeScript
TypeScript Types

Generate TypeScript type definitions

Generate TypeScript type definitions for:

[API response / data structure description]

Include:
- Proper interface/type definitions
- Optional fields where appropriate
- Union types if needed
- Generic types if applicable
- JSDoc comments for documentation
Git
Commit Message

Write conventional commit messages

Write a conventional commit message for the following changes:

[Changes description]

Follow the format: type(scope): description

Types: feat, fix, docs, style, refactor, perf, test, chore

Include:
- Subject line (50 chars max)
- Body with details (if needed)
- Breaking changes (if any)
- Related issue references
DevOps
Dockerfile Generator

Create optimized Dockerfiles

Create an optimized Dockerfile for a [language/framework] application.

Requirements:
- [List requirements]

Include:
- Multi-stage build if beneficial
- Security best practices
- Proper caching of layers
- Non-root user
- Health check
- Comments explaining each step