Prompt Library

Pre-populated prompts for common development tasks. Copy and customize for your needs.

All Prompts (222)

Code Review Expert

Code Review

Perform thorough code reviews focusing on best practices, security, and maintainability.

Review this code for: best practices, security vulnerabilities, performance issues, and maintainability. Provide specific suggestions.

Unit Test Generator

Testing

Create comprehensive unit tests with edge cases and mocking strategies.

Generate unit tests for this code. Include: happy path, edge cases, error scenarios, and mocking for dependencies.

API Design Consultant

API Design

Design RESTful APIs following best practices with proper endpoint structure.

Help me design a REST API for this feature. Suggest endpoints, request/response schemas, status codes, and error handling.

Performance Analyzer

Performance

Analyze code performance and suggest optimizations for bottlenecks.

Analyze this code for performance issues. Identify bottlenecks, suggest optimizations, and explain the expected improvements.

Schema Validator

Data

Validate JSON schemas and suggest improvements for data structures.

Review this JSON schema. Check for completeness, suggest validation rules, and recommend improvements.

Error Handler Builder

Error Handling

Create robust error handling strategies with user-friendly messages.

Design error handling for this code. Include: try-catch blocks, error messages, logging, and recovery strategies.

Refactoring Assistant

Refactoring

Refactor code for better readability, maintainability, and performance.

Refactor this code to improve: readability, maintainability, performance, and adherence to design patterns.

Integration Test Builder

Testing

Create integration tests that validate system components working together.

Generate integration tests for these components. Include: setup, teardown, data mocking, and assertion strategies.

Security Auditor

Security

Identify security vulnerabilities and suggest hardening measures.

Audit this code for security issues. Check for: injection attacks, authentication flaws, data exposure, and suggest fixes.

TypeScript Type Generator

TypeScript

Generate TypeScript types and interfaces from data structures.

Generate TypeScript types for this data structure. Include: interfaces, types, enums, and utility types as needed.

Regex Pattern Builder

Utilities

Create and explain regex patterns for various validation scenarios.

Create a regex pattern for this validation requirement. Explain each part and provide test cases.

Database Migration Writer

Database

Write safe database migrations with rollback strategies.

Create a database migration for this schema change. Include: up/down migrations, data preservation, and rollback strategy.

Component Architecture

Frontend

Design React component architecture with proper state management.

Design component architecture for this feature. Include: component hierarchy, props, state management, and data flow.

CLI Tool Helper

CLI

Build command-line tools with argument parsing and help documentation.

Help me build a CLI tool for this task. Include: argument parsing, commands, options, help text, and error handling.

Git Workflow Designer

DevOps

Design Git workflows and branching strategies for teams.

Design a Git workflow for this project. Include: branching strategy, commit conventions, PR process, and release workflow.

Algorithm Optimizer

Algorithms

Optimize algorithms for time and space complexity.

Analyze this algorithm for time/space complexity. Suggest optimizations and provide an improved implementation.

Unit Testing - Java

Testing

Generate comprehensive JUnit unit tests with high coverage, mocking, and edge-case validation.

You are a Senior Software Engineer specializing in writing high-coverage unit tests with deep expertise in testability, mocking, clean code practices, and edge-case validation. Generate comprehensive JUnit unit tests for the following Java class or method: Code: {paste code here} Guidelines: • Use JUnit 5 • Include positive, negative, boundary, and exception cases • Mock external dependencies using Mockito • Follow the Arrange-Act-Assert structure • Aim for 90%+ code coverage • Suggest improvements if the code is not easily testable Output format: 1. Imports 2. Test class 3. Individual test methods with explanations 4. Coverage summary 5. Missing edge cases (if any)

Unit Testing - JavaScript / TypeScript (Core Logic)

Testing

Write high-quality Jest unit tests for non-UI logic such as utils, services, and pure functions.

You are a Senior Software Engineer specializing in writing high-coverage unit tests with deep expertise in testability, mocking, clean code practices, and edge-case validation. Write high-quality Jest unit tests for the following JavaScript/TypeScript code (non-UI logic such as utils, services, pure functions, etc.): Code: {paste code} Requirements: • Use Jest as the test runner • Focus on business logic, pure functions, helpers, or services (non-UI) • Include assertions for valid, invalid, and boundary inputs • Mock external dependencies (HTTP clients, DB/SDK, timers, etc.) • Cover asynchronous behavior (promises, async/await) where applicable • Ensure coverage > 90% Output format: - Test file with imports - Individual test blocks with clear, descriptive names - Mocks/spies/stubs setup - Notes on untestable areas or recommended refactors

Unit Testing - React Components

Testing

Write Jest + React Testing Library unit tests for React components with user interaction testing.

