agentleFS
dainchdainch/my-skills/prompt-optimizer/SKILL.md

prompt-optimizer

Skill1 starsChanged 12 days agoMITView on GitHub

Turn vague user goals into executable agent briefs. Use when the user knows the desired outcome but is unsure how to specify programming requirements, constraints, deliverables, verification, deployment, or agent instructions; also use to optimize prompts for Codex, Claude, Cursor, ChatGPT, or other coding agents before implementation.

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

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

  • 0

    Common

    Most of the 64 edited versions we read keep these.

  • 12

    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 skill to write the prompt or task brief.

    line 12
  2. Distinctive:

    When fields are missing, choose a safe default instead of asking unless the missing answer changes the task materially.

    line 36
  3. Distinctive:

    Use these defaults for beginner users:

    line 40
  4. Distinctive:

    Prefer the simplest maintainable implementation.

    line 42
  5. Distinctive:

    Prefer existing project patterns over adding new frameworks.

    line 43
  6. Distinctive:

    Prefer static or low-dependency solutions for small websites and utilities.

    line 44
  7. Distinctive:

    Ask before public publishing, destructive changes, paid services, or broad refactors.

    line 49
  8. Distinctive:

    After the prompt, add a short note with:

    line 88
  9. Distinctive:

    When asking the user to decide, use no more than three choices.

    line 96
  10. Distinctive:

    Do not ask open-ended questions such as "What framework do you want?" for beginner users.

    line 108
  11. Distinctive:

    Before finalizing the optimized prompt, verify that it answers these questions:

    line 112
  12. Distinctive:

    If any answer is no, revise the prompt before returning it.

    line 122

“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

Purpose

Convert an under-specified goal into a brief that another agent can execute with clear scope, success criteria, constraints, deliverables, and verification requirements.

Use this skill to write the prompt or task brief. Do not implement the target project unless the user explicitly asks you to continue into implementation.

Workflow

  1. Identify the user's real outcome.
  2. Infer a conservative default execution path.
  3. Fill missing engineering requirements that a beginner may not know to ask for.
  4. Turn risky ambiguity into 2-3 concrete choices when needed.
  5. Produce a ready-to-use agent prompt.
  6. Self-check that the prompt can be executed and verified.

Intake

Extract these fields from the user's request and local context when available:

  • Goal: the desired final outcome in plain language.
  • User level: beginner, technical, or expert.
  • Inputs: files, URLs, screenshots, notes, repositories, examples, or source material.
  • Target agent: Codex, Claude, Cursor, ChatGPT, generic agent, or unknown.
  • Environment: local app, repo path, OS, framework, deployment target, or unknown.
  • Constraints: scope, style, dependencies, privacy, budget, time, and safety boundaries.
  • Deliverables: code, data, docs, tests, deployment steps, prompt, report, or design.
  • Verification: commands, screenshots, manual checks, acceptance criteria, or evidence.

When fields are missing, choose a safe default instead of asking unless the missing answer changes the task materially.

Default Assumptions

Use these defaults for beginner users:

  • Prefer the simplest maintainable implementation.
  • Prefer existing project patterns over adding new frameworks.
  • Prefer static or low-dependency solutions for small websites and utilities.
  • Require clear deliverables and verification evidence.
  • Require a short README when the result is meant to be reused or shared.
  • Require deployment notes when the user says publish, share, website, or GitHub.
  • Protect private data by default: exclude secrets, local-only URLs, account pages, API keys, tokens, and personal dashboards.
  • Ask before public publishing, destructive changes, paid services, or broad refactors.

Output Shape

Return the optimized prompt in Chinese unless the user asks otherwise.

Use this structure:

# Agent Task Brief

## Background
[Explain the user's situation and available inputs.]

## Goal
[State the final outcome in concrete terms.]

## Inputs
[List files, URLs, screenshots, examples, and what to read first.]

## Execution Requirements
[Describe the required workflow and implementation constraints.]

## Success Criteria
[List observable acceptance criteria.]

## Deliverables
[List exact files, docs, commands, or artifacts expected.]

## Verification
[Require real command output, screenshots, tests, or manual checks.]

## Prohibited Actions
[List scope boundaries and unsafe actions.]

## When Choices Are Needed
[Give default choices and ask only with 2-3 options.]

After the prompt, add a short note with:

  • Recommended default plan.
  • Open choices, only if truly needed.
  • Main risks or boundaries.

Choice Questions

When asking the user to decide, use no more than three choices. Each choice must include the tradeoff and a recommended default.

Use this format:

One choice needs confirmation:

1. Option A (recommended): ...
2. Option B: ...
3. Option C: ...

Do not ask open-ended questions such as "What framework do you want?" for beginner users. Replace them with defaults and tradeoffs.

Self-Check

Before finalizing the optimized prompt, verify that it answers these questions:

  • Can another agent start without asking obvious follow-up questions?
  • Does it define what "done" means?
  • Does it name the input files or source material?
  • Does it prevent uncontrolled scope expansion?
  • Does it include verification based on real tools or observable evidence?
  • Does it handle beginner maintenance and deployment needs?
  • Does it protect secrets, private links, and risky public content where relevant?

If any answer is no, revise the prompt before returning it.

Optional Reference

For reusable patterns and examples, read references/brief-patterns.md.

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.