This is the canonical guide for writing better prompts. It covers the techniques that actually matter: few-shot learning with examples, chain-of-thought reasoning, systematic optimization through A/B testing, reusable templates, and system prompt design. The progressive disclosure pattern is especially useful, showing you when to add complexity versus keeping it simple. Use this when your prompts are inconsistent, when you're burning tokens on bloated instructions, or when you need to debug why an agent isn't behaving as expected. The concrete examples and error recovery patterns make it practical rather than theoretical.

skills.sh installs
604
GitHub stars
33.2K
last updated
Aug 21, 2026

Install

$ npx -y skills add davila7/claude-code-templates --skill prompt-engineering --agent claude-code

Installs into .claude/skills of the current project.

Files

Prompt Engineering Patterns

Advanced prompt engineering techniques to maximize LLM performance, reliability, and controllability.

Core Capabilities

1. Few-Shot Learning

Teach the model by showing examples instead of explaining rules. Include 2-5 input-output pairs that demonstrate the desired behavior. Use when you need consistent formatting, specific reasoning patterns, or handling of edge cases. More examples improve accuracy but consume tokens—balance based on task complexity.

Example:

Extract key information from support tickets:

Input: "My login doesn't work and I keep getting error 403"
Output: {"issue": "authentication", "error_code": "403", "priority": "high"}

Input: "Feature request: add dark mode to settings"
Output: {"issue": "feature_request", "error_code": null, "priority": "low"}

Now process: "Can't upload files larger than 10MB, getting timeout"

2. Chain-of-Thought Prompting

Sponsors

Details

Repository
github.com/davila7/claude-code-templates
Categories
Documentation, AI & Agent Building, Debugging
First seen
May 16, 2026

More from davila7/claude-code-templates

All 618
1adobe avatarauthoringadobe/skillsGenerate comprehensive documentation for content authors taking over an AEM Edge Delivery Services project. Analyzes the project structure and produces a comple599skills.sh installs
2adobe avataradminadobe/skillsGenerate comprehensive admin documentation for AEM Edge Delivery Services project handover. Creates admin guide covering Config Service setup, permissions, acce596skills.sh installs
3netresearch avatarjira-syntaxnetresearch/jira-skillUse when writing or formatting Jira descriptions, comments, or any text destined for Jira. Converts Markdown to Jira wiki markup, provides templates (bug report596skills.sh installs
4mhattingpete avatarcodebase-documentermhattingpete/claude-skills-marketplaceGenerates comprehensive documentation explaining how a codebase works, including architecture, key components, data flow, and development guidelines. Use when u594skills.sh installs
5davila7 avatarhumanizerdavila7/claude-code-templatesRemove signs of AI-generated writing from text. Use when editing or reviewing text to make it sound more natural and human-written. Based on Wikipedia's compreh585skills.sh installs
6wanshuiyin avatarpixel-artwanshuiyin/auto-claude-code-research-in-sleepGenerate pixel art SVG illustrations for READMEs, docs, or slides. Use when user says "画像素图", "pixel art", "make an SVG illustration", "README hero image", or w582skills.sh installs