prompt-engineering
Skill4 starsChanged 9 months agoMITView on GitHub
Use this skill when writing, improving, or debugging prompts for any AI model — Claude, GPT, Gemini, or Copilot. Also use when designing plan-before-execute workflows, verification patterns, self-improvement loops, or structuring AI instructions for maximum clarity and output quality. Trigger on keywords: prompt, prompt engineering, instruct AI, system prompt, few-shot, chain-of-thought, AI instruction, prompt template, prompt pattern.
98 other projects use a version of this.
Adopted by
Most recently taken up by
- gromov0737/skillstheir own version, first seen Nov 29, 2026
- kaushik-holla/agent-skillstheir own version, first seen Nov 29, 2026
- martinholovsky/claude-skills-generatortheir own version, first seen Nov 29, 2026
- amutaal122/ai-engineer-mastertheir own version, first seen Nov 29, 2026
- Arslan-Ali-11/claude_skillstheir own version, first seen Nov 29, 2026
- afine907/skillstheir own version, first seen Nov 29, 2026
Used with
Projects with it also use security-checklist, multi-agent-orchestration and 7 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
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 4 projects that use this
xfstudioSkillllm-evaluation
Implement comprehensive evaluation strategies for LLM applications using automated metrics, human feedback, and benchmarking. Use when testing LLM performance, measuring AI application quality, or establishing evaluation frameworks.
Also in 3 projects that use this
MicrosoftSkillcost-optimization
Optimize existing Azure resources and analyze Reservations or Savings Plans. WHEN: \"optimize Azure costs\", \"reduce cloud spending\", \"rightsize resources\", \"find idle resources\", \"orphaned disk\", \"deleted VM still charged\", \"public IP still charging\", \"reservation utilization\", \"Savings Plan coverage\", \"commitment recommendation\", \"why is pay-as-you-go still charged\". DO NOT USE FOR: cost spikes, forecasts, pricing estimates, budgets, or governance.
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
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 6 projects that use this
Other versions98 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 98
- trycompai/comp★ 2.2ksame name
- niki914/zafiro★ 405same name
- CodeAlive-AI/ai-driven-development★ 194same name
- grandamenium/cortextos★ 106same name
- nahid-sparktales/agent-dispatcher★ 59same name
- martinholovsky/claude-skills-generator★ 48same name
- nimadorostkar/Claude-Skills-collection★ 41same name
- geekatron/jerry★ 37same name
- Bbar0n234/learnflow-ai★ 35same name
- sabahattink/antigravity-fullstack-hq★ 30same name
88 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 repository37 other files it gives its agents.
- .github/copilot-instructions.mdCopilot instructions
- ai-agent-designSkill
- ai-assisted-learningSkill
- ai-prompting-patternsSkill
- api-designSkill
- backend-devSkill
- career-growthSkill
- client-communicationSkill
- code-explanationSkill
- code-readingSkill
- code-reviewSkill
- cross-functional-collabSkill
- database-designSkill
- debugging-mindsetSkill
- devops-cicdSkill
- doc-creationSkill
- focus-productivitySkill
- frontend-designSkill
- git-workflowSkill
- incident-responseSkill
- internal-commsSkill
- interview-prepSkill
- mcp-builderSkill
- performance-reviewSkill
- problem-solvingSkill
- research-synthesisSkill
- resume-portfolioSkill
- self-healing-mindsetSkill
- side-project-planningSkill
- sprint-planningSkill
- system-designSkill
- technical-communicationSkill
- technical-mentoringSkill
- tech-researchSkill
- testingSkill
- threat-modelingSkill
- web-artifacts-builderSkill
The file
We split this skill into the rules it gives an agent
9 rules. 0 are common, 8 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 86 edited versions we read keep these.
8
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
The Golden Rule: If the output isn't what you wanted, the problem is almost always in the prompt — not the model.
- Distinctive: line 18
Every effective prompt has four components:
- Distinctive: line 42
Ask directly with no examples.
- Distinctive: line 71
Use clear separators to prevent the model from confusing instructions with content.
- Distinctive: line 105
Ask the model to critique its own output before finalizing.
- Distinctive: line 151
Always instruct the AI to verify its own work before presenting it.
- Distinctive: line 175
When the AI makes a mistake, don't just fix it — extract the lesson:
- Very specific: line 220
Delimiter Protection: Use """ or XML tags to clearly separate instructions from user content.
- Distinctive: line 221
Principle of Least Privilege: Don't give the AI more context or permissions than it needs for the task.
“Common” is measured: kept by at least 6 in 10 of the 86 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
Core Philosophy
A great prompt is not a magic spell — it's a specification. The more precisely you define the goal, context, constraints, and output format, the more reliably the AI performs. Think of prompting like writing a function signature: the model is the implementation, you are the interface designer.
The Golden Rule: If the output isn't what you wanted, the problem is almost always in the prompt — not the model.
Prompt Anatomy (4-Part Structure)
Every effective prompt has four components:
ROLE: Who the AI should be (expertise, perspective, voice)
GOAL: What you want done (specific, unambiguous task)
CONTEXT: Relevant background, data, constraints, examples
OUTPUT: Exact format, length, structure of the responseExample
ROLE: You are a senior TypeScript developer with expertise in React and Next.js.
GOAL: Review this component for performance issues and suggest specific improvements.
CONTEXT: This is a client component in Next.js 15 App Router.
Performance is critical — this renders on every keystroke.
[paste code here]
OUTPUT: List issues as BLOCKER / WARNING / SUGGESTION with specific fix for each.Core Techniques
Zero-Shot
Ask directly with no examples. Works for well-understood tasks.
Write a conventional commit message for this diff: [diff]Few-Shot
Provide 2–3 examples before the real task. Best for format-sensitive or pattern-matching tasks.
Examples:
Input: Added login form → Output: feat(auth): add login form with email/password
Input: Fixed null crash → Output: fix(api): handle null response from user endpoint
Now write a commit message for: [diff]Chain-of-Thought (CoT)
Force step-by-step reasoning. Add "Think step by step" or "Reason through this before answering."
Is this API design RESTful? Think step by step before answering.Role / Persona Assignment
Set expertise level and perspective upfront.
You are a security engineer specializing in OWASP Top 10.
Review this authentication code for vulnerabilities.Delimiters
Use clear separators to prevent the model from confusing instructions with content.
Refactor the following code:
"""
[code here]
"""
Rules: No external dependencies. TypeScript only. Preserve existing tests.Advanced Techniques
Self-Consistency
For critical decisions, run the same prompt 3 times and take the majority answer. Reduces variance on high-stakes reasoning.
Tree of Thought (ToT)
Force the model to explore multiple approaches before committing.
Propose three different approaches to solve this problem.
For each approach, list pros, cons, and implementation complexity.
Then recommend the best one with justification.ReAct (Reason + Act)
Interleave reasoning with action steps. Best for agentic or multi-step tasks.
Thought: What do I need to understand before solving this?
Action: [tool or analysis]
Observation: [result]
Thought: Based on this, the next step is...Metacognitive Prompting
Ask the model to critique its own output before finalizing.
After generating your answer, critically evaluate it:
- Are all steps logically valid?
- Are there unsupported assumptions?
- What could go wrong with this approach?
Correct any issues before presenting the final answer.COSTAR Framework
Structured template for complex prompts:
- Context — background information
- Objective — what you want done
- Style — tone and voice
- Tone — formal, casual, direct
- Audience — who will read this
- Response format — structure of output
Plan-Before-Execute Pattern
Never let AI jump straight to implementation for non-trivial tasks.
Step 1 — Plan: Outline your approach step by step.
Do NOT write any code yet.
Step 2 — Review: I will confirm the plan before you proceed.
Step 3 — Execute: Implement each step from the approved plan.When to Use Plan Mode
- Task spans multiple files or components
- Architectural decisions are involved
- Uncertainty exists about requirements
- Task has 3+ steps
When to Skip It
- Single-file, well-defined change
- Bug fix with obvious cause and solution
- Formatting or style-only change
Verification Patterns
Always instruct the AI to verify its own work before presenting it.
Before finalizing your answer:
1. Check that all steps are logically sound
2. Verify no assumptions were made that weren't stated
3. Confirm the output matches the requested format
4. Correct any issues you find
Then present the final answer.For code specifically:
After writing the code:
1. Trace through it mentally with a simple test case
2. Check all edge cases (null, empty, boundary values)
3. Verify error handling is present
4. Confirm it matches the requirements exactlySelf-Improvement Loop
When the AI makes a mistake, don't just fix it — extract the lesson:
I noticed an error in your previous response: [describe error]
1. Explain why this error occurred
2. State the general rule that would prevent it
3. Apply that rule to the corrected answerFor long sessions, maintain a lessons log:
Update your working notes with this lesson:
[lesson from the correction]
Apply this to all remaining tasks in this session.Model-Specific Tips
| Model | Strengths | Best Practices |
| Claude | Long context, nuanced reasoning, following complex instructions | Use XML-style tags for structure, provide CLAUDE.md for project context, explicit role assignment |
| GPT-4/4o | Strict format adherence, JSON output, code generation | Put instructions at top, use delimiters, hint at language with imports |
| Gemini | Research, citations, massive context windows, multi-modal | Request citations explicitly, define scope and time range, specify how to handle uncertainty |
| Copilot | In-editor context awareness, code completion | Use .github/copilot-instructions.md for project context, be explicit about stack |
Anti-Patterns (What to Avoid)
| Anti-Pattern | Problem | Fix |
| "Write code for X" | Too vague | Add role, constraints, output format |
| Treating first answer as final | Misses errors | Always include verification step |
| No examples for format-sensitive tasks | Wrong format | Add 2–3 few-shot examples |
| Skipping role assignment | Generic tone/depth | Always assign a specific expertise persona |
| Concatenating user input into system prompt | Prompt injection risk | Use delimiters, validate input, separate concerns |
| Over-prompting simple tasks | Wastes tokens | Match prompt complexity to task complexity |
Prompt Security
- Prompt Injection: User input that hijacks the model's behavior. Never concatenate raw user input into system prompts.
- Delimiter Protection: Use
"""or XML tags to clearly separate instructions from user content. - Principle of Least Privilege: Don't give the AI more context or permissions than it needs for the task.
- Input Validation: Sanitize user inputs before they reach the model in production systems.
See Also
references/prompt-templates.md— Ready-to-use prompt templates for common dev tasksai-prompting-patternsskill — Agent communication and intent clarification patternsai-agent-designskill — Building full agentic systems
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.

