prompt-optimizer

Refines prompts for clarity and reduced ambiguity using the 4-D methodology.

4|Updated Feb 20, 2026
One-click install
npx skills add https://github.com/JoelLewis/skill-library --skill prompt-optimizer-joellewis
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: prompt-optimizer
Source: https://github.com/JoelLewis/skill-library/tree/main/plugins/meta/skills/prompt-optimizer
Command: npx skills add https://github.com/JoelLewis/skill-library --skill prompt-optimizer-joellewis

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Refine prompts to maximize clarity and reduce ambiguity for Claude Code and compatible agents.

Core Features & Use Cases

  • 4-D Methodology (Deconstruct, Diagnose, Develop, Deliver) to audit and refine prompts.
  • XML tagging, CoT patterns, and few-shot scaffolding to stabilize outputs.
  • Use cases include creating new system prompts, refining existing prompts, and hardening prompts for consistent behavior.

Quick Start

Provide a draft prompt and run the 4-D audit to produce an optimized prompt ready for deployment.

Frequently Asked Questions about prompt-optimizer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I optimize system prompts to reduce ambiguity for Claude Code?

To optimize system prompts, apply a 4-D methodology that deconstructs, diagnoses, develops, and delivers the text. This process reduces ambiguity by adding XML tagging, chain-of-thought patterns, and few-shot examples to stabilize agent outputs.

What is the 4-D method for prompt engineering?

The 4-D method for prompt engineering is a structured audit framework that deconstructs intent, diagnoses weaknesses, develops improved instructions, and delivers the optimized prompt. It ensures repeatable refinement for system prompts and task instructions.

How do I add few-shot examples and XML structuring to my prompts?

You add few-shot examples and XML structuring during the develop phase of prompt optimization. This scaffolding stabilizes outputs by providing clear structural boundaries and demonstrating expected response formats to the agent.

Can I use this prompt optimizer for hardening existing task prompts?

Yes, you can use the prompt optimizer for hardening existing task prompts. It audits your current instructions, identifies areas of ambiguity, and refines them into reliable prompts ready for consistent deployment across compatible agents.

Does prompt engineering with CoT patterns improve agent reliability?

Prompt engineering with chain-of-thought patterns improves agent reliability by structuring the reasoning process. Combined with XML tagging and optional reference text, it guides the model through logical steps to produce consistent and safe outputs.

When should I not use few-shot scaffolding in a system prompt?

You should avoid few-shot scaffolding when it causes excessive token usage or conflicts with highly dynamic task instructions. If the reference text or examples create rigid constraints that limit the agent's adaptability, rely on direct XML structuring instead.