prompt-optimizer
Skill3 starsChanged 4 months agoMITView on GitHub
Optimize prompts for token efficiency, latency, and output quality while preserving task behavior. Use when working on prompt engineering, AI workflows, agents, context design, or LLM optimization.
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 repository59 other files it gives its agents.
- agent-memory-designerSkill
- ai-cost-optimizerSkill
- ai-evaluation-builderSkill
- ai-latency-optimizerSkill
- ai-solution-architectSkill
- ai-workflow-builderSkill
- context-engineeringSkill
- human-in-the-loop-designerSkill
- multi-agent-plannerSkill
- prompt-engineerSkill
- prompt-reviewerSkill
- adr-generatorSkill
- api-designerSkill
- architecture-reviewSkill
- component-diagram-builderSkill
- container-diagram-builderSkill
- data-flow-analyzerSkill
- integration-plannerSkill
- observability-plannerSkill
- scalability-advisorSkill
- solution-architectureSkill
- system-context-builderSkill
- experiment-designerSkill
- go-to-market-plannerSkill
- pricing-strategy-advisorSkill
- mcp-best-practicesSkill
- mcp-client-generatorSkill
- mcp-security-reviewSkill
- mcp-server-generatorSkill
- mcp-tool-generatorSkill
- acceptance-criteria-generatorSkill
- analytics-instrumentation-plannerSkill
- competitive-analysisSkill
- epic-generatorSkill
- feature-prioritizationSkill
- idea-validatorSkill
- north-star-metric-advisorSkill
- okr-builderSkill
- persona-generatorSkill
- prd-generatorSkill
- problem-statement-builderSkill
- product-discovery-assistantSkill
- product-vision-builderSkill
- sprint-plannerSkill
- story-mappingSkill
- user-story-generatorSkill
- value-proposition-designerSkill
- chunking-strategy-advisorSkill
- embedding-strategy-advisorSkill
- hybrid-search-advisorSkill
- knowledge-ingestion-plannerSkill
- rag-architecture-designerSkill
- retriever-optimizerSkill
- ai-governance-advisorSkill
- ai-threat-modelingSkill
- guardrails-builderSkill
- owasp-llm-reviewerSkill
- prompt-injection-detectorSkill
- skill-nameSkill
The file
We split this skill into the rules it gives an agent
3 rules. 0 are common, 3 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 58 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 54
Never remove safety constraints for token savings
- Distinctive: line 55
Never remove output format contract
- Distinctive: line 118
Use shorter synonyms and bullet lists over prose.
“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
Purpose
Optimize prompts for token efficiency, latency, and output quality while preserving task behavior.
Input: Prompt specification (reviewed), test cases, optimization goal (cost/latency/quality)
Output: Optimized prompt with change log, token comparison, and regression test plan
Examples: See examples.md for worked input/output.
Workflow
Step 1: Baseline measurement
Document current prompt:
| Metric | Value |
| Template tokens (estimate) | |
| Example tokens | |
| Total typical request tokens | |
| Optimization goal | cost / latency / quality |
Step 2: Identify optimization opportunities
Categories:
- Redundancy — repeated instructions
- Verbosity — instructions expressible more concisely
- Example efficiency — fewer/shorter few-shot examples
- Structure — reorder for model attention
- Variable compression — summarize context inputs
Step 3: Apply optimizations
For each change:
| Change | Tokens saved | Quality risk | Rationale |
Rules:
- Never remove safety constraints for token savings
- Never remove output format contract
- Preserve test case pass behavior
Step 4: Produce optimized prompt
Deliver side-by-side or diff-style comparison:
- Original section → Optimized section
- Net token change
Step 5: Regression test plan
Map each test case from prompt-engineer:
| Test ID | Must still pass | Risk if fails |
Recommend A/B test if quality risk is Medium+.
Step 6: Validate
Run Validation checklist.
Decision Rules
| Condition | Action |
| No test cases available | Stop; request from prompt-engineer |
| Optimization breaks safety constraint | Revert change; safety > tokens |
| Quality risk High for a change | Flag; require A/B test before deploy |
| <10% token savings | Report low ROI; may not be worth complexity |
| Customer-facing prompt | Never remove refusal or delimiter rules |
Validation
- Baseline token metrics documented
- ≥3 optimization changes with rationale
- Optimized prompt preserves output format contract
- Safety constraints unchanged
- Token savings quantified (before/after)
- Regression test plan covers all original test cases
- Changes with quality risk flagged
- No Role Play introduced
Anti-patterns
- Strip safety for tokens — removing constraints to save tokens.
- Optimize without tests — changes without regression verification.
- Over-compress — ambiguous instructions that hurt quality.
- Remove all examples — zero-shot when few-shot was needed.
- False precision — exact token counts without noting estimation uncertainty.
Best Practices
- Optimize iteratively; one change category at a time.
- Use shorter synonyms and bullet lists over prose.
- Move critical instructions to end of prompt (recency).
- Track prompt versions with measured metrics.
- Pair with prompt-reviewer after optimization.
Output Structure
# Prompt Optimization: [Prompt Name]
## Baseline
| Metric | Before |
|--------|--------|
| Template tokens | |
| Total typical | |
## Changes
| # | Change | Tokens saved | Risk |
|---|--------|--------------|------|
## Optimized Prompt
[Full optimized template]
## Comparison
| Metric | Before | After | Delta |
|--------|--------|-------|-------|
## Regression Tests
| Test ID | Must pass | Status |
|---------|-----------|--------|
## Recommendation
Deploy | A/B test first | Revert [change #]Next Skills
| Outcome | Recommended Skill |
| Re-review optimized prompt | ai/prompt-reviewer |
| Context still too large | ai/context-engineering |
| Quality degraded | ai/prompt-engineer |
| Cost at architecture level | ai/ai-cost-optimizer |
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.

