prompt-engineering
Skill1 starsChanged 9 months agoMITView on GitHub
Optimize prompts for LLMs - structure, clarity, and effectiveness. Use when writing system prompts, designing AI features, or improving LLM interactions.
We split this skill into the rules it gives an agent
1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.
0
Common
Most of the 69 edited versions we read keep these.
1
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 307
Edge cases: Test with unusual inputs
“Common” is measured: kept by at least 6 in 10 of the 69 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 Engineering
When to Use This Skill
- Writing system prompts for AI applications
- Designing AI-powered features
- Optimizing existing prompts for better results
- Reducing hallucinations and improving accuracy
- Building RAG systems or AI agents
Core Principles
1. Be Specific and Clear
❌ Bad: "Summarize this"
✅ Good: "Summarize this article in 3 bullet points, focusing on:
- The main argument
- Key supporting evidence
- The conclusion
Keep each bullet under 25 words."2. Provide Context
❌ Bad: "Fix this code"
✅ Good: "You are a senior Python developer reviewing code for a production API.
The following function handles user authentication.
Review for security vulnerabilities and suggest fixes with explanations."3. Use Examples (Few-Shot)
Convert product descriptions to JSON format.
Example 1:
Input: "Blue cotton t-shirt, size M, $29.99"
Output: {"color": "blue", "material": "cotton", "type": "t-shirt", "size": "M", "price": 29.99}
Example 2:
Input: "Red leather wallet, $45"
Output: {"color": "red", "material": "leather", "type": "wallet", "price": 45}
Now convert:
Input: "Black wool sweater, size L, $89.50"4. Structured Output
Analyze the following customer feedback and respond in this exact format:
SENTIMENT: [positive/negative/neutral]
TOPICS: [comma-separated list]
URGENCY: [low/medium/high]
SUGGESTED_ACTION: [one sentence]
SUMMARY: [2-3 sentences]Prompt Patterns
Role Pattern
You are an expert [ROLE] with [EXPERIENCE/QUALIFICATIONS].
Your task is to [SPECIFIC TASK].
Consider [CONSTRAINTS/REQUIREMENTS].Example:
You are a senior security engineer with 10 years of experience in web application security.
Your task is to review this authentication code for vulnerabilities.
Consider OWASP Top 10, common attack vectors, and secure coding best practices.Chain of Thought
Solve this step by step:
1. First, identify [X]
2. Then, analyze [Y]
3. Consider [Z]
4. Finally, conclude with [ANSWER]
Show your reasoning for each step.Self-Consistency
Approach this problem from three different angles:
1. [Approach A]
2. [Approach B]
3. [Approach C]
Then synthesize the insights into a final answer.Reflection Pattern
After generating your response:
1. Review your answer for accuracy
2. Check for any logical errors
3. Verify all facts mentioned
4. If you find issues, correct them
Mark corrections with [CORRECTED].System Prompt Structure
# Role
You are [ROLE DESCRIPTION].
# Context
[BACKGROUND INFORMATION]
[CONSTRAINTS]
[USER CONTEXT]
# Instructions
[PRIMARY TASK]
[SPECIFIC REQUIREMENTS]
[OUTPUT FORMAT]
# Guidelines
- [GUIDELINE 1]
- [GUIDELINE 2]
- [GUIDELINE 3]
# Examples
[EXAMPLE INPUT/OUTPUT PAIRS]
# Edge Cases
- If [CONDITION], then [ACTION]
- Never [PROHIBITED ACTION]Reducing Hallucinations
Ground in Facts
Answer based ONLY on the provided context.
If the information is not in the context, say "I don't have enough information to answer this."
Context:
[PROVIDED DOCUMENTS/DATA]
Question: [USER QUESTION]Require Citations
For each claim you make, cite the source from the provided documents.
Format: [CLAIM] (Source: [DOCUMENT NAME], Section: [SECTION])
If you cannot cite a source, prefix with "Based on general knowledge:" or don't include it.Confidence Levels
Rate your confidence in each statement:
- HIGH: Directly stated in sources
- MEDIUM: Reasonably inferred from sources
- LOW: Extrapolated or uncertain
Format: [STATEMENT] [CONFIDENCE: HIGH/MEDIUM/LOW]Output Control
Length Control
Respond in exactly:
- One sentence (for simple queries)
- One paragraph (for explanations)
- 3-5 bullet points (for lists)
- No more than 200 words (for summaries)Format Control
Respond using this JSON schema:
{
"answer": string,
"confidence": number (0-1),
"sources": string[],
"follow_up_questions": string[]
}Tone Control
Write in a [TONE] tone:
- Professional: Formal language, third person
- Friendly: Conversational, second person
- Technical: Precise terminology, detailed
- Simple: Plain language, no jargonRAG-Specific Prompts
Document QA
You are a helpful assistant that answers questions based on provided documents.
Instructions:
1. Read the provided context carefully
2. Answer ONLY based on the context
3. If the answer isn't in the context, say "I cannot find this information in the provided documents"
4. Quote relevant passages when helpful
5. If multiple documents conflict, note the discrepancy
Context:
{context}
Question: {question}
Answer:Multi-Document Synthesis
Synthesize information from the following sources to answer the question.
Requirements:
- Combine insights from all relevant sources
- Note any contradictions between sources
- Cite sources for key claims
- Indicate gaps in available information
Sources:
{documents}
Question: {question}Agent Prompts
Tool Use
You have access to these tools:
{tool_descriptions}
To use a tool, format your response as:
THOUGHT: [Your reasoning about what to do]
ACTION: [tool_name]
INPUT: [tool input]
After receiving tool output:
OBSERVATION: [What you learned]
THOUGHT: [Next step reasoning]
...
When you have the final answer:
THOUGHT: I now have enough information
FINAL_ANSWER: [Your response to the user]Planning
Before taking action, create a plan:
1. UNDERSTAND: What is the user asking for?
2. DECOMPOSE: Break into subtasks
3. SEQUENCE: Order the subtasks
4. EXECUTE: Complete each subtask
5. VERIFY: Check the result
6. RESPOND: Provide the answerOptimization Tips
| Issue | Solution |
| Too verbose | Add "Be concise" or word limits |
| Missing details | Add "Explain your reasoning" |
| Wrong format | Provide explicit format example |
| Inconsistent | Add more examples |
| Hallucinating | Ground with "Based only on..." |
| Off-topic | Add role constraints |
| Too generic | Add specific context |
Testing Prompts
- Edge cases: Test with unusual inputs
- Adversarial: Try to break the prompt
- Consistency: Same input multiple times
- Length: Short and long inputs
- Ambiguity: Unclear requests
Other versions78 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 78
- trycompai/comp★ 2ksame name
- niki914/zafiro★ 319same name
- CodeAlive-AI/ai-driven-development★ 167same name
- grandamenium/cortextos★ 101same name
- nahid-sparktales/agent-dispatcher★ 59same name
- geekatron/jerry★ 37same name
- Bbar0n234/learnflow-ai★ 35same name
- nimadorostkar/Claude-Skills-collection★ 33same name
- sabahattink/antigravity-fullstack-hq★ 30same name
- VoDaiLocz/kilo-kit-mcp★ 28same name
68 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.
Used alongsideProjects with it also use security-checklist, coding-principles and 9 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.
atuljha23Skillsecurity-checklist
OWASP-style quick reference — authn/authz, injection, secrets, sessions, crypto, dependencies. Use during code review and before committing security-sensitive changes.
Also in 3 projects that use this
GoogleSkillcoding-principles
Enforces engineering, architecture, public API, and code quality standards distilled from human reviewer feedback across A2UI pull requests. Use when authoring new code, refactoring, addressing review feedback, or reviewing PR diffs. Don't use for release publishing or spec blueprint generation without code or PR changes.
Also in 3 projects that use this
javalenciacaiSkillmulti-agent-orchestration
Design and coordinate multi-agent systems where specialized agents work together to solve complex problems. Covers agent communication, task delegation, workflow orchestration, and result aggregation. Use when building coordinated agent teams, complex workflows, or systems requiring specialized expertise across domains.
Also in 3 projects that use this
pproencaSkillrefactoring
Code refactoring best practices based on Martin Fowler's catalog and Clean Code principles. This skill should be used when refactoring existing code, improving code structure, reducing complexity, eliminating code smells, or reviewing code for maintainability. Triggers on tasks involving extract method, rename, decompose conditional, reduce coupling, or improve readability.
Also in 5 projects that use this
LangChainSkillweb-research
Use this skill for requests related to web research; it provides a structured approach to conducting comprehensive web research
Also in 4 projects that use this
harrissohail6Skilldatabase-design
Database schema design and SQL best practices. Use when designing tables, writing queries, or optimizing database performance.
Also in 4 projects that use this
In this repository125 other files it gives its agents.
- skills/vercel-composition-patterns/AGENTS.mdAGENTS.md
- skills/vercel-react-best-practices/AGENTS.mdAGENTS.md
- skills/vercel-react-native-skills/AGENTS.mdAGENTS.md
- address-sanitizerSkill
- aflppSkill
- algorand-vulnerability-scannerSkill
- algorithmic-artSkill
- ask-questions-if-underspecifiedSkill
- atherisSkill
- audit-context-buildingSkill
- audit-prep-assistantSkill
- autonomous-skillSkill
- aws-skillsSkill
- better-authSkill
- brainstormingSkill
- brand-guidelinesSkill
- burpsuite-project-parserSkill
- cairo-vulnerability-scannerSkill
- canvas-designSkill
- cargo-fuzzSkill
- changelog-generatorSkill
- claude-in-chrome-troubleshootingSkill
- cloudflare-skillsSkill
- code-maturity-assessorSkill
- codeqlSkill
- codex-skillSkill
- constant-time-analysisSkill
- constant-time-testingSkill
- cosmos-vulnerability-scannerSkill
- coverage-analysisSkill
- d3js-visualizationSkill
- db-resetSkill
- deep-researchSkill
- deploySkill
- dev-startSkill
- differential-reviewSkill
- dispatching-parallel-agentsSkill
- doc-coauthoringSkill
- doc-generateSkill
- documentationSkill
- docxSkill
- dwarf-expertSkill
- entry-point-analyzerSkill
- env-checkSkill
- executing-plansSkill
- expo-skillsSkill
- finishing-a-development-branchSkill
- firebase-apk-scannerSkill
- fix-reviewSkill
- frontend-designSkill
- fuzzing-dictionarySkill
- fuzzing-obstaclesSkill
- git-automationSkill
- google-design-mdSkill
- guidelines-advisorSkill
- harness-writingSkill
- health-checkSkill
- huggingface-skillsSkill
- insecure-defaultsSkill
- internal-commsSkill
- The first 60 shown.
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.

