prompt-optimizer
Skill0 starsChanged 9 months agoMITView on GitHub
Iteratively optimize a prompt using PromptSpec + tests + versioning + Gemini reviewer. Use only when the user explicitly wants prompt iteration with tracked versions and test feedback.
79 other projects use a version of this.
Adopted by
Most recently taken up by
- hmohammed7/claude-skillstheir own version, first seen Nov 16, 2026
- dainch/my-skillstheir own version, first seen Nov 16, 2026
- learn-with-santosh/claude-master-skillstheir own version, first seen Nov 15, 2026
- VinayKhandia/no-sloptheir own version, first seen Nov 15, 2026
- GabrieleDattile/agent-superpowerstheir own version, first seen Nov 15, 2026
- talki-io/prompt-optimizertheir own version, first seen Nov 13, 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 versions79 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 79
- github/awesome-copilot★ 41ksame name
- daymade/claude-code-skills★ 1.5ksame name
- getsentry/skills★ 1.2ksame name
- chujianyun/skills★ 755same name
- Cranot/roam-code★ 517same name
- loulanyue/awesome-claude-notes★ 272same name
- Fmarzochi/EGC★ 61same name
- drvoss/everything-copilot-cli★ 49same name
- khalilbenaz/claude-skills-collection★ 28same name
- kunwl123456/zeroclaw-skills-collection★ 27same name
69 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 repository33 other files it gives its agents.
- 13fSkill
- info-lake-healthSkill
- calendarSkill
- chatgpt-organizerSkill
- chatgptSkill
- exploreSkill
- flashbackSkill
- GANSkill
- kbSkill
- learnSkill
- linkSkill
- meeting-backtestSkill
- meeting-transcriptSkill
- mocSkill
- notebooklmSkill
- organizer-transcriptSkill
- planSkill
- podcastSkill
- podwise-downloaderSkill
- portfolioSkill
- researchSkill
- reviewSkill
- socratic-writerSkill
- substackSkill
- supply-chainSkill
- telegramSkill
- thesisSkill
- tradeSkill
- vault-healthSkill
- wechat-haoSkill
- x-bookmarksSkill
- xueqiuSkill
- youtube-downloaderSkill
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 2 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 64 edited versions we read keep these.
2
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 10
TestSuite: Test cases with expected output characteristics
- Distinctive: line 189
Only stores: inputs, Gemini output, versions, user feedback
“Common” is measured: kept by at least 6 in 10 of the 64 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
Iteratively optimize prompts through:
- PromptSpec: Define requirements, constraints, and evaluation criteria
- TestSuite: Test cases with expected output characteristics
- Versioning: Track all prompt iterations
- Gemini Review: Structured feedback with PASS/FAIL verdict, issues, and minimal patches
- User Testing: User-driven testing is MANDATORY before each iteration
Workflow
┌─────────────────────────────────────────────────────────────────┐
│ 1. 创建 Session → 2. 填写 Spec → 3. Claude 生成初版 │
└─────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────┐
│ 4. Gemini 审阅 │
│ (理论层面检查) │
└────────┬────────┘
│
▼
┌──────────────────────────────┐
│ 5. 用户测试 (必须!用户主导) │
│ → 用真实数据测试 prompt │
│ → 记录实际效果和问题 │
└──────────────┬───────────────┘
│
▼
┌────────────┐
│ 满意? │
└─────┬──────┘
│
┌──────────┴──────────┐
│ │
YES NO
│ │
▼ ▼
┌───────────┐ ┌─────────────────────┐
│ 6. 完成 │ │ 6. 记录反馈 + 迭代 │
│ Finalize │ │ → 回到第4步 │
└───────────┘ └─────────────────────┘核心原则:用户测试 > Gemini 审阅
- Gemini 审阅是"理论层面"的检查(格式、逻辑、约束)
- 用户测试是"实战层面"的验证(真实数据、实际效果)
- 只有用户说"好"才算好,Gemini 的 PASS 只是参考
Step-by-Step
1. Create Session
python ~/.claude/skills/prompt-optimizer/scripts/run.py optimizer.py new --goal "USER'S GOAL"2. Fill PromptSpec
Edit data/sessions/{id}/spec.md to define:
- Task description (one sentence)
- Input/output format
- Hard constraints (must satisfy)
- Soft constraints (try to satisfy)
- Things to avoid
- Evaluation criteria
3. Create Initial Prompt (Claude)
echo "PROMPT_TEXT" | python ~/.claude/skills/prompt-optimizer/scripts/run.py optimizer.py add-version --session ID --source claude4. Gemini Review (理论检查)
python ~/.claude/skills/prompt-optimizer/scripts/run.py optimizer.py review --session IDGemini returns:
- Verdict: PASS / FAIL
- Top 5 Issues: Problem → severity → trigger scenario → verification
- Minimal Patch: Replace/add/delete instructions (not full rewrite)
- Regression Risks: Potential new issues from changes
5. User Testing (必须!用户主导)
这是最关键的一步。用户必须:
- 用真实数据测试当前版本的 prompt
- 观察实际输出效果
- 记录问题和改进建议
python ~/.claude/skills/prompt-optimizer/scripts/run.py optimizer.py feedback --session ID --text "USER'S FEEDBACK"反馈应包含:
- 测试了什么数据?
- 实际输出是什么?
- 哪里不符合预期?
- 需要怎么改?
6. Iterate or Finalize
如果用户不满意:
- Claude 根据用户反馈 + Gemini 建议修改 prompt
- 保存新版本
- 回到第 4 步
如果用户满意:
python ~/.claude/skills/prompt-optimizer/scripts/run.py optimizer.py finalize --session IDCommands
| Command | Description |
configure --api-key KEY | Set Gemini API key |
status | Check API and session stats |
new --goal "..." | Create new session |
list | List all sessions |
show --session ID | Show session details |
add-version --session ID | Add prompt version |
review --session ID | Get Gemini review |
feedback --session ID --text "..." | Record user test feedback (必须) |
diff --session ID --v1 N | Compare versions |
finalize --session ID | Complete session |
Data Structure
data/sessions/{session_id}/
├── state.json # Session metadata
├── spec.md # PromptSpec (requirements)
├── tests/ # Test cases
│ ├── case_001.md
│ └── ...
├── versions/ # Prompt versions
│ ├── manifest.json
│ ├── v1.md
│ └── v2.md
└── conversations/ # Review rounds + user feedback
├── round_001.json # 包含 gemini_review + user_feedback
└── ...Example Session
User: 帮我优化一个分析财报的 prompt
Claude: 创建优化 session...
[Creates session, fills spec.md]
[生成初版 prompt v1]
让我请 Gemini 审阅...
[Gemini Review - Round 1]
Verdict: FAIL
Issues: 缺少输出格式定义...
Claude: 根据 Gemini 建议修改,保存为 v2。
请你用真实财报数据测试一下这个 prompt。
User: 我测试了腾讯 2024Q3 财报,发现:
1. 输出的表格格式不对
2. 没有提取研发费用
3. 投资建议太模糊
Claude: 收到!根据你的反馈修改:
1. 修正表格格式
2. 添加研发费用到关键指标
3. 投资建议增加具体理由要求
保存为 v3...
[继续迭代]
User: 这次测试效果很好,可以用了
Claude: [finalize session]
最终 prompt 为 v4,经过 3 轮迭代。Notes
- 用户反馈优先级最高 - Gemini 只是辅助,用户说了算
- Only stores: inputs, Gemini output, versions, user feedback
- Gemini acts as "strict reviewer" - conservative, specific, testable suggestions
- Each iteration MUST include user testing before proceeding
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.

