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 →

Coding

Security Audit Checklist (OWASP)

Optimized for: gpt-4o • TEXT
Security audit following OWASP Top 10:

**1. Injection Flaws**
- [ ] Use parameterized queries
- [ ] Validate & sanitize all inputs
- [ ] Use ORM safely

**2. Broken Authentication**
- [ ] Implement MFA
- [ ] Use secure session management
- [ ] Hash passwords (bcrypt/Argon2)
- [ ] Implement rate limiting

**3. Sensitive Data Exposure**
- [ ] Encrypt data at rest & in transit (TLS 1.3)
- [ ] Don't log sensitive data
- [ ] Use secure key management

**4. XML External Entities (XXE)**
- [ ] Disable XML external entity processing
- [ ] Use secure XML parsers

**5. Broken Access Control**
- [ ] Verify permissions server-side
- [ ] Implement RBAC/ABAC
- [ ] Test authorization logic

**6. Security Misconfiguration**
- [ ] Remove default credentials
- [ ] Disable directory listing
- [ ] Keep dependencies updated
- [ ] Use security headers (CSP, HSTS)

**7. XSS (Cross-Site Scripting)**
- [ ] Escape output
- [ ] Use Content Security Policy
- [ ] Sanitize HTML inputs

**8. Insecure Deserialization**
- [ ] Validate serialized data
- [ ] Use signing/encryption

**9. Using Components with Known Vulnerabilities**
- [ ] Regular dependency audits
- [ ] Automated security scanning
- [ ] Subscribe to security advisories

**10. Insufficient Logging & Monitoring**
- [ ] Log security events
- [ ] Monitor for anomalies
- [ ] Set up alerting

Security audits, penetration testing prep, compliance

Coding

SQL Schema Design Best Practices

Optimized for: gpt-4o • TEXT
Design database schema for [APPLICATION]:

**Naming Conventions**:
- Tables: plural, snake_case (users, order_items)
- Columns: singular, snake_case (user_id, created_at)
- Primary keys: id (integer, auto-increment)
- Foreign keys: [table_singular]_id

**Standard Columns** (all tables):
- id: Primary key
- created_at: Timestamp
- updated_at: Timestamp
- deleted_at: Soft deletes (optional)

**Relationships**:
- One-to-Many: Foreign key in child table
- Many-to-Many: Junction table
- One-to-One: Foreign key with UNIQUE constraint

**Indexes**:
- Primary key (automatic)
- Foreign keys
- Frequently queried columns
- Composite indexes for multi-column queries

**Data Types**:
- Use appropriate sizes (VARCHAR vs TEXT)
- ENUM for fixed options
- JSON for flexible data (use sparingly)
- UUID for distributed systems

**Constraints**:
- NOT NULL where appropriate
- UNIQUE for natural keys
- CHECK for validation
- DEFAULT values

**Normalization**:
- 3NF for OLTP
- Denormalize for read-heavy (with care)
- Avoid EAV anti-pattern

**Example Schema**:
```sql
CREATE TABLE users (
  id SERIAL PRIMARY KEY,
  email VARCHAR(255) UNIQUE NOT NULL,
  password_hash VARCHAR(255) NOT NULL,
  created_at TIMESTAMP DEFAULT NOW(),
  updated_at TIMESTAMP DEFAULT NOW()
);

CREATE INDEX idx_users_email ON users(email);
```

Database design, schema planning, data modeling

Coding

Accessibility (a11y) Audit Checklist

Optimized for: general • TEXT
Website accessibility audit (WCAG 2.1 AA):

**Perceivable**:
- [ ] Alt text for images
- [ ] Captions for videos
- [ ] Color contrast ≥4.5:1 (text), ≥3:1 (UI)
- [ ] Don't rely on color alone
- [ ] Responsive text sizing

**Operable**:
- [ ] Keyboard navigation (no mouse required)
- [ ] Skip to main content link
- [ ] Focus indicators visible
- [ ] No keyboard traps
- [ ] Sufficient time for tasks
- [ ] Pause/stop animations

**Understandable**:
- [ ] lang attribute on html
- [ ] Consistent navigation
- [ ] Clear error messages
- [ ] Form labels & instructions
- [ ] Predictable behavior

**Robust**:
- [ ] Valid HTML
- [ ] ARIA landmarks
- [ ] Semantic HTML (header, nav, main, footer)
- [ ] ARIA labels where needed
- [ ] Screen reader tested

**Forms**:
- [ ] Label associated with input
- [ ] Required fields marked
- [ ] Error identification & suggestions
- [ ] Fieldset & legend for groups

