prompt-optimizer

prompt-optimizer is a skill for Claude Code from i-stack/ai-coding-kit. It costs 146 tokens per session (1,096 once invoked), scanned A, original, MIT.

A tool that improves a user's prompt after the user asks for that help. It recalls similar past questions, asks clarifying questions when needed, shows the rewritten prompt for confirmation, and then answers it.

In plain words
What is it for?
Use it to turn a vague request into a structured prompt, with optional clarification and a saved record of the original and revised versions.
Why use it?
It removes ambiguity before work begins and prevents the agent from silently changing what the user asked for.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the skills-engineering plugin — 13 skills shipped together

Good fit Use it to turn a vague request into a structured prompt, with optional clarification and a saved record of the original and revised versions.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/i-stack/ai-coding-kit/prompt-optimizer
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 i-stack/ai-coding-kit --skill prompt-optimizer
Clone the repo
git clone --depth 1 https://github.com/i-stack/ai-coding-kit

Made for: Claude Code.

Or install skills-engineering, the plugin that ships this one along with the rest of its 13 skills.

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-optimizer

README.md
[![agentmods](https://agentmods.dev/badge/skills/i-stack/ai-coding-kit/prompt-optimizer/github.svg)](https://agentmods.dev/skills/i-stack/ai-coding-kit/prompt-optimizer)
Your own site
<a href="https://agentmods.dev/skills/i-stack/ai-coding-kit/prompt-optimizer"><img src="https://agentmods.dev/badge/skills/i-stack/ai-coding-kit/prompt-optimizer/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 prompt-optimizer

Your own site · 80×15
<a href="https://agentmods.dev/skills/i-stack/ai-coding-kit/prompt-optimizer"><img src="https://agentmods.dev/badge/skills/i-stack/ai-coding-kit/prompt-optimizer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 146 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,096 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.00146 $0.01096
Opus 5.5 $0.00058 $0.00438
Sonnet 5.5 $0.00029 $0.00219
Haiku 4.5 $0.00015 $0.00110

Measured 24d ago against content hash c055f6bc2a30, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

prompt-optimizer 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 24d 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.

skills-engineering/prompt-optimizer/SKILL.md · 42 lines

What it actually says

Prompt Optimizer

强制入口

命中本 skill 时,必须先完整阅读 references/prompt_optimizer.md 并按其中条款执行。

  • 不得以 preamble、规则摘要或其它二次摘要代替该文件全文。
  • 盘问规则复用 plan-grill 的 interview 子集(PG-000 门控 + PG-001PG-003 逐一盘问,不复用 PG-004 锁定产出,故不产出 PLAN.md),历史召回复用 historical-recall(HR-001HR-005),本 skill 不内联重复这两套规则,只做「澄清 + 改写 + 展示 + 回答 + 回写」这层增量。

六条核心规则

  • [POPT-001] 触发门控:仅主动触发(@prompt-optimizer 或「帮我优化提问」「优化这个 prompt」「改写我的问题」),不做「发送时自动拦截」。
  • [POPT-002] 历史召回:改写前针对原始提问 recall 相似历史;历史澄清结论仅作待验证线索,据此跳过盘问须标注「未澄清假设(来源:历史线索)」。
  • [POPT-003] 盘问判定与澄清:复用 plan-grill PG-000 门控 + PG-001~PG-003(仅 interview,不产出 PLAN.md),存在阻塞性歧义时先逐一盘问澄清,无歧义直接改写。
  • [POPT-004] 改写:宿主 AI 基于「盘问澄清 + 历史线索」把原始提问重写为结构化高质量提示词,并满足改写验收判据。
  • [POPT-005] 透明确认与回答:先展示优化后提示词并以「请确认或修正以上优化稿;确认前不回答原问题。」收尾;确认前不回答原问题,确认后基于它回答;用户显式跳过确认时仍先展示优化稿、标注「未确认假设」后基于优化稿作答,改写改变对象或事实前提时不得跳过。
  • [POPT-006] 回写闭环:把原始提问、澄清结论、优化后提示词分别归档到 .plan-reviews/<date-slug>/ 下的 QUESTION.md / CLARIFICATION.md / OPTIMIZED.md(PROMPT-OPTIMIZATION.md 仅存一行标题;OPTIMIZED.md 容纳确认版 / 修正版 / 豁免确认版)并 sync 回灌知识库。

细则见 references/prompt_optimizer.md,规则 ID 真值登记在 references/rule_index.md。

入口语义

  • 主动触发:用户输入「帮我优化提问」「优化这个 prompt」「改写我的问题」或 @prompt-optimizer。
  • 不触发:普通对话、事实查询、代码生成等未请求优化的输入;本 skill 不做「发送时自动拦截」,不参与非优化类任务的执行。

与相邻 skill 的分工

Skill 分工
historical-recall 动手前召回 .plan-reviews/ 历史线索(POPT-002 委托其 recall,自身只读)
plan-grill 需求盘问(POPT-003 委托其 PG-000 门控 + PG-001~003;仅 interview,不产出 PLAN.md)
prompt-optimizer(本 skill) 澄清后改写提问、透明展示、基于优化版回答、回写闭环
cognitive-reasoning 回答环节的论证质量与真值接地(正交约束,不改变本 skill 流程)
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. 24d ago First seen · 42 lines · 146 tokens per session scan A c055f6bc2a30

Subscribe to this mod's changes

prompt-optimizer is a skill published in the GitHub repository i-stack/ai-coding-kit (3 stars, last pushed 11d ago), licensed MIT. It adds 146 tokens to every session and 1,096 once invoked, about $0.0006 per session on Opus 5.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-11-06.

Related

prompt-optimizer compared with skills from other repositories

prompt-optimizer next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
prompt-optimizeri-stack/ai-coding-kitSkill311d agoMITA146Claude Code
agent-creatorhotovo/aider-deskSkill1.5k9d agoApache-2.0A60Claude Code, Codex
writing-testshotovo/aider-deskSkill1.5k9d agoApache-2.0A48Claude Code, Codex
githits-mcpgithits-com/githits-cliSkill144todayApache-2.0A48Claude Code
ppt-design-skillsunchaokun/PPT-Design-SkillSkill5312mo agoMITA35Codex
hunk-reviewkodustech/kodus-aiSkill1.7ktodaynoneA69Claude Code, Codex
kodus-review-settingskodustech/kodus-aiSkill1.7ktodaynoneA92Claude Code, Codex