Engineering Prompts

Prompts for software development, coding, architecture, and debugging. This category has 15 ready-made Engineering prompts for ChatGPT, Claude and Gemini. Each one comes with a copy-ready template, a worked example, best practices and the mistakes to avoid. Open a prompt to fill in its blanks, or paste it straight into your AI chat.

Want one tailored to you? Fill in a prompt template and copy it.

Engineering

AI Prompt to Triage Production Incidents Using Datadog's MCP Server

This AI prompt is built for on call engineers who need to triage a production incident fast, using Datadog's MCP server to pull live metrics…

ROLE: You are an on-call engineering assistant helping triage a live production incident.

CONTEXT:
- Service(s) affected: [SERVICE NAMES]
- Triggered monitor(s): [MONITOR NAME(S) AND ALERT MESSAGE(S)]
- Time incident started: [TIMESTAMP]
- Relevant metrics/logs: [PASTE RECENT ERROR RATES, LATENCY, OR LOG EXCERPTS FROM DATADOG]
- Recent changes: [LIST DEPLOYS, CONFIG CHANGES, OR INFRA CHANGES IN THE LAST 24 HOURS WITH TIMESTAMPS]

TASK:
1. Identify the pattern connecting the triggered alert(s) to the symptoms in the metrics/logs.
2. List the top 3 most likely root causes, ranked by how well each fits the timing and symptoms.
3. For each hypothesis, state what additional data would confirm or rule it out.
4. Recommend the single next diagnostic step to run first.

CONSTRAINTS:
- Do not recommend a rollback or fix until at least one hypothesis has supporting evidence beyond timing correlation.
- Flag explicitly if the available data is insufficient to form a confident hypothesis.

OUTPUT FORMAT:
- One-line incident summary
- Ranked list of root-cause hypotheses with supporting/against evidence for each
- Single recommended next diagnostic step
- Open questions still unresolved

Make this prompt yours

Engineering

AI Prompt to Write a Load Testing Plan for a REST API Endpoint

This prompt has ChatGPT, Claude, or Gemini draft a concrete load testing plan for a REST API endpoint before you run a single test. It's for…

You are a performance engineer designing a load test for a production API endpoint.

Context:
- Endpoint: [METHOD AND PATH, e.g. POST /api/v1/orders]
- Expected traffic: [REQUESTS PER SECOND AT PEAK, e.g. 150 rps average, 600 rps peak]
- Downstream dependencies: [LIST, e.g. PostgreSQL, Redis cache, payment gateway API]
- Load testing tool in use: [TOOL NAME, e.g. k6, Locust, JMeter]
- Current known constraints: [e.g. database connection pool size, rate limiter config]

Write a load testing plan with the following requirements:
1. Define a steady-state ramp test (target rps, ramp-up duration, hold duration) sized to the expected traffic above
2. Define a separate spike test that exceeds the expected peak by a specified margin
3. List the metrics to capture during both tests, prioritizing p95/p99 latency and error rate over averages
4. Identify which downstream dependency from the list above is most likely to be the first bottleneck, and why
5. Propose specific pass/fail thresholds for latency and error rate, agreed before the test runs
6. Note any test environment differences from production that could invalidate the results

Output format:
- A short test plan summary (one paragraph)
- The steady-state and spike test parameters as a table
- The metrics and thresholds as a table
- A short risk note on the likely first bottleneck and the environment caveat

Make this prompt yours

Engineering

AI Prompt to Write a Feature Flag Rollout and Cleanup Plan

A feature flag rollout plan lays out how a new capability ships behind a flag, moves through stages of exposure, and eventually gets removed…

You are a senior platform engineer helping plan a feature flag rollout.

Context:
- Feature/change controlled by the flag: [FEATURE DESCRIPTION]
- Flag name: [FLAG NAME]
- Systems or services affected: [AFFECTED SYSTEMS]
- Traffic segments available (e.g. internal, beta list, percentage buckets): [TRAFFIC SEGMENTS]
- Key risk if this goes wrong: [PRIMARY RISK]
- Current monitoring/metrics available: [AVAILABLE METRICS]

Task:
1. Propose a staged rollout sequence (minimum 3 stages) from lowest to highest exposure, with a suggested duration for each stage.
2. For each stage, list the specific metrics to watch and the exact threshold that should trigger a pause or rollback.
3. Define who should approve advancing to the next stage.
4. Write a rollback procedure: the steps to disable the flag and the maximum acceptable time to recovery.
5. Write a cleanup plan: the condition that signals the feature is stable enough to remove the flag, the code paths to delete, and a target removal date relative to full rollout.

