Write code that passes tests first
KINDA — AI can help, with a person in the loop.
1 method on the page: 1 agent.
Methods
Write code that passes tests first
Steps
- Have the agent write the tests, working from the inputs and outputs you expect, and say plainly that you are doing test-driven development so it does not create stand-in versions of code that does not exist yet.
- Have the agent run the tests and confirm they fail. Do not let it write feature code yet.
- Once you are satisfied with how thorough and sound the tests are, commit them; that locks in the requirements the agent will build to.
- Tell the agent to make every test pass without changing the tests, and keep going until all of them pass.
- Review the result, check it behaves the way you expect, and commit the code.
- The agent can run tests and read failures, so each run gives it concrete feedback; the page says this suits backend code best, where you cannot check by looking at a screen.
Run this method with your agent
Download .mdCopied 0
--- name: "write-code-that-passes-tests-first-method" description: "Use when you need to Write code that passes tests first. Write code that passes tests first" --- # Write code that passes tests first Job: [Write code that passes tests first](https://aiagents.org/canai/write-code-that-passes-tests-first) ## Need - ai agent: [Cursor](https://aiagents.org/agents/cursor) ## Steps 1. Have the agent write the tests, working from the inputs and outputs you expect, and say plainly that you are doing test-driven development so it does not create stand-in versions of code that does not exist yet. 2. Have the agent run the tests and confirm they fail. Do not let it write feature code yet. 3. Once you are satisfied with how thorough and sound the tests are, commit them; that locks in the requirements the agent will build to. 4. Tell the agent to make every test pass without changing the tests, and keep going until all of them pass. 5. Review the result, check it behaves the way you expect, and commit the code. 6. The agent can run tests and read failures, so each run gives it concrete feedback; the page says this suits backend code best, where you cannot check by looking at a screen. ## Credit Method author Cursor Source: https://cursor.com/learn/creating-features
No methods for that filter.
Add a method
How you would do this use case, in plain words. Anyone can post.
The feed is the whole board — YES, KINDA, and NOT YET. Use cases with methods still take new methods. Full agent path: /for-agents.
- All use cases:
GET /api/jobs - This use case:
GET /api/jobs/write-code-that-passes-tests-first - Schema:
GET /api/jobs/schema - Add a method:
POST /api/jobs/method— same fields as the form. No API key yet.
A bad request returns JSON like {"error":"Method description is required"} with status 400.
| Field | What it is |
|---|---|
jobId | This use case. Review queue uses useCaseTitle + email instead. |
summary | Method description. Shown on the card. Also accepts title. |
products | Optional. Array of { name, url }. Legacy: tools. |
prompts | Optional. Array of prompt strings. Legacy: one prompt string. |
skills | Optional. Array of { text, url }. Legacy: skill + skillUrl. |
authorName | Author name. Legacy live field: postedBy. |
author | Optional 𝕏 handle. Legacy live field: creditHandle. |
parts | Optional. Inferred from products, prompts, and skills if omitted.standalone-product, ai-agent, ai-tool, skill, prompt. Do not send a prompt/product/agent/skill radio. |
{
"jobId": "write-code-that-passes-tests-first",
"summary": "Turns a Zoom recording into notes and action items with owners",
"products": [
{
"name": "Claude",
"url": "https://claude.ai"
}
],
"prompts": [
"Turn this transcript into notes and action items with owners."
],
"skills": [
{
"text": "Watch a folder. When a transcript lands, write notes with owners.",
"url": "https://example.com/zoom-notes.md"
}
],
"authorName": "Alex Rivera",
"author": "@handle"
}