prompt-optimize

prompt-optimize is a command for coding agents from HermeticOrmus/claude-code-game-development. It costs 0 tokens per session (3,143 once invoked), scanned B, original, MIT.

You are an expert prompt engineer specializing in crafting effective prompts for LLMs through advanced techniques including constitutional AI, chain-of-thought reasoning, and model-specific optimization.

Command

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 commands/hermeticormus/claude-code-game-development/prompt-optimize
Clone the repo
git clone --depth 1 https://github.com/HermeticOrmus/claude-code-game-development

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

README.md
[![agentmods](https://agentmods.dev/badge/commands/hermeticormus/claude-code-game-development/prompt-optimize.svg)](https://agentmods.dev/commands/hermeticormus/claude-code-game-development/prompt-optimize)
Your own site
<a href="https://agentmods.dev/commands/hermeticormus/claude-code-game-development/prompt-optimize"><img src="https://agentmods.dev/badge/commands/hermeticormus/claude-code-game-development/prompt-optimize.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,143 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. Scan, not verified.
Origin unknown 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 $0.00000 $0.03143
Opus 5 $0.00000 $0.01571
Sonnet 5 $0.00000 $0.00629
Haiku 4.5 $0.00000 $0.00314

Measured today against content hash b8620d529ed8, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

prompt-optimize scanned grade B with 1 finding 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 today.

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.

Strips warnings and disclaimersmediumAnti-refusal

Omitting safety caveats hides risk from the user and is a common jailbreak preamble.

- No speculation without disclaimers
plugins/llm-application-dev/commands/prompt-optimize.md · 588 lines

How it starts

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

Prompt Optimization

You are an expert prompt engineer specializing in crafting effective prompts for LLMs through advanced techniques including constitutional AI, chain-of-thought reasoning, and model-specific optimization.

Context

Transform basic instructions into production-ready prompts. Effective prompt engineering can improve accuracy by 40%, reduce hallucinations by 30%, and cut costs by 50-80% through token optimization.

Requirements

$ARGUMENTS

Instructions

1. Analyze Current Prompt

Evaluate the prompt across key dimensions:

Assessment Framework

  • Clarity score (1-10) and ambiguity points
  • Structure: logical flow and section boundaries
  • Model alignment: capability utilization and token efficiency
  • Performance: success rate, failure modes, edge case handling

Decomposition

  • Core objective and constraints
  • Output format requirements
  • Explicit vs implicit expectations
  • Context dependencies and variable elements

2. Apply Chain-of-Thought Enhancement

Standard CoT Pattern

# Before: Simple instruction
prompt = "Analyze this customer feedback and determine sentiment"

# After: CoT enhanced
prompt = """Analyze this customer feedback step by step:

1. Identify key phrases indicating emotion
2. Categorize each phrase (positive/negative/neutral)
3. Consider context and intensity
4. Weigh overall balance
5. Determine dominant sentiment and confidence

Customer feedback: {feedback}

Step 1 - Key emotional phrases:
[Analysis...]"""

Zero-Shot CoT

enhanced = original + "\n\nLet's approach this step-by-step, breaking down the problem into smaller components and reasoning through each carefully."

Tree-of-Thoughts

tot_prompt = """
Explore multiple solution paths:

Problem: {problem}

Approach A: [Path 1]
Approach B: [Path 2]
Approach C: [Path 3]

Evaluate each (feasibility, completeness, efficiency: 1-10)
Select best approach and implement.
"""

3. Implement Few-Shot Learning

Read the full file on GitHub · 588 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. today First seen · 588 lines · 0 tokens per session scan B b8620d529ed8

Subscribe to this mod's changes

prompt-optimize is a command published in the GitHub repository HermeticOrmus/claude-code-game-development (59 stars, last pushed 3mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 3,143 tokens. A static security scan graded it B with 1 finding (strips warnings and disclaimers). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.