Loading...
Loading...
Use this skill when crafting, iterating, or optimizing prompts for LLMs including zero-shot, few-shot, chain-of-thought, role prompting, structured output, and prompt chaining. Not for fine-tuning or training models. Not for evaluating model quality across benchmarks.
npx skill4agent add xcrrr/claude-skills prompt-engineer| Task | Approach |
|---|---|
| Get consistent structured output | Add explicit format spec + JSON schema example in the prompt |
| Improve reasoning accuracy | Use chain-of-thought: "Think step by step before answering" |
| Classify text reliably | Provide 2–3 labeled few-shot examples per class |
| Set model persona and constraints | Write a detailed system prompt before the user turn |
| Handle long complex tasks | Break into a prompt chain with intermediate outputs |
| Reduce hallucinations | Instruct model to cite sources or say "I don't know" explicitly |
| Make outputs deterministic | Lower temperature + explicit format constraints |
<document><query>---{{input}}Original vague prompt: "Summarize this customer review and tell me if it's positive or negative."SYSTEM:
You are a sentiment analysis assistant. You always respond with valid JSON only — no prose, no markdown fences. If you cannot determine sentiment, set "sentiment" to "unknown" and explain in "reason".
USER:
Analyze the following customer review. Return a JSON object with exactly these fields:
{
"sentiment": "positive" | "negative" | "neutral" | "unknown",
"confidence": 0.0–1.0,
"key_themes": ["theme1", "theme2"],
"summary": "one sentence summary",
"reason": "brief explanation of sentiment classification"
}
Review:
<review>
{{customer_review_text}}
</review>"unknown"confidenceTask: Classify contract clauses as "liability-limiting", "indemnification", "IP-assignment", or "other".
The model keeps misclassifying indemnification clauses as liability-limiting.SYSTEM:
You are a contract analysis assistant specializing in clause classification. Think through each clause step by step before classifying. Respond only in the format shown in the examples.
USER:
Classify each contract clause. Think step by step, then provide your classification.
---
EXAMPLE 1:
Clause: "Neither party shall be liable for indirect, incidental, or consequential damages arising out of this agreement."
Reasoning: This clause restricts what types of damages can be claimed. It limits liability exposure — it does not require one party to protect another. This is a liability cap, not an indemnification.
Classification: liability-limiting
---
EXAMPLE 2:
Clause: "Vendor shall indemnify, defend, and hold harmless Client from any third-party claims arising from Vendor's breach of this agreement."
Reasoning: This clause requires the Vendor to actively protect the Client from external claims. It creates an obligation to defend and compensate — this is indemnification, not merely limiting damages.
Classification: indemnification
---
EXAMPLE 3:
Clause: "All work product created by Contractor under this agreement is assigned to Client upon creation."
Reasoning: This clause transfers ownership of created works. It concerns who owns intellectual property, not liability or indemnification.
Classification: IP-assignment
---
Now classify this clause:
Clause: "{{clause_text}}"
Reasoning:Reasoning: