Agent skill · writing content · wshobson
prompt-engineering-patterns
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.
Why this skill is useful
Provides advanced techniques for prompt optimization and structured output handling that the AI wouldn't reliably generate on its own.
What it needs
About 3k tokens when loaded. Last updated 2026-08-05. 38,570 stars on the source repository.
What this skill does
Prompt Engineering Patterns Master advanced prompt engineering techniques to maximize LLM performance, reliability, and controllability. When to Use This Skill Designing complex prompts for production LLM applications Optimizing prompt performance and consistency Implementing structured reasoning patterns (chain-of-thought, tree-of-thought) Building few-shot learning systems with dynamic example selection Creating reusable prompt templates with variable interpolation Debugging and refining prompts that produce inconsistent outputs Implementing system prompts for specialized AI assistants Using structured outputs (JSON mode) for reliable parsing Core Capabilities 1. Few-Shot Learning Example selection strategies (semantic similarity, diversity sampling) Balancing example count with context window constraints Constructing effective demonstrations with input-output pairs Dynamic example retrieval from knowledge bases Handling edge cases through strategic example selection 2. Chain-of-Thought Prompting Step-by-step reasoning elicitation Zero-shot CoT with "Let's think step by step" Few-shot CoT with reasoning traces Self-consistency techniques (sampling multiple reasoning paths) Verification and validation steps 3. Structured Outputs JSON mode for reliable parsing Pydantic schema enforcement Type-safe response handling Error handling for malformed outputs 4. Prompt Optimization Iterative refinement workflows A/B testing prompt variations Measuring prompt performance metrics (accuracy, consistency, latency) Reducing token usage while maintaining quality Handling edge cases and failure modes 5. Template Systems Variable interpolation and formatting Conditional prompt sections Multi-turn conversation templates Role-based prompt composition Modular prompt components 6. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills wshobson/prompt-engineering-patterns