agentleFS
chrispanggchrispangg/deepagentsdk/.cursor/skills/prompt-engineer/SKILL.md

prompt-engineer

Skill128 starsChanged 10 months agoMITView on GitHub

Use this skill when creating, improving, or optimizing prompts for Claude. Applies Anthropic's best practices for prompt engineering including clarity, structure, consistency, hallucination reduction, and security. Useful when users request help with writing prompts, improving existing prompts, reducing errors, increasing consistency, or implementing specific techniques like chain-of-thought, multishot prompting, or XML structuring.

We split this skill into the rules it gives an agent

11 rules. 0 are common, 11 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 61 edited versions we read keep these.

  • 11

    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
  1. Distinctive:

    Ask clarifying questions to understand:

    line 29
  2. Distinctive:

    Use XML tags for structure

    line 42
  3. Distinctive:

    Read the appropriate reference file(s) based on techniques needed:

    line 57
  4. Distinctive:

    Structure: Use XML tags to organize

    line 111
  5. Distinctive:

    Run prompt multiple times with varied inputs

    line 149
  6. Distinctive:

    Check consistency across runs

    line 150
  7. Distinctive:

    Verify outputs match expected format

    line 151
  8. Distinctive:

    Test and measure improvement

    line 161
  9. Distinctive:

    Start with core techniques and add advanced patterns only when needed.

    line 178
  10. Distinctive:

    When delivering prompts, explain which techniques were used and why.

    line 181
  11. Distinctive:

    Always validate critical outputs, especially for high-stakes applications.

    line 184

“Common” is measured: kept by at least 6 in 10 of the 61 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Prompt Engineering Skill

This skill provides comprehensive guidance for creating effective prompts for Claude based on Anthropic's official best practices. Use this skill whenever working on prompt design, optimization, or troubleshooting.

Overview

Apply proven prompt engineering techniques to create high-quality, reliable prompts that produce consistent, accurate outputs while minimizing hallucinations and implementing appropriate security measures.

When to Use This Skill

Trigger this skill when users request:

  • Help writing a prompt for a specific task
  • Improving an existing prompt that isn't performing well
  • Making Claude more consistent, accurate, or secure
  • Creating system prompts for specialized roles
  • Implementing specific techniques (chain-of-thought, multishot, XML tags)
  • Reducing hallucinations or errors in outputs
  • Debugging prompt performance issues

Workflow

Step 1: Understand Requirements

Ask clarifying questions to understand:

  • Task goal: What should the prompt accomplish?
  • Use case: One-time use, API integration, or production system?
  • Constraints: Output format, length, style, tone requirements
  • Quality needs: Consistency, accuracy, security priorities
  • Complexity: Simple task or multi-step workflow?

Step 2: Identify Applicable Techniques

Based on requirements, determine which techniques to apply:

Core techniques (for all prompts):

  • Be clear and direct
  • Use XML tags for structure

Specialized techniques:

  • Role-specific expertise → System prompts
  • Complex reasoning → Chain of thought
  • Format consistency → Multishot prompting
  • Multi-step tasks → Prompt chaining
  • Long documents → Long context tips
  • Deep analysis → Extended thinking
  • Factual accuracy → Hallucination reduction
  • Output consistency → Consistency techniques
  • Security concerns → Jailbreak mitigation

Step 3: Load Relevant References

Read the appropriate reference file(s) based on techniques needed:

For basic prompt improvement:

Read references/core_prompting.md

Covers: clarity, system prompts, XML tags

For complex tasks:

Read references/advanced_patterns.md

Covers: chain of thought, multishot, chaining, long context, extended thinking

For specific quality issues:

Read references/quality_improvement.md

Covers: hallucinations, consistency, security

Step 4: Design the Prompt

Apply techniques from references to create the prompt structure:

Basic Template:

[System prompt - optional, for role assignment]

<context>
Relevant background information
</context>

<instructions>
Clear, specific task instructions
Use numbered steps for multi-step tasks
</instructions>

<examples>
  <example>
    <input>Sample input</input>
    <output>Expected output</output>
  </example>
  [2-4 more examples if using multishot]
</examples>

<output_format>
Specify exact format (JSON, XML, markdown, etc.)
</output_format>

[Actual task/question]

Key Design Principles:

  1. Clarity: Be explicit and specific
  2. Structure: Use XML tags to organize
  3. Examples: Provide 3-5 concrete examples for complex formats
  4. Context: Give relevant background
  5. Constraints: Specify output requirements clearly

Step 5: Add Quality Controls

Based on quality needs, add appropriate safeguards:

For factual accuracy:

  • Grant permission to say "I don't know"
  • Request quote extraction before analysis
  • Require citations for claims
  • Limit to provided information sources

For consistency:

  • Provide explicit format specifications
  • Use response prefilling
  • Include diverse examples
  • Consider prompt chaining

