Task prompt · Coding

Write tests for a file

by Agent Yard Team

Adds meaningful unit tests that cover edge cases, not just the happy path.

You'll attach

Needs file

Works with

CursorClaude CodeCodexClaudeChatGPTGemini

Use cases

  • Adds meaningful unit tests that cover edge cases, not just the happy path.
  • When you already have a file and want the AI to work from it instead of starting from scratch.
  • Reuse it as often as you like: fill in the blanks (test framework) with new details and copy again.
  • With Cursor, Claude Code, Codex and more, the AIs that support what this prompt needs.

How to use it

  1. Open Cursor or Claude Code in your terminal (or another AI listed here).
  2. Attach the file (PDF, Word, CSV or Excel), or paste its text into the prompt.
  3. Fill in the highlighted blank ([TEST FRAMEWORK]) below, or edit them after pasting.
  4. Copy the prompt, paste it into the chat and send.

Fill in the blanks (optional)

Prompt

Remix
Write tests for the attached file using [TEST FRAMEWORK].

- First list the behaviors worth testing, including edge cases, errors and boundary values.
- Then write the tests: clear names that describe behavior, arrange-act-assert, no testing of private internals.
- Mock only external services (network, time, randomness).
- Point out any code that is hard to test and suggest a small refactor.
One email a week

The best new prompts and personas, nothing else.

The Weekly is presented byyour brandSponsored · open

More Coding prompts

Footer partner · openThis strip runs at the foot of every page. One partner at a time.Ask about it →