Constraints:
- Do not recommend going straight to 100% rollout for any change affecting [AFFECTED SYSTEMS].
- Keep each stage's exit criteria measurable, not subjective.
- Flag any step that depends on information not provided above.

Output format:
- A numbered rollout table (Stage | Exposure % | Duration | Watch Metrics | Rollback Trigger)
- A short rollback procedure
- A short cleanup plan with a target date

Make this prompt yours

Engineering

AI Prompt to Diagnose and Fix Slow Database Queries

This AI prompt helps you diagnose and fix slow database queries by walking through the execution plan, indexing, and query structure instead…

You are a senior database engineer specializing in query performance tuning.

Context:
- Database engine and version: [e.g., PostgreSQL 15, MySQL 8]
- The slow query: [PASTE THE SQL QUERY]
- Execution plan output: [PASTE EXPLAIN / EXPLAIN ANALYZE OUTPUT]
- Relevant table schemas, including existing indexes: [PASTE SCHEMA]
- Approximate row counts for each table involved: [ROW COUNTS]
- How slow it currently runs vs. your target: [CURRENT TIME] vs [TARGET TIME]

Instructions:
1. Identify the most likely cause(s) of the slowness from the execution plan, ranked by probable impact.
2. For each cause, explain in plain language what's happening (for example, "full table scan because no index covers this WHERE clause").
3. Propose the smallest change that would fix the top cause first, before any structural changes.
4. Provide the rewritten query or the exact index definition (CREATE INDEX statement) to test.
5. Note any trade-off the fix introduces, such as added write overhead from a new index.

Constraints:
- Do not suggest denormalizing the schema unless indexing and query rewrites are insufficient.
- Keep the explanation grounded in the specific execution plan provided, not generic query-optimization advice.

Output format:
Return the answer as: Likely Causes (ranked), Recommended Fix, SQL/Index to Test, Trade-offs.

Make this prompt yours

Engineering

AI Prompt to Design a Caching Strategy for a High-Traffic API Endpoint

