| name | prompt-optimizer |
| type | meta |
| family | meta |
| rigor | full |
| description | Use when a draft prompt, instruction set, or agent skill description needs refinement, clarity, or improved performance. |
| keywords | prompt engineering, 4-D methodology, chain of thought, few-shot, XML tags, system prompt, optimization, clarity |
| compatibility | Claude Code and compatible agent products |
| requires | ["writing-skills"] |
| enhances | ["getting-started","using-skills"] |
| sources_pdf | [] |
| sources_web | ["OpenAI Prompt Engineering Guide","Anthropic Prompt Engineering Documentation"] |
Overview
Prompt optimization is the engineering of intent into machine-executable instructions. This skill applies the 4-D Methodology (Deconstruct, Diagnose, Develop, Deliver) to ensure that prompts are clear, structured, and optimized for specific model architectures (e.g., Claude's XML tagging vs. OpenAI's Markdown preference).
Iron Law
NO PROMPT SHIPS WITHOUT RUNNING THE 4-D AUDIT
Failing to audit a prompt leads to "drift"—where the AI's output gradually diverges from the user's intent due to ambiguity or structural weakness.
State Machine
digraph prompt_optimization_flow {
"Rough Input" [shape=doublecircle];
"Deconstruct: Intent & Context" [shape=box];
"Diagnose: Ambiguity Audit" [shape=box];
"Develop: Apply Frameworks" [shape=box];
"Deliver: Final Construction" [shape=box];
"Validation: Test Run" [shape=diamond];
"Optimized Prompt" [shape=doublecircle];
"Rough Input" -> "Deconstruct: Intent & Context";
"Deconstruct: Intent & Context" -> "Diagnose: Ambiguity Audit";
"Diagnose: Ambiguity Audit" -> "Develop: Apply Frameworks";
"Develop: Apply Frameworks" -> "Deliver: Final Construction";
"Deliver: Final Construction" -> "Validation: Test Run";
"Validation: Test Run" -> "Optimized Prompt" [label="pass"];
"Validation: Test Run" -> "Diagnose: Ambiguity Audit" [label="fail"];
}
When to Use This Skill
- When an AI provides "hallucinated" or irrelevant answers.
- When creating a new system prompt or "SKILL.md" file.
- When a complex task needs to be broken down for a model.
- When you need to force a model to follow a specific output format (JSON, XML, Markdown).
When NOT to Use This Skill
- For simple, conversational queries where high precision is unnecessary.
- When the bottleneck is the model's knowledge cutoff rather than the instruction set.
Core Process
Step 1: Deconstruct (Extract Core Intent)
Strip the prompt to its atomic parts. Identify:
- Role: Who is the AI supposed to be? (Source: Anthropic).
- Goal: What is the specific, measurable outcome?
- Constraints: What MUST NOT happen? (Source: OpenAI).
Step 2: Diagnose (Audit for "Leaks")
Look for structural weaknesses:
- Ambiguity: Are words like "better," "fast," or "creative" left undefined?
- Cognitive Load: Is the prompt trying to do too many things at once?
- Format Gaps: Is the desired output structure clearly defined? (Source: Anthropic).