Post

Most Agent failures aren’t about bad models. They’re about bad prompts. Here’s how to write prompts that actually work—based on thousands of real dev-Agent interactions 👇🧵

❌ “Fix bug in login handler” ✅ “Login fails with 500 on incorrect passwords. Repro: call /api/auth with wrong creds. Check auth_service.py. Add test if possible.” Agents need context like humans do.

Include why, not just what. ❌ “Use events instead of direct method calls” ✅ “Reviewers flagged tight coupling in SettingsWebviewPanel.statusUpdate(). Let’s refactor to events to improve modularity.” Reasoning aligns the Agent with your intent.

Give references to code, tests, or docs. ❌ “Write tests for ImageProcessor” ✅ “Write tests for ImageProcessor.Follow structure in test_text_processor.py” The Agent learns better by example.

0 reposts1 like

Point the Agent to the right files. ❌ “Add JSON parser to chat backend” ✅ “Add JSON parser in LLMOutputParsing (services/ folder). It’ll be used to extract structured output from chat completions.” Precision = performance.

Don’t cram it all in at once. ❌ “Read ticket, build UI, write tests, update docs” ✅ Break into steps: - Read ticket - Build UI - Write tests - Update docs Let the Agent finish before moving on.

Ask for a plan before action. “I need to expose time zone settings. First, suggest a plan—don’t write code yet.” This gives you control. And gives the Agent a checkpoint to align.

Agent prompting = engineering communication. Don’t think “prompt engineering.” Think “design doc + task breakdown + pair programming.” Good prompts are good collaboration.