Coding prompt library

AI Coding Prompts Library

Ready-made coding prompts to copy and adapt, with the required inputs, the expected outputs, the suitable tool and a practical example. Replace what is between the curly braces with your project's details.

4 results

Analyse a stack trace and reproduce the error before fixing it.

Debugging promptsBeginner
View the prompt
This is an error from {{project}} ({{stack}}):
{{extra}}
Follow this order:
1. Summarise what the error says and where it happens.
2. List hypotheses ranked by likelihood, with the evidence for each.
3. Write a test that reproduces the error and fails.
4. Fix the root cause, not the symptom, then run the test and the neighbouring tests.
5. Explain why the fix prevents the error from recurring.
Details

A plan for diagnosing concurrency, timing and rare-case errors.

Debugging promptsAdvanced
View the prompt
In {{project}} there is an error that only appears sometimes: {{extra}}.
- List the common causes of this pattern (concurrency, event ordering, caches, timing, rare data).
- Propose precise temporary logging to collect evidence without leaking sensitive data.
- Write a script that repeats the scenario hundreds of times or under load.
- After collecting the evidence: identify the cause, then the fix, with a test that covers it.
Details

Explain an inherited code module and map its flow before touching it.

Debugging promptsIntermediate
View the prompt
Read the module {{extra}} in {{project}} and do not change anything.
Write:
1. The overall purpose in one paragraph.
2. The main execution flow and a Mermaid sequence diagram.
3. Entry points, external dependencies and side effects (files, network, database).
4. Risky or unclear areas, and questions that need an answer from the team.
5. Suggested characterization tests that pin down the current behaviour.
Details

Analyse a CI failure log and fix it without disabling tests.

Debugging promptsIntermediate
View the prompt
This is a CI failure log from {{project}}:
{{extra}}
- Identify the failing step and the cause.
- Separate code failures from environment failures (versions, cache, secrets).
- Reproduce it locally if possible, then fix it.
- Not allowed: disabling or skipping the test, or adding a retry to hide the problem.
Details