Prompt optimizer

From agentic-dev3o/devx-plugins · View interactive version

Prompt optimizer is an AI agent skill from the GitHub repository agentic-dev3o/devx-plugins. Rewrites a given prompt or agent definition by applying Anthropic prompt-engineering best practices — clarity and directness, context and motivation, XML structure, role assignment, long-context layout, output format control, communication-style calibration, and parallel-tool-call affordance. Produc

How to use this skill

Skill file

Prompt Optimizer

Target: $ARGUMENTS (path to a prompt file, agent definition, or pasted prompt text)

Workflow

Progress checklist:

Prompt Optimization:
- [ ] Step 1: Capture the target prompt
- [ ] Step 2: Identify intent, model, and runtime
- [ ] Step 3: Diagnose against eight techniques
- [ ] Step 4: Rewrite the prompt
- [ ] Step 5: Produce before/after report with rationale

Step 1: Capture the Target Prompt

Determine whether $ARGUMENTS is:

If the prompt is part of a larger agent (tools, examples, memory layout), capture the surrounding shape but keep the rewrite scoped to the prompt itself. Do not rewrite tool definitions in this skill — the audit skill flags those, and tool rewrites belong in their own pass.

Step 2: Identify Intent, Model, and Runtime

Before optimizing, answer:

If any of these are ambiguous and would materially change the rewrite, ask one focused question. Do not ask if the answer is inferable from the prompt itself.

Step 3: Diagnose Against Eight Techniques

For each technique below, read the matching reference and decide whether the current prompt applies it well, partially, or not at all. Note the gap concretely (quote the offending text or note its absence).

  1. Clarity and directness — references/clarity.md
  2. Context and motivation — references/context.md
  3. Structure with XML tags — references/structure.md
  4. Role prompting — references/role.md
  5. Long-context layout — references/long-context.md
  6. Communication style and verbosity — references/communication-style.md
  7. Format control — references/format-control.md
  8. Parallel tool calling — references/parallel-tools.md

Skip techniques that do not apply (e.g. parallel tool calling on a prompt with no tools). Do not invent gaps to justify rewrites.

Step 4: Rewrite the Prompt

Apply changes in this order, smallest-impact-first to preserve voice:

  1. Add missing role assignment (one sentence at the top).
  2. Add motivation to rules that need it.
  3. Restructure with XML tags where mixed content benefits.
  4. Tighten verbose passages; remove restated rules.
  5. Add explicit format control if absent.
  6. Add long-context layout adjustments if applicable.
  7. Add communication-style and verbosity calibration.
  8. Add parallel-tool-call affordance if tools are present.

Constraints on the rewrite:

Step 5: Produce Before/After Report with Rationale

Output structure:

## Target

<file path or "inline prompt">

## Diagnosis

| Technique | Current state | Action |
|-----------|---------------|--------|
| Clarity and directness | Respected / Partial / Missing | Applied / Skipped / N/A |
| Context and motivation | ... | ... |
| Structure (XML) | ... | ... |
| Role | ... | ... |
| Long context | ... | ... |
| Communication style | ... | ... |
| Format control | ... | ... |
| Parallel tools | ... | ... |

## Before

<original prompt, verbatim>

## After

<rewritten prompt>

## Changes Applied

1. <Technique>: <what changed and why, ≤2 sentences, citing the reference>
2. <Technique>: ...
...

## What I Did Not Change

- <Things you considered and left alone, with reason>

If the prompt is already strong on every technique that applies, say so plainly and do not rewrite. A non-change is a valid output.

Constraints

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.