العودة للمدونة

مكتبة المتخصصين

Developer Prompt Library

مجموعة شاملة ومتطورة من الـ Prompts لمختلف المجالات، مصممة للمطورين والمهندسين

Code Analysis & Review

Full Code Review

Review this {{language}} code and provide: 1. Bugs or logical errors 2. Performance bottlenecks 3. Security vulnerabilities 4. Violations of SOLID/cle...

Code Analysis & Review

Quick Sanity Check

Give me a quick sanity check on this code: - Any obvious bugs? - Does the logic match the intent? - Any red flags? Code: {{code}}...

Code Analysis & Review

PR Review Simulation

Act as a senior backend engineer doing a pull request review. Be direct, opinionated, and concise. Flag anything you'd block the PR for. Context: {{p...

Code Analysis & Review

Complexity Analysis

Analyze the complexity of this code: Language: {{language}} Code: {{code}} Provide: 1. Time complexity (Big O) per function 2. Space complexity 3. W...

Code Analysis & Review

Dead Code Detection

Review this codebase/module for dead code: Language: {{language}} Code: {{code}} Identify: - Unused functions, variables, imports - Unreachable code...

Code Analysis & Review

Dependency Coupling Analysis

Analyze the coupling in this module: Code: {{code}} Identify: - Tight coupling between components - Hidden dependencies - Circular dependencies - Su...

Debugging & Error Fixing

Error Diagnosis

I'm getting this error in my {{language}} app: Error: {{error_message}} Stack trace: {{stack_trace}} Relevant code: {{code}} Explain what's causin...

Debugging & Error Fixing

Bug Hunt

This function isn't behaving as expected. Expected behavior: {{expected}} Actual behavior: {{actual}} Code: {{code}} Find the bug and explain why i...

Debugging & Error Fixing

Intermittent Bug (Flaky Issue)

I have a bug that doesn't happen consistently. Symptoms: {{symptoms}} Frequency: {{frequency}} Environment: {{environment}} Code: {{code}} List lik...

Debugging & Error Fixing

Memory Leak Investigation

I suspect a memory leak in this {{language}} service. Symptoms: {{symptoms}} Memory growth pattern: {{pattern}} Relevant code: {{code}} Identify lik...

Debugging & Error Fixing

Regression Analysis

This code worked before but broke after a recent change. What changed: {{change_description}} Before behavior: {{before}} After behavior: {{after}} ...

Debugging & Error Fixing

Environment-Specific Bug

This bug only happens in {{environment}} (not locally). Error: {{error}} Local config: {{local_config}} {{environment}} config: {{env_config}} What ...

API Design

REST API Design

Design a RESTful API for the following feature: Feature: {{feature_description}} Entities involved: {{entities}} Business rules: {{rules}} Provide: ...

API Design

API Endpoint Review

Review this API endpoint design: {{api_spec}} Check for: 1. REST conventions compliance 2. Naming consistency 3. Missing edge case handling 4. Secur...

API Design

API Contract (OpenAPI snippet)

Write an OpenAPI 3.0 snippet for this endpoint: Method: {{method}} Path: {{path}} Description: {{description}} Request body: {{request_body}} Possibl...

API Design

API Pagination Design

