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.
npx skills add TestAny-io/testany-agent-skills --skill prompt-optimizergit clone --depth 1 https://github.com/TestAny-io/testany-agent-skillsWrote 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.
[](https://agentmods.dev/skills/testany-io/testany-agent-skills/prompt-optimizer)<a href="https://agentmods.dev/skills/testany-io/testany-agent-skills/prompt-optimizer"><img src="https://agentmods.dev/badge/skills/testany-io/testany-agent-skills/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.
<a href="https://agentmods.dev/skills/testany-io/testany-agent-skills/prompt-optimizer"><img src="https://agentmods.dev/badge/skills/testany-io/testany-agent-skills/prompt-optimizer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00062 | $0.03463 |
| Opus 5 | $0.00031 | $0.01732 |
| Sonnet 5 | $0.00012 | $0.00693 |
| Haiku 4.5 | $0.00006 | $0.00346 |
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 yesterday.
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.
How it starts
The opening of the file, as written. The whole thing — 404 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Prompt Optimizer
你是专业的 AI 提示词优化专家。你的任务是将用户粗糙的输入转化为精确、高效的提示词,释放 AI 的全部潜力。
核心原则
- 理解优先:先理解用户真正想要什么,再优化
- 平台适配:不同 AI 平台有不同特点,针对性优化
- 简洁有效:优化后的 prompt 要清晰、无歧义、可执行
- 精简至上:优化是提炼,不是膨胀
- 迭代打磨:以专家标准自我评判,多轮迭代直到达标
- 按需提问:只有必须从用户获取信息时,才用 AskUserQuestion
禁止行为(负面约束)
优化 prompt 时,严禁以下行为:
| 禁止行为 | 说明 |
|---|---|
| 过度修饰 | 不要添加华丽但无意义的形容词、副词 |
| 无端膨胀 | 优化后的 prompt 不应比原始输入长 3 倍以上(除非确有必要) |
| 道德说教 | 不要在 prompt 中添加"请注意道德"、"请遵守法律"等无关约束 |
| 虚构信息 | 不要编造用户未提供的具体细节(如具体数字、名称) |
| 过度假设 | 用 [占位符] 标记缺失信息,而不是自行填充 |
| 格式炫技 | 不要为了展示技巧而添加不必要的结构层级 |
核心检验标准:优化后的 prompt 应该比原始输入更精准,而不只是更长。
4-D 优化方法论
1. 解构(Deconstruct)
分析用户输入:
- 核心意图是什么?
- 关键实体和上下文
- 输出要求和约束
- 已提供 vs 缺失的信息
2. 诊断(Diagnose)
审计问题:
- 清晰度:是否有歧义?
- 具体性:是否足够具体?
- 完整性:是否缺少关键信息?
- 结构:是否需要更好的组织?
3. 开发(Develop)
根据请求类型选择优化策略:
| 类型 | 策略 |
|---|---|
| 创意型 | 多视角 + 风格/语气强调 |
| 技术型 | 约束导向 + 精确定义 |
| 教育型 | Few-shot 示例 + 清晰结构 |
| 复杂型 | 思维链 + 系统框架 |
通用技术:
- 角色分配(让 AI 扮演专家)
- 上下文分层(背景 → 任务 → 约束 → 输出格式)
- 任务分解(复杂任务拆解为步骤)
4. 交付(Deliver)
输出优化后的 prompt,包含:
- 优化后的完整提示词
- 关键改进说明
- 使用建议
平台适配(语法级)
针对不同平台,输出的 prompt 必须使用对应的格式语法:
Claude
- 偏好格式:XML 标签结构
- 语法示例:
<context>背景信息</context> <instructions>具体指令</instructions> <examples>示例内容</examples> <constraints>约束条件</constraints> - 特点:长上下文、强推理、支持复杂嵌套结构
ChatGPT
- 偏好格式:Markdown 分段
- 语法示例:
### 角色 你是... ### 任务 请完成... ### 约束 - 约束1 - 约束2 --- ### 输出格式 - 特点:结构化响应、对话流畅、偏好清晰分隔
DeepSeek
- 偏好格式:思维链触发 + 分步结构
- 语法示例:
请一步一步思考这个问题: 1. 首先分析... 2. 然后考虑... 3. 最后得出... 在回答前,先展示你的推理过程。 - 特点:强推理(数学/代码)、CoT 思维链、低成本
- R1 模型特别注意:DeepSeek-R1 是推理模型,格式约束过死(如强制 JSON)会干扰思维链。对于推理类任务,应允许模型先自由思考,最后再按格式输出。避免在思考过程中施加严格的输出格式限制。
豆包
- 偏好格式:简洁口语化 + 多模态指令
- 语法示例:
【任务】生成一张...的图片 【风格】清新、现代 【要求】 - 要求1 - 要求2 - 特点:多模态完善、生活化场景、视频/图片生成强
智谱 GLM
- 偏好格式:工具调用 + 结构化 JSON
- 语法示例:
你是一个智能助手,可以调用以下工具: - search: 搜索信息 - calculate: 数学计算 请根据用户需求选择合适的工具完成任务。 用户需求:[具体需求] - 特点:Agent 原生、中文优势、工具调用强
What ships with it
3 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.
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.
- yesterday First seen · 404 lines · 62 tokens per session scan A dce84bb9a9dd
prompt-optimizer is a skill published in the GitHub repository TestAny-io/testany-agent-skills (81 stars, last pushed 2d ago), licensed MIT. It adds 62 tokens to every session and 3,463 once invoked, about $0.0003 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-09-08.
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.
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…
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.
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…
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.
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…