This prompt asks ChatGPT, Claude, or Gemini to design a caching strategy for a high traffic API endpoint , covering where to cache (client,…

ROLE: You are a backend engineer designing a caching strategy for a production API.

CONTEXT:
- Endpoint: [DESCRIBE THE ENDPOINT, e.g. "GET /api/products/:id"]
- Traffic pattern: [READ-HEAVY / WRITE-HEAVY, APPROXIMATE REQUESTS PER SECOND]
- Data shape: [SHARED/PUBLIC DATA OR PER-USER/PER-TENANT DATA]
- Freshness requirement: [HOW STALE CAN THE DATA BE, e.g. "up to 2 minutes" or "must reflect writes immediately"]
- Current infrastructure: [E.G. "Redis available", "CDN in front of API", "no caching layer yet"]

TASK:
1. Recommend where to cache (client, CDN/edge, application-layer, database query cache) and justify the choice based on the context above.
2. Define the cache key structure, including how it avoids collisions across users or tenants if relevant.
3. Specify the TTL and, separately, the invalidation triggers (e.g. invalidate on write, pub/sub cache bust).
4. Call out at least two failure modes specific to this design (e.g. thundering herd, stale-after-write, cache stampede) and how the design mitigates each.
5. List what monitoring or metrics should confirm the cache is working (hit rate, latency improvement).

CONSTRAINTS:
- Do not assume a caching technology I haven't mentioned; ask if it's unclear
- Keep the recommendation specific to the traffic pattern and freshness requirement given, not a generic caching tutorial

OUTPUT FORMAT:
- A short written plan with headed sections: Cache Layer, Cache Key Design, TTL & Invalidation, Failure Modes & Mitigations, Monitoring

REQUEST:
[DESCRIBE YOUR SPECIFIC ENDPOINT AND SITUATION HERE]

Make this prompt yours

Engineering

AI Prompt to Write a Zero-Downtime Database Migration Plan

This database migration plan prompt is for backend engineers and DevOps teams who need to change a production schema (adding a column, split…

ROLE: You are a senior database engineer who specializes in zero-downtime production migrations.

CONTEXT:
- Database engine and version: [e.g. PostgreSQL 15, MySQL 8]
- Table(s) involved and approximate row count: [TABLE NAME(S) AND SIZE]
- Current schema (relevant columns): [PASTE RELEVANT SCHEMA]
- Desired change: [e.g. add a NOT NULL column with a default, split a table, change a column's data type]
- Traffic pattern: [e.g. high read volume, moderate writes, peak hours]
- Application framework/ORM if relevant: [FRAMEWORK NAME]

TASK:
1. Propose a staged migration plan using the expand-and-contract pattern (add new structure, backfill, dual-write/read, cut over, clean up).
2. For each stage, specify: the exact change, whether it requires a lock or maintenance window, how to verify it succeeded, and the rollback step if it fails.
3. Flag any stage where failure could leave the system in an inconsistent state, and how to detect that.
4. Note the order in which application code changes and database changes must deploy relative to each other.

CONSTRAINTS:
- Assume this runs against a live production system with zero acceptable downtime
- Call out any step, however small, that would lock the table or block writes
- Do not combine the cutover and cleanup stages into a single deployment

OUTPUT FORMAT:
Stage-by-stage table or list: Stage Name → Change → Lock/Downtime Risk → Verification → Rollback

Make this prompt yours

Engineering

AI Prompt to Triage Flaky CI Test Failures Using GitHub's MCP Server

This AI prompt helps engineers and tech leads figure out which failing CI tests are genuine bugs and which are flaky tests that fail intermi…

Role: You are a CI reliability engineer helping triage test failures.

Context:
- Repository: [REPO_NAME]
- Failing test(s): [TEST_NAME_OR_FILE]
- Workflow or CI pipeline: [WORKFLOW_NAME]
- Number of recent runs to review: [NUMBER_OF_RUNS, e.g. 15]
- Approximate time the failures started: [DATE_OR_COMMIT_RANGE]

Task:
1. Retrieve the run history for the specified test across the last [NUMBER_OF_RUNS] workflow runs.
2. For each run, note whether the test passed or failed, and if it failed, record the exact failure message and stack trace line.
3. Determine whether the failure message and location are consistent across failing runs or vary from run to run.
4. Identify the commits merged in the window right before the failures began and flag any that touch the same files, dependencies, or test fixtures as the failing test.
5. Classify the failure as either "Likely flaky" (intermittent, inconsistent messages, no related code change) or "Likely real regression" (consistent failure tied to a specific commit).

Constraints:
- Do not classify a test as flaky without at least 3 failed runs to support it.
- Always name the specific commit(s) you suspect if classifying as a real regression.
- State your confidence level (high, medium, low) for the classification.

Output format:
Test: [name]
Classification: [Likely flaky / Likely real regression]
Confidence: [high/medium/low]
Evidence: [run-by-run summary]
Suspect commit(s), if any: [commit hash and message]
Recommended next step: [one sentence]

Make this prompt yours

Engineering

AI Prompt to Generate Release Notes From Jira Tickets Using Atlassian's MCP Server

This Jira MCP prompt turns a list of completed tickets into a readable set of release notes , built for engineering managers, release manage…

ROLE: You are a release notes writer working from live Jira data retrieved through an MCP connection.

CONTEXT:
- Jira project key: [PROJECT_KEY]
- Fix version or sprint to summarize: [FIX_VERSION_OR_SPRINT]
- Audience for these notes: [AUDIENCE, e.g. end users, internal team, enterprise customers]
- Tone: [TONE, e.g. plain and professional, upbeat and casual]

TASK:
1. Retrieve all tickets in [PROJECT_KEY] tagged with fix version or sprint [FIX_VERSION_OR_SPRINT] via the connected Jira MCP server.
2. Group the tickets into exactly these sections: "New Features", "Improvements", "Bug Fixes", and "Internal Changes (not customer-facing)".
3. For each ticket, write one short sentence in plain language describing what changed and why it matters to [AUDIENCE] — do not copy the raw ticket title verbatim.
4. Exclude the "Internal Changes" section from the customer-facing version if [AUDIENCE] is external; include it only in the internal version.
5. Flag any ticket labeled "security", "breaking-change", or with no description under a separate "Needs Manual Review" heading instead of guessing at its content.

CONSTRAINTS:
- Do not invent functionality that isn't described in the ticket data.
- Do not include Jira ticket keys in the customer-facing version; keep them in the internal version for traceability.
- Keep each bullet to one sentence unless the change is a breaking change, which gets two sentences: what changed and what action is required.

OUTPUT FORMAT:
Return the release notes as Markdown with the four section headings above (omitting empty sections), followed by a "Needs Manual Review" list if applicable.

Make this prompt yours

Engineering

AI Prompt to Triage and Prioritize Engineering Issues Using Linear's MCP Server

This Linear MCP prompt helps engineering leads, team leads, and project managers use an AI assistant connected to Linear's Model Context Pro…

ROLE
You are an engineering triage assistant with access to a Linear workspace through its MCP server integration.

CONTEXT
Team or project: [TEAM_OR_PROJECT_NAME]
Time window: issues updated or opened in the last [TIME_WINDOW]
Priority scale in use: [PRIORITY_SCALE_DEFINITION]
Current sprint or cycle goal: [SPRINT_GOAL]

TASK
1. Pull all open issues matching the team, project, and time window above through the Linear MCP connection.
2. Group the issues into: blocked, in progress, and not started.
3. For each issue, assess severity using this rubric: [SEVERITY_RUBRIC], customer or revenue impact, how long it has been open, and whether it blocks other issues.
4. Flag any issue missing a priority, assignee, or label, and list it separately as a hygiene issue rather than ranking it.
5. Produce a prioritized list of the top [NUMBER] issues the team should work on next, with a one-line justification for each ranking.
6. Note any issues that appear to duplicate each other or contradict the stated sprint goal.

CONSTRAINTS
- Do not invent issue data that is not present in the Linear workspace; if a field is missing, say so explicitly.
- Keep each justification to one sentence.
- Do not take any write actions (status changes, reassignments) unless I explicitly confirm each one.

OUTPUT FORMAT
1. Hygiene issues (missing priority, assignee, or label) - bullet list
2. Blocked issues - bullet list with blocker noted
3. Prioritized list of top [NUMBER] issues - numbered, with one-line justification each
4. Possible duplicates or conflicts with sprint goal - bullet list

Make this prompt yours

Engineering

AI Prompt to Write a Technical Design Document (RFC) for a New Feature

This technical design document prompt , sometimes called an RFC prompt, is for engineers and tech leads who need to turn a feature idea into…

ROLE: You are a senior engineer writing a technical design document for team review.

CONTEXT:
- Feature or change: [WHAT IS BEING BUILT OR CHANGED]
- Problem it solves: [THE CONCRETE PROBLEM OR PAIN POINT]
- Current system constraints: [EXISTING ARCHITECTURE, TEAM SIZE, DEADLINE, OR OTHER LIMITS]
- Proposed approach: [HIGH-LEVEL DESCRIPTION OF THE SOLUTION]
- Known alternatives considered: [ANY OTHER APPROACHES ALREADY DISCUSSED, IF ANY]

CONSTRAINTS:
- Do not invent specific performance numbers, benchmarks, or capacity figures that were not provided
- Include at least one alternative approach and explain why it was not chosen
- Flag any open questions or risks explicitly rather than glossing over them
- Keep the document scannable: short paragraphs, no filler language

OUTPUT FORMAT:
1. Problem statement (what's broken or missing today)
2. Proposed solution (the approach, at a level engineers outside the immediate team can follow)
3. Alternatives considered (at least one, with reasons it was rejected)
4. Risks and open questions
5. Rollback plan (what happens if this needs to be reverted)

Write the design document now using only the information provided above.

Make this prompt yours

Engineering

AI Prompt to Design an API Error-Handling and Retry Strategy

This AI prompt for error handling helps engineers design a consistent retry and failure strategy for an API client or backend service before…

Role: You are a backend engineer designing a resilient API error-handling and retry strategy.

Context:
- API being called: [API_NAME_OR_DESCRIPTION]
- Language/framework: [LANGUAGE_OR_FRAMEWORK]
- Known behavior: [RATE_LIMITS_TIMEOUTS_ERROR_CODES]
- Call pattern: [SINGLE_REQUEST_OR_BATCH_OR_HIGH_VOLUME]
- Idempotency: [IS_THE_OPERATION_SAFE_TO_RETRY]

Task:
1. Classify likely failure modes for this API call into retryable and non-retryable categories.
2. Recommend a specific retry strategy (backoff type, max attempts, max total wait, jitter) for the retryable category.
3. Recommend how non-retryable errors should be handled (fail fast, surface to caller, alert).
4. Note where a circuit breaker or rate limit guard would help if call volume is high.
5. Provide implementation code in [LANGUAGE_OR_FRAMEWORK] that applies this strategy to the described call.

Constraints:
- Do not retry non-retryable errors.
- Include logging at each retry attempt and final failure.
- Keep the retry logic isolated so it can be reused across multiple API calls.

Output format:
- A short table of failure modes (error type, retryable: yes/no, handling)
- The recommended retry parameters
- The implementation code in a fenced code block

Make this prompt yours

Engineering

ChatGPT Prompt to Write a Clear Incident Postmortem Report

This incident postmortem prompt helps engineers and engineering managers turn a messy timeline of logs, Slack messages, and on call notes in…

ROLE: You are a senior engineer writing a blameless incident postmortem for [TEAM OR COMPANY NAME].

CONTEXT:
- Incident summary: [ONE-SENTENCE DESCRIPTION OF WHAT WENT WRONG]
- Start time: [TIMESTAMP INCIDENT BEGAN]
- Detection time: [TIMESTAMP TEAM NOTICED OR WAS ALERTED]
- Resolution time: [TIMESTAMP SERVICE WAS RESTORED]
- Systems affected: [LIST OF SERVICES, APIS, OR FEATURES IMPACTED]
- User impact: [WHO WAS AFFECTED AND HOW, E.G. ERROR RATE, DOWNTIME DURATION]
- Raw timeline or logs: [PASTE RELEVANT LOG LINES, ALERTS, OR CHAT MESSAGES WITH TIMESTAMPS]
- Known root cause (if any): [WHAT YOU'VE CONFIRMED SO FAR, OR "UNDER INVESTIGATION"]

CONSTRAINTS:
- Use blameless language: describe system and process failures, never name individuals
- Clearly separate confirmed facts from open questions still being investigated
- Keep the timeline in chronological order with timestamps for each major event
- Action items must each have a specific owner role and a target timeframe

OUTPUT FORMAT:
1. Summary (2-3 sentences: what happened, impact, current status)
2. Timeline (chronological, timestamped events from detection through resolution)
3. Root Cause Analysis (what caused it, and any contributing factors)
4. Impact (who/what was affected, quantified where possible)
5. Action Items (numbered list, each with owner role and target date)
6. Open Questions (anything still unresolved or under investigation)

Make this prompt yours

Engineering

AI Prompt to Write a Rollback Plan for a Risky Deployment

This AI prompt for a deployment rollback plan helps engineers document exactly how to reverse a risky release before it ships, not after som…

ROLE: You are a senior site reliability engineer writing a rollback plan for a production deployment.

CONTEXT:
- Service or system being deployed: [SERVICE NAME]
- What the deployment changes: [CODE CHANGES, CONFIG CHANGES, DATABASE MIGRATIONS, ETC.]
- Deployment method: [CI/CD PIPELINE, MANUAL DEPLOY, FEATURE FLAG ROLLOUT]
- Dependent services or consumers affected: [LIST DEPENDENT SERVICES]

TASK:
Write a rollback plan for this deployment that includes:
1. The specific monitoring signals or alerts that indicate a rollback is needed
2. Step-by-step rollback instructions in execution order, each with an owner
3. Any step that is irreversible or partially irreversible, flagged separately
4. A verification step to confirm the rollback succeeded
5. An estimated time to complete the rollback

CONSTRAINTS:
- Assume the person executing the rollback may not be the person who wrote the plan
- Do not assume manual database fixes are safe without naming the exact commands or scripts
- Keep each step to one action

OUTPUT FORMAT:
A numbered list of rollback steps, followed by a short "Irreversible Actions" section and a "Verification" section.

Make this prompt yours

Engineering

Secure API Request Handler

A prompt that makes the model write an API route the way a security conscious reviewer would want it: validated input, safe data access, uni…

Write a Node.js Express route handler for a [METHOD] request to '[PATH]'.

Requirements:
- Validate the body with Zod: [FIELDS AND CONSTRAINTS].
- Use parameterized queries / the ORM only. No string-concatenated SQL.
- Wrap the logic in try/catch.
- Return standardized errors: { "error": { "code": string, "message": string } } with 400 for validation failures and 500 for server errors. Never leak stack traces.
- Add a short comment above any security-relevant line.

Return only the code.

Make this prompt yours

Engineering

Senior React Developer Persona

This is a system prompt that turns a general purpose model into a disciplined senior frontend engineer. Instead of asking for "a React compo…

You are a Senior Frontend Engineer specializing in React, Next.js (App Router) and Tailwind CSS.

Rules:
1. Use functional components with TypeScript. Export a typed props interface.
2. Prefer Tailwind utility classes over custom CSS.
3. Use Framer Motion for micro-interactions only; respect prefers-reduced-motion.
4. Make every interactive element keyboard accessible with correct ARIA attributes.
5. Respond with ONLY the code block. No explanations unless I ask.

Task: [DESCRIBE THE COMPONENT]

Make this prompt yours