prompt-engineer
Skill6 starsChanged 8 months agoMITView on GitHub
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.
74 other projects use a version of this.
Adopted by
Most recently taken up by
- santiago-migoni/claude-skillstheir own version, first seen Nov 8, 2026
- wanghongN/SkillsRepotheir own version, first seen Nov 8, 2026
- AxlZero21/Skillstheir own version, first seen Nov 8, 2026
- joe-qai/qa-skillstheir own version, first seen Nov 8, 2026
- lsyamsiar/claude-skillstheir own version, first seen Nov 1, 2026
- jaskirat1616/grok-skillstheir own version, first seen Nov 1, 2026
Used with
Projects with it also use idea-validator, webapp-testing and 5 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
dipaulavsSkillidea-validator
Validates app ideas before building. Analyzes market saturation, competitors, real demand vs stated interest, solo builder feasibility (2-4 weeks timeline), and monetization potential. Use when user asks to validate an idea, evaluate a concept, check if idea is worth building, or before starting a new project.
Also in 3 projects that use this
JetBrainsSkillwebapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
Also in 4 projects that use this
JetBrainsSkilldoc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision docs, or similar structured content. This workflow helps users efficiently transfer context, refine content through iteration, and verify the doc works for readers. Trigger when user mentions writing docs, creating proposals, drafting specs, or similar documentation tasks.
Also in 3 projects that use this
MicrosoftSkillapi-design
Guide for designing and documenting RESTful APIs. Use when asked to design an API, create endpoints, or document an API.
Also in 3 projects that use this
StrayDragonSkillui-ux-pro-max
UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient.
Also in 4 projects that use this
SentrySkillskill-creator
Create new agent skills following the Agent Skills specification. Use when asked to "create a skill", "add a new skill", "write a skill", "make a skill", "build a skill", or scaffold a new skill with SKILL.md. Guides through requirements, writing, registration, and verification.
Also in 6 projects that use this
Other versions74 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 74
- Jeffallan/claude-skills★ 12ksame name
- elithrar/dotfiles★ 222same name
- chrispangg/deepagentsdk★ 128same name
- aakashg/pm-claude-skills★ 106same name
- thedesignproject/agent-skills★ 88same name
- OpenCoven/coven★ 75same name
- monaccode/astromesh★ 39same name
- joe-qai/qa-skills★ 30same name
- jshsakura/awesome-opencode-skills★ 30same name
- Fandry96/k3-agentic-skills★ 27same name
64 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository68 other files it gives its agents.
- dataset-curatorSkill
- eval-designerSkill
- model-comparatorSkill
- business-analystSkill
- competitor-analystSkill
- market-researcherSkill
- meeting-facilitatorSkill
- okr-plannerSkill
- pitch-deck-writerSkill
- product-managerSkill
- ux-researcherSkill
- api-designerSkill
- architecture-designerSkill
- code-reviewerSkill
- debuggerSkill
- documentation-writerSkill
- refactorerSkill
- regex-masterSkill
- security-auditorSkill
- sql-expertSkill
- test-writerSkill
- chart-builderSkill
- dashboard-designerSkill
- data-analystSkill
- data-cleanerSkill
- excel-expertSkill
- sql-analystSkill
- color-paletteSkill
- design-critiquerSkill
- frontend-designSkill
- ux-writerSkill
- ci-cd-helperSkill
- docker-expertSkill
- kubernetes-helperSkill
- monitoring-setupSkill
- flashcard-makerSkill
- lesson-plannerSkill
- quiz-creatorSkill
- tutorSkill
- docxSkill
- pdfSkill
- pptxSkill
- xlsxSkill
- budget-plannerSkill
- financial-analystSkill
- invoice-generatorSkill
- contract-reviewerSkill
- legal-summarizerSkill
- terms-of-serviceSkill
- decision-makerSkill
- habit-builderSkill
- journalingSkill
- note-takerSkill
- task-plannerSkill
- citation-formatterSkill
- fact-checkerSkill
- literature-reviewerSkill
- summarizerSkill
- web-researcherSkill
- academic-essaySkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. 0 are common, 13 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 65 edited versions we read keep these.
13
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 52
Self-consistency: Run the same CoT prompt N times and majority-vote the answer.
- Distinctive: line 157
Always test prompts on at least 10 real inputs before declaring them production-ready
- Distinctive: line 159
Use the lowest effective temperature: 0.0 for deterministic extraction, 0.7–1.0 for creative tasks
- Distinctive: line 160
Prefer XML tags over triple backticks as delimiters — they're less likely to appear in real input
- Distinctive: line 161
Put the most important instructions at the beginning AND end of the prompt (primacy + recency effect)
- Distinctive: line 162
When using few-shot examples, ensure they cover the edge cases you care about most
- Distinctive: line 163
Keep system prompts focused — every sentence should earn its token budget
- Distinctive: line 164
Use "You must" and "Always" for hard constraints.
- Distinctive: line 168
Not specifying what to do when the model is uncertain — it will hallucinate a confident answer
- Distinctive: line 176
Add "Do not add any text before or after the JSON" to enforce clean parseable JSON output
- Distinctive: line 177
Use "If you are unsure, say 'I don't know' rather than guessing" to reduce hallucination
- Distinctive: line 181
Test prompt robustness by deliberately injecting adversarial inputs (e.g., "ignore previous instructions")
- Distinctive: line 182
Use Anthropic's Constitutional AI principles or OpenAI's system prompt best practices as references
“Common” is measured: kept by at least 6 in 10 of the 65 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Prompt Engineer
Overview
This skill covers systematic design and iteration of prompts for large language models (LLMs). It applies proven techniques — zero-shot, few-shot learning, chain-of-thought reasoning, role prompting, structured output constraints, system prompt design, and multi-step prompt chaining — to improve accuracy, consistency, and reliability of LLM outputs. The skill is applicable to any LLM API (OpenAI, Anthropic, Gemini, Mistral, open-source models) and covers both single-turn and multi-turn conversation design, as well as production-grade prompt templates with variable injection.
When to Use
- A prompt produces inconsistent, vague, or off-format outputs and needs iteration
- Designing prompts that must return structured JSON, XML, Markdown, or CSV output
- Building few-shot examples to guide classification, extraction, or transformation tasks
- Creating system prompts that establish persona, tone, constraints, or output rules
- Chaining multiple prompts together for complex multi-step reasoning tasks
- Reducing hallucination by adding grounding instructions, citations requirements, or self-checks
- Optimizing a prompt for a specific model (GPT-4, Claude, Llama, etc.) given its strengths
- Converting a vague user request into a precise, production-ready prompt template
When NOT to Use
- Fine-tuning or training a model on new data (use model training skills)
- Evaluating model quality across a benchmark suite (use eval-designer skill)
- Writing application code that calls the LLM API (use a coding skill)
- Comparing different LLMs for a use case (use model-comparator skill)
- RAG pipeline design (retrieval-augmented generation requires its own architecture skill)
Quick Reference
| 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 |
Instructions
- Define the task precisely — Write a one-sentence task definition: what the model must do, what the input is, and what the output must look like. Vague tasks produce vague outputs. Example: "Extract all company names and their associated revenue figures from the following earnings call transcript and return them as a JSON array."
- Choose the prompting technique — Select based on task complexity:
- Zero-shot: Simple tasks with clear instructions. No examples needed.
- Few-shot: Classification, formatting, or style tasks. Provide 2–5 labeled examples.
- Chain-of-thought (CoT): Math, logic, multi-step reasoning. Add "Think step by step."
- Role prompting: Tasks requiring expertise or persona. "You are a senior tax attorney…"
- Self-consistency: Run the same CoT prompt N times and majority-vote the answer.
- Prompt chaining: Decompose a complex task into sequential prompts where each feeds the next.
- Write the system prompt — For APIs that support system prompts (OpenAI, Anthropic), put persistent instructions here: role, output format, constraints, what to do when uncertain. Keep it under 500 tokens unless the task genuinely requires more context.
- Structure the user prompt — Use clear delimiters to separate instructions from input data. Use XML tags (
<document>,<query>), triple backticks, or---separators. Place instructions before the data, not after. - Specify output format explicitly — Tell the model exactly what format to use. If JSON, provide the schema or a filled example. If Markdown, show the heading structure. If a list, show how items should be formatted. Include a negative example if there is a common wrong format to avoid.
- Add few-shot examples — For classification or extraction tasks, include 2–5 examples in the prompt. Format them identically to the real input/output pair. Choose examples that cover edge cases and are representative of the real distribution.
- Iterate and test — Test on at least 10 representative inputs. Track: did the model follow the format? Did it hallucinate? Was the reasoning correct? Identify failure patterns and add instructions or examples to address them.
- Version and document the prompt — Save prompts in a template file with variable placeholders (
{{input}}). Document what model version it was tested on, what temperature, and what the expected pass rate is. - Optimize for the target model — Different models respond differently: Claude prefers XML tags and explicit role instructions; GPT-4 responds well to numbered instructions; open-source models often need more explicit format constraints. Test the same prompt on the target model even if it worked on another.
- Add safety and fallback instructions — Include: what to do if the input is out of scope, how to handle ambiguous inputs, whether to ask for clarification or make a best-effort attempt, and how to indicate low confidence.
Examples
Example 1: Improving a Vague Prompt to Get Structured JSON Output
Input:
Original vague prompt: "Summarize this customer review and tell me if it's positive or negative."Output:
Improved prompt (system + user):
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>Why this works:
- System prompt enforces JSON-only output at the model level
- Explicit schema with types eliminates ambiguity
- XML tag delimiter prevents the model from treating the review text as instructions
"unknown"fallback prevents hallucinated confident answersconfidencefield enables downstream filtering of low-quality classifications
Example 2: Few-Shot Chain-of-Thought Prompt for Legal Clause Classification
Input:
Task: Classify contract clauses as "liability-limiting", "indemnification", "IP-assignment", or "other".
The model keeps misclassifying indemnification clauses as liability-limiting.Output:
Few-shot CoT system prompt:
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:Why this works:
- Chain-of-thought examples show the model the reasoning pattern to distinguish similar categories
- The two easily-confused categories (liability vs indemnification) each get an explicit contrasting example
- Format template forces reasoning before classification, reducing snap-judgment errors
Reasoning:at the end primes the model to complete the reasoning before the answer
Best Practices
- Always test prompts on at least 10 real inputs before declaring them production-ready
- Version prompts in code just like application code — breaking changes in prompts are real bugs
- Use the lowest effective temperature: 0.0 for deterministic extraction, 0.7–1.0 for creative tasks
- Prefer XML tags over triple backticks as delimiters — they're less likely to appear in real input
- Put the most important instructions at the beginning AND end of the prompt (primacy + recency effect)
- When using few-shot examples, ensure they cover the edge cases you care about most
- Keep system prompts focused — every sentence should earn its token budget
- Use "You must" and "Always" for hard constraints; use "prefer" or "try to" for soft preferences
Common Mistakes
- Giving vague instructions like "be helpful and accurate" without specifying what accuracy means
- Not specifying what to do when the model is uncertain — it will hallucinate a confident answer
- Using too many few-shot examples (>10) which can cause the model to pattern-match instead of reason
- Forgetting to test the prompt on the actual target model — prompts are not portable across models
- Putting instructions after the input data — models weight early context more heavily
- Asking multiple distinct tasks in one prompt — split into separate prompts or clearly numbered steps
- Assuming the same prompt works at different temperatures — always co-tune prompt and temperature
Tips & Tricks
- Add "Do not add any text before or after the JSON" to enforce clean parseable JSON output
- Use "If you are unsure, say 'I don't know' rather than guessing" to reduce hallucination
- For long documents, use "Here is the most relevant section:" before the content to focus attention
- Chain-of-thought is most effective in the middle of a response — put format instructions last
- "Let's think step by step" reliably improves math and logic; for simpler tasks it wastes tokens
- Test prompt robustness by deliberately injecting adversarial inputs (e.g., "ignore previous instructions")
- Use Anthropic's Constitutional AI principles or OpenAI's system prompt best practices as references
Related Skills
- dataset-curator
- eval-designer
- model-comparator
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

