prompt-engineering
Comprehensive guide for crafting effective prompts that maximize LLM output quality. Use when (1) writing or reviewing system prompts, (2) optimizing prompts for better results, (3) creating prompts for specific use cases (coding, writing, analysis), (4) troubleshooting poor LLM responses, or (5) teaching prompt engineering techniques.
❔ da accertare
⚪ mai vettata — nessuno l'ha ancora guardata; non vuol dire che sia a posto
C:\Users\Ettore\Claude\Projects\MD_DB_v1\01_STRUMENTI_di_LAVORO\SKILLS\prompt-engineering\SKILL.mdC:\Users\Ettore\Claude\Projects\MD_DB_v1\01_STRUMENTI_di_LAVORO\SKILLS\prompt-engineeringname: prompt-engineering description: Comprehensive guide for crafting effective prompts that maximize LLM output quality. Use when (1) writing or reviewing system prompts, (2) optimizing prompts for better results, (3) creating prompts for specific use cases (coding, writing, analysis), (4) troubleshooting poor LLM responses, or (5) teaching prompt engineering techniques.
Prompt Engineering Skill
Craft prompts that produce reliable, high-quality LLM outputs.
Core Principles
1. Be Explicit and Clear
State exactly what you want. Don't assume the model will infer intent.
Vague: "Create a dashboard"
Explicit: "Create an analytics dashboard with user metrics, revenue charts, and export functionality. Include interactive filters for date range and user segments."
Lead with action verbs: "Write," "Analyze," "Generate," "Create"
2. Provide Context and Motivation
Explain why something matters. Context enables better decisions.
Less effective: "NEVER use bullet points"
More effective: "Write in flowing paragraphs because I find prose easier to read than lists for this learning content."
Include context about: purpose, audience, how output will be used, underlying problem.
3. Be Specific with Constraints
Vague: "Create a meal plan"
Specific: "Design a Mediterranean diet meal plan: 1,800 calories daily, low glycemic foods, vegetarian. Include breakfast, lunch, dinner, one snack with nutritional breakdowns."
Specify: word count, format, timeline, audience, requirements, restrictions.
4. Use Examples (Few-Shot Prompting)
Show rather than tell when format matters.
Here's the summary style I want:
Article: [AI regulation article]
Summary: EU passes AI Act targeting high-risk systems. Key: transparency requirements, human oversight. Effective 2026.
Now summarize this article in the same style: [new article]Start with one example. Add more only if output doesn't match expectations.
5. Grant Permission for Uncertainty
Reduce hallucinations by allowing "I don't know."
"Analyze this financial data. If data is insufficient to draw conclusions, say so rather than speculating."
Advanced Techniques
Chain of Thought (CoT)
Request step-by-step reasoning for complex analytical tasks.
Basic: Add "Think step-by-step" to instructions.
Guided:
Think before you write. First, analyze what messaging appeals to this donor. Then, identify relevant program aspects. Finally, write the personalized email.Structured:
Think in <thinking> tags. Analyze the donor, identify relevant aspects, then write the email in <email> tags.Prefilling (API Usage)
Start the AI's response to control format.
messages=[
{"role": "user", "content": "Extract name and price into JSON."},
{"role": "assistant", "content": "{"}
]In chat: "Output only valid JSON. Begin with an opening brace."
Prompt Chaining
Break complex tasks into sequential prompts.
- "Summarize this paper: methodology, findings, implications."
- "Review the summary for accuracy. Provide graded feedback."
- "Improve the summary based on this feedback: [step 2 output]"
Use when: complex multi-stage tasks, iterative refinement needed, single prompts produce inconsistent results.
Output Format Control
Tell what TO do, not what NOT to do:
- Instead of "Don't use markdown" → "Write in flowing prose paragraphs"
Match prompt style to desired output style.
Technique Selection Guide
| Need | Technique |
|---|---|
| Specific output format | Examples, prefilling, explicit format instructions |
| Step-by-step reasoning | Extended thinking or chain of thought |
| Complex multi-stage task | Prompt chaining |
| Prevent hallucinations | Permission to say "I don't know" |
| Consistent tone | Context about audience and purpose |
Troubleshooting
| Problem | Solution |
|---|---|
| Too generic | Add specificity, examples, or "go beyond basics" |
| Off-topic | Explain actual goal and why you're asking |
| Inconsistent format | Add examples or prefilling |
| Unreliable complex results | Break into multiple prompts |
| Unnecessary preambles | Use prefilling or "Skip preamble" |
| Makes up information | Grant permission to say "I don't know" |
| Suggests instead of implements | Be explicit: "Change this" not "Can you suggest" |
Common Mistakes
- Over-engineering: Longer ≠ better
- Ignoring basics: Advanced techniques don't fix unclear prompts
- Assuming mind-reading: Be specific about expectations
- Using every technique: Select only what addresses your challenge
- No iteration: First prompt rarely works perfectly
- Outdated techniques: XML tags and heavy role prompting are less necessary with modern models
Quick Reference
For specific prompt patterns and templates, see [references/patterns.md](references/patterns.md).
For domain-specific prompting (coding, writing, analysis), see [references/domains.md](references/domains.md).
Conteggio esatto dall'endpoint Anthropic count_tokens (gratuito, solo rate-limited), envelope del messaggio già sottratto. I caratteri sono un dato locale, servono da riscontro.
Questa skill è in sola lettura: la libreria condivisa si modifica nel vault, non da qui. Per lavorarci sopra si copia la cartella nello workspace di un agente e si modifica lì.
- references/domains.md5.6 kB
- references/patterns.md6.0 kB
- SKILL.md4.9 kB
nessuna modifica fatta da qui: nessun backup
questo workspace non è un repo git
Scrittura consentita solo dentro le cartelle skills\ dei workspace del registro e solo sul file SKILL.md (deroga alla stanza Identità autorizzata da Ettore il 2026-08-10). Ogni salvataggio crea prima un backup datato; nessun file viene mai cancellato.