For security:

  • Add harmlessness screening
  • Establish clear ethical boundaries
  • Implement input validation
  • Use layered protection

Step 6: Optimize and Test

Optimization checklist:

  • Could someone with minimal context follow the instructions?
  • Are all terms and requirements clearly defined?
  • Is the desired output format explicitly specified?
  • Are examples diverse and relevant?
  • Are XML tags used consistently?
  • Is the prompt as concise as possible while remaining clear?

Testing approach:

  • Run prompt multiple times with varied inputs
  • Check consistency across runs
  • Verify outputs match expected format
  • Test edge cases
  • Validate quality controls work

Step 7: Iterate Based on Results

Debugging process:

  1. Identify failure points
  2. Review relevant reference material
  3. Apply appropriate techniques
  4. Test and measure improvement
  5. Repeat until satisfactory

Common Issues and Solutions:

IssueSolutionReference
Inconsistent formatAdd examples, use prefillingquality_improvement.md
HallucinationsAdd uncertainty permission, quote groundingquality_improvement.md
Missing stepsBreak into subtasks, use chainingadvanced_patterns.md
Wrong toneAdd role to system promptcore_prompting.md
Misunderstands taskAdd clarity, provide contextcore_prompting.md
Complex reasoning failsAdd chain of thoughtadvanced_patterns.md

Important Principles

Progressive Disclosure Start with core techniques and add advanced patterns only when needed. Don't over-engineer simple prompts.

Documentation When delivering prompts, explain which techniques were used and why. This helps users understand and maintain them.

Validation Always validate critical outputs, especially for high-stakes applications. No prompting technique eliminates all errors.

Experimentation Prompt engineering is iterative. Small changes can have significant impacts. Test variations and measure results.

Quick Reference Guide

Technique Selection Matrix

User NeedPrimary TechniqueReference File
Better clarityBe clear and directcore_prompting.md
Domain expertiseSystem promptscore_prompting.md
Organized structureXML tagscore_prompting.md
Complex reasoningChain of thoughtadvanced_patterns.md
Format consistencyMultishot promptingadvanced_patterns.md
Multi-step processPrompt chainingadvanced_patterns.md
Long documents (100K+ tokens)Long context tipsadvanced_patterns.md
Deep analysisExtended thinkingadvanced_patterns.md
Reduce false informationHallucination reductionquality_improvement.md
Consistent outputsConsistency techniquesquality_improvement.md
Security/safetyJailbreak mitigationquality_improvement.md

When to Combine Techniques

  • Structured analysis: XML tags + Chain of thought
  • Consistent formatting: Multishot + Response prefilling
  • Complex workflows: Prompt chaining + XML tags
  • Factual reports: Quote grounding + Citation verification
  • Production systems: System prompts + Input validation + Consistency techniques

Resources

This skill includes three comprehensive reference files:

references/core_prompting.md

Essential techniques for all prompts:

  • Being clear and direct
  • System prompts and role assignment
  • Using XML tags effectively

references/advanced_patterns.md

Sophisticated techniques for complex tasks:

  • Chain of thought prompting
  • Multishot prompting
  • Prompt chaining
  • Long context handling
  • Extended thinking

references/quality_improvement.md

Techniques for specific quality issues:

  • Reducing hallucinations
  • Increasing consistency
  • Mitigating jailbreaks and prompt injections

Load these files as needed based on the workflow steps above.

Download now (ZIP)

  • Other versions69 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 69

    1. Jeffallan/claude-skills★ 12ksame name
    2. elithrar/dotfiles★ 206same name
    3. aakashg/pm-claude-skills★ 106same name
    4. thedesignproject/agent-skills★ 88same name
    5. OpenCoven/coven★ 75same name
    6. monaccode/astromesh★ 38same name
    7. jshsakura/awesome-opencode-skills★ 30same name
    8. Fandry96/k3-agentic-skills★ 27same name
    9. felvieira/claude-skills-fv★ 27same name
    10. jaskirat1616/grok-skills★ 22same name

    59 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 idea-validator, debugger and 6 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.
    • dipaulavsSkill

      idea-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

    • JohnJBorenSkill

      debugger

      Systematic debugging workflows, root cause analysis, and troubleshooting patterns

      Also in 3 projects that use this

    • VercelSkill

      technical-writer

      Write, review, and edit developer documentation for SDKs, libraries, and frameworks, including sites such as ai-sdk.dev and chat-sdk.dev. Use for getting-started guides, tutorials, API references, conceptual explanations, integration guides, migration guides, troubleshooting, and code examples.

      Also in 3 projects that use this

    • MicrosoftSkill

      api-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

    • JetBrainsSkill

      webapp-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 3 projects that use this

    • BlockSkill

      frontend-design

      Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.

      Also in 6 projects that use this

  • In this repository11 other files it gives its agents.

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

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.