All skills
wshobson avatar

/prompt-engineering-patterns

@511f834
by Seth Hobsonwshobson/agents40k stars
4,281

This skill should be used when the user asks to "optimize a prompt", "improve prompt performance", "design a prompt template", "write better prompts", "debug prompt issues", "use chain-of-thought", "structured prompting", "few-shot prompting", or wants to apply advanced prompt engineering patterns for production LLM applications.

Use this Skill: https://skilld.dev/gh/wshobson/agents/prompt-engineering-patterns

This session only. Nothing lands on disk.

assetsprompt-template-library.md

≈823 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Prompt Template Library

Classification Templates

Sentiment Analysis

Classify the sentiment of the following text as Positive, Negative, or Neutral.

Text: {text}

Sentiment:

Intent Detection

Determine the user's intent from the following message.

Possible intents: {intent_list}

Message: {message}

Intent:

Topic Classification

Classify the following article into one of these categories: {categories}

Article:
{article}

Category:

Extraction Templates

Named Entity Recognition

Extract all named entities from the text and categorize them.

Text: {text}

Entities (JSON format):
{
  "persons": [],
  "organizations": [],
  "locations": [],
  "dates": []
}

Structured Data Extraction

Extract structured information from the job posting.

Job Posting:
{posting}

Extracted Information (JSON):
{
  "title": "",
  "company": "",
  "location": "",
  "salary_range": "",
  "requirements": [],
  "responsibilities": []
}

Generation Templates

Email Generation

Write a professional {email_type} email.

To: {recipient}
Context: {context}
Key points to include:
{key_points}

Email:
Subject:
Body:

Code Generation

Generate {language} code for the following task:

Task: {task_description}

Requirements:
{requirements}

Include:
- Error handling
- Input validation
- Inline comments

Code:

Creative Writing

Write a {length}-word {style} story about {topic}.

Include these elements:
- {element_1}
- {element_2}
- {element_3}

Story:

Transformation Templates

Summarization

Summarize the following text in {num_sentences} sentences.

Text:
{text}

Summary:

Translation with Context

Translate the following {source_lang} text to {target_lang}.

Context: {context}
Tone: {tone}

Text: {text}

Translation:

Format Conversion

Convert the following {source_format} to {target_format}.

Input:
{input_data}

Output ({target_format}):

Analysis Templates

Code Review

Review the following code for:
1. Bugs and errors
2. Performance issues
3. Security vulnerabilities
4. Best practice violations

Code:
{code}

Review:

SWOT Analysis

Conduct a SWOT analysis for: {subject}

Context: {context}

Analysis:
Strengths:
-

Weaknesses:
-

Opportunities:
-

Threats:
-

Question Answering Templates

RAG Template

Answer the question based on the provided context. If the context doesn't contain enough information, say so.

Context:
{context}

Question: {question}

Answer:

Multi-Turn Q&A

Previous conversation:
{conversation_history}

New question: {question}

Answer (continue naturally from conversation):

Specialized Templates

SQL Query Generation

Generate a SQL query for the following request.

Database schema:
{schema}

Request: {request}

SQL Query:

Regex Pattern Creation

Create a regex pattern to match: {requirement}

Test cases that should match:
{positive_examples}

Test cases that should NOT match:
{negative_examples}

Regex pattern:

API Documentation

Generate API documentation for this function:

Code:
{function_code}

Documentation (follow {doc_format} format):

Use these templates by filling in the {variables}

Source: SKILL.md on GitHub

No alerts16d5 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    The skill is a comprehensive resource for prompt engineering patterns, including templates, documentation, and optimization utilities. It follows established best practices for LLM application development and uses standard, trusted libraries. No malicious behaviors, obfuscation, or security risks were identified.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer6mo

    2/9 files flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 511f834. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 3 days ago.

Activeupdated 3 months ago
  • prompt-engineering
  • llm
  • chain-of-thought
  • few-shot
  • structured-outputs
  • prompt-optimization
  • pydantic
  • langchain
  • claude

README badge

README badge for wshobson/agents/prompt-engineering-patterns

Teaches advanced prompt engineering patterns including chain-of-thought reasoning, few-shot learning, structured outputs, and prompt optimization for production LLM applications. Use this skill when optimizing prompts, designing templates, implementing reasoning patterns, or debugging inconsistent LLM outputs.

Generated from the current SKILL.md.

What prompt engineering techniques does this skill cover?
The skill covers few-shot learning, chain-of-thought reasoning, structured outputs (JSON mode and Pydantic schemas), prompt optimization and A/B testing, template systems with variable interpolation, and system prompt design for specialized assistants.
Does this skill work with specific LLM providers?
The quick start example uses Claude via langchain_anthropic, but the patterns are model-agnostic. The skill teaches prompt engineering techniques applicable to any LLM that supports structured outputs and multi-turn conversations.
Can I use this skill for debugging prompts that produce inconsistent outputs?
Yes. The skill includes iterative refinement workflows, A/B testing strategies, and guidance on measuring consistency metrics to identify and fix prompt issues in production.
Does this skill include template systems and reusable prompt components?
Yes. It covers variable interpolation, conditional prompt sections, multi-turn conversation templates, and modular prompt composition for building reusable systems.
What should I do if outputs are malformed or don't parse correctly?
Use structured outputs with Pydantic schema enforcement and JSON mode to enforce type-safe responses. The skill also documents error handling strategies and common pitfalls to avoid.

Generated from the current SKILL.md. These answers refresh after source changes.