Agent skill

Enhance Prompt

by LegalQuants in LegalQuants/lq-ai

A skill your agent uses 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…

Apache-2.0Auto-check passedLegal & Compliance

Install Enhance Prompt

skills CLI
$ npx skills add LegalQuants/lq-ai --skill enhance-prompt -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install LegalQuants/lq-ai enhance-prompt --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/LegalQuants/lq-ai.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/enhance-prompt .claude/skills/enhance-prompt && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
enhance-prompt
GitHub stars
150
Token cost
~3.3k tokens
SKILL.md length
1,597 words
Files
7
Skills in repo
16
Repo updated
First seen
Licence
Apache-2.0

At a glance

A skill your agent uses 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…

  • Works in 2 steps: The user has invoked Enhance Prompt… → The application has Enhance Prompt's…
  • The user has typed a short
  • SKILL.md covers When this skill applies, When NOT to apply (skip…, What a good expansion does and What a good expansion does NOT…, plus 5 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Enhance Prompt is an agent skill from LegalQuants/lq-ai. 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.

Its SKILL.md is about 3.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 8 other files (for example `examples/example_short_prompt.md`, `examples/example_skipped.md` and `examples/example_with_skill.md`).

It sits in Legal & Compliance. The repository describes itself as: Open-source AI for legal teams. Bring your own keys, run it where you want, own your data. The licence is Apache-2.0.

When your agent uses it

  • The user has typed a short
  • Vague prompt and the system is configured to expand prompts before submission
  • The user explicitly invokes Enhance Prompt
  • Asks the system to improve this prompt before sending. Rewrites the users input into a structured legal prompt with role

Example prompts

  • “Enhance Prompt”
  • “improve this prompt before sending.”
  • “/enhance-prompt”

Workflow steps

2 steps, taken from the first numbered list in SKILL.md.

  1. The user has invoked Enhance Prompt explicitly (button click, skill attachment, or trigger phrase).
  2. The application has Enhance Prompt's auto-expand toggle enabled and the user has just submitted a prompt.

What it can do on your machine

Read from SKILL.md and the folder at commit d185a62. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are yaml).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Enhance Prompt loads about 3.3k tokens when it runs. Until then it costs about 133 tokens; SKILL.md has 1,597 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~133
When it runs · the whole SKILL.md, loaded when a task matches
~3.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from LegalQuants/lq-ai at commit d185a62, republished under its Apache-2.0 licence (© LegalQuants). 1,597 words, ~3,303 tokens.

Download SKILL.mdSave it as .claude/skills/enhance-prompt/SKILL.md (or your agent's skills folder). This skill also uses 6 other files; get the full folder from GitHub.
name
enhance-prompt
description
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.
lq_ai.title
Enhance Prompt
lq_ai.version
1.0.0
lq_ai.author
LegalQuants
lq_ai.tags
meta, prompt-engineering, productivity
lq_ai.jurisdiction
agnostic
lq_ai.trigger_examples
enhance this prompt, improve this prompt before sending, rewrite this for better results, [invoked automatically when Enhance Prompt toggle is on]
lq_ai.output_format
structured
lq_ai.self_improvement
false

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:

  1. The user has invoked Enhance Prompt explicitly (button click, skill attachment, or trigger phrase).
  2. 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_skills includes 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:

  1. 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.
  2. 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 jurisdiction if available, or note that the expansion assumed US-default and the answer should be re-asked if a different jurisdiction applies.
  3. 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.
  4. 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."
  5. Output format. Bulleted list? Memo with headings? Table? One-paragraph summary? Default to whatever the substance suggests, but make it explicit.
  6. 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.
  7. 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.
Show full SKILL.md (690 more words)Show less

Workflow

  1. 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).

  2. Check skip conditions. Run through the skip conditions in the section above. If any apply, return a skip decision (see Output section). Stop here.

  3. Read the context. If attached_skills, attached_files, chat_history, or jurisdiction are provided, read them. Identify what is already established and should not be re-established.

  4. 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).

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

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

  7. Return the structured output. See Output section.

Output

The skill returns a structured object:

yaml
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_user to the user with edit/submit/skip controls.
  • Submitting expanded_prompt to the model when the user confirms.
  • Submitting the original raw_input if 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: false with skip_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.

© LegalQuants, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 6 other files in skills/enhance-prompt of LegalQuants/lq-ai.

  • SKILL.md
  • examples/example_short_prompt.md
  • examples/example_skipped.md
  • examples/example_with_skill.md
  • reference/expansion_patterns.md
  • reference/preserve_user_voice.md
  • test-plan.md

Open the folder on GitHubat commit d185a62

Compare with similar skills

Enhance Prompt next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Enhance Prompt compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Enhance Prompt this skillLegalQuants/lq-ai150—~3.3kAutomated safety check: PassApache-2.0
Paper to Chinese Patent DrafterYuan1z0825/nature-skills47k1 repos~1.1kAutomated safety check: PassApache-2.0
C15tc15t/c15t1.9k1 repos~1.6kAutomated safety check: PassApache-2.0
Contract Reviewevolsb/claude-legal-skill4641 repos~3.6kAutomated safety check: PassMIT
Legal Clinic Client Intakeanthropics/claude-for-legal9.6k3 repos~3.2kAutomated safety check: PassApache-2.0
Paper To Cn Patentsnipp-zha/Paper-to-patent-Skill1071 repos~959Automated safety check: PassNone

Similar skills

  • Paper to Chinese Patent Drafter

    Yuan1z0825/nature-skills

    Drafts Chinese invention patent applications and technical disclosures from research papers or inventor materials, tying each claim feature to source evidence.

    47k GitHub starsUsed in 1 repo~1.1k tokens
    Legal & ComplianceAuto-check passed
  • C15t

    c15t/c15t

    Work with c15t consent management docs, APIs, and integrations for Next.js, React, and JavaScript.

    1.9k GitHub starsUsed in 1 repo~1.6k tokens
    Legal & ComplianceAuto-check passed
  • Contract Review

    evolsb/claude-legal-skill

    Review legal contracts, NDAs, employment agreements, SaaS terms, and M&A documents.

    464 GitHub starsUsed in 1 repo~3.6k tokens
    Legal & ComplianceAuto-check passed
  • Legal Clinic Client Intake

    anthropics/claude-for-legal

    Official

    Structures a legal clinic client intake interview and produces a case summary with cross-area issue spotting, conflict flags and triage classification.

    9.6k GitHub starsUsed in 3 repos~3.2k tokens
    Legal & ComplianceAuto-check passed
  • Paper To Cn Patent

    snipp-zha/Paper-to-patent-Skill

    Convert scientific papers, theses, technical reports, source code, figures, or research manuscripts into evidence-grounded Chinese invention patent drafts.

    107 GitHub starsUsed in 1 repo~959 tokens
    Legal & ComplianceAuto-check passed
  • Employment Contract Templates

    ynulihao/AgentSkillOS

    Create employment contracts, offer letters, and HR policy documents following legal best practices.

    618 GitHub starsUsed in 12 repos~4.1k tokens
    Legal & ComplianceAuto-check passed

More from LegalQuants/lq-ai

All 16 skills in this repo
  • A skill your agent uses when the user provides a client alert, regulatory bulletin, law firm memo, or similar legal update and wants the time-sensitive action items, deadlines, and obligations…

    150 GitHub stars~4k tokensUpdated today
    Auto-check passed
  • Case Law Research

    LegalQuants/lq-ai

    A skill your agent uses when the user asks to find, read, or cite U.S.

    150 GitHub stars~2.4k tokensUpdated today
    Auto-check passed
  • Comms Improver

    LegalQuants/lq-ai

    A skill your agent uses when the user has a piece of legal-jargon-heavy text and wants it rewritten in plain language for a specified non-legal audience.

    150 GitHub stars~3.8k tokensUpdated today
    Auto-check passed
  • Contract QA

    LegalQuants/lq-ai

    A skill your agent uses when the user has a contract loaded and asks a specific question about it — what a clause means, where something is addressed, whether a term is unusual, how a provision…

    150 GitHub stars~4k tokensUpdated today
    Auto-check passed
  • Contract Snapshot

    LegalQuants/lq-ai

    A skill your agent uses when the user wants to compare the same handful of terms across N contracts side-by-side in a grid — what is the term, survival period, carveouts, and governing law in each…

    150 GitHub stars~1.8k tokensUpdated today
    Auto-check passed
  • Dpa Checklist Review

    LegalQuants/lq-ai

    A skill your agent uses when the user provides a Data Processing Agreement, Data Processing Addendum, or HIPAA Business Associate Agreement and asks whether it contains the terms required under the…

    150 GitHub stars~3.7k tokensUpdated today
    Auto-check passed

Questions about Enhance Prompt

What does Enhance Prompt do?

A skill your agent uses 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…. Enhance Prompt is an agent skill from LegalQuants/lq-ai." 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.

When should I use Enhance Prompt?

Enhance Prompt fits situations like: the user has typed a short; vague prompt and the system is configured to expand prompts before submission; the user explicitly invokes Enhance Prompt; asks the system to improve this prompt before sending. Rewrites the users input into a structured legal prompt with role.

How do I install Enhance Prompt in Claude Code?

Run `npx skills add LegalQuants/lq-ai --skill enhance-prompt -a claude-code`. Or copy the skill folder (skills/enhance-prompt in LegalQuants/lq-ai) into .claude/skills/enhance-prompt in your project. Claude Code loads it when a task matches its description.

How do I install Enhance Prompt in Codex?

Run `npx skills add LegalQuants/lq-ai --skill enhance-prompt -a codex`. Or copy the skill folder (skills/enhance-prompt in LegalQuants/lq-ai) into .agents/skills/enhance-prompt in your project. Codex loads it when a task matches its description.

Can I use Enhance Prompt in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add LegalQuants/lq-ai --skill enhance-prompt -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/enhance-prompt, .gemini/skills/enhance-prompt, .github/skills/enhance-prompt and .opencode/skills/enhance-prompt in your project.

What does Enhance Prompt need to run?

SKILL.md names no scripts, command-line tools or credentials: Enhance Prompt is instructions for the agent only.

Does Enhance Prompt access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Enhance Prompt safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Enhance Prompt use?

Enhance Prompt is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Enhance Prompt use?

About 3.3k tokens (SKILL.md is roughly 13k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Enhance Prompt?

Skills that share tags, products or a category with Enhance Prompt: Paper to Chinese Patent Drafter (Yuan1z0825/nature-skills, 47k stars), C15t (c15t/c15t, 1.9k stars), Contract Review (evolsb/claude-legal-skill, 464 stars) and Legal Clinic Client Intake (anthropics/claude-for-legal, 9.6k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Enhance Prompt?

LegalQuants (a GitHub organization) maintains it in LegalQuants/lq-ai, which has 150 GitHub stars. The repository holds 16 skills in this directory. The repository was last updated on October 11, 2026.

Source: LegalQuants/lq-ai on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.