Prompt library

Software Development prompts

Prompts for planning changes, reviewing code, writing tests, and debugging, structured so an assistant returns work you can check.

  • planning
  • architecture
  • code
100/100 · 163 tokens

Implementation plan for a change

Turns a feature request and the relevant code into an ordered plan with files, risks, and tests.

Use it when: Before you start a change that touches several files and you want the steps and the risks written down first.

prompt
You are a senior software engineer planning a change to an existing codebase.

## Task
Produce an ordered plan for the requested change, based only on the code provided below.

## Requirements
- List the steps in the order they must be done.
- Name the file and function each step changes.
- State one risk for every step that changes existing behavior.
- List the tests that must pass before the change is complete.
- Use the phrase "not shown in the code provided" where the code does not contain what a step needs.

## Output format
Return markdown with four sections: Summary (2 sentences), Steps (numbered list), Risks (bulleted list), and Tests (bulleted list).

## Input
<request>
{{request}}
</request>

<code>
{{code}}
</code>

Variables

{{request}}
The change you want, in your own words.
{{code}}
The files or functions the change touches.

Example input

request: Add rate limiting to the login endpoint, 5 attempts per minute per IP.
code: the login route handler and the existing middleware file.

Example output

## Summary
Add a per-IP limiter as middleware on POST /login. Existing middleware order is kept.

## Steps
1. middleware/rateLimit.ts: add createLimiter(max, windowMs)...
2. routes/auth.ts, loginRouter: apply the limiter before validateBody...

## Risks
- Step 2: requests behind a shared proxy share one IP...

## Tests
- 6th attempt within a minute returns 429...

Illustrative: written to show the expected shape, not generated by a model.

  • debugging
  • errors
  • code
100/100 · 162 tokens

Root cause analysis from an error

Works from a stack trace and the code around it to a ranked list of causes and the check that confirms each one.

Use it when: When you have an error and the code but not yet the cause, and want hypotheses you can test in order.

prompt
You are a senior software engineer debugging a production error.

## Task
Identify the most likely root causes of the error below, using the stack trace and the code provided.

## Requirements
- Rank at most 3 causes from most to least likely.
- Quote the line of code each cause depends on.
- Give one check for each cause that confirms or rules it out.
- Do not propose a fix for a cause until its check is stated.
- Write "cannot be determined from the input" for anything the trace and code do not show.

## Output format
Return a markdown table with the columns Rank, Cause, Evidence, and Check, followed by one paragraph naming the cause to test first.

## Input
<error>
{{error}}
</error>

<code>
{{code}}
</code>

Variables

{{error}}
The error message and stack trace.
{{code}}
The functions named in the trace.

Example input

error: TypeError: Cannot read properties of undefined (reading 'id') at getOrder (orders.js:42)
code: the getOrder function and its caller.

Example output

| Rank | Cause | Evidence | Check |
|---|---|---|---|
| 1 | `user` is undefined when the session expired | `const id = req.user.id` (line 42) | Log `req.user` for a request with an expired cookie |

Test cause 1 first: it is the only path where `req.user` is unset.

Illustrative: written to show the expected shape, not generated by a model.

Make it yours

Edit the requirements to match your standards, then check the result. Theprompt analyzer re-scores it as you type, theoptimizer removes filler without dropping a requirement, and thesecurity scanner flags secrets and personal data before you send it to a model.

More categories