AI Prompts Library
Curated collection of expert prompts for coding, writing, marketing, image generation, and more
Have a great prompt? Submit it to the library →
Popular Tags:
Regex Pattern Builder and Explainer
You are a regex expert who creates, explains, and debugs regular expressions. Help with the described pattern matching need. **What to Match:** [DESCRIBE WHAT YOU WANT TO MATCH] **Programming Language:** [JavaScript / Python / Go / Java / PHP / Ruby / .NET] **Sample Input:** [PROVIDE SAMPLE STRINGS THAT SHOULD AND SHOULD NOT MATCH] **Provide:** 1. **The Regex Pattern:** - Provide the complete pattern with proper delimiters for the language - Include necessary flags (global, case-insensitive, multiline) - If the pattern has capture groups, explain what each group captures 2. **Visual Breakdown:** - Break the regex into segments - Explain each segment in plain English - Use a character-by-character walkthrough for complex parts - Show the pattern as a railroad diagram description 3. **Test Cases:** - 5 strings that SHOULD match (with explanation of what is captured) - 5 strings that should NOT match (with explanation of why) - Edge cases to be aware of 4. **Usage Example:** - Complete code snippet showing the regex in use - Include: matching, extracting groups, replacing, and splitting examples - Show how to handle the match result properly 5. **Performance Notes:** - Warn about catastrophic backtracking risks - Suggest non-capturing groups where capture is not needed - Recommend possessive quantifiers or atomic groups if supported - Alternative approach if regex is not the best tool for this job 6. **Common Variations:** - Provide a stricter version that rejects more edge cases - Provide a more lenient version that accepts more formats - Show how to make the pattern Unicode-aware if relevant **Output**: The regex pattern, visual explanation, test cases, and ready-to-use code snippet.
Input validation, text parsing, data extraction, log analysis, search and replace
System Design Interview Prep
You are a senior system design interviewer at a top tech company. Walk through a complete system design for the described problem.
**Design Problem:** [e.g., Design Twitter, Design a URL shortener, Design a chat system, Design a ride-sharing service]
**Scope:** [What specific features to focus on]
**Scale:** [Expected users, requests per second, data volume]
**Walk through the design using this structure:**
1. **Requirements Clarification (5 minutes):**
- Functional requirements (what the system does)
- Non-functional requirements (latency, availability, consistency, durability)
- Constraints and assumptions
- Back-of-envelope calculations:
- Storage requirements (per day, per year)
- Bandwidth requirements
- Read vs. write ratio
- QPS (queries per second) for each operation
2. **High-Level Design (10 minutes):**
- System architecture diagram description (components and data flow)
- API design (REST endpoints with request/response schemas)
- Data model (key entities, relationships, storage choice justification)
- Choose appropriate technologies for each component with reasoning
3. **Deep Dive (15 minutes):**
- Database design: Schema, sharding strategy, replication, indexing
- Caching strategy: What to cache, cache invalidation, cache-aside vs. write-through
- Message queues: When and why to use async processing
- CDN strategy for static content
- Search functionality (if applicable)
- Notification system (if applicable)
4. **Scalability (5 minutes):**
- Horizontal scaling strategy
- Database scaling (read replicas, sharding, partitioning)
- Load balancing (algorithm choice, health checks)
- Rate limiting and throttling
- Auto-scaling policies
5. **Reliability and Fault Tolerance (5 minutes):**
- Single points of failure and how to eliminate them
- Replication and redundancy
- Graceful degradation strategy
- Circuit breaker patterns
- Data consistency model (strong vs. eventual)
6. **Monitoring and Operations:**
- Key metrics to monitor
- Alerting strategy
- Deployment strategy (blue-green, canary)
**Output**: Complete system design walkthrough with diagrams, calculations, and trade-off discussions.
System design interview preparation, architecture reviews, technical planning
Pull Request Description Writer
You are a senior engineer who writes clear, thorough pull request descriptions that make code review efficient and productive. Given a diff or description of changes, write a comprehensive PR description. **Changes:** [DESCRIBE CHANGES or PASTE DIFF] **Related Issue/Ticket:** [TICKET_NUMBER or DESCRIPTION] **Repository:** [REPO_NAME] **Type of Change:** [Feature / Bug Fix / Refactor / Hotfix / Dependency Update / Documentation] **Generate a PR description with:** 1. **Title:** (Conventional format) - `feat:`, `fix:`, `refactor:`, `docs:`, `test:`, `chore:` - Clear, concise summary under 72 characters 2. **Summary:** - 2-3 sentences explaining WHAT changed and WHY - Link to issue/ticket - Business context for the change 3. **Changes Made:** - Bullet list of specific changes, grouped by file or component - For each change: what was modified and why - Highlight any architectural decisions made 4. **How to Test:** - Step-by-step manual testing instructions - Expected behavior for each test case - Edge cases to verify - Test data setup if needed 5. **Screenshots/Recordings:** - Description of visual changes (suggest what screenshots to add) - Before/after comparison points 6. **Checklist:** - [ ] Tests added/updated for these changes - [ ] Documentation updated if needed - [ ] No breaking changes (or breaking changes documented) - [ ] Database migrations are reversible - [ ] Feature flag added for gradual rollout - [ ] Accessibility checked - [ ] Performance impact assessed 7. **Reviewer Notes:** - Areas that need special attention during review - Questions for the reviewer - Known trade-offs or technical debt introduced - Deployment considerations **Output**: Complete PR description in Markdown, ready to paste into GitHub/GitLab.
Writing PR descriptions, improving code review quality, team communication
API Documentation Generator (OpenAPI/Swagger)
Generate comprehensive API documentation for [API NAME].
**API Details:**
- Base URL: [URL]
- Authentication: [TYPE]
- Version: [VERSION]
**For Each Endpoint:**
```yaml
/api/endpoint:
method:
summary: Brief description
description: Detailed explanation
parameters:
- name: param
in: query/path/header
required: true/false
schema:
type: string/number/etc
description: Parameter purpose
requestBody:
content:
application/json:
schema:
type: object
properties:
field: type
responses:
'200':
description: Success response
content:
application/json:
example:
{data}
'400':
description: Error response
```
**Include:**
- Authentication guide
- Rate limiting info
- Error codes
- Code examples (cURL, JavaScript, Python)
- Changelog
- Postman collection
API documentation, developer onboarding
Git Commit Message Generator
Generate semantic commit messages following Conventional Commits standard. **Changes Made:** [DESCRIBE YOUR CHANGES] **Generate commits in format:** ``` type(scope): subject body (optional) footer (optional) ``` **Types:** - feat: New feature - fix: Bug fix - docs: Documentation - style: Formatting, missing semi-colons, etc - refactor: Code refactoring - perf: Performance improvement - test: Adding tests - chore: Maintenance tasks **Guidelines:** - Subject: Imperative mood, lowercase, no period, max 50 chars - Body: Explain what and why (not how), max 72 chars per line - Footer: Breaking changes, issue references **Examples:** ``` feat(auth): add OAuth2 Google login Implements Google OAuth2 authentication flow with proper token management and refresh logic. Closes #123 ```
Git workflows, version control, documentation
Database Migration Script Generator
Generate database migration script for [DATABASE: PostgreSQL/MySQL/MongoDB]. **Migration Type:** - [ ] Create table - [ ] Alter table - [ ] Add column - [ ] Drop column - [ ] Add index - [ ] Data migration **Details:** [DESCRIBE SCHEMA CHANGES] **Generate:** 1. **Up Migration** (apply changes) 2. **Down Migration** (rollback) 3. **Data Migration** (if needed) 4. **Validation Queries** **Requirements:** - Idempotent (can run multiple times safely) - Transaction-wrapped - Rollback-safe - Include comments - Handle edge cases - Test data examples - Performance considerations for large tables **Also provide:** - Pre-migration checklist - Post-migration validation - Backup recommendations
Database migrations, schema changes, data migrations
Regex Pattern Generator & Explainer
Create and explain regular expression patterns. **Task**: [DESCRIBE WHAT YOU WANT TO MATCH] **Examples of valid inputs:** - [EXAMPLE 1] - [EXAMPLE 2] **Examples of invalid inputs:** - [EXAMPLE 1] - [EXAMPLE 2] **Generate:** 1. **Regex Pattern** ``` /pattern/flags ``` 2. **Explanation** (step-by-step breakdown) - `^` - Start of string - `[a-z]` - Lowercase letter - etc. 3. **Flags Explained** - `g` - Global match - `i` - Case insensitive - `m` - Multiline 4. **Test Cases** ``` Should match: ✓ "example1" ✓ "example2" Should not match: ✗ "invalid1" ✗ "invalid2" ``` 5. **Code Examples** - JavaScript - Python - PHP 6. **Performance Tips** - Optimization suggestions - Common pitfalls - Alternative approaches
Input validation, data parsing, text processing
Chrome Extension Complete Builder
Build Chrome extension [NAME]: **manifest.json** (v3) **popup.html/js** (UI & logic) **content.js** (page interaction) **background.js** (service worker) **styles.css** Include: - Complete working code - Permissions setup - Installation guide - Testing steps - Store submission guide - Security best practices Production-ready, documented.
Browser extensions, productivity tools
Webhook Handler with Security
Webhook endpoint for [SERVICE A → SERVICE B]: **Endpoint** - POST handler **Signature Verification** - HMAC validation, timestamp check **Payload Processing** - Validation, transformation, error handling **Idempotency** - Prevent duplicate processing **Retry Logic** - Exponential backoff **Monitoring** - Logging, alerts, metrics Include: Full code, tests, deployment.
API integrations, automation
Dockerfile Multi-Stage Optimizer
Optimize Dockerfile: **Multi-stage Build** - Builder + production stages **Layer Caching** - Dependencies first, code last **Security** - Non-root user, minimal base image **Size Reduction** - Alpine Linux, .dockerignore **Performance** - Parallel builds, BuildKit Include: Optimized Dockerfile, .dockerignore, docker-compose.yml, build commands, size comparison.
Containerization, Docker optimization
API Error Response Designer
Design comprehensive API error response:
```json
{
"error": {
"code": "ERROR_CODE",
"message": "Human-readable error message",
"details": "Detailed explanation",
"timestamp": "2025-10-02T02:00:00Z",
"request_id": "uuid",
"documentation_url": "https://docs.example.com/errors/ERROR_CODE",
"field_errors": [
{
"field": "email",
"message": "Invalid email format",
"code": "INVALID_FORMAT"
}
]
}
}
```
**Error Categories**:
- 4xx Client Errors: Authentication, validation, not found
- 5xx Server Errors: Internal, service unavailable, timeout
**Best Practices**:
- Use consistent error codes
- Provide actionable messages
- Include request tracking
- Add documentation links
- Never expose sensitive data
API development, error handling, developer experience
Performance Optimization Checklist
Optimize [WEB APP/API/DATABASE] performance: **Frontend Optimization**: - [ ] Minify CSS/JS/HTML - [ ] Compress images (WebP, lazy loading) - [ ] Use CDN for static assets - [ ] Implement code splitting - [ ] Add browser caching headers - [ ] Reduce HTTP requests - [ ] Optimize fonts (font-display: swap) **Backend Optimization**: - [ ] Database query optimization - [ ] Add database indexes - [ ] Implement caching (Redis/Memcached) - [ ] Use connection pooling - [ ] Add rate limiting - [ ] Optimize API responses (pagination, partial) - [ ] Enable gzip compression **Database Optimization**: - [ ] Analyze slow queries (EXPLAIN) - [ ] Add composite indexes - [ ] Denormalize where beneficial - [ ] Implement query caching - [ ] Optimize table structure - [ ] Regular VACUUM/ANALYZE **Monitoring**: - [ ] Set up APM (New Relic, DataDog) - [ ] Track Core Web Vitals - [ ] Monitor error rates - [ ] Set performance budgets
Performance audits, optimization sprints, speed improvements
No Prompts Found
Try adjusting your filters or search query.
Want Custom Prompts?
Get personalized AI prompts tailored to your specific needs and workflow.
Contact Us