You are a Senior Software Engineer specializing in writing high-coverage unit tests with deep expertise in testability, mocking, clean code practices, and edge-case validation. Write Jest + React Testing Library unit tests for the following React component(s): Component Code: {paste React component(s)} Context: - State management: {Redux / Zustand / Context API / none} - Routing: {React Router / Next.js / none} Requirements: • Use Jest with React Testing Library • Test rendering, props, state changes, callbacks and side-effects • Interact with the component like a real user (click, type, select, etc.) • Cover different props combinations and edge cases • Mock network calls, context providers, and external modules as needed Output format: 1. Test file with imports 2. Test cases grouped by behavior (rendering, interactions, conditional UI) 3. Usage of RTL queries (getByRole, getByText, etc.) and user-event 4. Notes on improving component testability (if relevant)

Unit Testing - Angular Components & Services

Testing

Generate Angular unit tests using TestBed with Jasmine/Karma for components and services.

You are a Senior Software Engineer specializing in writing high-coverage unit tests with deep expertise in testability, mocking, clean code practices, and edge-case validation. Generate Angular unit tests for the following component and/or service: Angular Code: {paste component/service} Angular Version: {vX.X} Requirements: • Use Angular TestBed with Jasmine and Karma (or Jest if specified) • For components: test template bindings, inputs, outputs, DOM changes, and interactions • For services: test business logic, HTTP calls (HttpTestingController), and error handling • Mock dependencies using TestBed providers or spies • Include positive, negative, boundary and error scenarios Output format: 1. Test module/TestBed setup 2. Individual test cases for each behavior 3. Mock/stub configuration for services and HTTP 4. Suggestions for refactoring to improve testability (if needed)

Unit Testing - Vue.js Components

Testing

Write unit tests for Vue.js components using Vue Test Utils with Vitest or Jest.

You are a Senior Software Engineer specializing in writing high-coverage unit tests with deep expertise in testability, mocking, clean code practices, and edge-case validation. Write unit tests for the following Vue.js component(s): Vue Component Code: {paste component} Stack: - Vue Version: {2 / 3} - Test Runner: {Vitest / Jest} - State Management: {Vuex / Pinia / none} Requirements: • Use Vue Test Utils with Vitest or Jest • Test rendering, props, events, emitted outputs, and reactive state • Interact with the component (clicks, inputs, selects, etc.) • Mock HTTP calls, global plugins, and stores where required • Cover different prop values and edge conditions Output format: 1. Test setup (mount/shallowMount, plugins, stores) 2. Test cases grouped by feature/behavior 3. Emitted events and DOM assertion examples 4. Recommendations for improving component testability (if applicable)

Unit Testing - Python

Testing

Generate complete Pytest unit tests with fixtures, mocking, and high branch coverage.

You are a Senior Software Engineer specializing in writing high-coverage unit tests with deep expertise in testability, mocking, clean code practices, and edge-case validation. Generate complete Pytest unit tests for the following code: Code: {paste here} Guidelines: • Use pytest (no unittest boilerplate) • Include fixtures for reusable test data • Mock external dependencies using unittest.mock or pytest-mock • Validate positive, negative, edge, and exception flows • Ensure high branch coverage Output format: 1. Imports 2. Fixtures 3. Test cases 4. Coverage summary 5. Suggested improvements to make code more testable

Unit Testing - C#

Testing

Write robust xUnit unit tests with Moq mocking and comprehensive scenario coverage.

You are a Senior Software Engineer specializing in writing high-coverage unit tests with deep expertise in testability, mocking, clean code practices, and edge-case validation. Write robust xUnit unit tests for the following C# code: Code: {paste code here} Guidelines: • Use xUnit test framework • Mock dependencies using Moq • Include expected success, failure, boundary and exception scenarios • Follow Arrange-Act-Assert structure • Validate thrown exceptions using Assert.Throws Output format: - Test class with imports - Individual test methods with meaningful names - Mock configuration - Missing edge case recommendations

Unit Testing - Go

Testing

Write Go unit tests with table-driven tests, mocking, and concurrency coverage.

You are a Senior Software Engineer specializing in writing high-coverage unit tests with deep expertise in testability, mocking, clean code practices, and edge-case validation. Write Go unit tests for the following code: Code: {paste here} Guidelines: • Use the Go testing package • Prefer table-driven tests • Mock external dependencies using gomock or lightweight test doubles • Cover success, failure, boundary, and concurrency (if applicable) • Add benchmarks if relevant Output format: - _test.go file content - Table-driven test blocks - Helper functions / mocks - Improvement notes (if needed)

Unit Testing - PHP

Testing

Generate complete PHPUnit unit tests with Mockery and comprehensive flow validation.

You are a Senior Software Engineer specializing in writing high-coverage unit tests with deep expertise in testability, mocking, clean code practices, and edge-case validation. Generate complete PHPUnit unit tests for the following PHP code: Code: {paste code here} Guidelines: • Use PHPUnit 10 • Mock dependencies using Mockery • Include positive, negative, edge and exception flows • Validate return values, state changes, and DB/API interactions (mocked) Output format: - Test class - Test methods with clear descriptive names - Mock configuration - Remaining edge case suggestions

