llm-prompt-optimizer

llm-prompt-optimizer is a skill for Claude Code, Codex from tmolavi/mcp-agent-skills-hub. It costs 35 tokens per session (1,442 once invoked), scanned A, original, MIT.

A guide for improving prompts, the instructions given to language models such as GPT or Claude, so their responses are clearer and more consistent.

In plain words
What is it for?
Use it to refine prompts, design agent or chatbot instructions, request reliable JSON output, and adapt prompts across language models.
Why use it?
It helps reduce vague answers, hallucinations, inconsistent formatting, and unnecessary token use.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to refine prompts, design agent or chatbot instructions, request reliable JSON output, and adapt prompts across language models.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/tmolavi/mcp-agent-skills-hub/llm-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 tmolavi/mcp-agent-skills-hub --skill llm-prompt-optimizer
Clone the repo
git clone --depth 1 https://github.com/tmolavi/mcp-agent-skills-hub

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/tmolavi/mcp-agent-skills-hub/llm-prompt-optimizer/github.svg)](https://agentmods.dev/skills/tmolavi/mcp-agent-skills-hub/llm-prompt-optimizer)
Your own site
<a href="https://agentmods.dev/skills/tmolavi/mcp-agent-skills-hub/llm-prompt-optimizer"><img src="https://agentmods.dev/badge/skills/tmolavi/mcp-agent-skills-hub/llm-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 llm-prompt-optimizer

Your own site · 80×15
<a href="https://agentmods.dev/skills/tmolavi/mcp-agent-skills-hub/llm-prompt-optimizer"><img src="https://agentmods.dev/badge/skills/tmolavi/mcp-agent-skills-hub/llm-prompt-optimizer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 35 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,442 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.00035 $0.01442
Opus 5 $0.00017 $0.00721
Sonnet 5 $0.00007 $0.00288
Haiku 4.5 $0.00003 $0.00144

Measured 8d ago against content hash 9967df7db719, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, 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 8d 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

Copies of this mod

2 near-identical copies found in the catalogue:

skills/llm-prompt-optimizer/SKILL.md · 188 lines

How it starts

The opening of the file, as written. The whole thing — 188 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 · 188 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. 8d ago First seen · 188 lines · 35 tokens per session scan A 9967df7db719

Subscribe to this mod's changes

llm-prompt-optimizer is a skill published in the GitHub repository tmolavi/mcp-agent-skills-hub (8 stars, last pushed 16d ago), licensed MIT. It adds 35 tokens to every session and 1,442 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-09-03.

Related

Other skills, from other repositories

happyhorse-prompt-studio

Interactive prompt studio for HappyHorse 1.0 video generation. Guides users through scenario discovery with vivid examples, then assembles production-ready prompts in JP/CN/EN. Use when someone wants to create AI video content with HappyHorse but doesn't know where to start, or when they have a specific scenario and…

modelstudioai/skills · 93 tokens

prompt-builder

An interactive tool that builds a reusable, structured prompt from a description of your task. A prompt is the instruction you give an AI system.

KirKruglov/claude-skills-kit · 72 tokens

prompt-library-curator

Organize and tag your personal prompt collection into a structured markdown catalog with an index table. Use when you have accumulated saved prompts and want to structure, deduplicate, and label them for reuse. Triggers: 'organize my prompts', 'prompt library', 'tag my prompts', 'structure my prompt collection'…

KirKruglov/claude-skills-kit · 95 tokens

prompt-enhancer

TÜRKÇE AÇIKLAMA ─────────────── Bu skill, belirsiz veya eksik bir kullanıcı isteğini alır ve onu daha net, daha spesifik, daha uygulanabilir bir prompt'a dönüştürür. Agent'ın yanlış anlayarak iş yapmasını önler. "Şunu düzelt" gibi muğlak bir istek, "hangi koşulda ne bekleniyor, başarı kriteri ne" formatına çevrilir.

omergocmen/vibe-coder-kit · 0 tokens

ai-product

Every product will be AI-powered. The question is whether you'll build it right or ship a demo that falls apart in production.

sickn33/agentic-awesome-skills · 28 tokens

cost-aware-llm-pipeline

A planning guide for choosing language models and managing the amount of conversation context used by an AI coding workflow. It groups tasks by complexity and gives rules for avoiding context overflow during long sessions.

hashgraph-online/awesome-codex-plugins · 42 tokens