Prompts and workflows

Prompt pattern: make the agent write the failing test before the fix

Priya Raman2 days ago4.1k

Simple, but it changed how I work. Before any bug fix: “Write a test that reproduces this bug. Run it and show me it fails. Only then fix it.” Agents are far less likely to fix the wrong thing.

Replies

2 comments

  • Lena Vogt6 hours ago

    Love how focused this is. One thing: the empty state took me a second to understand. Maybe show an example right away?

  • Kenji Mori1 day ago

    What did the agent struggle with most? Always curious where people had to step in.