Unit Testing - Ruby

Testing

Write RSpec unit tests with describe/context structure and comprehensive path coverage.

You are a Senior Software Engineer specializing in writing high-coverage unit tests with deep expertise in testability, mocking, clean code practices, and edge-case validation. Write RSpec unit tests for the following Ruby code: Code: {paste here} Guidelines: • Use RSpec 3 • Follow describe / context / it structure • Use mocks/stubs via rspec-mocks • Cover happy, sad, edge and exception paths • Recommend refactorings if the code is difficult to test Output format: - RSpec test file - Blocks grouped by behavior - Mock/stub usage - List of uncovered edge cases

Unit Testing - Swift

Testing

Generate complete Swift unit tests with XCTest, protocol-based mocks, and async coverage.

You are a Senior Software Engineer specializing in writing high-coverage unit tests with deep expertise in testability, mocking, clean code practices, and edge-case validation. Generate complete Swift unit tests for the following code: Code: {paste code} Guidelines: • Use XCTest framework • Mock dependencies using protocol-based stubs/mocks • Ensure success, failure, edge, and async cases are covered • Validate business logic and state transitions Output format: 1. Test class 2. Individual test methods 3. Mocks/Stubs 4. Coverage notes 5. Recommendations for improving testability

Integration Testing - API Integration

Testing

Design and improve API integration tests with comprehensive validation of contracts, flows, and edge cases.

You are a Senior Software Engineer and QA Automation Specialist with deep expertise in microservices, CI/CD pipelines, API contracts, data flows, mocking/stubbing, business workflows, and edge-case validation. Design and improve API integration tests for the following APIs: APIs / Endpoints involved: {list endpoints and their purpose} Context: - System / Product: {describe} - Tech Stack: {backend language, framework, API gateway if any} - Auth Method: {JWT / OAuth2 / API key / Session} Goals: • Validate request/response correctness, status codes, and error handling • Validate data contracts (required fields, types, constraints) • Cover integration flows across multiple dependent APIs • Include positive, negative, boundary, and failure-path scenarios Output format: 1. List of integration test scenarios grouped by flow 2. For each scenario, specify: - Pre-conditions - API calls sequence (with dependencies) - Expected responses and side effects - Validation points (DB / cache / queues / logs if applicable) 3. Suggestions for automating these tests (tooling, framework, and structure) 4. Additional edge cases or resilience tests you recommend

Integration Testing - Microservices

Testing

Create integration testing approach for microservices with service-to-service communication validation.

You are a Senior Software Engineer and QA Automation Specialist with deep expertise in microservices, CI/CD pipelines, API contracts, data flows, mocking/stubbing, business workflows, and edge-case validation. Create an integration testing approach for the microservices described below: Microservices and Responsibilities: {list services and what they do} Data Flow / Events: {describe or paste diagrams if available} Goals: • Validate service-to-service communication (sync and async) • Validate event/queue/topic flows (Kafka/RabbitMQ/etc.) • Ensure data consistency across services and databases • Identify failure points and retry/compensation behavior Output format: 1. Integration test strategy tailored to these microservices 2. Test scenarios grouped by business flow (order, payment, notification, etc.) 3. For each scenario, specify: - Services involved - APIs/events used - Test data and pre-conditions - Expected cross-service behavior and data consistency checks 4. Suggestions for automation stack (test framework, mocking strategy, environment setup) 5. Recommended resilience tests (time-outs, partial failures, retries, idempotency)

Integration Testing - Database Integration

Testing

Design integration tests for database interactions with transaction and constraint validation.

You are a Senior Software Engineer and QA Automation Specialist with deep expertise in microservices, CI/CD pipelines, API contracts, data flows, mocking/stubbing, business workflows, and edge-case validation. Design integration tests for code that interacts with the database as described below: Code / Modules: {paste code or describe modules} Database Details: - Type: {PostgreSQL / MySQL / MongoDB / etc.} - Key Tables/Collections: {list} - Important Constraints: {FKs, unique, not null, etc.} Goals: • Verify that queries and ORM logic work correctly end-to-end • Validate transactions, rollback behavior, and isolation expectations • Ensure constraints and indexes are respected • Cover migration/rollback scenarios if relevant Output format: 1. List of integration test scenarios involving DB operations 2. For each scenario include: - Preloaded test data (seed) - Operation(s) under test - Expected DB state before and after - Rollback / error handling expectations 3. Recommended tooling and patterns (test containers, in-memory DB, fixtures) 4. Suggestions to keep tests stable, performant, and CI-friendly

...
Showing 1 - 30 of 222 prompts