Prompt Engineering
Skill1 starsChanged 7 months agoMITView on GitHub
Design, optimize, and evaluate prompts for Claude. Covers system prompts, few-shot examples, chain-of-thought reasoning, structured output, and systematic evaluation of prompt quality. Trigger phrases: "design a prompt", "optimize prompt", "prompt engineering", "write a system prompt", "improve my prompt", "prompt template", "few-shot examples"
2 other projects use a version of this.
Adopted by
Most recently taken up by
- OpenLabor/openlabortheir own version, first seen Aug 27, 2026
- ralfyishere/rules-with-receiptstheir own version, first seen Jul 8, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- OpenLabor/openlabor★ 5same name
- ralfyishere/rules-with-receipts★ 2same name
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 repository164 other files it gives its agents.
- instrument-data-to-allotropeSkill
- literature-reviewSkill
- nextflow-developmentSkill
- scientific-problem-selectionSkill
- scvi-toolsSkill
- single-cell-rna-qcSkill
- discover-brandSkill
- enforce-voiceSkill
- generate-guidelinesSkill
- csat-reportSkill
- customer-escalationSkill
- customer-researchSkill
- draft-responseSkill
- kb-articleSkill
- sentiment-analysisSkill
- ticket-triageSkill
- analyzeSkill
- build-dashboardSkill
- create-vizSkill
- data-context-extractorSkill
- data-modelingSkill
- data-pipelineSkill
- etl-designSkill
- explore-dataSkill
- sql-queriesSkill
- statistical-analysisSkill
- validate-dataSkill
- write-querySkill
- accessibility-reviewSkill
- component-librarySkill
- design-critiqueSkill
- design-handoffSkill
- design-systemSkill
- frontend-designSkill
- research-synthesisSkill
- user-researchSkill
- ux-copySkill
- wireframingSkill
- Agent DevelopmentSkill
- CLAUDE.md ManagementSkill
- MCP Server BuilderSkill
- Plugin DevelopmentSkill
- Skill CreatorSkill
- curriculum-designSkill
- lesson-planningSkill
- quiz-generatorSkill
- study-guideSkill
- tutoringSkill
- api-designSkill
- architectureSkill
- ci-cd-pipelineSkill
- code-reviewSkill
- database-migrationSkill
- debugSkill
- dependency-auditSkill
- deploy-checklistSkill
- documentationSkill
- error-handlingSkill
- git-workflowSkill
- incident-responseSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
12 rules. About 0 are common, 12 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈12
Distinctive · estimate
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 56
Write the initial prompt following these structural principles:
- Distinctive: line 62
Examples: - if using few-shot, place here
- Distinctive: line 65
Use XML tags to separate sections:
- Distinctive: line 92
When using few-shot prompting:
- Distinctive: line 98
Keep examples representative of real inputs
- Distinctive: line 107
Test edge cases: - run unusual inputs and fix failures
- Distinctive: line 108
Check consistency: - verify output format matches across runs
- Distinctive: line 113
Create an evaluation framework:
- Distinctive: line 116
Run each input through the prompt
- Distinctive: line 129
Test cases for ongoing quality monitoring
- Distinctive: line 143
Action: Create a role-based system prompt with specific review criteria (security, performance, readability), severity levels, and …
- Distinctive: line 155
Front-load critical instructions: - put the most important rules first
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Prompt Engineering
Design high-quality prompts for Claude that produce reliable, accurate, and well-structured outputs across diverse use cases.
Prerequisites
- Clear understanding of the task the prompt should accomplish
- Example inputs and desired outputs
- Knowledge of the target audience and context
- Access to Claude API or Claude Code for testing
Workflow
Step 1: Define the Task
Establish clear requirements:
- Objective - what should the prompt accomplish in one sentence
- Input format - what data will the prompt receive
- Output format - exact structure of the desired response
- Constraints - length limits, tone, forbidden content, required elements
- Edge cases - unusual inputs the prompt must handle
- Evaluation criteria - how to measure prompt quality
Step 2: Choose the Prompt Pattern
Select the appropriate technique based on the task:
Direct instruction: Simple tasks with clear requirements. State what to do plainly.
System prompt + user prompt: Tasks requiring persistent persona or rules. System prompt sets behavior; user prompt provides the specific request.
Few-shot examples: Tasks where showing is easier than telling. Provide 2-5 input/output pairs before the actual input.
Chain-of-thought: Complex reasoning tasks. Instruct the model to think step-by-step before answering.
Structured output: Tasks requiring specific formats. Define the output schema explicitly using XML tags, JSON, or Markdown.
Role-based: Tasks benefiting from domain expertise. Assign a specific expert role with relevant knowledge.
Step 3: Draft the Prompt
Write the initial prompt following these structural principles:
- Context first - provide background before the task
- Task statement - clear, unambiguous instruction
- Constraints - rules and boundaries
- Output format - explicit format specification
- Examples - if using few-shot, place here
- Input data - the actual content to process
Use XML tags to separate sections:
<context>
Background information about the task domain.
</context>
<task>
What Claude should do with the input.
</task>
<constraints>
- Rule 1
- Rule 2
</constraints>
<output_format>
Description of the expected output structure.
</output_format>
<input>
{{user_input}}
</input>Step 4: Add Few-Shot Examples
When using few-shot prompting:
- Include 2-5 diverse examples covering different scenarios
- Order examples from simple to complex
- Show the exact output format you expect
- Include at least one edge case example
- Keep examples representative of real inputs
Step 5: Optimize the Prompt
Iterate on the draft:
- Remove ambiguity - eliminate words with multiple interpretations
- Reduce length - cut redundant instructions without losing clarity
- Strengthen constraints - make rules more specific and enforceable
- Test edge cases - run unusual inputs and fix failures
- Check consistency - verify output format matches across runs
- Measure quality - score outputs against evaluation criteria
Step 6: Evaluate Systematically
Create an evaluation framework:
- Build a test set of 10-20 diverse inputs with expected outputs
- Run each input through the prompt
- Score each output on your evaluation criteria (accuracy, format, completeness)
- Calculate aggregate metrics
- Identify failure patterns and iterate
Output Format
The skill produces:
- Complete prompt text ready for use
- System prompt (if applicable) separated from user prompt
- Few-shot examples (if applicable)
- Evaluation criteria checklist
- Test cases for ongoing quality monitoring
Examples
Example 1: Data Extraction Prompt
User: "Create a prompt that extracts contact info from emails"
Action: Design a structured extraction prompt with XML output tags, few-shot examples of various email formats, and handling for missing fields.
Example 2: Code Review Prompt
User: "Design a system prompt for automated code review"
Action: Create a role-based system prompt with specific review criteria (security, performance, readability), severity levels, and structured feedback format.
Example 3: Classification Prompt
User: "Build a prompt for categorizing support tickets"
Action: Design a chain-of-thought classification prompt with category definitions, few-shot examples per category, confidence scoring, and multi-label support.
Best Practices
- Be explicit about format - show the exact output structure, do not assume
- Use XML tags for structure - they improve parsing and reduce format drift
- Front-load critical instructions - put the most important rules first
- Avoid negations when possible - "use formal tone" over "don't be informal"
- Test with adversarial inputs - try inputs designed to break the prompt
- Keep system prompts stable - change user prompts for per-request variation
- Document prompt versions - track what changed and why
- Measure before optimizing - establish a baseline before making changes
- Use temperature thoughtfully - lower for consistency, higher for creativity
- Iterate in small steps - change one thing at a time to isolate improvements
Error Handling
| Error | Cause | Recovery |
| Format drift | Output structure varies across runs | Add stricter format instructions and examples |
| Hallucination | Model generates unsupported claims | Add grounding constraints, require citations |
| Instruction skipping | Model ignores some rules | Move ignored rules to more prominent position |
| Over-verbosity | Output far exceeds desired length | Add explicit length constraints with word counts |
| Edge case failure | Unusual inputs produce bad output | Add few-shot examples for edge cases |
| Inconsistent quality | Quality varies across inputs | Add chain-of-thought reasoning step |
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.

