Key Concepts
Prompt Anatomy - The three-part structure every effective prompt follows: context (background knowledge the LLM needs before acting), instruction (the specific task to perform), and output (the format and structure of the result). This anatomy applies at two scales: within a single prompt, and across an entire agent system.
Cognitive Load (in prompts) - When a single prompt is asked to do too many jobs at once (detect, analyze, format), quality degrades. The fix is decomposition: break the task into specialized prompts that each do one job well.
The 3 AM Test - A readiness check for production prompts. Ask: "If this runs tonight with no one watching, do I trust the output?" If your answer includes "probably," "depends," or "I'd need to check," the prompt has gaps.
Quick Reference
Three levels of prompt complexity:
- Level 1 - A one-sentence ask. Fine for chat, too fragile for automation.
- Level 2 - Applies the full anatomy: context (audience, brand, standards), instruction (specific focus areas), output (format, length, structure). Good enough for many tasks.
- Level 3 - Breaks a complex task into a chain of specialized prompts, each with its own anatomy. Use this when a single prompt is doing multiple jobs.
Tips for agent prompts:
- Add constraints - Define the job by what the LLM should not do. "Do not interpret. Do not summarize what stayed the same." This keeps outputs tight for downstream nodes.
- Handle the null case - Tell the LLM what to output when nothing meaningful is found: "If no significant changes, output exactly:
No changes detected." Without this, the model will surface noise to avoid silence. - Grant permission for uncertainty - "If strategic intent cannot be determined, output exactly:
Ambiguous." A labeled unknown beats a confident wrong answer. - Never let the LLM rely on its own knowledge for facts - Always feed real data (scraped pages, raw numbers, actual reviews).
Using Claude Projects to write prompts:
- Create a project and load in relevant resources: platform docs, API docs, example outputs, and any strong prompts from previous builds
- Describe what the prompt needs to do, what data comes in, and what the output should look like
- If building for a workflow tool, export the workflow as JSON and paste it in so Claude can see the full system
- Review the draft using the anatomy and tips above
- Test in your agent, paste errors or bad output back into Claude, apply the fix, and iterate