agentleFS
AznatkoinyAznatkoiny/plugin-forge/skills/prompt-optimizer/SKILL.md

prompt-optimizer

Skill1 starsChanged 3 months agoMITView on GitHub

Optimize, rewrite, or create prompts for Claude models. Use when the user wants to improve an existing prompt, turn a rough thought dump into a well-structured prompt, write a prompt from scratch, craft a Deep Research request, or tune a prompt for a specific model (Fable 5, Mythos 5, Opus 5, Opus 4.8, Sonnet 5, Haiku 4.5), effort level, or platform (Claude Code, Cowork, claude.ai chat, API). Also use when migrating prompts between model generations or when a prompt is underperforming.

72 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use agent-architecture-audit, continuous-agent-loop and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • ronmkrSkill

    agent-architecture-audit

    Full-stack diagnostic for agent and LLM applications. Audits the 12-layer agent stack for wrapper regression, memory pollution, tool discipline failures, hidden repair loops, and rendering corruption. Produces severity-ranked findings with code-first fixes. Essential for developers building agent applications, autonomous loops, or any LLM-powered feature.

    Also in 3 projects that use this

  • junimnjwSkill

    continuous-agent-loop

    Patterns for continuous autonomous agent loops with quality gates, evals, and recovery controls.

    Also in 3 projects that use this

  • junimnjwSkill

    agent-harness-construction

    Design and optimize AI agent action spaces, tool definitions, and observation formatting for higher completion rates.

    Also in 3 projects that use this

  • get-proofpilotSkill

    context-budget

    Audits Claude Code context window consumption across agents, skills, MCP servers, and rules. Identifies bloat, redundant components, and produces prioritized token-savings recommendations.

    Also in 5 projects that use this

  • LangChainSkill

    docker-patterns

    Best practices for Docker containerization and multi-stage builds

    Also in 4 projects that use this

  • royaluniondesign-sysSkill

    deployment-patterns

    Deployment workflows, CI/CD pipeline patterns, Docker containerization, health checks, rollback strategies, and production readiness checklists for web applications.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 58 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Load references per the routing tables below: Read every file the target matches before writing.

    line 14
  2. Very specific:

    Structure with XML tags: when mixing instructions, context, examples, or variable inputs.

    line 23
  3. Very specific:

    3–5 examples: when format or tone is hard to describe: relevant, diverse (edge cases, no unintended patterns), wrapped in <example> tags.

    line 24

“Common” is measured: kept by at least 6 in 10 of the 58 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Prompt Optimizer

Turn whatever the user has — an existing prompt, a rough thought dump, or nothing at all — into a prompt tuned for their target model, effort level, and application. Never tune for a specific model from memory: the per-model behavioral deltas live in references/ and change every generation. Route first, then write.

Workflow

  1. Classify the starting material. Existing prompt → diagnose before rewriting (see Common defects below); preserve the user's domain knowledge and hard-won constraints. Thought dump → extract goal, audience, constraints, success criteria; reorganize, don't summarize away. Nothing → interview first.
  2. Establish the target. Four facts, inferred where possible, asked in ONE batch (AskUserQuestion in Claude Code) only for what's missing: model, application (Claude Code / Cowork / claude.ai chat / Deep Research / API or custom agent), effort or thinking setting, intent (what success looks like, who consumes the output, one-off vs reusable). If the user doesn't know model/effort, recommend from references/models-and-effort.md instead of asking them to decide blind.
  3. Load references per the routing tables below. Read every file the target matches before writing.
  4. Build or rewrite applying the universal guidelines, then layer the model-specific and application-specific patterns from the loaded references. Copy the references' verbatim prompt snippets where they fit — they are tested language.
  5. Deliver: the prompt in a fenced block (with {{PLACEHOLDER}}s for reusable prompts), one-line recommended settings (model, effort/thinking, placement), and 3–6 "what changed and why" bullets for rewrites. Offer one iteration round: if the output misses, ask for the actual output and diagnose rather than guessing.

Universal guidelines (all current Claude models)

  • Clear and direct. The golden rule: show the prompt to a colleague with minimal context — if they'd be confused, Claude will be too. Want above-and-beyond behavior? Ask for it explicitly.
  • Give the reason, not only the request. State why the task matters, who it's for, what the output enables. Claude generalizes correctly from motivation ("output is read by TTS, so no ellipses" beats "NEVER use ellipses").
  • Make success measurable. Concrete output format, length, audience, acceptance criteria.
  • Structure with XML tags when mixing instructions, context, examples, or variable inputs. Long documents (20k+ tokens) go at the TOP, query at the bottom; wrap docs in <document> tags and ask for grounding quotes first.
  • 3–5 examples when format or tone is hard to describe: relevant, diverse (edge cases, no unintended patterns), wrapped in <example> tags. Claude follows examples over contradicting instructions.
  • Say what to do, not what to avoid. "Write flowing prose paragraphs" beats "don't use markdown." Match your prompt's own style to the desired output style.
  • Prefer general instructions over prescriptive steps. "Think thoroughly about edge cases" beats a hand-written reasoning plan. Current models need intent and boundaries, not enumerated micro-instructions — over-prescription degrades output (only Haiku-class models want the opposite: explicit steps, tighter format specs, more examples).
  • Effort is the primary capability/cost lever — recommend an effort setting alongside the prompt; per-model recommendations differ (see routing).
  • Cut everything that doesn't earn its tokens. Obsolete scaffolding actively hurts: anti-laziness nudges, "CRITICAL: you MUST" emphasis, prescribed step-by-step reasoning, prefill hacks, budget_tokens thinking configs, forced interim status messages, and show-your-reasoning instructions (refusal risk on Fable 5).
  • Measure any prompting change against real outputs or evals rather than assuming it helped.

Routing — model axis (always load the matching file)

Target modelReadThe traps it saves you from
Fable 5 / Mythos 5references/fable-5.mdLonger turns by default (timeouts, async check-ins); effort high default / xhigh for capability-critical; anti-overplanning + brevity + checkpoint snippets; grounding progress claims against tool results; memory-system construction; parallel-subagent defaults; send-to-user tool; NEVER instruct reasoning echo (reasoning_extraction refusals); prior-generation skills are too prescriptive — trim them
Opus 5references/opus-5.mdREMOVE verification/self-check instructions (over-verification); effort doesn't shorten visible responses — prompt length explicitly; written deliverables run long — calibrate; scope-expansion constraint; subagent spawn caps; thinking-disabled artifacts
Opus 4.8references/opus-4-8.mdThinking OFF unless {type: "adaptive"}; xhigh start for coding/agentic + 64k max_tokens headroom; favors reasoning over tool calls — raise effort or instruct tool use; literal instruction following at low effort; cream/serif design default
Sonnet 5references/sonnet-5.mdAdaptive thinking ON by default (change from 4.6); temperature/top_p/top_k now 400 errors; new tokenizer ≈ +30% tokens — revisit max_tokens; effort mapping (Sonnet 5 medium ≈ 4.6 high); literal instruction following
Haiku 4.5no dedicated guideUse universal guidelines + the Haiku-class exception above (explicit steps, more examples); say honestly that no behavioral guide is on file
Any model, deep topicreferences/best-practices.mdFull sections: General principles, Output and formatting, Tool use (parallel calls, <default_to_action> blocks), Thinking and reasoning, Agentic systems (state management, subagents, anti-hardcoding, anti-hallucination), Capability-specific tips, Migration considerations

Routing — application axis (load in addition to the model file)

Application contextRead
Claude Code, Cowork, claude.ai chat, API — where instructions live, platform featuresreferences/platforms.md
Deep Research requestreferences/deep-research.md (brief structure, template, anti-patterns)
Long-horizon / autonomous / multi-agent runs (incl. Claude Code ultracode)model file's long-run sections (Fable 5: longer turns, progress grounding, subagents, memory, early stopping) + references/best-practices.md § Agentic systems
Code-review harnessOpus 4.8 / Sonnet 5: the model file's "Code review harnesses" section. Opus 5: "Capability improvements" (code-review bullet). Fable 5: no dedicated section — apply the same rule from here: conservative-filter language ("only high-severity," "be conservative") silently tanks recall on current models; instruct report-everything with per-finding severity+confidence and filter downstream
Interactive coding productmodel file's "Interactive coding products" section (front-load the spec; reduce user turns)
Frontend/design briefmodel file's "Design and frontend defaults" (fixed house-style palettes; specify concretely or ask for 4 directions)
Computer usemodel file's "Computer use" section (resolution/cost tuning)
Choosing model or effort for the userreferences/models-and-effort.md

Worked routing examples: "Fable 5 in Claude Code driving an ultracode fleet" → fable-5.md (all long-run sections) + platforms.md § Claude Code + best-practices.md § Agentic systems. "Opus 5 deep research in the Claude app" → opus-5.md (deliverable length, over-verification) + deep-research.md.

Common defects in existing prompts

  • Missing motivation — rules with no why.
  • Buried instructions — critical constraints mid-wall-of-text; move to top/bottom or a tagged section.
  • Conflicting rules — accumulated patches; resolve, don't stack.
  • Negative-only formatting rules — replace with positive instructions.
  • Obsolete scaffolding — see the cut-list in Universal guidelines; also legacy verification steps (harmful on Opus 5) and forced-status-update scaffolding (current models update well unprompted).
  • Example drift — examples contradicting instructions; Claude follows the examples.
  • Wrong-generation tuning — prompt tuned for an older model's failure modes; check the target model file's migration notes before preserving any workaround.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.