agentleFS
yuchenmiao04yuchenmiao04/My_skills/skills/writing-polish/prompt-optimizer/SKILL.md

prompt-optimizer

Skill8 starsChanged 5 months agoMITView on GitHub

Use when the user asks to optimize, strengthen, rewrite, audit, or improve LLM prompts, especially prompts for structured outputs, multimodal inputs, agent workflows, or review-only translations. Applies OpenAI, Anthropic, and Google Gemini prompt-engineering guidance.

79 other projects use a version of this.

Adopted by

Most recently taken up by

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.
  • ronmkrSkill

    agent-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

  • junimnjwSkill

    continuous-agent-loop

    Patterns for continuous autonomous agent loops with quality gates, evals, and recovery controls.

    Also in 3 projects that use this

  • junimnjwSkill

    agent-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-proofpilotSkill

    context-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

  • LangChainSkill

    docker-patterns

    Best practices for Docker containerization and multi-stage builds

    Also in 4 projects that use this

  • royaluniondesign-sysSkill

    deployment-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

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 64 edited versions we read keep these.

  • 6

    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:

    Use this workflow for prompt optimization tasks.

    line 8
  2. Distinctive:

    Put the instruction and success criteria near the top of the runtime prompt.

    line 13
  3. Distinctive:

    Prefer positive instructions over only saying what not to do.

    line 17
  4. Distinctive:

    Add examples only when they materially reduce ambiguity.

    line 18
  5. Distinctive:

    If a Chinese version is requested for review, store it separately and mark it as non-runtime.

    line 20
  6. Distinctive:

    When current source attribution is needed, consult the official pages:

    line 33

“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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Prompt Optimizer

Use this workflow for prompt optimization tasks.

Workflow

  1. Identify the runtime prompt separately from documentation or review-only translations.
  2. Put the instruction and success criteria near the top of the runtime prompt.
  3. Structure context with explicit sections or delimiters such as # Role, # Objective, # Input, # Instructions, and # Output Contract.
  4. Define what the model should do, what evidence it may use, and what shortcuts are forbidden.
  5. Specify the output schema exactly. For JSON tasks, require one valid JSON object and no extra text.
  6. Prefer positive instructions over only saying what not to do. Include concise edge-case handling.
  7. Add examples only when they materially reduce ambiguity; avoid examples that leak labels or encourage shortcuts.
  8. For multimodal prompts, explicitly tell the model how to use each modality and how to handle unclear, missing, irrelevant, or conflicting evidence.
  9. If a Chinese version is requested for review, store it separately and mark it as non-runtime.
  10. Validate by compiling/loading the prompt templates and running a dry run or small sample when code is involved.

Quality Checks

  • The prompt is task-specific, concrete, and avoids vague adjectives.
  • It separates role, objective, inputs, rules, checklist, and output contract.
  • It prevents hidden-label, source-reputation, path-name, and metadata shortcut reasoning when relevant.
  • It tells the model how to handle uncertainty instead of forcing a false precision.
  • It preserves schema compatibility with the calling code.

Reference Guidance

When current source attribution is needed, consult the official pages:

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.