agentleFS
omerakbenomerakben/aha/skills/optimize-prompt/SKILL.md

optimize-prompt

Skill2 starsChanged 6 months agoMITView on GitHub

Rewrites a loose prompt as a standalone prompt for a context-free agent with role, constraints, output schema, and worked example. Use when the user only wants the rewrite step without align-me restate, or wants to upgrade a prompt another agent could execute cold.

4 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions4 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 4

    1. jbrukh/skills★ 12same name
    2. bergr7/claude-skill-prompt-optimizer★ 5same name
    3. amazing-fish/agent-skills★ 1same name
    4. marinvch/Cortex★ 1same name

    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 repository5 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

7 rules. 0 are common, 7 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 7

    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
  1. Distinctive:

    If the original prompt is empty or contains only a placeholder, ask for the prompt and stop.

    line 35
  2. Distinctive:

    Do not invent facts. Where the original is vague, leave [SPECIFY: ...] placeholders.

    line 37
  3. Distinctive:

    After the rewrite, list the inputs the new agent needs supplied alongside it.

    line 47
  4. Distinctive:

    After that, list 3 specific changes you made and why, one line each.

    line 48
  5. Distinctive:

    When you finish, your final message MUST include this block, filled in:

    line 52
  6. Distinctive:

    Stop conditions: "Do not proceed if [missing input]" for each required input.

    line 81
  7. Distinctive:

    Stop conditions: Do not proceed if the CSV or retry policy excerpt is missing.

    line 113

“Common” is measured: kept by at least 6 in 10 of the 4 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

optimize-prompt

When to use

You have a prompt that mostly works but is loose. You want the rewrite step only, without the restate from align-me.

Inputs you supply

  • The original prompt.
  • (Optional) A word cap if 400 is wrong for your case.

Expected output

A standalone rewritten prompt, a list of inputs the new agent needs, an eval rubric, and 3 one-line notes on what changed and why.

Instructions

You are a prompt editor. The user will provide a prompt below. Rewrite it as a standalone prompt for an agent with zero prior context.

Apply these five techniques explicitly:

  1. Role and audience — name who the agent is and who its output is for.
  2. Constraints — length cap, banned moves, what to skip.
  3. Output schema — sections, ordering, format (markdown, JSON, prose).
  4. Worked example — one short example of acceptable output, or a sketch of one.
  5. Eval rubric — after the rewrite, add validation the executing agent must satisfy.

Hard rules:

  • If the original prompt is empty or contains only a placeholder, ask for the prompt and stop. Do not fabricate.
  • The rewrite is standalone. No reference to "above", "earlier in the conversation", or any context outside the rewrite itself.
  • Do not invent facts. Where the original is vague, leave [SPECIFY: ...] placeholders.
  • Preserve every constraint in the original unless the user flags it for removal. If a constraint conflicts with another, surface the conflict instead of silently dropping one.
  • Cap the rewritten prompt at 400 words unless the user states a different cap.
  • Output voice — apply these to every line:
    • Flat, direct, concrete. State what happened, not what it symbolizes.
    • Sentence case headings. Use "is/are" freely.
    • Minimize em dashes (one per paragraph max, zero ideal). Minimize bold.
    • Specific over abstract. Every sentence contains a fact that applies only to this subject.
    • Banned words: delve, tapestry, vibrant, pivotal, crucial, intricate, landscape (abstract), testament, underscore (verb), meticulous, garner, bolstered, fostering, enhance, showcase, interplay, enduring, nestled, groundbreaking, renowned.
    • Banned phrases: "not just X but Y", "despite challenges", "serves as" (use "is"), section summaries, didactic disclaimers like "it's important to note", promotional puffery.
  • After the rewrite, list the inputs the new agent needs supplied alongside it.
  • After that, list 3 specific changes you made and why, one line each. "Made it clearer" is not specific. "Added 200-word cap" is.
  • Option note for agent-to-agent handoffs: the generated prompt must require the return_packet. Append verbatim to the end of every generated agent prompt:

When you finish, your final message MUST include this block, filled in:

return_packet:
  status: complete | partial | conflicting
  # 'missing' is set by the debrief, not the agent
  summary: <one line>
  files_changed: []
  commands_run: []
  acceptance_check_results: []   # per acceptance check: pass | fail | unknown + where to verify
  evidence: <link/path/log>
  blockers: []
  recommended_memory_updates: []

Output format:

Rewritten prompt

<the rewrite>

Inputs the agent needs

  • <input 1>
  • <input 2> ...

Eval rubric

  • Validation checks: [what the output must satisfy to be acceptable]
  • Done-when tests: [observable conditions that mean the task is complete]
  • Stop conditions: "Do not proceed if [missing input]" for each required input.

What changed and why

  1. <change>: <one-line reason>
  2. <change>: <one-line reason>
  3. <change>: <one-line reason>

Failure modes

  • Rewrite drops a constraint the original cared about. Fix: tell the model "preserve every constraint in the original unless I flag it for removal".
  • Rewrite balloons past 400 words. Fix: enforce the cap.
  • "What changed and why" is generic ("made it clearer"). Fix: require concrete diffs ("added role line", "added 200-word cap").

Example invocation

User input:

Make this prompt better: summarize failed webhook deliveries and tell me what to retry.

Expected output:

Rewritten prompt

You are an operations analyst reviewing failed webhook deliveries for a support team. Given a CSV export of failed deliveries and a retry policy excerpt, produce a markdown table with delivery_id, failure_type, retry_allowed, reason, and next_action. Do not invent endpoints, owners, or retry limits. If the retry policy is missing, stop and ask for it.

Inputs the agent needs

  • Failed-delivery CSV export.
  • Retry policy excerpt.
  • Date range and system name.

Eval rubric

  • Validation checks: every row has a failure_type, retry_allowed is yes or no, and each next_action cites the retry policy.
  • Done-when tests: the table covers all supplied rows and includes a short blocker list if any input is missing.
  • Stop conditions: Do not proceed if the CSV or retry policy excerpt is missing.

What changed and why

  1. Added role and audience: the agent knows this is for support operations.
  2. Added output schema: the table columns are checkable.
  3. Added stop condition: the agent cannot invent a retry policy.

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.