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
- Rojios/everything-claude-codetheir own version, first seen Nov 8, 2026
- ahmadvahidi/skill-atlastheir own version, first seen Nov 8, 2026
- Samuel-Shek/prompt-optimizertheir own version, first seen Nov 8, 2026
- EchoUser005/prompt-optimizertheir own version, first seen Nov 8, 2026
- dreamor/prompt-optimizer-skilltheir own version, first seen Nov 8, 2026
- rodeyseijkens/skillstheir own version, first seen Nov 6, 2026
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.
ronmkrSkillagent-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
junimnjwSkillcontinuous-agent-loop
Patterns for continuous autonomous agent loops with quality gates, evals, and recovery controls.
Also in 3 projects that use this
junimnjwSkillagent-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-proofpilotSkillcontext-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
LangChainSkilldocker-patterns
Best practices for Docker containerization and multi-stage builds
Also in 4 projects that use this
royaluniondesign-sysSkilldeployment-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
Other versions72 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 72
- github/awesome-copilot★ 41ksame name
- daymade/claude-code-skills★ 1.5ksame name
- getsentry/skills★ 1.1ksame name
- chujianyun/skills★ 751same name
- Cranot/roam-code★ 517same name
- loulanyue/awesome-claude-notes★ 272same name
- Fmarzochi/EGC★ 61same name
- drvoss/everything-copilot-cli★ 48same name
- khalilbenaz/claude-skills-collection★ 28same name
- kunwl123456/zeroclaw-skills-collection★ 27same name
62 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository10 other files it gives its agents.
- arm-evalsSkill
- build-evalsSkill
- build-loopSkill
- forgeSkill
- generation-standardsSkill
- primitive-catalogSkill
- shipSkill
- skill-forgeSkill
- verifySkill
- write-contractSkill
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
- Distinctive: line 14
Load references per the routing tables below: Read every file the target matches before writing.
- Very specific: line 23
Structure with XML tags: when mixing instructions, context, examples, or variable inputs.
- Very specific: line 24
3–5 examples: when format or tone is hard to describe: relevant, diverse (edge cases, no unintended patterns), wrapped in <example> tags.
“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.
Files
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
- 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.
- 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.mdinstead of asking them to decide blind. - Load references per the routing tables below. Read every file the target matches before writing.
- 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.
- 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_tokensthinking 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 model | Read | The traps it saves you from |
| Fable 5 / Mythos 5 | references/fable-5.md | Longer 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 5 | references/opus-5.md | REMOVE 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.8 | references/opus-4-8.md | Thinking 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 5 | references/sonnet-5.md | Adaptive 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.5 | no dedicated guide | Use universal guidelines + the Haiku-class exception above (explicit steps, more examples); say honestly that no behavioral guide is on file |
| Any model, deep topic | references/best-practices.md | Full 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 context | Read |
| Claude Code, Cowork, claude.ai chat, API — where instructions live, platform features | references/platforms.md |
| Deep Research request | references/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 harness | Opus 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 product | model file's "Interactive coding products" section (front-load the spec; reduce user turns) |
| Frontend/design brief | model file's "Design and frontend defaults" (fixed house-style palettes; specify concretely or ask for 4 directions) |
| Computer use | model file's "Computer use" section (resolution/cost tuning) |
| Choosing model or effort for the user | references/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.
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
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.

