enhance-prompt
Skill63 starsChanged 6 months agoApache-2.0View on GitHub
Use when the user has typed a short or vague prompt and the system is configured to expand prompts before submission, or when the user explicitly invokes "Enhance Prompt" or asks the system to "improve this prompt before sending." Rewrites the user's input into a structured legal prompt with role, jurisdiction, task, constraints, and output format made explicit, and returns the expansion alongside a brief reasoning section so the user can review, edit, or skip before the expanded prompt is submitted to the model.
14 other projects use a version of this.
Adopted by
Most recently taken up by
- ryanportfolio/Harness-Firmwaretheir own version, first seen Oct 3, 2026
- ryanportfolio/Corewise.Academytheir own version, first seen Oct 3, 2026
- delorenj/skillstheir own version, first seen Oct 2, 2026
- diodeme/Gold-Bandtheir own version, first seen Sep 30, 2026
- ryanportfolio/HarnessFirmware.comtheir own version, first seen Sep 29, 2026
- nate2022-ai/nate-ai-skillstheir own version, first seen Sep 21, 2026
Used with
Projects with it also use addskill, advocate 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.
ryanportfolioSkilladdskill
Create, import, update, or install repository or personal skills; includes runtime ownership, resources, and discovery validation.
Also in 3 projects that use this
ryanportfolioSkilladvocate
Use only when the user explicitly invokes $advocate to challenge a change just made before it lands. Do not trigger from natural-language requests.
Also in 3 projects that use this
- +10 more from ryanportfolio
Other versions14 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 14
- diodeme/Gold-Band★ 143same name
- vobase/vobase★ 61same name
- delorenj/skills★ 15same name
- autohandai/community-skills★ 11same name
- VoDaiLocz/Enhance-Prompt★ 11same name
- nate2022-ai/nate-ai-skills★ 8same name
- nicholyx/ai-skills★ 6same name
- jhy0285/monofield★ 4same name
- OmyDaGreat/skills★ 1same name
- ryanportfolio/Corewise.Academy★ 1same name
4 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 repository49 other files it gives its agents.
- action-items-from-client-alertSkill
- adversarial-qcSkill
- ai-act-quickSkill
- bart-statutory-reference-checkerSkill
- building-chronologiesSkill
- california-property-taxSkill
- case-file-analyzerSkill
- ClassifyCCPSkill
- collating-reviewer-feedbackSkill
- comms-improverSkill
- contract-qaSkill
- coquill-analyzerSkill
- coquill-rendererSkill
- coquillSkill
- coquill-transcriberSkill
- corporate-registry-investigationSkill
- customs-trade-lawSkill
- dpa-art28Skill
- dpa-checklist-reviewSkill
- foreign-law-researchSkill
- legal-claim-economicsSkill
- legal-translationSkill
- license-complySkill
- local-first-legal-workspaceSkill
- lq-board-document-reviewSkill
- lq-governance-playbook-benchmarkSkill
- msa-review-commercial-purchaseSkill
- msa-review-saasSkill
- nda-reviewSkill
- nis2-navigatorSkill
- nist-ai-rmfSkill
- office-word-diffSkill
- privacy-notice-euSkill
- proposition-checkingSkill
- redfern-scheduleSkill
- redlinesSkill
- sgciteSkill
- skill-creatorSkill
- statutory-analysisSkill
- superdoc-redlinesSkill
- text-provenanceSkill
- uk-citation-verificationSkill
- uk-court-of-appeal-judicial-preference-checkSkill
- uk-disclosure-list-reviewSkill
- uk-particulars-of-claim-reviewSkill
- uk-witness-statement-reviewSkill
- us-state-privacy-navigatorSkill
- vendor-privacy-policy-first-passSkill
- vibe-legal-batch-redlinerSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. 0 are common, 10 are distinctive, and 5 are very specific to this project.
0
Common
Most of the 12 edited versions we read keep these.
10
Distinctive
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 58
The prompt is already well-structured: If the user has already specified role, task, constraints, and output format, expansion adds noise.
- Distinctive: line 60
The prompt is a follow-up question continuing a prior task: When chat_history shows the user is iterating on a previous answer ("can you …
- Very specific: line 62
The user has explicitly opted out for this prompt: If the user has typed --no-enhance-prompt, [skip enhance prompt], or similar, honor it.
- Very specific: line 63
A skill is attached that already expands the prompt itself: If attached_skills includes a skill whose description shows it handles prompt …
- Distinctive: line 65
When skipping, return the skip decision explicitly (see Output section) so the application can pass the original prompt through.
- Distinctive: line 77
Citation expectations: When the prompt is about a document, specify whether responses should cite specific clauses or sections.
- Distinctive: line 84
Does not narrow the user's intent: If the user's prompt is open-ended, the expansion preserves that openness.
- Distinctive: line 85
Does not import skills the user did not attach: If there is no NDA-Review skill attached but the prompt is about an NDA, the expansion may …
- Distinctive: line 86
Does not contradict skill instructions: If a skill is attached, the expansion respects the skill's scope.
- Distinctive: line 94
Check skip conditions: Run through the skip conditions in the section above.
- Very specific: line 96
Read the context: If attached_skills, attached_files, chat_history, or jurisdiction are provided, read them.
- Distinctive: line 100
Draft the expansion: Write the expanded prompt.
- Very specific: line 141
Empty or near-empty input: If the user submitted only whitespace, "?", "test," or similar, return expansion_applied: false with …
- Distinctive: line 145
Prompts asking the skill to do something other than expand: If the user's prompt is "what does Enhance Prompt do" or "skip Enhance Prompt," …
- Very specific: line 161
Both artifacts retain the original's privilege status: If the raw_input was a privileged attorney-client communication or attorney work …
“Common” is measured: kept by at least 6 in 10 of the 12 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
Enhance Prompt
Rewrite the user's prompt into a more effective version before it is submitted to the model. Show the user what changed and why. Make the expansion visible and editable, never silent.
The point of this skill is not to make every prompt longer. It is to surface the implicit assumptions in a short prompt and turn them into explicit instructions, so the model produces what the user actually wanted on the first try rather than after several rounds of clarification.
When this skill applies
Apply when:
- The user has invoked Enhance Prompt explicitly (button click, skill attachment, or trigger phrase).
- The application has Enhance Prompt's auto-expand toggle enabled and the user has just submitted a prompt.
In auto-expand mode, also apply the skip conditions in the next section before producing an expansion. Auto-expand should not be aggressive — many prompts do not need expansion, and producing an expansion when one is not needed is friction rather than value.
When NOT to apply (skip conditions)
Skip the expansion and let the original prompt through unchanged when:
- The prompt is already well-structured. If the user has already specified role, task, constraints, and output format, expansion adds noise. Heuristic: if the prompt is over ~80 words and contains explicit instructions about format, audience, or scope, skip.
- The prompt is conversational or interpersonal. "thanks," "what did you mean by that," "go ahead," "skip that point" — these are conversational moves, not new tasks. Do not expand.
- The prompt is a follow-up question continuing a prior task. When chat_history shows the user is iterating on a previous answer ("can you also add X," "shorter please," "what about California"), the prior turn supplies context; expansion would discard it. Do not expand.
- The prompt is operational rather than substantive. "summarize the document I just uploaded," "translate this," "format this as a table" — these are direct operational asks; expansion adds friction without adding clarity.
- The user has explicitly opted out for this prompt. If the user has typed
--no-enhance-prompt,[skip enhance prompt], or similar, honor it. - A skill is attached that already expands the prompt itself. If
attached_skillsincludes a skill whose description shows it handles prompt expansion or rewriting, skip — let the attached skill drive.
When skipping, return the skip decision explicitly (see Output section) so the application can pass the original prompt through.
What a good expansion does
A good expansion makes implicit elements explicit. The implicit elements that most often need surfacing in legal prompts are:
- Role. What kind of lawyer is the model adopting? "You are an in-house counsel reviewing X" anchors the response in the right voice and rigor. Default role is in-house counsel; adjust for context.
- Jurisdiction. Legal answers depend on jurisdiction. If the prompt asks a question with jurisdiction-dependent answers and no jurisdiction is specified, fold in the user's configured
jurisdictionif available, or note that the expansion assumed US-default and the answer should be re-asked if a different jurisdiction applies. - Audience. Is the output for the user, for forwarding to a business partner, for board consumption, for outside counsel? The audience changes the tone, length, and depth.
- Scope. "Review this contract" can mean a 30-second triage or a two-hour substantive review. Surface the implicit scope. "Identify three to five most important issues" is a different ask than "comprehensive review."
- Output format. Bulleted list? Memo with headings? Table? One-paragraph summary? Default to whatever the substance suggests, but make it explicit.
- Constraints and exclusions. What should the response not do? "Without giving a final legal opinion," "without speculating about enforceability," "limited to issues observable in the document text" — these are the safety rails that keep the model in scope.
- Citation expectations. When the prompt is about a document, specify whether responses should cite specific clauses or sections.
A good expansion adds these only where they are actually missing. Adding a role to a prompt that already specifies a role is noise. Adding a jurisdiction to a question that has no jurisdiction-dependent component is noise.
What a good expansion does NOT do
- Does not invent legal substance. The skill expands the prompt; it does not pre-answer it. If the user's prompt is "what's the standard term length for an NDA," the expansion clarifies role, audience, and format — it does not insert "the standard is 3 years" into the prompt.
- Does not narrow the user's intent. If the user's prompt is open-ended, the expansion preserves that openness. Specifying "give me three issues" when the user said "review this" substitutes the skill's judgment for the user's.
- Does not import skills the user did not attach. If there is no NDA-Review skill attached but the prompt is about an NDA, the expansion may note that NDA-Review exists in the library, but does not insert NDA-Review's review framework into the prompt.
- Does not contradict skill instructions. If a skill is attached, the expansion respects the skill's scope. The skill's frontmatter description tells you what the skill does; the expansion should complement, not override.
- Does not discard user wording. Preserve the user's substantive verbs and nouns. "Help me figure out" stays as-is; do not "improve" it to "Analyze comprehensively." The user's voice carries information about urgency, formality, and confidence — preserving it is part of preserving intent.
- Does not exceed reasonable length. A good expansion is typically 2–5x the length of the input. A 10-word prompt becoming a 200-word prompt is a sign the expansion has overreached.
Workflow
- Read the input. Parse the raw_input. Identify what the user is asking for (the substantive task) and how the user is asking for it (voice, formality, urgency).
- Check skip conditions. Run through the skip conditions in the section above. If any apply, return a skip decision (see Output section). Stop here.
- Read the context. If
attached_skills,attached_files,chat_history, orjurisdictionare provided, read them. Identify what is already established and should not be re-established. - Identify the gaps. Walk through the seven elements (role, jurisdiction, audience, scope, output format, constraints, citation expectations) and identify which are implicit in the prompt and worth surfacing. Skip elements that are already explicit, and skip elements that are not relevant to this prompt (e.g., citation expectations are irrelevant if no document is in scope).
- Draft the expansion. Write the expanded prompt. Preserve the user's substantive verbs and nouns. Add the elements identified in step 4. Keep total length to 2–5x the input length.
- Write the reasoning section. Three to six bullet points, one per element you added or modified. Each bullet names what was added and why in plain language. The user will read this; write for the user, not for a developer.
- Return the structured output. See Output section.
Output
The skill returns a structured object:
expansion_applied: true | false
expanded_prompt: <the expanded prompt text, or the original if skipped>
reasoning:
- <bullet on what was added or modified, and why>
- <one bullet per substantive change>
skip_reason: <if expansion_applied is false, the reason from the skip conditions list, or null>
preview_to_user: |
<a single rendered string the application can show in the "review before sending" UI, combining the expanded prompt and the reasoning, formatted for human reading>The skill is responsible for:
- Producing the expansion content and reasoning.
- Returning the structured output the application consumes.
The application is responsible for:
- Showing
preview_to_userto the user with edit/submit/skip controls. - Submitting
expanded_promptto the model when the user confirms. - Submitting the original
raw_inputif the user chooses skip. - Providing a "view this skill" affordance on the review screen so the user can inspect the skill itself if they want to (see Transparency below).
The skill itself does not invoke the model with the expanded prompt; it returns the expansion for the application to handle.
Transparency
This skill is designed to be inspectable by the user. The application should make the skill's contents (this SKILL.md and its supporting files) viewable from the review-before-sending screen. Users who want to understand exactly how their prompts are being enhanced — including the patterns this skill applies, the constraints on what is added, and the principles for preserving voice — should be able to read the skill itself.
Transparency is a feature, not a leak. The skill's instructions are not a trade secret; they are open-source work product. Users who can read the skill can also disagree with it, fork it, or replace it. That is the right relationship between users and the tools that shape their work.
Edge cases and refusals
- Empty or near-empty input. If the user submitted only whitespace, "?", "test," or similar, return
expansion_applied: falsewithskip_reason: "input too short to expand meaningfully". - Multilingual input. Preserve the language of the input. A prompt in French expands to a French expanded prompt with French reasoning. If the input mixes languages or the language is unclear, expand in the dominant language and note the ambiguity in reasoning.
- Prompts that contain confidential information in the prompt itself. Do not extract or paraphrase the confidential content into the reasoning section. The reasoning section talks about structure, not content.
- Prompts that are clearly outside legal practice. If the user's prompt has nothing to do with legal work (e.g., "what's a good restaurant in Boston," "write a haiku about my dog"), expand using general role/audience/format heuristics rather than legal-specific ones. Do not refuse — Enhance Prompt is a general expansion skill that is calibrated for legal work but still useful elsewhere.
- Prompts asking the skill to do something other than expand. If the user's prompt is "what does Enhance Prompt do" or "skip Enhance Prompt," route to the skip path and return the original.
Reference materials
reference/expansion_patterns.md— common patterns for legal-prompt expansion across categories of legal work (contract review, drafting, research, advice).reference/preserve_user_voice.md— the principles for keeping the user's voice intact through expansion.examples/example_short_prompt.md— short prompt expanded to a full structured prompt.examples/example_skipped.md— example of a prompt that should be skipped, with reasoning.examples/example_with_skill.md— expansion when a skill is already attached, showing how the expansion respects the attached skill's scope.
Privilege treatment
The user's raw_input and the resulting expanded_prompt may both contain privileged matter. The expanded prompt is a derivative of the user's input — it inherits whatever privilege status the original had. Treat the expansion as you would treat the original communication.
Concretely:
- Both artifacts retain the original's privilege status. If the
raw_inputwas a privileged attorney-client communication or attorney work product, theexpanded_promptis too. Privilege does not strip away by virtue of the skill rewriting the surface form. - Do not store the expanded prompt outside the privilege circle. Hosts implementing this skill must not log, retain, transmit, or share the
expanded_prompt,preview_to_user, orreasoningoutside the same trust boundary that would apply to the user's original prompt. Analytics pipelines, training-data collection, third-party model endpoints, and shared review queues are common leak paths and must be inside-the-circle or excluded. - The reasoning section is also derivative. Even though the reasoning talks about structure rather than content, it can name the subject matter of the prompt and therefore carry the same privilege status. Do not treat
reasoningas safe-to-log just because it does not quote the input verbatim. - Host responsibility. The user is responsible for not embedding privileged content in
raw_inputwhere the host application is not configured to handle it; the host application is responsible for not logging, retaining, or transmitting the expanded artifact outside the privilege circle. This skill itself writes nothing — but it produces an artifact that downstream systems will be tempted to log.
QA Remediation (LegalQuants, 2026-05)
This skill was reviewed against the Legal Skill Design Framework on 2026-05-11 (verdict: SOME CONCERN). The substantive gap identified was that privilege implications of the expanded-prompt artifact were not addressed — every legal prompt this meta-skill touches becomes a rewritten artifact that the host application may log or retain, and the original SKILL.md addressed confidentiality only at the reasoning-section level. The "Privilege treatment" section above was added in remediation to make explicit that (a) the user's input prompt and the expanded version may both contain privileged matter, (b) both retain whatever privilege status the original had, and (c) the expanded prompt must not be stored, logged, or shared outside the privilege circle. Frontmatter was updated with version, last_reviewed, and last_reviewed_by, and authorship was reconciled to credit Kevin Keller (matching the registry README). The technical workflow, skip conditions, expansion patterns, and output schema were left intact.
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.

