Back to Skills

prompt-engineering

Provides workflows to write, debug, and optimize prompts for LLMs, including few-shot example selection, chain-of-thought structuring, system prompt design, and template composition. Use when the user asks to write or improve a prompt, wants help with few-shot examples, chain-of-thought, system prompts, prompt templates, or asks how to get better results from an LLM.

311stars36forksUpdated 7/25/2026

Security Assessment

Safe(95/100)
Security Score95/100

About prompt-engineering

This skill provides workflows to write, debug, and optimize prompts for large language models. It solves the recurring problem of ad-hoc, unreliable prompting by offering structured, testable, and reusable patterns for few-shot example selection, chain-of-thought reasoning, prompt optimization, template composition, and system prompt design.

The skill keeps a concise main workflow and defers deep guidance to targeted reference files loaded per pattern. It covers five core areas: few-shot learning (example count of roughly 3-5, semantic-similarity and diversity selection, progressive complexity ordering, with concrete templates for classification, transformation, extraction, and error correction); chain-of-thought reasoning (zero-shot and few-shot CoT, self-consistency by sampling multiple paths, and verification steps); prompt optimization (baseline measurement, single-variable changes, tracking accuracy, consistency, token efficiency, robustness, and safety, and A/B validation with statistical significance); template systems (clear variable naming, conditional sections, role-based and hierarchical composition); and system prompt design (role and expertise specification). Reference material includes reusable templates and example selection utilities such as a context-aware selection routine.

Target users are prompt engineers, application developers, and anyone building LLM-powered features who needs to draft, restructure, or measurably improve prompts and system prompts, add few-shot examples or reasoning scaffolds, or create reusable prompt templates. It is a provider-agnostic guidance skill focused on prompt design methodology and evaluation rather than any specific model API.

FAQ

What prompt techniques does this skill cover?

Few-shot learning, chain-of-thought reasoning, prompt optimization, template systems, and system prompt design, each with dedicated reference files.

How many few-shot examples does it recommend?

Typically 3-5, balanced against context-window limits, chosen for diversity and edge-case coverage and ordered from simple to complex.

How does it approach optimizing a prompt?

Measure baseline performance first, make single-variable changes for accurate attribution, track metrics like accuracy, consistency, token efficiency, robustness, and safety, and use statistical significance testing for A/B validation.

Is this tied to a specific LLM provider?

No. The guidance is model-agnostic and focuses on general prompt-design methodology, templates, and evaluation rather than a particular vendor API.

When should I reach for this skill?

When writing, rewriting, or improving a prompt, adding few-shot examples or reasoning scaffolds, creating a reusable system prompt or template, or running a measurable prompt optimization.

All Files

6 files
references/few-shot-patterns.md9.3 KB
View
references/system-prompt-design.md17.9 KB
View
references/cot-patterns.md10.5 KB
View
SKILL.md10.1 KB
View
references/optimization-frameworks.md15.1 KB
View
references/template-systems.md16.7 KB
View

Install prompt-engineering

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill