llm-prompt-optimizer

llm-prompt-optimizer is a skill for Claude Code, Codex from beel-collab/presets.dev. It costs 28 tokens per session (1,456 once invoked), scanned A, a copy of llm-prompt-optimizer, MIT.

A skill for rewriting instructions given to a large language model, such as GPT, Claude, or Gemini, so the requested result is clearer and more consistent.

In plain words
What is it for?
Use it to improve prompts for chatbots and agents, require reliable JSON or other structured output, add examples and constraints, and reduce unnecessary model output.
Why use it?
It addresses vague answers, made-up information, badly formatted output, excessive token use, and prompts that work inconsistently between models.

Skill for Claude CodeCodex

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/beel-collab/presets.dev/llm-prompt-optimizer
Any agent
npx skills add beel-collab/presets.dev --skill llm-prompt-optimizer
Clone the repo
git clone --depth 1 https://github.com/beel-collab/presets.dev

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/beel-collab/presets.dev/llm-prompt-optimizer.svg)](https://agentmods.dev/skills/beel-collab/presets.dev/llm-prompt-optimizer)
Your own site
<a href="https://agentmods.dev/skills/beel-collab/presets.dev/llm-prompt-optimizer"><img src="https://agentmods.dev/badge/skills/beel-collab/presets.dev/llm-prompt-optimizer.svg" alt="Measured on agentmods" height="20"></a>
Per session 28 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,456 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 91% copy Near-identical to another mod 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.00028 $0.01456
Opus 5 $0.00014 $0.00728
Sonnet 5 $0.00006 $0.00291
Haiku 4.5 $0.00003 $0.00146

Measured 5d ago against content hash 94904282ccdc, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

llm-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 5d 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.

Origin

This is a copy

91% identical to llm-prompt-optimizer — 11 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

claude/skills/ai-ml/llm-prompt-optimizer/SKILL.md · 189 lines

How it starts

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

LLM Prompt Optimizer

Overview

This skill transforms weak, vague, or inconsistent prompts into precision-engineered instructions that reliably produce high-quality outputs from any LLM (Claude, Gemini, GPT-4, Llama, etc.). It applies systematic prompt engineering frameworks — from zero-shot to few-shot, chain-of-thought, and structured output patterns.

When to Use This Skill

  • Use when a prompt returns inconsistent, vague, or hallucinated results
  • Use when you need structured/JSON output from an LLM reliably
  • Use when designing system prompts for AI agents or chatbots
  • Use when you want to reduce token usage without sacrificing quality
  • Use when implementing chain-of-thought reasoning for complex tasks
  • Use when prompts work on one model but fail on another

Step-by-Step Guide

1. Diagnose the Weak Prompt

Before optimizing, identify which problem pattern applies:

Problem Symptom Fix
Too vague Generic, unhelpful answers Add role + context + constraints
No structure Unformatted, hard-to-parse output Specify output format explicitly
Hallucination Confident wrong answers Add "say I don't know if unsure"
Inconsistent Different answers each run Add few-shot examples
Too long Verbose, padded responses Add length constraints

2. Apply the RSCIT Framework

Every optimized prompt should have:

  • RRole: Who is the AI in this interaction?
  • SSituation: What context does it need?
  • CConstraints: What are the rules and limits?
  • IInstructions: What exactly should it do?
  • TTemplate: What should the output look like?

Before (weak prompt):

Explain machine learning.

After (optimized prompt):

You are a senior ML engineer explaining concepts to a junior developer.

Context: The developer has 1 year of Python experience but no ML background.

Task: Explain supervised machine learning in simple terms.

Constraints:
- Use an analogy from everyday life
- Maximum 200 words
- No mathematical formulas
- End with one actionable next step

Format: Plain prose, no bullet points.

Read the full file on GitHub · 189 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. 5d ago First seen · 189 lines · 28 tokens per session scan A 94904282ccdc

Subscribe to this mod's changes

llm-prompt-optimizer is a skill published in the GitHub repository beel-collab/presets.dev (2 stars, last pushed 4mo ago), licensed MIT. It adds 28 tokens to every session and 1,456 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. It is 91% identical to llm-prompt-optimizer, differing in 11 lines, and is treated as a copy.

Related

Other skills, from other repositories

prompt-enhancer

Transform poor or overly simple prompts with expert-level framing. Use when the user explicitly asks to improve, refine, or rewrite a prompt, or wants help framing a request for another AI system. Do NOT use for authoring, reviewing, or migrating system prompts or skills targeting a specific Claude model…

sammcj/agentic-coding · 67 tokens

llm-prompting-guide

Prompt format rules for generative video and music models. Use when writing or reviewing a prompt for MiniMax H3 (text/image/reference-to-video with native audio) or MiniMax Music 3 (song generation from caption plus lyrics), in ComfyUI or elsewhere. Do NOT use for chat-assistant prompts, or for generative models not…

sammcj/agentic-coding · 79 tokens

deepeval

Use when discussing or working with DeepEval (the python AI evaluation framework).

sammcj/agentic-coding · 19 tokens

ml-llm-wiki

Use when answering questions from this machine-learning knowledge base. Triggers: questions about transformers, attention cost and efficiency, and long-context scaling; 'what do we know about attention', 'check the ML wiki'. Read-only querying of compiled knowledge; to add, update, supersede, lint, audit, or critique…

sammcj/agentic-coding · 80 tokens

metodo-3w1h

Dê a habilidade para agentes de IA de estruturar e otimizar prompts de imagens utilizando rigorosamente o método 3W1H (Who, What, Where, How) criado pelo Mário Lúcio. Utilize esta skill sempre que o usuário mencionar termos como 'gerar imagem', 'criar prompt de imagem', 'engenharia de prompt de imagem', 'fotorrealismo…

marioluciofjr/skills · 144 tokens

prompt-estruturado

Gera prompts a partir de uma estrutura modularizada com persona, contexto, tarefa, formato e regras.

marioluciofjr/skills · 27 tokens