prompt-engineering
Prompt engineering patterns for Claude including system prompts, few-shot examples, chain-of-thought, structured output, templates, and prefilling. Use when the user is writing prompts, designing system instructions, extracting structured data, building prompt templates, or optimizing Claude responses for quality and consistency.
npx skills add majiayu000/claude-skill-registry --skill prompt-engineering-versoxbt-claude-initial-setup --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Prompt Engineering Patterns and techniques for crafting effective Claude prompts. Covers system prompts, few-shot learning, chain-of-thought reasoning, structured output, and prefilling. ## When to Use - User is writing or optimizing prompts for Claude - User needs structured JSON output from Claude - User is designing system prompts or instructions - User wants chain-of-thought reasoning or few-shot examples - User is building prompt templates for reuse ## Core Patterns ### System Prompts System prompts set Claude's persona, constraints, and output format. Place stable instructions here; they are cached separately and can use prompt caching. ```python message = client.messages.create( model="claude-sonnet-4-6-20250514", max_tokens=1024, system="""You are a senior code reviewer. Follow these rules: 1. Focus on bugs, security issues, and performance problems. 2. Rate severity as CRITICAL, HIGH, MEDIUM, or LOW. 3. Provide a fix for each issue found. 4. If the code is clean, say "No issues found." and nothing else.""", messages=[{"role": "user", "content": f"Review this code:\n```\n{code}\n```"}] ) ``` ### Few-Shot Examples Provide 2-4 input/output examples to demonstrate the exact
- When to Use
- Core Patterns
- System Prompts
- Few-Shot Examples
- Chain-of-Thought Reasoning
- Structured Output (JSON Mode)
- Prefilling Assistant Responses
- Anti-Patterns
- Quick Reference
What does the prompt-engineering skill do?
Prompt engineering patterns for Claude including system prompts, few-shot examples, chain-of-thought, structured output, templates, and prefilling. Use when the user is writing prompts, designing system instructions, extracting structured data, building prompt templates, or optimizing Claude responses for quality and consistency.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill prompt-engineering-versoxbt-claude-initial-setup --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
