/prompt-engineering:prompt-engineeringfrom Prompt Engineering
Rewrites and optimizes prompt drafts using proven engineering techniques — draft diagnosis, canonical structure (role, context, sequencing, XML, few-shot, chain-of-thought, output contract), and technique selection by task and target model (Claude, OpenAI, Gemini).
Ships in Prompt Engineering. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Turns a raw draft into a production-grade prompt by applying proven prompt engineering techniques. Distilled from primary sources (Anthropic prompting best practices + prompt improver, OpenAI GPT-5/reasoning guides, Google Gemini PTCF, The Prompt Report) — see references/ for the full material.
The user sends a prompt draft (or describes what they want). The skill returns a rewritten, optimized version, ready to paste, plus a short changelog of what changed and why. It is not meant to answer the prompt — it is meant to improve the prompt.
references/model-profiles.md — the rules diverge (e.g. reasoning models do NOT want "think step by step").Inspired by Anthropic's official prompt improver flow (example identification → initial draft → CoT refinement → example enhancement), expanded with diagnosis and technique selection.
Extract from the draft (and from conversation context):
references/task-patterns.md.){{placeholders}}.Pick techniques from the decision table below (detail in references/techniques.md). Apply only those that add value to the task. Mentally note the why of each — it goes in the changelog.
Build the prompt in the canonical structure (below), applying the selected techniques and the golden rules. Preserve every {{...}} variable from the original. Convert negative instructions into positive ones. Add motivation to non-obvious instructions. Mirror the rigor level and the format of the cases in references/worked-examples.md.
Run references/quality-checklist.md against the rewritten version. Fix whatever fails before delivering. Golden test: "could a colleague with no context execute this prompt without doubt?" If not, adjust.
Return in the output format (below): optimized prompt in a copyable block + changelog + open questions (if any). When useful, point to references/evaluation.md so the user can A/B test the before/after.
Recommended order (omit sections that don't add value for the task at hand):
<thinking>/<analysis> block before the answer (CoT). NOT in reasoning models (o-series, GPT-5 reasoning) — see model-profiles.<example>/<examples>, showing input→reasoning→output. Especially for format/tone/classification.<thinking>) from the final output (<answer>).{{double_brackets}}, ideally wrapped in XML, for reuse and testing.references/prompt-security.md).| Task type | Core techniques | Reference to load |
|---|---|---|
| Classification | Role, XML inputs, diverse few-shot, short CoT, enum output | techniques + task-patterns |
| Structured extraction | Role, XML, output schema (JSON), grounding by quotes | task-patterns |
| Generation/writing | Role, persona+audience, tone examples, format, constraints | task-patterns |
| Coding | Clear objective, constraints, explicit scope, anti-overengineering, output contract | model-profiles (Claude coding) |
| Reasoning/analysis | CoT (non-reasoning models) or high-level goal (reasoning models), self-check/Reflexion; Least-to-Most or Tree-of-Thoughts on hard problems | techniques + model-profiles |
| Research | Success criteria, competing hypotheses, multi-source verification, decomposition, RAG/Generated Knowledge | techniques |
| Agentic/tool-use | Explicit action instruction, ReAct, parallel tool calls, autonomy/safety balance, context engineering (just-in-time retrieval, compaction, note-taking, sub-agents) | techniques + model-profiles |
| Summarization/transformation | Long-context layout (data at top), grounding, output contract (length) | techniques |
Always respond like this:
## Optimized prompt
<code block with the final prompt, ready to paste — preserving {{variables}}>
## What changed
- <technique applied> — <why / which weakness it fixes>
- ... (4–8 bullets, concise)
## Assumptions / open questions
- <only if any — assumed defaults or a doubt worth confirming>
If the user asks for variations (e.g. lean version vs full version, or Claude version vs GPT version), deliver both in separate blocks.
references/techniques.md — applied catalog of the highest-return techniques (zero/few-shot, zero-shot modifiers, CoT and variants, decomposition with PAL/PoT code, ensembling, self-criticism CoVe/Reflexion, RAG, context engineering for agents) with when to use each. Load when choosing reasoning/research/agentic techniques.references/technique-index.md — exhaustive index of ALL known techniques (The Prompt Report's taxonomy of 58 + extras), by category. Load to make sure no approach was forgotten, or when the user asks for total coverage.references/model-profiles.md — differences between Claude 4.x, OpenAI GPT/reasoning, and Gemini. Load whenever the target isn't Claude default, or for coding/agentic.references/task-patterns.md — ready-made templates by task type. Load to build the structure for classification/extraction/generation.references/worked-examples.md — complete examples (draft → optimized → changelog), including the "already-good prompt" case. Load to calibrate the quality bar and the output format, especially when in doubt about how much to rewrite.references/quality-checklist.md — self-review checklist (Phase 4). Load always before delivering.references/evaluation.md — how to test whether the rewrite is actually better (quick A/B, metrics by task type, regression guard). Load when the user wants to validate the gain or has a small test set.references/prompt-security.md — defense against prompt injection/jailbreak. Load when the prompt processes untrusted input or operates as an agent.references/auto-optimization.md — automatic prompt optimization (APE, OPRO, DSPy, MIPRO...). Load when the user has a dataset/evals and wants programmatic optimization.references/sources.md — all the links to primary sources and papers. Load when you need to cite/update the base.assets/canonical-template.md — reusable XML skeleton of the canonical prompt.This skill covers text prompting. Image/audio/video generation prompting (Midjourney, DALL·E, Veo, etc.) is out of scope — the structural principles transfer partially, but the modality-specific levers (aspect ratio, style refs, weights) are not covered here.
assets/canonical-template.md (opens in a new tab)references/auto-optimization.md (opens in a new tab)references/evaluation.md (opens in a new tab)references/model-profiles.md (opens in a new tab)references/prompt-security.md (opens in a new tab)references/quality-checklist.md (opens in a new tab)references/sources.md (opens in a new tab)references/task-patterns.md (opens in a new tab)references/technique-index.md (opens in a new tab)references/techniques.md (opens in a new tab)references/worked-examples.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
prompt-engineering, prompt-optimization, ai-prompts, claude, openai, gemini
npx claudepluginhub phalves23/prompt-engineering-skill --plugin prompt-engineeringOther plugins' skills for the same job