← ClaudeAtlas

prompt-engineeringlisted

Use when helping user write an LLM prompt. Cover structure, examples, output format, anti-patterns.
liujiarui0918/claude-code-codex-strongest · ★ 0 · AI & Automation · score 62
Install: claude install-skill liujiarui0918/claude-code-codex-strongest
# Prompt Engineering — Write Prompts That Work When the user asks you to help write or improve a prompt for an LLM, work from a structure. Don't just "polish" — diagnose what's missing and add it. ## Iron Law **Test a prompt with at least 3 different inputs before declaring it done.** A prompt that works on one example is not a prompt; it's a coincidence. If you can't run the prompt, at least walk through it mentally with 3 inputs and predict the output. ## Anatomy of a Working Prompt A good prompt has these elements, in roughly this order: 1. **Role / context** — who is the model acting as? What's the situation? 2. **Task** — what specifically should it do? One sentence. 3. **Constraints** — must / must-not. Brief, explicit. 4. **Examples** (few-shot) — 1-3 input → output pairs. Diverse. 5. **Output format** — concrete structure (XML / JSON / markdown / labeled sections). 6. **Evaluation criteria** (optional) — how to judge a good response. Not every prompt needs all six. But missing more than two usually breaks it. ## Few-Shot vs Zero-Shot - Zero-shot works for simple, well-known tasks ("translate this to French"). - Few-shot beats zero-shot for: domain-specific formats, unusual output structures, edge cases the model would otherwise miss. - **3 examples is the sweet spot.** 1 example is risky (looks like an instance, not a pattern). 5+ has diminishing returns and bloats the prompt. - Make examples **diverse**: different lengths, different edge cases, including one