Skip to content
Development
Skill

/meta-prompt-optimizer

Audit and rewrite prompts against Claude Opus 4.7 instruction-following best practices. Produces a scored audit plus a rewritten prompt. Use when the user asks to audit, review, critique, rewrite, improve, optimize, tighten, score, fix, migrate, or draft a prompt — including

From plugin
erpaval
2911 skills4 agents3 hooks5 MCP

Claude Code

$ npx -y skills add laithalsaadoon/erpaval --skill meta-prompt-optimizer --agent claude-code

SKILL.md

meta-prompt-optimizer.SKILL.md
name: meta-prompt-optimizer
description: >
  Audit and rewrite prompts against Claude Opus 4.7 instruction-following best practices.
  Produces a scored audit plus a rewritten prompt. Use when the user asks to audit,
  review, critique, rewrite, improve, optimize, tighten, score, fix, migrate, or draft
  a prompt — including system prompts, CLAUDE.md files, Claude Code agent definitions,
  slash commands, SKILL.md files, Jinja2 prompt templates, or tool/parameter descriptions
  in Pydantic v2 or Zod schemas. Trigger on phrases like "is this prompt any good",
  "why isn't Claude following this", "why isn't my agent triggering", "my CLAUDE.md is
  being ignored", "rewrite this for Opus 4.7", "cache hit rate is low on my prompt",
  "the model keeps picking the wrong tool", or on pasted prompt text asking for feedback.
  Also trigger on mentions of prompt engineering, prompt best practices, or
  instruction-following problems. Use this skill whenever the task involves editing,
  reviewing, or writing the text of a prompt — even if the user doesn't say "prompt".
user_facing: true

Contents

| File | When to load | | ----------------------------------- | -------------------------------------------------------------------------- | | `references/opus-4-7-principles.md` | Core prompting principles and the 4.7-specific behavior shifts | | `references/rubric.md` | Scoring rubric — shared with the `prompt-critic` agent | | `references/rewriting-patterns.md` | Before/after transformation patterns with worked examples | | `references/target-types.md` | Type-specific guidance (CLAUDE.md, agents, commands, Jinja2, Pydantic/Zod) |

The `prompt-critic` agent in this plugin shares the same rubric and is the right tool when the user wants a scored assessment without a rewrite.

Meta-prompt optimizer

Audit and rewrite prompts so they work well on Claude Opus 4.7. Every run produces two deliverables: a scored audit (what's wrong and why) and a rewritten prompt that applies the fixes.

The guidance is grounded in Anthropic's official prompting best-practices doc for the Claude 4.x family, with emphasis on the Opus 4.7-specific behavior shifts (literal instruction following, adaptive thinking, effort-driven calibration, dialed-back emphasis language, positive framing).

The three modes

The user's request determines which mode to run.

| Mode | Trigger | Output | | --------------------- | -------------------------------------------------------------------------------- | ----------------------------------------------------------- | | **Audit only** | "review this prompt", "critique this", "is this any good?", "score this" | Structured audit report (pass/fail per rubric item + notes) | | **Audit + rewrite** | "improve this", "rewrite for 4.7", "optimize this", "fix this prompt" | Audit report **+** revised prompt **+** changelog | | **Draft from intent** | "write a system prompt that…", "draft an agent for…", "give me a CLAUDE.md for…" | New prompt written against the rubric from the start |

If the mode is ambiguous, ask once. Default to **audit + rewrite** when the user hands over an existing prompt.

Workflow

Step 1 — Identify the target type

Different prompt types need different treatment. Pick the matching section of `references/target-types.md` and load it before proceeding:

  • **CLAUDE.md** (project or global memory) — 200-line auto-load ceiling, must stay terse, imports via `@path` are an option.
  • **Claude Code agent definition** (`.md` with YAML frontmatter) — description is the triggering mechanism, body is the system prompt.
  • **Slash command** (`.md` with YAML frontmatter) — arguments, bash execution, may compose with other skills.
  • **SKILL.md** body — description is the triggering mechanism, progressive disclosure via references.
  • **System prompt in production code** — usually a multi-line string or Jinja2 template. Often templated with variables.
  • **Pydantic v2 or Zod tool / tool-input description** — terse natural-language strings the model reads when deciding whether and how to call a tool.

If you can't tell what type it is from context, ask.

Step 2 — Read the relevant references

Always load:

  • `references/opus-4-7-principles.md` — the principles you're grading against.
  • `references/rubric.md` — the scoring rubric.

Load selectively:

  • `references/rewriting-patterns.md` — when rewriting (modes 2 and 3).
  • `references/target-types.md` — the section matching the detected type.

Step 3 — Run the audit

For each rubric item, mark it pass / needs work / rethink and note a concrete finding. Cite line numbers or specific phrases in the source prompt when calling out issues. Audits without evidence are not useful.

The rubric has four categories:

1. **Directness and clarity** — is the ask specific, imperative, verifiable? 2. **Framing and tone** — positive statements rather than negative? Emphasis used sparingly? Contrastive phrasing avoided? 3. **Structure** — appropriate use of XML tags, ordered by stability for caching, scope stated explicitly? 4. **Type-specific fitness** — passes the checks for its target type (e.g., CLAUDE.md under 200 lines, agent description describes when to trigger).

A full rubric walkthrough lives in `references/rubric.md`. Use it verbatim — do not improvise new rubric items mid-audit.

Step 4 — Rewrite (if the mode calls for it)

Apply the transformations from `references/rewriting-patterns.md`. The most common ones:

1. **Flip negatives to positives.** Say what to do, not just what to avoid. Cite source: Anthropic prompt-engineering doc, "Tell Claude what to do instead of what not t

Read more
@theagenticguy
Ships witherpaval

Autonomous software development for Claude Code. ERPAVal stands for Explore · Research · Plan · Act · Validate — the five-phase loop, plus a sixth Compound phase that writes durable lessons to disk so the next session inherits what this one learned.

2911 skills4 agents5 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
29
Star history of theagenticguy/erpaval on GitHub, a chart by star-history.com

Other skills on erpaval.

erpaval

erpaval

Workflow for autonomous software development with Claude Code. Classifiers route scope, complexity, directory state, and spec…

agent-ux-patterns

agent-ux-patterns

Agent UX patterns and human-in-the-loop design: Twilio A2H protocol, Levels of Autonomy (L0-L5), inbox pattern, progressive…

customer-research

customer-research

Customer research and problem framing using the research-design discipline: hypothesis, null hypothesis, MECE questions, methods,…

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills10d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc11d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react1d252k
@facebook@facebookInstall Skill

Questions about meta-prompt-optimizer.

Which coding agents can use meta-prompt-optimizer?
meta-prompt-optimizer installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.