**Interactive Elements**:
- [ ] Button vs link (semantic)
- [ ] Tab order logical
- [ ] Modal focus management
- [ ] Disabled state communicated

**Testing Tools**:
- [ ] axe DevTools
- [ ] WAVE
- [ ] Lighthouse
- [ ] Screen reader (NVDA/JAWS/VoiceOver)
- [ ] Keyboard only navigation

**Success Criteria**: All Level A & AA criteria met

Accessibility audits, WCAG compliance, inclusive design

Coding

Expert Code Reviewer with Security Focus

Optimized for: general • TEXT
You are an expert code reviewer with deep knowledge of security, performance, and best practices across multiple programming languages.

Your task is to review the following code and provide:
1. **Security Analysis**: Identify any security vulnerabilities (SQL injection, XSS, CSRF, authentication issues, etc.)
2. **Performance Review**: Highlight performance bottlenecks and suggest optimizations
3. **Code Quality**: Assess readability, maintainability, and adherence to best practices
4. **Bug Detection**: Point out logical errors, edge cases, and potential runtime issues
5. **Recommendations**: Provide specific, actionable improvements with code examples

For each issue found, specify:
- Severity (Critical, High, Medium, Low)
- Location (file, line number if available)
- Detailed explanation of the problem
- Concrete solution with improved code

Code to review:
[PASTE YOUR CODE HERE]

Pre-deployment code review, security audits, code quality assessment

Coding

Python Debugging Expert Assistant

Optimized for: gpt-4o • TEXT
You are an expert Python debugger with deep knowledge of common pitfalls, edge cases, and debugging strategies.

**Error/Issue:**
[DESCRIBE THE PROBLEM OR PASTE ERROR MESSAGE]

**Code:**
```python
[PASTE YOUR PYTHON CODE HERE]
```

**Environment:**
- Python version: [VERSION]
- Operating System: [OS]
- Dependencies: [LIST KEY PACKAGES]

**Expected Behavior:**
[WHAT SHOULD HAPPEN]

**Actual Behavior:**
[WHAT ACTUALLY HAPPENS]

**Please provide:**

1. **Root Cause Analysis**
   - Identify the exact source of the problem
   - Explain why it occurs
   - Note any misunderstandings of Python concepts

2. **Immediate Fix**
   - Provide corrected code with inline comments
   - Highlight the changes

3. **Best Practices**
   - Suggest improvements beyond just fixing the bug
   - Recommend better patterns or approaches
   - Add error handling if missing

4. **Prevention**
   - How to avoid this issue in the future
   - Testing approach for this scenario
   - Relevant Python idioms or patterns

5. **Additional Context**
   - Related Python gotchas
   - Performance considerations
   - Alternative implementations

Debug Python code, learn from errors, improve code quality, understand Python idioms

Coding

SQL Query Optimizer & Performance Tuner

Optimized for: gpt-4o • TEXT
Analyze and optimize the following SQL query for maximum performance.

**Current Query:**
```sql
[PASTE YOUR SQL QUERY HERE]
```

**Database Context:**
- Database System: [MySQL/PostgreSQL/SQL Server/Oracle]
- Table row counts: [TABLE1: X rows, TABLE2: Y rows]
- Current indexes: [LIST EXISTING INDEXES]
- Query execution time: [CURRENT TIME]
- Use case: [DESCRIPTION OF WHAT QUERY DOES]

**Performance Requirements:**
- Target execution time: [GOAL]
- Frequency: [How often this query runs]
- Data freshness needs: [Real-time/Near real-time/Can be cached]

**Please provide:**

1. **Performance Analysis**
   - Identify performance bottlenecks
   - Explain current query execution plan
   - Point out inefficient operations (full table scans, cartesian products, etc.)

2. **Optimized Query**
   - Rewritten query with improvements
   - Inline comments explaining changes
   - Alternative approaches if multiple solutions exist

3. **Indexing Strategy**
   - Recommended indexes to create
   - Explain which clauses each index helps
   - Consider trade-offs (write performance, storage)

4. **Additional Optimizations**
   - Partitioning recommendations
   - Caching opportunities
   - Database configuration tweaks
   - Query refactoring into multiple queries if beneficial

5. **Expected Performance Gain**
   - Estimated improvement
   - Explain why these changes help

6. **Monitoring & Maintenance**
   - What metrics to track
   - When to revisit the optimization

Database performance tuning, slow query optimization, scaling data-heavy applications

Want Custom Prompts?

Get personalized AI prompts tailored to your specific needs and workflow.

Contact Us