Standard review
Generate tests for an existing function
Create focused tests from current behavior before making implementation changes.
Prompt template
You are helping me with: Generate tests for an existing function.
Context:
- Main material: {{code}}
- Target reader or user: {{expected_behavior}}
- Constraints or decision context: {{test_framework}}
Task:
1. Restate the goal in one sentence.
2. Produce the requested output in a structured format.
3. Separate facts from assumptions.
4. Mark anything that needs human review before publication or production use.
5. End with a concise next-step checklist.
Rules:
- Do not invent sources, dates, benchmarks, test results, or quotes.
- If information is missing, write what is missing and how to verify it.
- Keep the output practical enough that a human can act on it immediately.Variables
| Variable | Description | Required |
|---|---|---|
| {{code}} | Replace {{code}} with the real input for this prompt. | Yes |
| {{expected_behavior}} | Replace {{expected_behavior}} with the real input for this prompt. | Yes |
| {{test_framework}} | Replace {{test_framework}} with the real input for this prompt. | Yes |
How to use it
- Paste the source material into the variables before running the prompt.
- Ask for a second pass only after you review the first output.
- Save the final prompt and manual edits if the workflow will be repeated.
Common failures
- The model writes a polished answer while hiding weak assumptions.
- The output adds facts that were not present in the input.
- The structure looks complete but lacks a review checklist.
Improvement tips
- Add one real example before asking for style changes.
- State the channel, audience, and risk level explicitly.
- Ask the model to show missing information instead of filling gaps.
Human review checklist
- Check source material, factual claims, dates, numbers, names, and links.
- Remove unsupported claims and vague confidence language.
- Confirm the final output fits the real reader and workflow.
Related AI skills
Related prompts
CodingStandard review
Create a debugging hypothesis list
Turn symptoms into ordered hypotheses, checks, and rollback-safe experiments.
3 variables
CodingSource check required
Draft a deployment test plan
Plan setup checks, failure cases, and evidence needed before calling a tool production-ready.
3 variables
CodingStandard review
Explain an error message step by step
Convert a confusing error into likely causes, checks, and safe next actions.
3 variables
CodingStandard review
Refactor a function safely
Ask AI to refactor code while preserving behavior, tests, and edge cases.
3 variables