• 42 prompts
  • 9 editor’s picks

Browse by format

  • Agents

    4
    System prompts and instructions that turn a chat assistant into a focused specialist or a reusable workflow.
  • Audio

    2
    Audio prompts for songs, sound design and voice direction in Suno and ElevenLabs.
  • Code

    4
    Coding prompts for reviews, tests, refactors, debugging and documentation, for chat assistants and AI code editors.
  • Image

    18
    Image prompts for photorealism, illustration, product shots and design concepts. Works with Midjourney, GPT Image, Nano Banana, Flux and Ideogram.
  • Video

    5
    Video prompts that describe the shot, the motion and the camera, ready for Veo, Sora, Kling and Runway.
  • Writing

    9
    Writing prompts for copy, emails, articles, scripts and summaries, tuned for ChatGPT, Claude and Gemini.

Editor’s pick

Categories

Twelve categories, from portraits and product shots to code reviews and lesson plans. Each one opens a list you can filter.

All categories

Prompts for the model you use

AI models

Every prompt lists the models it works with. On a prompt page, “Open in” copies it and opens the tool.

All models

Write unit tests for this function

Thorough unit tests covering normal cases, edge cases and errors, with suspected bugs flagged; change the language, framework and focus.

Customise it

Added

The prompt4 details to fill in · 150 words

Act as a senior Python engineer who writes clear, reliable tests. Write unit tests for the code below using pytest. Steps: 1. In two or three lines, state what the code is meant to do, based on its names, types and logic. 2. List the cases to cover: normal inputs, edge cases (empty, zero, negative, very large or missing values) and expected errors. 3. Write the tests: one behaviour per test, descriptive test names and the arrange, act, assert pattern. 4. Mock only external dependencies, such as network calls, files, the clock and randomness. Pay extra attention to: boundary values and invalid input. Rules: the tests must run as written, with every import included. Do not change the code under test. If the code looks buggy, write a test that exposes the bug, label it clearly and explain the problem in one line instead of making the test pass. Code: (paste your function here)

Works with

, ,

Click a highlighted part to change it.

LevelBeginner
You getA ready-to-run test file
Best forAdding tests to existing code

Make it yours

Pick an option or type your own. The preview updates as you go: copy it when it reads right, or open it straight in your AI tool.

Your version stays in this browser. Ctrl or ⌘ + Enter copies it.

Your details4 details to fill in
Language
Test framework
Preview
Act as a senior Python engineer who writes clear, reliable tests. Write unit tests for the code below using pytest. Steps: 1. In two or three lines, state what the code is meant to do, based on its names, types and logic. 2. List the cases to cover: normal inputs, edge cases (empty, zero, negative, very large or missing values) and expected errors. 3. Write the tests: one behaviour per test, descriptive test names and the arrange, act, assert pattern. 4. Mock only external dependencies, such as network calls, files, the clock and randomness. Pay extra attention to: boundary values and invalid input. Rules: the tests must run as written, with every import included. Do not change the code under test. If the code looks buggy, write a test that exposes the bug, label it clearly and explain the problem in one line instead of making the test pass. Code: (paste your function here)

About this prompt

Good tests describe behaviour, cover the edges and fail for a clear reason. This prompt makes the model state what the code should do, plan the cases and then write small, readable tests, flagging suspected bugs instead of hiding them.

Why it works

  1. Behaviour first

    Stating what the code should do before testing it catches misunderstandings early and gives every test a clear target.

  2. A case list

    Listing normal, edge and error cases up front makes the coverage visible, so you can spot gaps before any test is written.

  3. One behaviour per test

    Small, well-named tests tell you exactly what broke when one fails.

  4. Expose bugs, do not hide them

    Telling the model not to bend tests around buggy code turns the test suite into a bug finder.

Tips for better results

  • Remove API keys, passwords and real customer data from the code before you paste it.
  • Include the types, interfaces or a sample input so the tests use realistic data.
  • Run the tests straight away. If any fail, paste the output back and ask whether the test or the code is wrong.
  • In Cursor, select the function and its imports so the tests match your project’s structure and existing helpers.

Variations to try

  1. Table-driven tests in Go

    Act as a senior Go engineer. Write table-driven unit tests for the function below using the standard testing package. Give every row a case name, cover normal inputs, zero values, empty slices and error returns, and run each case as a subtest with t.Run. Do not change the function.

  2. Lock in behaviour before a refactor

    I am about to refactor the TypeScript function below. Write Jest characterisation tests that lock in its current behaviour exactly, including odd edge cases, even where the behaviour looks wrong. Name each test after the behaviour it captures, and list any behaviour that looks like a bug so I can decide whether to keep it.

Questions

Will the tests pass first time?

Not always. Run them and paste any failures back: sometimes the test is wrong, and sometimes it has found a real bug, which is the point.

Does it replace deciding what to test?

No. Read the case list from step 2 and add any business rule only you know about, such as limits, special customers or legal requirements.

Did this prompt work for you?

Quick copy

Write unit tests for this function

Copies your version from the studio.

For prompt makers

Got a prompt that works every time?

Send it in. We review every submission by hand and credit you on the page when it goes live.