prompt-engineering-patterns skill (wshobson): few-shot, chain-of-thought and template patterns for better prompts
Gives your agent proven prompt design patterns for few-shot examples, chain-of-thought, templates and system prompts.
- Installs
- 23.9K
- on skills.sh
- Stars
- 42.1K
- on GitHub
- Files
- 9
- besides SKILL.md
- Updated
- Oct 2026
- last repo commit
prompt-engineering-patterns is a guidance skill by Seth Hobson from the wshobson/agents collection. It loads when you ask to optimize a prompt, write better prompts, use chain-of-thought or build a prompt template. It covers six areas: few-shot learning, chain-of-thought, structured outputs, prompt optimization, template systems and system prompt design.
Its folder holds 6 reference guides, 2 asset files (example sets and a template library) and one Python script, scripts/optimize-prompt.py. SKILL.md does not name that script. The script runs a prompt A/B test loop and, as shipped, uses a mock model client, not a real API.
Good for
- Developers writing production prompts for LLM apps
- Teams debugging prompts that give inconsistent output
- Anyone building reusable prompt templates or system prompts
Install prompt-engineering-patterns
Claude Code
- 1
Copy this prompt.
Install the prompt-engineering-patterns skill in Claude Code. Run this command: npx skills add https://github.com/wshobson/agents --skill prompt-engineering-patterns Then check that it loaded and tell me how to use it.
- 2
Paste it into Claude Code. It shows the change and asks before running it.
Requires Node.js.
From its listing on skills.sh. Source.
What's in the skill
When it loads
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.
Sections in SKILL.md
- When to Use This Skill
- Core Capabilities
- 1. Few-Shot Learning
- 2. Chain-of-Thought Prompting
- 3. Structured Outputs
- 4. Prompt Optimization
- 5. Template Systems
- 6. System Prompt Design
- Quick Start
- Detailed patterns and worked examples
- Best Practices
- Common Pitfalls
- Success Metrics
Key facts
- Installs on skills.sh
- 23,873 (data from 2026-11-02)
- Last repo commit
- 2026-10-30
What it includes
Example selection, balancing count against context, edge cases
Covers choosing examples by similarity or diversity, building good input-output pairs and pulling examples from a knowledge base.
Try: “Improve this classification prompt with three good few-shot examples.”
Read ·
Few-shot learningStep-by-step reasoning, zero-shot and few-shot, self-consistency
Includes verification steps and sampling several reasoning paths.
Read ·
Chain-of-thoughtJSON mode, Pydantic schemas, handling bad output
The Quick Start shows a LangChain example that returns a typed SQL query object from a Claude model.
Write ·
Structured outputsIterate, A/B test and measure accuracy, latency and tokens
A refinement workflow with metrics and failure analysis.
Try: “My prompt gives inconsistent answers. Help me debug and tighten it.”
Read ·
Prompt optimizationVariables, conditional sections, multi-turn and modular prompts
Reusable prompt building blocks.
Write ·
Template systemsRole, constraints, output format and safety guidance
How to set model behavior and context for an assistant.
Read ·
System prompt designWorked patterns: error recovery, progressive disclosure, caching
Six patterns plus RAG and validation integration and token-efficiency tips.
Read ·
references/details.mdPrompt A/B test loop with a built-in mock model
Python script using numpy that scores prompt variants on test cases and can write optimization_results.json. As shipped it uses a mock client, so you would swap in a real one.
Runs code ·
scripts/optimize-prompt.pyfew-shot-examples.json and prompt-template-library.md
Sample example sets and a library of prompt templates.
Read ·
assets/
From the official docs
Permissions
Low risk
The skill is mostly reference text, with one Python script that writes a results file if you run it. Read any command your agent proposes before you approve it.
What it can do
- Read your data
- Create and change things
- Delete things
- Read-only mode
Watch out for
A bundled script can write a results file
scripts/optimize-prompt.py exports results with open(filename, 'w'). SKILL.md does not tell the agent to run it. Run it in a scratch folder if you try it.
Example code needs packages
The Quick Start imports langchain_anthropic and pydantic and the script imports numpy. Install them yourself in a virtual environment if you want to run the samples.
Technical details
| Scopes |
|
|---|
Questions
What does the prompt-engineering-patterns skill do?
It gives your agent a toolbox of prompt design techniques. It helps when you write, test or fix prompts for LLM apps.
How do I install it in Claude Code?
Use the install box at the top of this page. The wshobson/agents README also documents a skills-only route with npx skills add or gh skill install.
Does it run anything on my computer?
SKILL.md bundles one Python script, scripts/optimize-prompt.py, but does not tell the agent to run it. If you run it, it needs numpy, uses a mock model and writes optimization_results.json.
Do I need an API key?
SKILL.md names none. Its Quick Start example uses langchain_anthropic, so running that code would need access to a model, which SKILL.md does not describe.
Is it only for Claude?
No. It describes general LLM prompting techniques. Its Quick Start example happens to use a Claude model.
Is it safe?
Mostly reference text, plus one bundled Python script that writes optimization_results.json when someone runs it. SKILL.md does not mention the script, and its main block uses a mock client. Run it in a scratch folder, and review any command your agent proposes before you approve it.
Information
updated Nov 2, 2026
- Repository
- wshobson/agents
- Folder
plugins/llm-application-dev/skills/prompt-engineering-patterns
Sources
Docs, issue trackers and discussions this page is built from.
Show all 3Hide
- prompt-engineering-patterns SKILL.md · github.com
- optimize-prompt.py · github.com
- prompt-engineering-patterns details.md · github.com