Engineers effective prompts using systematic methodology. Use when designing prompts for Claude, optimizing existing prompts, or balancing simplicity, cost, and effectiveness. Applies progressive disclosure and empirical validation to prompt development.
Foundation First (Always Apply):
Then Assess:
Key insight: The best prompt achieves goals with minimum necessary structure.
Output Problems → Solutions:
| Problem | Solution |
|---------|----------|
| Too generic | Add specificity + examples |
| Off-topic | Add context explaining goals |
| Wrong format | Examples or structured outputs |
| Unreliable on complex tasks | Prompt chaining |
| Unnecessary preambles | "Start directly with..." or structured outputs |
| Hallucinations | "If unsure, acknowledge uncertainty" |
| Shallow reasoning | Raise effort |
Process Problems → Fixes:
| Mistake | Fix | |---------|-----| | Over-engineering | Start minimal, add only what helps | | Negative framing | Say what TO do instead | | No motivation | Explain the WHY | | No iteration | Test, measure, refine |
| Technique | What It Does | Cost | |-----------|--------------|------| | 1. Clarity | Explicit instructions, success criteria | Minimal | | 2. Context & Motivation | Explain WHY you want something | Minimal | | 3. Positive Framing | Say what TO do, not what NOT to do | Minimal | | 4. XML Structure | Separate sections in complex prompts | ~50-100 tokens |
Note: XML is less essential with Claude 4.x - use when genuinely needed.
| Technique | When to Use | Cost | |-----------|-------------|------| | 5. Effort / Thinking | Hard analysis, math, debugging | Higher effort = more tokens | | 6. Prompt Chaining | Multi-step, complex tasks | Multiple calls | | 7. Multishot Examples | Pattern learning, format | 200-1K each | | 8. System Role | Domain expertise needed | Minimal | | 9. Structured Outputs | Strict format requirements | Minimal | | 10. Long Context | 20K+ token inputs | Better accuracy | | 11. Context Budget | Repeated use, conversations | 90% savings | | 12. Tool Docs | Function calling, agents | 100-500/tool |
Before Writing:
Complexity Assessment:
Cost Optimization:
Deliverable:
When to use MCP tools during prompt engineering:
Need latest practices?
└─ WebSearch → Parallel Search
Need library docs?
└─ mcp__plugin_essentials_mcp (context7)
Prompt Caching:
Long Context Tips:
<document>, <source>Reducing Token Usage:
❌ Ignoring caching - Not leveraging repeated content (90% savings lost) ❌ Over-requesting effort - High effort for simple tasks (tokens wasted) ❌ Redundant examples - 5 examples when 2 suffice ❌ No batching - Real-time calls for non-urgent work (50% savings lost)
See LEVEL 2: Diagnostics for general fixes.
Detailed Technique Catalog:
reference/technique-catalog.md - Each technique explained with examples, token costs, combination strategiesReal-World Examples:
reference/examples.md - Before/after pairs for coding, analysis, extraction, agent tasksResearch Papers:
reference/research.md - Latest Anthropic research, benchmarks, best practices evolutionSearch for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer