/erpaval:meta-prompt-optimizerfrom erpaval
Audits and rewrites prompts for Claude Opus 4.7 instruction-following best practices. Produces a scored audit and rewritten prompt for system prompts, CLAUDE.md, agent definitions, slash commands, SKILL.md, Jinja2 templates, and Pydantic/Zod schemas.
Ships in erpaval. 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.
| 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.
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 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.
Different prompt types need different treatment. Pick the matching section of references/target-types.md and load it before proceeding:
@path are an option..md with YAML frontmatter) — description is the triggering mechanism, body is the system prompt..md with YAML frontmatter) — arguments, bash execution, may compose with other skills.If you can't tell what type it is from context, ask.
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.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:
A full rubric walkthrough lives in references/rubric.md. Use it verbatim — do not improvise new rubric items mid-audit.
Apply the transformations from references/rewriting-patterns.md. The most common ones:
**IMPORTANT:** / **YOU MUST:** for one or two high-cost rules. Opus 4.x over-triggers on aggressive language that was tuned for older models.<instructions>, <context>, <examples>, <frontend_aesthetics>.Output format depends on mode:
Audit only:
## Audit: [prompt name or summary]
### Scores
| Category | Score | Notes |
| --------------------- | --------------------------- | ------------------ |
| Directness & clarity | Pass / Needs work / Rethink | [specific finding] |
| Framing & tone | … | … |
| Structure | … | … |
| Type-specific fitness | … | … |
### Findings
1. **[Finding title]** — [what's wrong, with line reference]. Impact: [why it matters].
2. …
### Top priorities to fix
[numbered list of the 2-3 highest-leverage changes]
Audit + rewrite:
Same audit section, then:
### Rewritten prompt
[the full revised prompt]
### Changelog
- [Change 1] — [which rubric item it addresses]
- [Change 2] — …
Draft from intent:
## Drafted prompt: [name]
[the prompt]
### Rationale
- [Decision 1] — [why]
- [Decision 2] — …
After producing the deliverable, offer to run the prompt-critic agent on the result for an independent second opinion. The critic uses the same rubric from an unbiased starting point — useful for checking that the rewrite actually improved the scores rather than shuffling them.
Invoke it with the Agent tool, subagent_type: "prompt-critic", passing the rewritten prompt and the prompt's target type. Don't auto-run it — ask first, because users iterating quickly may not want the extra round trip. (Note: the prompt-critic agent is not bundled in this plugin — it lives in the upstream personal-plugins repo. If unavailable, the rewrite is the deliverable.)
Audit the template skeleton and the rendered output separately. Silent invalidators (per-request timestamps, user IDs, unsorted dict serialization) inside the template will break prompt caching. Flag them. See references/target-types.md → "Jinja2 templates".
These are terse by nature. The rubric applies differently — short is good here, but the description must answer three questions: what does this tool do, when should the model call it, what do the parameters mean. See references/target-types.md → "Tool descriptions".
If the user is migrating a prompt from an older model (e.g., Sonnet 3.7 → Opus 4.7), the rewrite should remove obsolete parameter guidance (sampling parameters, budget_tokens), dial back the shouting that older models needed, and flip negative framings. Note the migration explicitly in the changelog.
This skill is a prompt-optimizer — its output is held to the same standard it grades against.
references/rubric.md. The rubric is the contract.evals/evals.json (opens in a new tab)evals/fixtures/bad-agent.md (opens in a new tab)evals/fixtures/bad-claude-md.md (opens in a new tab)evals/fixtures/bad-jinja-template.j2 (opens in a new tab)evals/fixtures/bad-zod-tools.ts (opens in a new tab)evals/fixtures/okayish-system-prompt.txt (opens in a new tab)evals/trigger-eval-reviewed.json (opens in a new tab)evals/trigger-eval.json (opens in a new tab)references/opus-4-7-principles.md (opens in a new tab)references/rewriting-patterns.md (opens in a new tab)references/rubric.md (opens in a new tab)references/target-types.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
11 skills in this plugin
/agent-ux-patternsAgent UX patterns and human-in-the-loop design: Twilio A2H protocol, Levels of Autonomy (L0-L5), inbox pattern, progressive trust, decision journal, gate reviews, autonomous work reports. Six-phase methodology from vague pain point to concrete data model via landscape research and multi-direction brainstorming. Use when the user asks to design agent UX, pick an autonomy level, build a human-in-the-loop flow, structure an agent inbox, design approval gates, or mentions A2H, autonomy level, progressive trust, inbox pattern, approval gate, decision journal, or agentic design. Do NOT use for PRD drafting — use product-discovery. Do NOT use for frontend components — use frontend-design. Do NOT use for building agents with a specific SDK — use claude-agent-sdk, strands-sdk, langgraph-langchain, or mastra-vercel-ai.
/customer-researchCustomer research and problem framing using the research-design discipline: hypothesis, null hypothesis, MECE questions, methods, findings. Produces Pyramid-base-shaped output ready for downstream composition into PR/FAQs, long-form narratives, or PRDs. Use when the user asks to design user research, run customer interviews, synthesize research findings, frame a problem statement, build a customer journey map, plan a VoC study, or mentions pain-point analysis, research plan, hypothesis testing, customer insights, jobs-to-be-done, or voice of customer.
/erpavalWorkflow for autonomous software development with Claude Code. Classifiers route scope, complexity, directory state, and spec readiness before committing to Explore / Research / Plan / Act / Validate, then close the loop with a Compound step that persists lessons to `.erpaval/solutions/` for future sessions. Optional HMW reframing and EARS specification add structured rigor — Claude judges when to run them. Each Act subagent edits its own Markdown task packet section-by-section per the write protocol, and the orchestrator monitors with `wc -l`. Use when the user asks to implement a feature autonomously, build with agents, use ERPAVal, plan and execute a coding task, delegate to subagents, do agent-driven development, extract lessons, recall prior lessons, or mentions autonomous coding workflow or compound engineering.
/product-design-sharedShared canonical references for product-design frameworks — Pyramid Principle, Working Backwards, Double Diamond, research design, methodology selection. Consumed by `product-discovery`, `product-strategy`, `working-backwards`, and `customer-research` via `${CLAUDE_PLUGIN_ROOT}/skills/product-design-shared/references/`. Do NOT invoke this skill directly — it has no orchestrator and no templates. Load the upstream skill that owns your task (`product-discovery` for PRD / HMW / EARS, `product-strategy` for Rumelt / Wardley / Minto, etc.) and let it pull from this pool as needed.
/product-discoveryFile-first orchestrator for product discovery and spec frameworks. Frames the problem with a Discovery Lead / Product Analyst / System Architect role, spawns parallel framework agents (Double Diamond, How Might We, Jobs to Be Done, user stories + INVEST, EARS for AI-coder specs, Gherkin), synthesizes into a PRD or discovery memo, runs a critic pass. Absorbs prd-drafter (idea to PRD via 3 parallel research roles) and design-thinking (pain-point excavation, landscape research, brainstorm). Ships per-framework references, role prompts, templates for PRDs, HMW outputs, job stories, EARS specs. Use when the user asks to write a PRD, draft requirements, run discovery, brainstorm a product, turn insights into HMW questions, write job stories, spec a feature in EARS for Kiro or Spec Kit, define user stories with INVEST, run a Double Diamond round, or mentions JTBD, acceptance criteria, Kiro spec format. Do NOT use for business strategy (Rumelt, Wardley, PR-FAQ as leadership artifact) — use product-strategy.
/product-strategyFile-first orchestrator for business and product strategy frameworks. Frames the challenge with a CPO / CSO / VP Design role, spawns parallel framework agents (Rumelt kernel + Crux, Wardley Maps, Minto Pyramid as thinking structure, Working Backwards PR-FAQ as discovery artifact), synthesizes outputs into one strategy memo, runs a critic pass. Ships per-framework references, leadership role prompts, templates for strategy memos, PR-FAQs, Wardley maps, Minto arguments. Use when the user asks to do strategy work, run a Rumelt kernel, build a Wardley map, decide build-vs-buy, articulate the crux of a challenge, draft a PR-FAQ as discovery, write an executive strategy memo, structure an argument with Minto Pyramid, think from the CPO / CSO / VP Design perspective, or mentions Good Strategy Bad Strategy, The Crux, Rumelt, Simon Wardley, SCQA, or strategy thesis. Do NOT use for PRDs or HMW framing — use product-discovery.
npx claudepluginhub laithalsaadoon/erpaval --plugin erpavalOther plugins' skills for the same job