prompt-optimizer
Skill517 starsChanged 2 months agoApache-2.0View on GitHub
Optimize a vague subagent brief into a structured Agent task brief carrying falsifier, invariant, source-citation rule, and concrete-noun anchors. Invoke before Agent tool dispatch (Explore / general-purpose / Plan), before drafting research-wave specs, before writing HANDOVER memos, before composing /loop self-prompts. Source: agi-in-md Comparator-Aware Prompt Diagnostics paper + 81-prism Twinks catalog.
46 other projects use a version of this.
Adopted by
Most recently taken up by
- lifeofpi-lgtm/prompt-optimizertheir own version, first seen Oct 4, 2026
- talki-io/prompt-optimizertheir own version, first seen Sep 29, 2026
- neelshah4/claude-prompt-optimizertheir own version, first seen Sep 29, 2026
- chujianyun/skillstheir own version, first seen Sep 25, 2026
- github/awesome-copilottheir own version, first seen Sep 23, 2026
- yannick-bottino/consulting-claude-skillstheir own version, first seen Sep 21, 2026
Used with
Projects with it also use continuous-agent-loop, deployment-patterns 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.
InfopibeSkillcontinuous-agent-loop
Patterns for continuous autonomous agent loops with quality gates, evals, and recovery controls.
Also in 4 projects that use this
InfopibeSkilldeployment-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
xiaobei930Skillsearch-first
Research-before-coding workflow: systematically search existing solutions before custom implementation. Use when introducing new libraries, tools, or solving unfamiliar problems.
Also in 3 projects that use this
mryeastcodeSkillcontext-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 3 projects that use this
LangChainSkilldocker-patterns
Best practices for Docker containerization and multi-stage builds
Also in 3 projects that use this
xfstudioSkillarchitecture-decision-records
Write and maintain Architecture Decision Records (ADRs) following best practices for technical decision documentation. Use when documenting significant technical decisions, reviewing past architectural choices, or establishing decision processes.
Also in 3 projects that use this
Other versions46 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 46
- github/awesome-copilot★ 40ksame name
- daymade/claude-code-skills★ 1.4ksame name
- getsentry/skills★ 1ksame name
- chujianyun/skills★ 740same name
- loulanyue/awesome-claude-notes★ 272same name
- tpavanipradeep/everything-claude-code★ 134same name
- templetongroup/radiant★ 113same name
- Jamkris/everything-gemini-code★ 87same name
- drvoss/everything-copilot-cli★ 47same name
- kunwl123456/zeroclaw-skills-collection★ 27same name
36 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 repository16 other files it gives its agents.
- AGENTS.mdAGENTS.md
- roam-agent-guidanceSkill
- roam-evidence-hardeningSkill
- roam-lesson-maintenanceSkill
- roam-measurement-designSkill
- roam-milestone-planningSkill
- roam-product-writingSkill
- roam-release-readinessSkill
- roam-agent-guidanceSkill
- roam-evidence-hardeningSkill
- roam-lesson-maintenanceSkill
- roam-measurement-designSkill
- roam-milestone-planningSkill
- roam-product-writingSkill
- roam-release-readinessSkill
- roamSkill
The file
We split this skill into the rules it gives an agent
6 rules. 0 are common, 3 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 34 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 16
Before any Agent dispatch (Explore / general-purpose / Plan)
- Very specific: line 17
Before drafting a dev/SPEC-*.md research wave
- Distinctive: line 18
Before writing a HANDOVER memo a future agent reads cold
- Very specific: line 19
Before composing a /loop self-pacing prompt
- Very specific: line 51
When dispatching ≥4 agents in parallel (memory: feedback_continuous_saturation_refill_to_four), optimize each brief independently — …
- Distinctive: line 61
Every claim in the optimized brief carries one tag:
“Common” is measured: kept by at least 6 in 10 of the 34 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
A structured-assignment generator for subagent dispatch. The brief is the dominant variable for subagent quality, not the model (agi-in-md LAW 1). This skill forces every dispatch through a stable 6-field shape so subagents return source-grounded findings instead of summary-mode paragraphs.
When to invoke
- Before any Agent dispatch (Explore / general-purpose / Plan)
- Before drafting a
dev/SPEC-*.mdresearch wave - Before writing a HANDOVER memo a future agent reads cold
- Before composing a
/loopself-pacing prompt
Skip for maximally-specific requests (one-symbol fact lookup, single-line continuation, conversational reply with full context already in window).
Three rules
- Preserve the vanilla brief verbatim. Copy the original first. Normalize only path quoting. Without the vanilla as comparator, A/B scoring is meaningless.
- Apply the 6-field template. Load
references/optimized-prompt-template.mdand fill every field: Task, Target, Grounding rules, Process, Final output, Falsifier. Anchor every claim on concrete-noun terminals per LAW 4 (seeroam-code/CLAUDE.md"Concrete-noun anchor vocabulary" for the accepted set). - Iterate v1 → v2 → final. Each pass names one ornament removed or one anchor sharpened. Stop when the next edit would not change the next agent's action (CLAUDE.md maintenance contract: Behavioral Coverage × Token Cost = Constant).
Roam-code dispatch matrix
| Subagent | Brief shape | Falsifier example |
| Explore | breadth (quick / medium / very thorough) + exact symbol or pattern | "If you do not find X, that is the answer — do not invent it" |
| general-purpose | file paths + line numbers + exact API up front | "Every claim cites file:line; unsourced claims get deleted" |
| Plan | trade-off matrix + rejected alternatives + chosen path with rationale | "Name two rejected paths; if none, design space was too narrow" |
When dispatching ≥4 agents in parallel (memory:
feedback_continuous_saturation_refill_to_four), optimize each brief
independently — subagents share no context.
claude subagent is BANNED on this host (memory:
feedback_no_claude_subagent, W1072 worktree-MAX_PATH); route every
optimized brief to Explore / general-purpose / Plan.
Epistemic tags
Every claim in the optimized brief carries one tag:
[SOURCE]— directly read from file/log/output (maps to roamdirectconfidence)[DERIVED]— computed from sources (maps toderived)[ASSUMED]— working hypothesis pending verification (maps toinferred)[UNVERIFIABLE]— out-of-scope or unprovable from artifacts at hand (maps tolegacy_fallback)
Canonical vocabulary: src/roam/evidence/_vocabulary.py →
CLAIM_CONFIDENCES (4-member closed enum).
Output shape
For a rewrite return:
vanilla— original brief verbatimoptimized_final— dispatch-ready textiteration_notes— concise v1 / v2 / final diff rationalemeasurement_plan— 8-axis scoring plan when A/B was requested
For an A/B return:
- Dispatch parameters (subagent_type, working dir, identical context)
- 8-axis comparison from
references/optimized-prompt-template.md - Final opinion + caveats
Reference
references/optimized-prompt-template.md carries the 6-field skeleton,
the Codex CLI cross-family pattern, the 8-axis scoring rubric, and the
documented failure modes.
Upstream
Source: agi-in-md/.agents/skills/prompt-optimizer/. Empirical backing:
the 81-prism catalog with 22 top-tier "Twinks" scored on production
code + the Comparator-Aware Prompt Diagnostics paper. The 12 agi-in-md
laws are already imported into roam-code/CLAUDE.md; this skill
operationalizes them at dispatch time.
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.

