--:--:--
4b

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.

← IdentitàLibreria condivisa (MD_DB_v1)vsola lettura
da chi viene · l'abbiamo controllata

da accertare
mai vettata — nessuno l'ha ancora guardata; non vuol dire che sia a posto

dove sta
C:\Users\Ettore\Claude\Projects\MD_DB_v1\01_STRUMENTI_di_LAVORO\SKILLS\prompt-engineering\SKILL.md
C:\Users\Ettore\Claude\Projects\MD_DB_v1\01_STRUMENTI_di_LAVORO\SKILLS\prompt-engineering
SKILL.md
name: 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.

  1. "Summarize this paper: methodology, findings, implications."
  2. "Review the summary for accuracy. Provide graded feedback."
  3. "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

NeedTechnique
Specific output formatExamples, prefilling, explicit format instructions
Step-by-step reasoningExtended thinking or chain of thought
Complex multi-stage taskPrompt chaining
Prevent hallucinationsPermission to say "I don't know"
Consistent toneContext about audience and purpose

Troubleshooting

ProblemSolution
Too genericAdd specificity, examples, or "go beyond basics"
Off-topicExplain actual goal and why you're asking
Inconsistent formatAdd examples or prefilling
Unreliable complex resultsBreak into multiple prompts
Unnecessary preamblesUse prefilling or "Skip preamble"
Makes up informationGrant permission to say "I don't know"
Suggests instead of implementsBe explicit: "Change this" not "Can you suggest"

Common Mistakes

  1. Over-engineering: Longer ≠ better
  2. Ignoring basics: Advanced techniques don't fix unclear prompts
  3. Assuming mind-reading: Be specific about expectations
  4. Using every technique: Select only what addresses your challenge
  5. No iteration: First prompt rarely works perfectly
  6. 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).

peso
1850token · Opus 55057 caratteri

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.

modifica

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ì.

file accessori · 3
  • references/domains.md5.6 kB
  • references/patterns.md6.0 kB
  • SKILL.md4.9 kB
storico · 0 backup

nessuna modifica fatta da qui: nessun backup

commit sul file

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.

LIVE
1 AGENTE AL LAVORO ora · Romeo: chat Discord #romeo-brainstorm26 task in corso su 16818 progetti monitoratiHomelab · Censire HD e creare gallerie dei contenutiHomelab · RAG + NotebookLM locale per documenti voluminosiKB · Costruzione KB (template + 3 argomenti pilota)KB · Obsidian: setup e usoVita · Automazione piano pasti (dispensa→ricette→spesa→piano)Vita · Lista ingredienti collegata a ricette + preferite77 sessioni registrate1 AGENTE AL LAVORO ora · Romeo: chat Discord #romeo-brainstorm26 task in corso su 16818 progetti monitoratiHomelab · Censire HD e creare gallerie dei contenutiHomelab · RAG + NotebookLM locale per documenti voluminosiKB · Costruzione KB (template + 3 argomenti pilota)KB · Obsidian: setup e usoVita · Automazione piano pasti (dispensa→ricette→spesa→piano)Vita · Lista ingredienti collegata a ricette + preferite77 sessioni registrate