prompt-engineering-patterns

Apply few-shot learning, chain-of-thought, and structured output techniques to optimize LLM prompts.

Updated Apr 13, 2026
One-click install
npx skills add https://github.com/optioni/dungeons-and-dragons --skill prompt-engineering-patterns-optioni
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: prompt-engineering-patterns
Source: https://github.com/optioni/dungeons-and-dragons/tree/main/.claude/skills/prompt-engineering-patterns
Command: npx skills add https://github.com/optioni/dungeons-and-dragons --skill prompt-engineering-patterns-optioni

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This Skill helps you master advanced prompt engineering techniques, improving LLM performance, reliability, and controllability in production.

Core Features & Use Cases

  • Advanced Prompt Engineering: Techniques for optimizing prompts, improving LLM outputs, and designing production prompt templates.
  • Few-Shot Learning: Strategies for example selection, balancing example count, and dynamic example retrieval.
  • Chain-of-Thought Prompting: Step-by-step reasoning elicitation, zero-shot and few-shot CoT, self-consistency, and verification.
  • Structured Outputs: JSON mode, Pydantic schema enforcement, and error handling for reliable parsing.
  • Prompt Optimization: Iterative refinement, A/B testing, performance metrics, and token usage reduction.
  • Template Systems: Variable interpolation, conditional sections, multi-turn conversations, and modular components.
  • System Prompt Design: Setting model behavior, defining output formats, establishing roles, and defining content policies.

Quick Start

Use the prompt-engineering-patterns skill to design a prompt template for sentiment analysis with structured output.

Frequently Asked Questions about prompt-engineering-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I use few-shot learning and Chain-of-Thought prompting to improve LLM outputs?

Few-shot learning and Chain-of-Thought (CoT) prompting improve LLM outputs by providing selected examples and step-by-step reasoning structures. This Skill enables dynamic example retrieval and self-consistency verification to elicit reliable, structured responses.

What is the best way to enforce structured JSON outputs from an LLM?

Enforcing structured JSON outputs requires schema enforcement and error handling for reliable parsing. This Skill provides techniques using JSON mode and Pydantic schemas to constrain LLM responses into predictable data formats.

How do I design production prompt templates with variable interpolation and multi-turn conversations?

Designing production prompt templates involves building modular components with variable interpolation and conditional sections. This Skill provides template systems to manage multi-turn conversations and establish roles within system prompts.

How do I optimize prompts and reduce token usage through A/B testing?

Prompt optimization reduces token usage through iterative refinement and A/B testing. This Skill supplies strategies for measuring performance metrics to systematically improve prompt efficiency and LLM controllability.

Do I need prior prompt engineering knowledge to use advanced template systems and CoT strategies?

Advanced template systems and CoT strategies require prior knowledge of prompt engineering principles. This Skill is designed for practical application, focusing on advanced optimization and production template design rather than basic concepts.