prompt-optimization

prompt-optimization is a skill for Claude Code, Codex from shinpr/rashomon. It costs 42 tokens per session (3,225 once invoked), scanned A, original, MIT.

A plugin for comparing and improving prompts and skills through parallel runs in separate Git worktrees, which are independent working copies of a repository.

In plain words
What is it for?
It is for optimizing prompts, grading or updating skills, and running blind A/B comparisons.
Why use it?
It helps reveal which version performs better and supports structured prompt improvement instead of relying on one subjective result.

Skill for Claude CodeCodex

Written for Claude Code and Codex: shipped in a Claude Code plugin, but also agents/openai.yaml present.

Part of the rashomon plugin — 5 skills, 7 agents shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/shinpr/rashomon/prompt-optimization
Any agent
npx skills add shinpr/rashomon --skill prompt-optimization
Clone the repo
git clone --depth 1 https://github.com/shinpr/rashomon

Made for: Claude Code, Codex.

Or install rashomon, the plugin that ships this one along with the rest of its 5 skills, 7 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for prompt-optimization

README.md
[![agentmods](https://agentmods.dev/badge/skills/shinpr/rashomon/prompt-optimization.svg)](https://agentmods.dev/skills/shinpr/rashomon/prompt-optimization)
Your own site
<a href="https://agentmods.dev/skills/shinpr/rashomon/prompt-optimization"><img src="https://agentmods.dev/badge/skills/shinpr/rashomon/prompt-optimization.svg" alt="Measured on agentmods" height="20"></a>
Per session 42 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,225 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00042 $0.03225
Opus 5 $0.00021 $0.01613
Sonnet 5 $0.00008 $0.00645
Haiku 4.5 $0.00004 $0.00323

Measured 2d ago against content hash 3fa7505fe98d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

prompt-optimization scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/rashomon/skills/prompt-optimization/SKILL.md · 231 lines

How it starts

The opening of the file, as written. The whole thing — 231 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Prompt Optimization Skill

Purpose

Improve prompts while preserving user intent.

Core Principles

  1. Procedural Gates: Complete analysis, optimization, and balance in order. Each phase has observable pass conditions that control the next transition.
  2. Intent Preservation: Record the original requirements before changing wording, structure, context, constraints, or examples.
  3. Necessary and Sufficient Context: Include the information needed for a decision, action, or verification result. Condense or omit information that does not affect one of them.
  4. Minimal Sufficient Work: Classify discovered possibilities as candidates. Add work only when it changes the outcome, protects a required boundary, serves a real consumer, or supplies necessary proof.
  5. Traceable Changes: Connect every change to a finding or project-specific source.
  6. Self-Contained Execution: Require no temporary artifacts or additional agents.

Required References

Load references at the phase where their rules become necessary:

Phase Condition Required reference
Analysis Every prompt references/patterns.yaml
Analysis Target is a SKILL.md, agent, or skill reference references/skills.md
Balance Every prompt references/execution-quality.yaml

Record the loaded path and covered rule IDs in the phase's reference_coverage. A phase passes only when its required references and rule coverage are present.

Output Mode

Select the output mode before analysis. An explicit output_mode of interactive or machine takes priority; for any other value, ask the caller to choose one. When it is absent, use Machine mode only if the caller explicitly requests the Machine Output Contract as the response format; otherwise use Interactive mode. Apply the same rule to human and LLM callers.

Keep output_mode outside the target prompt and analysis.original_prompt.

Pattern Detection

Evaluate every pattern and record issue, already_satisfied, or not_applicable.

Read the full file on GitHub · 231 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago Changed · -12 tokens per session 3fa7505fe98d
  2. 6d ago First seen · 231 lines · 54 tokens per session scan A d3a11c38a14d

Subscribe to this mod's changes

prompt-optimization is a skill published in the GitHub repository shinpr/rashomon (18 stars, last pushed 6d ago), licensed MIT. It adds 42 tokens to every session and 3,225 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

ai-engineering-toolkit

6 production-ready AI engineering workflows: prompt evaluation (8-dimension scoring), context budget planning, RAG pipeline design, agent security audit (65-point checklist), eval harness building, and product sense coaching.

LiHongwei-cn/lihongwei-cn · 47 tokens

prompt-modeler

Generate structured strategic prompts with diagnostic and multiple options. Triggers on: /modelar-prompt.

chidekina/aria-superpowers · 24 tokens

ai-engineering-toolkit

6 production-ready AI engineering workflows: prompt evaluation (8-dimension scoring), context budget planning, RAG pipeline design, agent security audit (65-point checklist), eval harness building, and product sense coaching.

sickn33/agentic-awesome-skills · 47 tokens

promptfoo-evals

Write, refine, run, and QA promptfoo evaluation suites: promptfooconfig.yaml, prompts, providers, vars, tests, assertions, model-graded rubrics, transforms, datasets, exports, and CI gates. Use for non-redteam eval coverage, regression tests, or new eval matrices. Do not use for adversarial redteam plugin or strategy…

promptfoo/promptfoo · 79 tokens

prompt-master

Generates optimized prompts for AI tools. Activates only when the user explicitly asks to write, fix, improve, or adapt a prompt for a specific AI tool (LLM, Cursor, Midjourney, image AI, video AI, coding agents, etc.). Does not activate for general conversation, coding tasks, document writing, or other…

nidhinjs/prompt-master · 78 tokens

forensic-prompt-compiler

Forensic image-to-prompt compiler for image generation models. Use this skill whenever the user wants to: convert/describe an existing image into a generation prompt, reconstruct a scene as a prompt, generate prompts from reference images for AI image tools (Midjourney, FLUX, Stable Diffusion, DALL-E, or any diffusion…

AnastasiyaW/codex-claude-code-config · 218 tokens