empirical-prompt-tuning

empirical-prompt-tuning is a skill for Claude Code, Codex from MH4GF/claude-code. It costs 160 tokens per session (4,560 once invoked), scanned A, original, MIT.

A method for improving prompts by having an independent agent follow them, checking the results against fixed requirements, and repeating the process.

In plain words
What is it for?
Use it to test and refine important skills, slash commands, or task prompts with realistic scenarios and requirement checklists.
Why use it?
It finds unclear instructions and hidden failures that the prompt’s author may miss when reviewing their own writing.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions CLAUDE.md; mentions subagents; mentions Claude Code.

Good fit Use it to test and refine important skills, slash commands, or task prompts with realistic scenarios and requirement checklists.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mh4gf/claude-code/empirical-prompt-tuning
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.

Any agent
npx skills add MH4GF/claude-code --skill empirical-prompt-tuning
Clone the repo
git clone --depth 1 https://github.com/MH4GF/claude-code

Made for: Claude Code, Codex.

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 empirical-prompt-tuning

README.md
[![agentmods](https://agentmods.dev/badge/skills/mh4gf/claude-code/empirical-prompt-tuning/github.svg)](https://agentmods.dev/skills/mh4gf/claude-code/empirical-prompt-tuning)
Your own site
<a href="https://agentmods.dev/skills/mh4gf/claude-code/empirical-prompt-tuning"><img src="https://agentmods.dev/badge/skills/mh4gf/claude-code/empirical-prompt-tuning/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for empirical-prompt-tuning

Your own site · 80×15
<a href="https://agentmods.dev/skills/mh4gf/claude-code/empirical-prompt-tuning"><img src="https://agentmods.dev/badge/skills/mh4gf/claude-code/empirical-prompt-tuning.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 160 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,560 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00160 $0.04560
Opus 5 $0.00080 $0.02280
Sonnet 5 $0.00032 $0.00912
Haiku 4.5 $0.00016 $0.00456

Measured 9d ago against content hash 83c8ebdb406e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

empirical-prompt-tuning 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 9d 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.

user-scope-backup-2026-07-04/skills/empirical-prompt-tuning/SKILL.md · 186 lines

How it starts

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

Empirical Prompt Tuning

プロンプトの品質は書いた本人には分からない。書き手が「明瞭だ」と思うものほど、別エージェントが読むと詰まる。バイアスを排した実行者に実際に動かしてもらい、両面で評価して反復する のが本 skill の核。改善が頭打ちになるまで止めない。

いつ使うか

  • skill / slash command / タスクプロンプトを新規作成・大幅改訂した直後
  • エージェントが期待通り動かず、原因を指示側の曖昧さに求めたいとき
  • 重要度の高い指示(頻繁に使う skill、自動化の中核プロンプト)を堅牢化したいとき

使わない場面:

  • 一回限りの使い捨てプロンプト(評価コストが割に合わない)
  • 成功率の改善が目的ではなく、書き手の主観的好みを反映したいだけのとき

ワークフロー

  1. Iteration 0 — description と body の整合チェック(静的、dispatch 不要)

    • frontmatter description が謳う trigger / 用途を読む
    • body がカバーする範囲を読む
    • 乖離があれば iter 1 に進む前に description か body を合わせる
    • 例: description「navigation / form filling / data extraction」と書いてあるが body は npx playwright test の CLI ref のみ、のような乖離を検出
    • これを飛ばすと、subagent は description に合わせて body を「再解釈」し、実質 skill が要件を満たしていないのに精度が出る(false positive)
  2. ベースライン準備: 対象プロンプトを確定し、次の 2 つを用意する。

    • 評価シナリオ 2 〜 3 種(中央値 1 + edge 1 〜 2)。現実に起こりうるタスクで、対象プロンプトを実際に適用する場面を想定する。
    • 要件チェックリスト(精度算出のため)。シナリオごとに「成果物が満たすべき要件」を 3 〜 7 項目で列挙する。精度 % = 満たした項目数 / 全項目数。事前に固定すること(後から動かさない)。
  3. バイアス排除読み: 指示を「白紙」の実行者に読ませる。Task tool で 新規 subagent を dispatch する。自己再読で済ませない(直前に書いた文章を客観視することは構造的に不可能)。並列で複数シナリオを同時実行する場合は単一メッセージ内で複数 Agent 呼び出しを並べる。dispatch 不能環境の扱いは「環境制約」節を参照。

  4. 実行: 後述の subagent 起動契約 に従ったプロンプトを subagent に渡し、シナリオを実行させる。実行者は実装や出力を生成し、最後に自己申告レポートを返す。

  5. 両面評価: 戻ってきた結果から次を記録する。

    • 実行者の自己申告(subagent のレポート本文から抽出): 不明瞭点 / 裁量補完 / テンプレ適用で詰まった箇所
    • 指示側の計測(判定規則は本節で一元定義、他箇所は本節を参照する):
      • 成功/失敗: [critical] タグの付いた要件が 全て ○ のときのみ成功(○)。うち 1 つでも × または部分的なら失敗(×)。ラベルは ○ / × の 2 値のみ。
      • 精度(要件チェックリストの達成率 %。○ = 満点、× = 0、部分的 = 0.5 で合算、全項目数で割る)
      • ステップ数(Task tool の戻り値に付く usage メタの tool_uses をそのまま使う。Read / Grep も含める、除外しない)
      • 所要時間(Task tool の usage メタの duration_ms
      • 再試行回数(subagent が同じ判断をやり直した回数。subagent の自己申告レポートから抽出、指示側では測れない)
      • 失敗時は「どの [critical] 項目が落ちたか」を提示フォーマットの "不明瞭点" 節に 1 行添える(原因追跡のため)
    • 要件チェックリストには [critical] タグ付き項目を 最低 1 つ 含めること(0 件だと成功判定が vacuous になる)。事後に [critical] の付け外しをしない。
  6. 差分適用: 不明瞭点を潰す最小修正をプロンプトに入れる。1 イテレーション 1 テーマ(関連する複数修正は OK、無関係な修正は次回に回す)。

    • 修正前に「この修正が要件チェックリスト / 判定文言のどの項目を満たすか」を明示する(軸名から推測した修正は届かないことが多い。後述「修正の波及パターン」節)。
  7. 再評価: 新しい subagent で再度 2 → 5 を回す(同一 agent は再利用しない: 前回の改善を学習している)。並列度はイテレーションを進めても改善が頭打ちにならない場合に増やす。

  8. 収束判定: 目安「連続 2 イテレーションで新規の不明瞭点ゼロ かつ メトリクス改善が閾値以下(後述)」で停止。重要度が高いプロンプトは 3 連続にする。

Read the full file on GitHub · 186 lines

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. 9d ago First seen · 186 lines · 160 tokens per session scan A 83c8ebdb406e

Subscribe to this mod's changes

empirical-prompt-tuning is a skill published in the GitHub repository MH4GF/claude-code (2 stars, last pushed today), licensed MIT. It adds 160 tokens to every session and 4,560 once invoked, about $0.0008 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-31.

Related

Other skills, from other repositories

llm-app-patterns

Production-ready patterns for building LLM applications. Covers RAG pipelines, agent architectures, prompt IDEs, and LLMOps monitoring. Use when designing AI applications, implementing RAG, building agents, or setting up LLM observability.

davila7/claude-code-templates · 54 tokens

prompt-optimization

Improve a prompt on the evaluations workbench through a measured loop. Score the baseline first, then duplicate the target column, form a hypothesis from failing rows, edit the copy's prompt draft, run, compare pass rate and cost, and repeat until the numbers hold. Use when the user asks to optimize or improve a…

langwatch/langwatch · 105 tokens

enhance-prompt

Transforms vague UI ideas into polished, Stitch-optimized prompts. Enhances specificity, adds UI/UX keywords, injects design system context, and structures output for better generation results.

google-labs-code/stitch-skills · 41 tokens

prompt-engineer

Writes, refactors, and evaluates prompts for LLMs — generating optimized prompt templates, structured output schemas, evaluation rubrics, and test suites. Use when designing prompts for new LLM applications, refactoring existing prompts for better accuracy or token efficiency, implementing chain-of-thought or few-shot…

Jeffallan/claude-skills · 93 tokens

seedance-vocab-en

This skill should be used when an English Seedance 2.0 prompt needs clearer production wording, less generic prose, or precise vocabulary for camera, lighting, motion, VFX, audio, and constraints. Route blocked prompts through seedance-filter for context and boundary review.

Emily2040/seedance-2.0 · 61 tokens

ideogram4

Prompting patterns for Ideogram 4 text-to-image — best-in-class in-image text rendering and exact color/layout control via structured JSON captions. Use when generating images that need legible on-image text (title cards, thumbnails, logos, signage, CTAs), precise brand colors, or controlled spatial layout. Triggers…

digitalsamba/claude-code-video-toolkit · 99 tokens