agentleFS
theultimate-devtheultimate-dev/skills/skills/prompt-engineering/improving-prompts/SKILL.md

improving-prompts

Skill2 starsChanged 44 days agoMITView on GitHub

Rewrites a rough prompt into an engineered one. Classifies where the prompt will run (chat request, system prompt, coding or research agent task, agent operating instructions, long-document job, extraction or classification), diagnoses its gaps, applies the prompt and context engineering techniques that close them, and returns the techniques applied with reasons, the techniques rejected with reasons, placeholders for facts it could not infer, and a copy-paste-ready enhanced prompt inside an enhanced_prompt tag. Use when the user asks to improve, enhance, refine, optimize, rewrite, or engineer a prompt, system prompt, or agent task, or passes a prompt as the argument.

3 other projects use a version of this.

Adopted by

Most recently taken up by

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 3 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:

    Keep the prompt's language and register.

    line 17
  2. Distinctive:

    If no prompt was supplied, ask for it.

    line 19
  3. Distinctive:

    No emphasis in capitals, no "critical", no chains of "must".

    line 67
  4. Distinctive:

    No meta commentary inside the prompt: no "Improved prompt:", no technique labels, no notes to the user.

    line 70
  5. Distinctive:

    No instruction the destination cannot honour: no tests for a model without tools, no "search the web" without search.

    line 71
  6. Distinctive:

    When the draft is already good, the report says so and the applied table may hold a single cosmetic row.

    line 93

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

Improving prompts

Take the prompt the user supplied, return a short report and an enhanced prompt, and never block on questions. A technique earns its place only by closing a diagnosed gap; the shortest prompt that reliably does the job wins. The enhanced prompt is the user's own request, engineered, not a document about the request.

Take in the prompt

The prompt to improve is the text the user supplies with the request: inline, in a code block, or in a file to read. Everything else the user says, such as the target model, the harness, the audience, where the prompt will run, or what went wrong last time, is context for the diagnosis and does not go into the prompt.

A system prompt supplied together with a task prompt is two prompts with two destinations. Improve both and deliver two blocks.

Keep the prompt's language and register. Do not translate it, and do not turn first person into third person. Write the report in the language of the user's request.

If no prompt was supplied, ask for it. That is the only case in which this skill asks a question. If the prompt's purpose is to defeat a model's safeguards or to deceive people, say so in one sentence and stop.

Classify the destination

DestinationSignals in the draftWhat changes
Chat requestAn imperative one-liner or a question; a person reads the answer; no tools impliedStay short: task, audience, form, and the facts the reader lacks
System prompt or app prompt"You are…"; standing behaviour for many users or sessions; tools or policies describedRole, altitude, sections, tone, refusal and escalation, trust boundary, reusable prefix
Coding or research agent taskA repository, files, tests, an investigation; verbs like fix, implement, migrate, investigateScope, pointers to files and patterns, a verification target, autonomy and handback rules
Agent operating instructionsRules meant for every session: conventions, commands, etiquette; files such as AGENTS.md or CLAUDE.mdOnly what the agent cannot infer, short and calm; no tutorials
Long-document taskPasted or attached documents, "based on the attached", inputs of tens of thousands of tokensInputs first with metadata, question last, quote-first grounding
Extraction or classificationA schema, labels, "return JSON", a batch of inputsSchema shape, label set, no preamble, diverse examples

Choose the most likely destination and record it in the report. When two readings would produce materially different prompts, deliver the most likely one and name the other under Assumptions. Read diagnosis for the full signal list, the gap checklist, and how to write success criteria.

Diagnose

Walk the draft against this checklist: goal and definition of done; audience and destination; facts the reader lacks; constraints and scope; output form and length; a pattern the output must match; reasoning demand; risk, meaning untrusted content, side effects, hallucination stakes, or personal data; defects in the draft itself, meaning contradictions, duplicated rules, emphasis in capitals, prohibitions without an alternative, instructions the destination cannot honour, and bloat; runtime assumptions such as a prefilled response, a sampling setting, or a tool the destination lacks.

Rate each gap blocks (the model cannot do the job), degrades (it will do a worse job), or cosmetic. Only blocks and degrades justify a change. A draft with nothing above cosmetic is already good: say so, fix the cosmetics, and do not inflate it.

Select techniques

Pick from the groups below. Read the reference for every group you apply and for every group you reject on a judgment call.

GroupApply whenReject whenRead
Clarity and directnessThe verb is ambiguous; goal, audience, or constraints are missing; a "don't" has no positive alternative; the draft shouts or contradicts itselfThe vagueness is deliberate exploration ("what would you improve here?")clarity and structure
Structure and orderingInstructions mix with data or examples; the prompt exceeds a screen; it will be reusedA short conversational request; the existing structure already worksclarity and structure
ExamplesA format, tone, or label set must match a pattern, and real examples exist or can stand as placeholdersSimple tasks; examples would have to be invented; creative work where copying is the riskexamples
Roles and system promptsThe destination is a system prompt, or expertise changes the answerA role line that changes nothingsystem prompts
ReasoningMultistep analysis where the destination's thinking is off or unknown; checkable criteria exist for a self-checkLookups and transformations; models that already verify their work; latency-bound chatreasoning
Output controlAny deliverable; machine-consumed output; a length or format complaintThe user wants the model to choose the formoutput control
Context packagingThe reader lacks facts; inputs are long; sources are retrievable; a prefix will be reusedEverything needed is already present and shortcontext packaging
Reliability and groundingFactual, analytical, advisory, research, or code questionsFiction; pure formatting or translationreliability and grounding
Trust boundaries and safetyThird-party content, tools with side effects, public users, personal dataClosed inputs the user wrote, no tools, nobody else reads the outputtrust boundaries
Agent task promptsCoding, research, or operational work run by an agent with toolsChat without toolsagent tasks
DecompositionOne prompt carries several tasks; intermediate outputs need inspection; independent parts can run in parallelA capable model handles it in one pass and nobody needs the intermediatesdecomposition
Model-family adjustmentsThe user named the target model or familyTarget unknown: stay neutral and say somodel family notes

Rejection reasons must be specific to this prompt: "no real transcripts to use as examples; invented ones would teach the wrong voice", never "not needed". Record every group you seriously weighed.

Apply

  • Preserve intent, scope, voice, terms, and language. A changed meaning is a defect. If the draft contradicts itself, keep the reading its wording supports and flag it.
  • Never add a fact the user did not give: no product names, numbers, file paths, policies, dates, or audience claims. A missing fact becomes a placeholder in square brackets naming what goes there, such as [paste the failing test output] or [audience, e.g. finance managers], and every placeholder is listed under Assumptions. Nothing the draft already says becomes a placeholder.
  • Minimal sufficient structure. A one-line request usually becomes three to eight lines, not a page. Use tags or headings only when the prompt mixes kinds of content. Keep the user's structure where it works.
  • Say what to do. Keep a prohibition only when it protects something, and pair it with the alternative.
  • No emphasis in capitals, no "critical", no chains of "must". One plainly stated instruction each. Current models over-trigger on shouted rules.
  • Give the reason behind a constraint that is not obvious, in a clause, so the model can generalize from it.
  • Consistent terms and tag names throughout; descriptive tags, balanced and closed.
  • No meta commentary inside the prompt: no "Improved prompt:", no technique labels, no notes to the user. The enhanced prompt reads as the user's own request and stands alone without the report.
  • No instruction the destination cannot honour: no tests for a model without tools, no "search the web" without search.
  • Runtime settings and architecture stay out of the prompt text: effort or reasoning level, schema enforcement, cache breakpoints, tool-result encoding, screening, sampling parameters. Report them under Outside the prompt.
  • Model-neutral wording unless the user named the target. Then apply the dated adjustments and name the model in the report, never inside the prompt.
  • Each added sentence traces to one diagnosed gap. Do not stack techniques.

Shape the result with the prompt skeleton, dropping every section the diagnosis did not call for.

Check before delivering

Someone with no context could follow the prompt. Every addition maps to a blocks or degrades gap. Nothing is invented and every placeholder is listed. No contradictions, duplicate rules, shouted emphasis, or prohibition without an alternative remain. The length is proportionate to the task. Tags are balanced. The first sentence states the task. Language and voice are unchanged. Nothing asks the destination for what it cannot do. Model-specific wording appears only when a model was named.

Deliver

Fill the improvement report in this order and put nothing after the enhanced prompt:

  1. ## Diagnosis: destination; target, either the model the user named or "not specified; neutral"; three to six gaps with severity.
  2. ## Techniques applied: a table of technique and why here, each row naming the gap it closes.
  3. ## Techniques considered and not applied: a table of technique and why not, specific to this prompt.
  4. ## Assumptions and placeholders: omit when empty. One line per placeholder (what to fill in and why it could not be inferred) and per assumption.
  5. ## Outside the prompt: omit when empty. Settings, architecture, and evaluation suggestions the prompt text cannot carry.
  6. The enhanced prompt inside <enhanced_prompt> and </enhanced_prompt>, with the tagged block inside a fenced code block opened with more backticks than any run inside the prompt, at least four. The fence keeps markdown clients from rendering the prompt and lets code fences inside it survive. Two prompts use <enhanced_prompt role="system"> and <enhanced_prompt role="user">, each in its own fence.

When the draft is already good, the report says so and the applied table may hold a single cosmetic row. For calibration, read the worked examples. Without file access, deliver the same response as text and do not claim that a file was written.

References

ReadWhen
diagnosisClassifying the destination, rating gaps, writing success criteria, choosing the default bundle
clarity and structureAmbiguous verbs, missing goal or audience, shouted or negative rules, sectioning and ordering
examplesA pattern must be matched; deciding whether examples help or harm
system promptsSystem prompts, app prompts, and agent operating instructions
reasoningMultistep analysis, self-checks, and when reasoning instructions backfire
output controlFormat, length, structured data, prefill migration, formatting complaints
context packagingWhat to include, point to, or leave out; ordering; caching; long tasks
reliability and groundingFactual accuracy, quotes, citations, assumptions instead of invention
trust boundariesThird-party content, tools with side effects, public users, personal data
agent tasksPrompts a coding, research, or operational agent executes
decompositionSplitting one prompt into a chain, a pipeline, or a system prompt plus a task
model family notesThe user named the target model or family
worked examplesCalibrating length, placeholders, and the report
sourcesWhere the catalog comes from and its limits
improvement reportThe output skeleton
prompt skeletonSection order for task prompts and system prompts

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.