mit einem Klick
prompt-engineering
// Write, optimize, and debug prompts. Trigger on 'prompt', 'system prompt', 'few-shot', 'chain of thought', 'prompt template', 'reduce tokens', 'prompt caching'.
// Write, optimize, and debug prompts. Trigger on 'prompt', 'system prompt', 'few-shot', 'chain of thought', 'prompt template', 'reduce tokens', 'prompt caching'.
[HINT] Laden Sie das komplette Skill-Verzeichnis einschließlich SKILL.md und aller zugehörigen Dateien herunter
| name | prompt-engineering |
| description | Write, optimize, and debug prompts. Trigger on 'prompt', 'system prompt', 'few-shot', 'chain of thought', 'prompt template', 'reduce tokens', 'prompt caching'. |
Before touching a prompt, assess whether optimization is even the right move. Many "prompt problems" are actually data problems or architecture problems.
Pick the right optimization strategy based on how the prompt will be used.
| Aspect | Single-Turn | Multi-Turn |
|---|---|---|
| When | One prompt → one response (API calls, templates, classification) | Conversation chains, iterative refinement, agent loops |
| Key techniques | Role framing, structured output, few-shot examples, CoT | Context management, memory summarization, state tracking |
| Common pitfall | Over-engineering with multi-turn patterns (adds latency, no benefit) | Under-specifying conversation boundaries (model "forgets" role) |
| Caching | Prefix caching (stable system prompt first), response caching at temp=0 | Cache system prompt only; conversation turns invalidate response cache |
| Testing | Fixed input/output pairs, easy to A/B test | Scenario-based testing, harder to reproduce — test conversation flows |
Rule of thumb: If the prompt executes in a single LLM call, use single-turn techniques only. Multi-turn patterns (memory, summarization, state) add complexity for zero benefit on one-shot prompts.
rag-search skill)api-design skill)<rules>, <input>, <output> tags create clear section boundaries the model parses reliably — especially effective for weaker/smaller models{{variable}}, {% if %}) for reusable prompt templates. Store templates in files, not inline. Security: templates MUST be author-written, never user-suppliedBanned patterns. If you see these in a prompt, flag and fix immediately.
| Anti-Pattern | Why It Fails | Fix |
|---|---|---|
| "Be creative" / "Be helpful" | Vague, model already tries to be helpful — adds zero signal | Remove, or replace with specific behavioral instruction |
| "Do NOT hallucinate" | Model cannot reliably self-detect hallucination; creates false confidence | Add grounding: "Only use information from the provided context. If unsure, say 'I don't know'" |
| Wall of rules (>15 bullets) | Attention degrades on long flat lists — later rules get ignored | Group into prioritized sections (CRITICAL / IMPORTANT / NICE-TO-HAVE), max 5-7 per group |
| Contradictory instructions | "Be concise" + "Explain thoroughly" — model oscillates unpredictably | Pick one stance per section; use conditional triggers ("If user asks for detail, then expand") |
| Repeating the same instruction 3+ times | Wastes tokens, signals uncertainty to model, no accuracy gain after 2nd mention | State once clearly, optionally reinforce once in a different section |
| "Think step by step" on trivial tasks | CoT adds latency and tokens for zero accuracy gain on simple classification/extraction | Reserve CoT for reasoning-heavy tasks (math, multi-hop, analysis). Direct prompting for simple tasks |
| Excessive emphasis (ALL CAPS, !!!, bold everywhere) | ALL CAPS has zero measurable effect on compliance — "NEVER do X" performs the same as "Never do X". When everything is emphasized, nothing is | Reserve emphasis for structural markers (section headers). Max 3 emphasis markers per prompt |
| Few-shot examples that don't match target | Examples from a different domain/format confuse more than help | Examples must match the exact task format, domain, and edge cases |
| Prompt says "you are an expert" without constraints | Model generates confident-sounding but ungrounded output | Add domain boundaries: "You are an expert in X. You do NOT answer questions about Y" |
| No output format specification | Model picks random format each time — inconsistent parsing downstream | Always specify: JSON schema, bullet format, table structure, or "respond in exactly N sentences" |