Design a pagination strategy for this API endpoint: Endpoint: {{endpoint}} Dataset size: {{size}} Sort requirements: {{sort}} Client type: {{web | mo...

API Design

API Versioning Strategy

Design a versioning strategy for this API: Current state: {{current_version_and_clients}} Planned breaking changes: {{changes}} Client migration time...

API Design

GraphQL Schema Design

Design a GraphQL schema for: Domain: {{domain}} Main entities: {{entities}} Key operations: {{queries_and_mutations}} Auth requirements: {{auth}} Pr...

API Design

Webhook Design

Design a webhook system for: Events to emit: {{events}} Consumers: {{consumers}} Reliability requirements: {{sla}} Provide: payload structure, deliv...

Database & Query Optimization

Query Review

Analyze this {{db_type}} query: {{query}} Table schemas: {{schemas}} Current execution time: {{exec_time}} Expected load: {{load}} Provide: 1. Wha...

Database & Query Optimization

Schema Design

Design a database schema for: Use case: {{use_case}} Entities: {{entities}} Key relationships: {{relationships}} Scale expectations: {{scale}} Provi...

Database & Query Optimization

N+1 Query Detection

Review this code for N+1 query problems: ORM/DB used: {{orm}} Code: {{code}} Identify N+1 issues and rewrite using eager loading or batching....

Database & Query Optimization

Database Sharding Strategy

Design a sharding strategy for: Database: {{db_type}} Current size: {{size}} Growth rate: {{growth}} Query patterns: {{patterns}} Hotspot risks: {{ho...

Database & Query Optimization

Data Archival Strategy

Design a data archival strategy for: Table/collection: {{table}} Current size: {{size}} Retention policy: {{policy}} Access frequency of old data: {{...

Database & Query Optimization

Transaction Design

Review or design the transaction boundaries for this operation: Operation: {{operation}} Entities involved: {{entities}} Failure scenarios: {{failure...

Database & Query Optimization

Read Replica Strategy

I want to offload read traffic using read replicas. Current setup: {{current_setup}} Read/write ratio: {{ratio}} Consistency requirements: {{consiste...

Security Audit

Security Review

Perform a security audit on this {{language}} code: {{code}} Check for: 1. Injection vulnerabilities (SQL, NoSQL, command) 2. Authentication/authori...

Security Audit

Auth Flow Review

Review this authentication/authorization flow: {{auth_flow_description_or_code}} Check for: - Token handling issues - Session management flaws - Pri...

Security Audit

Dependency Check Guidance

I'm using these dependencies in my {{language}} project: {{dependencies_list}} Which ones are known to have security issues? What should I upgrade o...

Security Audit

OWASP Top 10 Checklist

Evaluate this {{language}} application against the OWASP Top 10: Application description: {{description}} Key features: {{features}} Tech stack: {{st...

Security Audit

JWT Implementation Review

Review this JWT implementation: Code: {{code}} Check for: - Algorithm confusion attacks (alg:none) - Key strength and storage - Claims validation (e...

Security Audit

RBAC / Permission System Design

Design a Role-Based Access Control system for: Application: {{application}} User types: {{user_types}} Resources: {{resources}} Actions per resource:...

Security Audit

Secrets Management Review

Review how this application manages secrets: {{code_or_config}} Check for: - Hardcoded credentials - Insecure secret storage - Secret rotation strat...

Refactoring

Refactor for Readability

Refactor this code to be more readable and maintainable. Don't change the behavior — only improve structure and clarity. Language: {{language}} Code:...

Refactoring

Refactor to Design Pattern

Refactor this code to use the {{pattern_name}} design pattern. Current code: {{code}} Show before and after, and explain why this pattern fits here....

Refactoring

Break Down God Class / Function

This class/function is doing too much. Break it down. Language: {{language}} Code: {{code}} Apply Single Responsibility Principle. Show the new stru...

Refactoring

Remove Magic Numbers / Strings

Refactor this code to eliminate magic numbers and magic strings. Language: {{language}} Code: {{code}} Replace with named constants, enums, or confi...

Refactoring

Improve Error Handling

Refactor the error handling in this code: Language: {{language}} Code: {{code}} Issues with current approach: {{current_issues}} Implement: proper ...

Refactoring

Extract Reusable Service / Module

Extract the reusable parts from this code into a shared service or module: Language: {{language}} Code: {{code}} Target: {{what_to_extract}} Show t...

Testing

Generate Unit Tests

Write unit tests for this function: Language/Framework: {{language}} + {{test_framework}} Code: {{code}} Cover: - Happy path - Edge cases - Error/ex...

Testing

Test Coverage Gap Analysis

Here is a function and its existing tests. Function: {{function_code}} Existing tests: {{test_code}} What cases are NOT covered? Write the missing ...

Testing

Integration Test Design

Design integration tests for this API endpoint: Endpoint: {{method}} {{path}} Business logic: {{logic}} Dependencies: {{dependencies}} Provide test ...

Testing

Load & Stress Test Plan

Design a load test plan for: Endpoint/feature: {{endpoint}} Expected normal load: {{normal_rps}} Peak load target: {{peak_rps}} SLA: {{response_time_...

Testing

Contract Testing Design

Design consumer-driven contract tests for this API: Provider: {{provider_service}} Consumer: {{consumer_service}} API contract: {{api_spec}} Use Pac...

Testing

Mock & Stub Strategy

Design a mocking strategy for these dependencies in my tests: Language/Framework: {{language}} + {{test_framework}} Dependencies to mock: {{dependenc...

Testing

Test Data Factory Design

Design a test data factory for: Entity: {{entity}} ORM/DB: {{orm}} Variations needed: {{variations}} Provide a factory/fixture pattern that makes te...

Architecture & System Design

System Design Review

Review this system architecture: {{architecture_description_or_diagram}} Evaluate: 1. Scalability 2. Single points of failure 3. Data consistency 4....

Architecture & System Design

Technology Choice Evaluation

I need to choose between these options for {{use_case}}: Option A: {{option_a}} Option B: {{option_b}} My constraints: - Team size: {{team_size}} - ...

Architecture & System Design

Microservices Boundary Design

I'm splitting this monolith into microservices. Domain: {{domain}} Current modules: {{modules}} Team structure: {{teams}} Suggest service boundaries...

Architecture & System Design

Capacity Planning

Help me with capacity planning for: Service: {{service}} Current metrics: {{current_load}} rps, {{avg_latency}} latency, {{cpu_mem}} resource usage G...

Architecture & System Design

Domain Model Design (DDD)

Help me design a domain model using DDD for: Domain: {{domain}} Core business rules: {{rules}} Key workflows: {{workflows}} Identify: aggregates, en...

Architecture & System Design

CQRS Design

Design a CQRS pattern for this feature: Feature: {{feature}} Current approach: {{current}} Read patterns: {{read_patterns}} Write patterns: {{write_p...

Architecture & System Design

Event Sourcing Design

Design an event sourcing implementation for: Aggregate: {{aggregate}} Events: {{events}} Projections needed: {{projections}} Storage: {{event_store}}...

Documentation

Generate Code Documentation

Write documentation for this code: Language: {{language}} Code: {{code}} Format: {{docstring | JSDoc | Swagger | plain markdown}} Include: purpose,...

Documentation

README Generation

Write a README.md for this project: Project name: {{name}} What it does: {{description}} Tech stack: {{stack}} How to run it: {{setup_steps}} Key env...

Documentation

ADR (Architecture Decision Record)

Write an ADR (Architecture Decision Record) for this decision: Decision: {{decision}} Context: {{context}} Options considered: {{options}} Chosen opt...

Documentation

Runbook Generation

Write an operational runbook for: Service: {{service}} Scenario: {{scenario}} (e.g. deployment, rollback, DB failover) Steps: {{steps}} Dependencies:...

Documentation

API Changelog Entry

Write a CHANGELOG entry for this API change: Version: {{version}} Breaking changes: {{breaking_changes}} New features: {{new_features}} Bug fixes: {{...

Documentation

Technical Design Document (TDD)

Write a Technical Design Document for: Feature: {{feature}} Problem it solves: {{problem}} Proposed approach: {{approach}} Alternatives considered: {...

Performance Optimization

Backend Performance Audit

Audit this code for performance issues: Language: {{language}} Code: {{code}} Expected load: {{rps}} requests/sec Identify bottlenecks and suggest o...

Performance Optimization

Caching Strategy

Design a caching strategy for this use case: Endpoint/feature: {{feature}} Data characteristics: {{data_description}} Cache options available: {{redi...

Performance Optimization

Async / Queue Strategy

This operation is too slow to do synchronously: Operation: {{operation_description}} Current approach: {{current}} Tech stack: {{stack}} Redesign us...

Performance Optimization

Horizontal vs Vertical Scaling Decision

Help me decide between horizontal and vertical scaling for: Service: {{service}} Current bottleneck: {{bottleneck}} Traffic pattern: {{traffic_patter...

Performance Optimization

Connection Pool Tuning

Help me tune the database connection pool for: Language/ORM: {{language_orm}} DB type: {{db_type}} Service instance count: {{instances}} Avg query du...

Code Generation

Boilerplate Generator

Generate production-ready boilerplate for: Type: {{REST API | CRUD service | background job | event handler}} Language/Framework: {{language_framewor...

Code Generation

Data Model / Entity

Generate a data model for: Entity: {{entity_name}} Fields: {{fields}} Validations: {{validations}} Language/ORM: {{language_orm}} Include: model def...

Code Generation

Migration Script

Generate a database migration script for: DB type: {{db_type}} Change: {{change_description}} Current schema: {{current_schema}} Include: up migrati...

Code Generation

CLI Tool Generation

Generate a CLI tool for: Purpose: {{purpose}} Language: {{language}} Commands needed: {{commands}} Input/output: {{io}} Include: argument parsing, h...

Code Generation

Middleware / Interceptor

Generate a {{middleware | interceptor | filter}} for: Framework: {{framework}} Purpose: {{purpose}} Logic: {{logic}} Should apply to: {{routes_or_end...

Code Generation

Config / Settings Module

Generate a configuration module for: Language/Framework: {{language_framework}} Environments: {{environments}} Config values: {{config_keys}} Validat...

DevOps & Deployment

Dockerfile Review

Review this Dockerfile: {{dockerfile}} App type: {{app_type}} Environment: {{production | staging}} Check for: 1. Security issues (running as root,...

DevOps & Deployment

CI/CD Pipeline Design

Design a CI/CD pipeline for: Project type: {{project_type}} Stack: {{stack}} Target platform: {{platform}} Current pain points: {{pain_points}} Prov...

DevOps & Deployment

Environment Variable Audit

Review how this app handles environment variables and configuration: {{code_or_config}} Check for: - Hardcoded secrets - Missing validation on start...

DevOps & Deployment

Kubernetes Manifest Review

Review these Kubernetes manifests: {{manifests}} App: {{app_description}} Check for: 1. Resource limits and requests 2. Liveness/readiness probes 3...

DevOps & Deployment

Zero-Downtime Deployment Strategy

Design a zero-downtime deployment strategy for: App type: {{app_type}} Current deployment method: {{current}} DB migration situation: {{db_migrations...

DevOps & Deployment

Infrastructure as Code Review

Review this IaC configuration: Tool: {{terraform | pulumi | cloudformation | cdk}} Code: {{iac_code}} Check for: - Security misconfigurations - Hard...

DevOps & Deployment

Rollback Plan Design

Design a rollback plan for this deployment: Service: {{service}} Change being deployed: {{change}} DB migrations included: {{migrations}} Dependencie...

Tech Lead / Architect Prompts

Technical Debt Assessment

Assess the technical debt in this codebase description: {{codebase_description}} Team size: {{team_size}} Age of codebase: {{age}} Known pain points:...

Tech Lead / Architect Prompts

Engineering Standards Document

Write an engineering standards document for a backend team working with {{stack}}. Cover: - Code style and formatting - Git workflow (branching, comm...

Tech Lead / Architect Prompts

Technical Interview Problem Design

Design a technical interview problem for a {{seniority_level}} backend engineer. Skills to assess: {{skills}} Time limit: {{duration}} Stack: {{stack...

Tech Lead / Architect Prompts

RFC (Request for Comments)

Write an RFC for this proposed change: Title: {{title}} Problem: {{problem}} Proposed solution: {{solution}} Alternatives considered: {{alternatives}...

Tech Lead / Architect Prompts

Post-Mortem Write-up

Write a blameless post-mortem for this incident: Incident summary: {{summary}} Timeline: {{timeline}} Root cause: {{root_cause}} Impact: {{impact}} ...

Tech Lead / Architect Prompts

Sprint / Iteration Planning Advice

Help me plan this sprint: Team size: {{team_size}} Sprint duration: {{duration}} Velocity (last sprint): {{velocity}} Backlog items to consider: {{ba...

Tech Lead / Architect Prompts

Team Onboarding Plan

Create a 30/60/90 day onboarding plan for a new {{role}} joining the team. Team context: {{team_context}} Stack: {{stack}} Key systems: {{systems}} C...

Git & Version Control

Commit Message Writing

Write a proper commit message for this change: Change description: {{change}} Files modified: {{files}} Type: {{feat | fix | refactor | chore | docs ...

Git & Version Control

Branch Strategy Design

Design a Git branching strategy for: Team size: {{team_size}} Release cadence: {{release_cadence}} Environments: {{environments}} Current pain points...

Git & Version Control

Merge Conflict Resolution

Help me resolve this merge conflict: Base branch: {{base_branch}} Feature branch: {{feature_branch}} Conflicting file: {{filename}} Conflict: {{conf...

Git & Version Control

Git History Cleanup

I need to clean up my Git history before merging. Current history: {{git_log}} Goal: {{squash | reorder | rewrite messages | split commits}} Provid...

Git & Version Control

Revert Strategy

I need to revert this change in production: Commit(s) to revert: {{commits}} How many other commits happened after it: {{commits_after}} Is the chang...

Code Understanding & Onboarding

Explain Unfamiliar Code

Explain this code to me as if I'm seeing this codebase for the first time: Language: {{language}} Code: {{code}} Explain: 1. What it does (plain Eng...

Code Understanding & Onboarding

Map a Codebase / Module

Help me understand the structure of this module: Language/Framework: {{language}} Directory structure: {{directory_tree}} Key files: {{key_files_con...

Code Understanding & Onboarding

Trace a Request / Data Flow

Trace the complete lifecycle of this request/event: Entry point: {{entry_point}} Expected behavior: {{expected}} Relevant code paths: {{code}} Show ...

Code Understanding & Onboarding

Explain Design Decision

Why is this code written this way? Explain the likely design rationale: Language: {{language}} Code: {{code}} What problem is this solving? What alt...

Code Understanding & Onboarding

Generate a Glossary

Generate a glossary for this domain/codebase: Domain: {{domain}} Key terms found in code/docs: {{terms}} For each term, provide: definition, how it'...

Logging & Observability

Logging Strategy Design

Design a structured logging strategy for: Service: {{service}} Language/Framework: {{language_framework}} Log aggregation tool: {{tool}} (e.g. ELK, D...

Logging & Observability

Logging Review

Review the logging in this code: {{code}} Check for: - Missing logs at critical points - Over-logging (noise) - Logging sensitive data (PII, tokens,...

Logging & Observability

Metrics & Alerting Design

Design metrics and alerting for: Service: {{service}} Key operations: {{operations}} SLA: {{sla}} Monitoring tool: {{prometheus | datadog | cloudwatc...

Logging & Observability

Distributed Tracing Setup

Design distributed tracing for: Services involved: {{services}} Communication: {{rest | grpc | events}} Tracing tool: {{jaeger | zipkin | datadog | o...

Logging & Observability

Observability Gap Analysis

Analyze this service for observability gaps: Service description: {{description}} Current logging: {{logging}} Current metrics: {{metrics}} Current a...

Resilience & Rate Limiting

Circuit Breaker Design

Design a circuit breaker for this integration: Calling service: {{caller}} Downstream service: {{target}} Expected failure modes: {{failures}} Langua...

Resilience & Rate Limiting

Retry Strategy Design

Design a retry strategy for: Operation: {{operation}} Failure types: {{failure_types}} Idempotency: {{idempotent: yes | no}} Max acceptable delay: {{...

Resilience & Rate Limiting

Rate Limiter Design

Design a rate limiting system for: Endpoint/service: {{endpoint}} Limit type: {{per-user | per-IP | per-API-key | global}} Limits: {{limit}} requests...

Resilience & Rate Limiting

Bulkhead Pattern Design

Design a bulkhead pattern for this service: Service: {{service}} Critical operations: {{critical_ops}} Non-critical operations: {{non_critical_ops}} ...

Resilience & Rate Limiting

Timeout Strategy

Design a timeout strategy for: Operation: {{operation}} Downstream dependencies: {{dependencies}} P99 latency of each dependency: {{latencies}} User-...

Data Validation & Sanitization

Input Validation Design

Design input validation for this API endpoint: Endpoint: {{method}} {{path}} Request body/params: {{schema}} For each field, define: - Type and form...

Data Validation & Sanitization

Validation Code Review

Review the input validation in this code: Language: {{language}} Code: {{code}} Check for: - Missing validations - Validation bypass risks - Inconsi...

Data Validation & Sanitization

Data Sanitization Strategy

Design a sanitization strategy for user-generated content in: Feature: {{feature}} Data types: {{data_types}} Storage: {{storage}} Output contexts: {...

Data Validation & Sanitization

File Upload Validation

Design validation and security checks for file uploads in: Feature: {{feature}} Allowed file types: {{types}} Max size: {{max_size}} Storage: {{local...

Event-Driven & Messaging

Event Schema Design

Design event schemas for: Domain events: {{events}} Format: {{json | avro | protobuf}} Consumers: {{consumers}} For each event: define payload, vers...

Event-Driven & Messaging

Message Queue Design

Design a message queue architecture for: Use case: {{use_case}} Producer: {{producer}} Consumers: {{consumers}} Message broker options: {{kafka | rab...

Event-Driven & Messaging

Saga Pattern Design

Design a Saga for this distributed transaction: Business process: {{process}} Services involved: {{services}} Steps: {{steps}} Use: {{choreography |...

Event-Driven & Messaging

Outbox Pattern Design

Design an Outbox pattern implementation for: Service: {{service}} Events to publish: {{events}} DB: {{db_type}} Message broker: {{broker}} Provide: ...

Event-Driven & Messaging

Consumer Idempotency

Design idempotent message consumption for: Consumer service: {{service}} Message type: {{message_type}} Processing logic: {{logic}} Duplicate risk: {...

AI-Assisted Planning

User Story Breakdown

Break down this feature into user stories and tasks: Feature: {{feature}} Target users: {{users}} Business value: {{value}} Tech stack: {{stack}} Fo...

AI-Assisted Planning

PRD → Technical Tasks

Convert this Product Requirements Document into technical tasks: PRD: {{prd}} For each requirement: - Identify backend, frontend, DB, and infra work...

AI-Assisted Planning

Estimation Breakdown

Help me estimate this technical task: Task: {{task}} Stack: {{stack}} Team experience with this area: {{experience}} Known unknowns: {{unknowns}} Pr...

AI-Assisted Planning

Technical Spike Definition

Define a time-boxed technical spike for: Question to answer: {{question}} Why it's needed: {{reason}} Time box: {{hours}} Define: scope, out-of-scop...

AI-Assisted Planning

Feature Flag Strategy

Design a feature flag strategy for rolling out: Feature: {{feature}} Risk level: {{risk}} Target rollout: {{rollout_plan}} (e.g. 5% → 25% → 100%) Fla...

Dependency & Upgrade Management

Library Upgrade Plan

Plan an upgrade for: Library: {{library}} Current version: {{current}} Target version: {{target}} Breaking changes in changelog: {{breaking_changes}}...

Dependency & Upgrade Management

Language/Runtime Upgrade

Plan an upgrade from {{current_version}} to {{target_version}} of {{language_or_runtime}}: Current stack: {{stack}} Known breaking changes: {{changes...

Dependency & Upgrade Management

Dependency Audit

Audit the dependencies in this project: Package file: {{package_file}} Identify: - Outdated dependencies (major versions behind) - Abandoned librari...

Dependency & Upgrade Management

Vendor Lock-in Assessment

Assess vendor lock-in risk in this architecture: Current services used: {{services}} Usage depth: {{usage_description}} For each vendor: lock-in lev...

Incident Response (Live)

Live Incident Diagnosis

LIVE INCIDENT — help me diagnose this: Service affected: {{service}} Symptoms: {{symptoms}} Error rate: {{error_rate}} Started at: {{time}} Recent de...

Incident Response (Live)

Blast Radius Assessment

Assess the blast radius of this incident: Failing component: {{component}} Downstream services: {{downstream}} Upstream callers: {{upstream}} Data im...

Incident Response (Live)

Hotfix Code Review (Urgent)

URGENT — review this hotfix before deploying to production: Problem it's fixing: {{problem}} Hotfix code: {{code}} Focus on: 1. Does it actually fix...

Incident Response (Live)

Customer-Facing Incident Communication

Write a customer-facing status page update for: Incident: {{incident}} Current status: {{investigating | identified | monitoring | resolved}} Impact:...

Concurrency & Race Conditions

Race Condition Detection

Review this code for race conditions: Language: {{language}} Concurrent context: {{threads | goroutines | async | workers}} Code: {{code}} Identify:...

Concurrency & Race Conditions

Locking Strategy Design

Design a locking strategy for: Operation: {{operation}} Shared resource: {{resource}} Concurrency level: {{concurrency}} DB/Cache: {{db}} Compare: o...

Concurrency & Race Conditions

Async/Concurrency Code Review

Review this concurrent/async code: Language: {{language}} Code: {{code}} Check for: - Unhandled promise rejections / goroutine panics - Goroutine/th...

Concurrency & Race Conditions

Distributed Lock Design

Design a distributed lock for: Operation: {{operation}} Lock store: {{redis | zookeeper | db}} Lock duration: {{duration}} Failure scenarios: {{lock_...

Multi-Tenancy & SaaS Patterns

Multi-Tenancy Model Design

Design a multi-tenancy model for: Product type: {{product}} Scale: {{tenants}} tenants, {{users_per_tenant}} users avg Isolation requirements: {{data...

Multi-Tenancy & SaaS Patterns

Tenant Isolation Review

Review this code for tenant isolation issues: Multi-tenancy model: {{model}} Code: {{code}} Check for: - Missing tenant_id filters in queries - Cros...

Multi-Tenancy & SaaS Patterns

Subscription & Billing Integration Design

Design a subscription/billing integration for: Product: {{product}} Plans: {{plans}} Billing provider: {{stripe | paddle | chargebee}} Metering: {{us...

Multi-Tenancy & SaaS Patterns

Per-Tenant Feature Flags

Design a per-tenant feature flag system for: Product: {{product}} Feature types: {{beta | paid_tier | experimental}} Storage: {{db | redis | launchda...

Knowledge Transfer & Handoff

Service Handoff Document

Write a knowledge transfer document for this service: Service: {{service}} What it does: {{description}} Tech stack: {{stack}} Key dependencies: {{de...

Knowledge Transfer & Handoff

Code Walkthrough Prep

Prepare a structured code walkthrough for: Module/service: {{module}} Audience: {{audience}} (junior | new joiner | external team) Duration: {{durati...

Knowledge Transfer & Handoff

Bus Factor Analysis

Analyze the bus factor risk in this team/codebase: Team: {{team}} Systems: {{systems}} Knowledge distribution: {{knowledge_map}} Identify: high-risk...

SQL Queries

Write a Query from Scratch

Write a SQL query for: DB type: {{mysql | postgresql | sqlite | mssql | oracle}} Goal: {{goal}} Tables involved: {{tables}} Schemas: {{schemas}}...

SQL Queries

Optimize a Slow Query

Optimize this slow SQL query: DB type: {{db_type}} Query: {{query}} Schema: {{schema}} Current execution time: {{exec_time}}...

SQL Queries

Rewrite Query Using Joins

Rewrite this query to use proper JOINs instead of subqueries or multiple queries: DB type: {{db_type}} Current query: {{query}}...

SQL Queries

Aggregation & Grouping Query

Write an aggregation query for: DB type: {{db_type}} Goal: {{goal}} (e.g. total sales per region per month, top 10 products by revenue) Tables: {{tables_and_schemas}}...

SQL Queries

Window Functions

Write a query using window functions for: DB type: {{db_type}} Goal: {{goal}} (e.g. running total, rank per group, lag/lead comparison, moving average)...

SQL Queries

CTE (Common Table Expression) Design

Rewrite or write this query using CTEs for readability: DB type: {{db_type}} Goal: {{goal}} Current query (if any): {{query}}...

SQL Queries

Pagination Query

Write an efficient pagination query for: DB type: {{db_type}} Table: {{table}} Schema: {{schema}} Sort by: {{sort_column}}...

SQL Queries

Full-Text Search Query

Write a full-text search query for: DB type: {{db_type}} Table: {{table}} Searchable columns: {{columns}} Search input: {{search_term}}...

SQL Queries

Upsert (Insert or Update)

Write an upsert query for: DB type: {{db_type}} Table: {{table}} Schema: {{schema}} Conflict key: {{conflict_column}}...

SQL Queries

Bulk Insert / Batch Operations

Write a bulk insert query for: DB type: {{db_type}} Table: {{table}} Schema: {{schema}} Batch size: {{batch_size}}...

SQL Queries

Recursive Query (Hierarchical Data)

Write a recursive query for: DB type: {{db_type}} Goal: {{goal}} (e.g. org chart traversal, category tree, bill of materials)...

SQL Queries

Soft Delete Query Patterns

Write query patterns for a soft delete implementation: DB type: {{db_type}} Table: {{table}} Soft delete column: {{deleted_at | is_deleted}}...

SQL Queries

Date & Time Query Patterns

Write date/time queries for: DB type: {{db_type}} Table: {{table}} Goal: {{goal}} (e.g. records in last 30 days, group by week, find gaps in date series)...

SQL Queries

Query Explain Plan Analysis

Analyze this query execution plan: DB type: {{db_type}} Query: {{query}} EXPLAIN output: {{explain_output}}...

SQL Queries

Index Design for a Query

Design optimal indexes for this query: DB type: {{db_type}} Query: {{query}} Table schema: {{schema}}...

SQL Queries

Stored Procedure / Function

Write a stored procedure or function for: DB type: {{db_type}} Goal: {{goal}} Input parameters: {{params}} Return: {{return_type}}...

SQL Queries

Data Migration Query

Write a data migration query for: DB type: {{db_type}} Migration goal: {{goal}} (e.g. backfill a new column, normalize a table, merge two tables)...

SQL Queries

Cross-Table Report Query

Write a report query that joins multiple tables: DB type: {{db_type}} Report goal: {{goal}} Tables and schemas: {{schemas}}...

SQL Queries

Detect Duplicate Records

Write a query to detect and optionally deduplicate records in: DB type: {{db_type}} Table: {{table}} Schema: {{schema}}...

SQL Queries

JSON Column Query

Write a query to work with JSON data stored in a column: DB type: {{db_type}} Table: {{table}} JSON column: {{column}}...

SQL Queries

Pivot / Crosstab Query

Write a pivot (crosstab) query to transform rows into columns: DB type: {{db_type}} Table: {{table}} Schema: {{schema}}...

SQL Queries

Gap Detection Query

Find gaps or missing values in a sequence or time series: DB type: {{db_type}} Table: {{table}} Schema: {{schema}}...

SQL Queries

Query Refactoring (Simplification)

Refactor this SQL query to be simpler and more maintainable: DB type: {{db_type}} Current query: {{query}}...

SQL Queries

Deadlock Investigation Query

Help me investigate a deadlock in my DB: DB type: {{db_type}} Transactions involved: Transaction A: {{query_a}}...

SQL Queries

Permissions & Row-Level Security

Design row-level security for: DB type: {{db_type}} Table: {{table}} Schema: {{schema}} Access rule: {{rule}}...

SQL Queries

Explain a SQL Query

Explain this SQL query in plain English: {{query}} Schema context: {{schema}}...

SQL Queries

Write a JOIN Query

Write a SQL query that joins these tables: DB type: {{db_type}} Tables and their relationships: {{tables_and_relationships}}...

SQL Queries

Subquery vs CTE vs JOIN — Best Approach

I need to write a query for this use case: DB type: {{db_type}} Schema: {{schema}} Requirement: {{requirement}}...

SQL Queries

Trigger Design

Write a SQL trigger for: DB type: {{db_type}} Table: {{table}} Event: {{INSERT | UPDATE | DELETE}} — {{BEFORE | AFTER}}...

SQL Queries

SQL Injection Prevention Review

Review this SQL code for injection vulnerabilities: Language/DB: {{language}} + {{db_type}} Code: {{code}}...

SQL Queries

Reporting Query (Complex Business Report)

Write a SQL query for this business report: DB type: {{db_type}} Schema: {{schema}} Report: {{report_name}} Metrics needed: {{metrics}}...

SQL Queries

Compare Two Result Sets

Write a SQL query to compare two result sets and find differences: DB type: {{db_type}} Table/query A: {{source_a}} Table/query B: {{source_b}}...

SQL Queries

Materialized View / Summary Table Design

Design a materialized view or summary table for: DB type: {{db_type}} Source tables: {{schema}} Report/query it should accelerate: {{query}}...

SQL Queries

Hierarchical / Tree Data Query

Query hierarchical data stored in: DB type: {{db_type}} Structure: {{adjacency_list | nested_set | closure_table | ltree}} Schema: {{schema}}...