Agent skill

Prompt Improver

by davekilleen in davekilleen/Dex

Rewrite a vague prompt into a rich, structured one, with automatic fallback.

MITAuto-check: notesAI & LLM Engineering

Install Prompt Improver

skills CLI
$ npx skills add davekilleen/Dex --skill prompt-improver -a claude-code

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

GitHub CLI
$ gh skill install davekilleen/Dex prompt-improver --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/davekilleen/Dex.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/prompt-improver .claude/skills/prompt-improver && 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
prompt-improver
GitHub stars
494
Token cost
~1.9k tokens
SKILL.md length
697 words
Files
1
Skills in repo
61
Repo updated
First seen
Licence
MIT

At a glance

Rewrite a vague prompt into a rich, structured one, with automatic fallback.

  • Works in 4 steps: Parse Flags and Extract Prompt → Determine Improvement Method → Improve the Prompt → …
  • The user says improve this prompt
  • SKILL.md covers Purpose, Arguments, Qualifiers and Process, plus 7 more sections
  • Calls node; needs ANTHROPIC_API_KEY

What it does

Prompt Improver is an agent skill from davekilleen/Dex. Rewrite a vague prompt into a rich, structured one, with automatic fallback. Use when the user says 'improve this prompt', 'make this prompt better', or hands over a thin instruction. Not for creating a reusable skill; use create-skill.

Its SKILL.md is about 1.9k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in AI & LLM Engineering, covering Prompt engineering. The repository describes itself as: Your AI Chief of Staff — a personal operating system starter kit that adapts to your role. No coding required. The licence is MIT.

When your agent uses it

  • The user says improve this prompt
  • Make this prompt better
  • Hands over a thin instruction

Example prompts

  • “improve this prompt”
  • “make this prompt better”
  • “/prompt-improver”

Requirements

  • A credential in ANTHROPIC_API_KEY

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Parse Flags and Extract Prompt
  2. Determine Improvement Method
  3. Improve the Prompt
  4. Handle Based on Mode

What it can do on your machine

Read from SKILL.md and the folder at commit d0ffc6b. 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

    Shell commands in SKILL.md call:

    • node

    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 these keys or tokens, usually read from environment variables:

    • ANTHROPIC_API_KEY

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

Context cost

Prompt Improver loads about 1.9k tokens when it runs. Until then it costs about 64 tokens; SKILL.md has 697 words of instructions outside code blocks.

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

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

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteMentions a .env fileSKILL.md:89
    r best results, add ANTHROPIC_API_KEY to .env"`
  • NoteMentions a .env fileSKILL.md:209
    1. Create `.env` file in vault root (if not exists)
  • NoteMentions a .env fileSKILL.md:211
    3. Make the file owner-only: `chmod 600 .env` (API keys should never be readable by other users of the machine)

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 davekilleen/Dex at commit d0ffc6b, republished under its MIT licence (© davekilleen). 697 words, ~1,857 tokens.

Download SKILL.mdSave it as .claude/skills/prompt-improver/SKILL.md (or your agent's skills folder).
name
prompt-improver
description
Rewrite a vague prompt into a rich, structured one, with automatic fallback. Use when the user says 'improve this prompt', 'make this prompt better', or hands over a thin instruction. Not for creating a reusable skill; use `create-skill`.
<!-- Generated from `.claude/skills/prompt-improver/SKILL.md` by `scripts/generate-agents-skills.py`. Do not edit. -->

Purpose

Transform vague, ambiguous prompts into rich, well-structured prompts. Uses Anthropic's prompt improvement capabilities when available, with graceful fallback to the current LLM.

How it works:

  1. User provides a vague prompt (e.g., "critique this doc")
  2. Skill improves the prompt using best available method
  3. Executes the improved prompt and returns results
  4. User sees the answer without seeing the improved prompt (unless flags are set)

Arguments

$PROMPT - The prompt to improve (required) $FEEDBACK - Optional feedback on what to improve (e.g., "Make it more detailed", "Add examples", "Focus on clarity") $TARGET_MODEL - Optional target model for the improved prompt (defaults to current model) $SYSTEM - Optional system prompt to improve alongside the user prompt


Qualifiers

Check if $PROMPT starts with a flag:

FlagBehavior
-pPrompt only - Show the improved prompt, don't execute
-vVerbose - Show the improved prompt, then execute
(none)Quick - Execute immediately without showing full prompt

Strip the flag from $PROMPT before processing.


Process

Step 1: Parse Flags and Extract Prompt

Check if $PROMPT starts with a flag (-p, -v) and extract:

  • mode: prompt-only, verbose, or quick (default)
  • original_prompt: The actual prompt text (flag removed)
  • feedback: Optional improvement guidance from $FEEDBACK
Step 2: Determine Improvement Method

Check in this order:

  1. Script available? Check if .scripts/improve-prompt.cjs exists

    • If yes → Use script (calls Anthropic API directly)
    • If no → Check for API key
  2. API key available? Check if ANTHROPIC_API_KEY is set in environment

    • If yes → Use Anthropic Messages API inline
    • If no → Fall back to current LLM

The fallback cascade:

Script (.scripts/improve-prompt.cjs)
    ↓ (if not available)
Anthropic Messages API (direct call)
    ↓ (if no API key)
Current LLM (Opus 4.5, Sonnet, etc.)
Step 3: Improve the Prompt

Method A: Script (preferred)

bash
node .scripts/improve-prompt.cjs "$PROMPT" "$FEEDBACK" "$TARGET_MODEL" "$SYSTEM"

Method B: Anthropic Messages API (direct) Make API call with:

  • Model: claude-sonnet-4-5-20250929 (optimized for prompt engineering)
  • System Prompt: Prompt engineering expert persona (see below)
  • User Message: The original vague prompt
  • Temperature: 0.3

Method C: Current LLM Fallback Use the current session's LLM to improve the prompt inline:

  • Notify user: "💡 Using inline improvement (no API key configured). For best results, add ANTHROPIC_API_KEY to .env"
  • Apply the same prompt engineering system prompt
  • Continue with the improved result
Step 4: Handle Based on Mode

Mode: prompt-only (flag: -p):

  1. Show: > **Original:** [original_prompt]
  2. Show the enhanced_prompt in a code block
  3. Stop. Do NOT execute.

Mode: verbose (flag: -v):

  1. Show: > **Original:** [original_prompt]
  2. Show the enhanced_prompt in a collapsible block:
    html
    <details>
    <summary>📝 Improved Prompt (click to expand)</summary>
    
    [enhanced_prompt]
    
    </details>
  3. Add --- separator
  4. Execute the enhanced_prompt and return results

Mode: quick (no flag - DEFAULT):

  1. Silently execute the enhanced_prompt
  2. Return results directly to user
  3. Do NOT show the improved prompt - user just sees the answer

Show full SKILL.md (281 more words)Show less

Prompt Engineering System Prompt

Used for both API and fallback methods:

You are an expert prompt engineer trained in Anthropic's best practices. Your job is to transform vague, ambiguous prompts into clear, structured, effective prompts.

Analyze the user's prompt and improve it using these techniques:

1. **Structure**: Add clear sections with XML tags or markdown headers
2. **Clarity**: Be specific about format, length, and success criteria
3. **Context**: Include necessary background and define ambiguous terms
4. **Examples**: Add few-shot examples when helpful
5. **Chain of Thought**: For complex tasks, request step-by-step reasoning
6. **Constraints**: Make implicit constraints explicit

Return ONLY the improved prompt. Do not explain your changes or add meta-commentary.

{if $FEEDBACK exists: "Focus on: {$FEEDBACK}"}

Examples

/prompt-improver -p critique this strategy doc
→ Shows improved prompt only, doesn't execute

/prompt-improver -v critique this strategy doc
→ Shows improved prompt, then executes it

/prompt-improver critique this strategy doc
→ Just executes the improved prompt

/prompt-improver -v "review this code" "Focus on security issues"
→ Shows improved prompt focused on security, then executes

Improvement Template Reference

The improved prompt typically follows this structure:

markdown
# Task
[Clear statement of what to do]

# Context
[Background information needed]

# Instructions
1. [Step 1]
2. [Step 2]
3. [Step 3]

# Constraints
- [Constraint 1]
- [Constraint 2]

# Output Format
[Expected format and structure]

# Examples (if helpful)
[Input/output examples]

Error Handling

SituationBehavior
Script not foundFall back to API
No API keyFall back to current LLM with notification
API rate limitRetry with exponential backoff, then fall back
API errorFall back to current LLM
Network issuesFall back to current LLM

Key principle: The skill should NEVER fail completely. It always has the current LLM as ultimate fallback.


Setup (Optional)

For best results, add your Anthropic API key:

  1. Create .env file in vault root (if not exists)
  2. Add: ANTHROPIC_API_KEY=your-key-here
  3. Make the file owner-only: chmod 600 .env (API keys should never be readable by other users of the machine)

Without the API key, the skill still works using the current LLM session.


Philosophy

Meta-prompting: This skill uses Claude to improve prompts for Claude. It's prompt engineering as a service.

Invisible by default: The best tools disappear. Users ask naturally, get expert results, never see the complexity.

Progressive disclosure: Flags (-v, -p) let power users inspect and learn from the improvements.

Graceful degradation: Works everywhere - with full API access, partial access, or no external access at all.


Track Usage (Silent)

Call the mark_feature_used tool on the dex-analytics MCP server with prompt-improver. This ticks the feature's box in System/usage_log.md, which is what /dex-level-up reads to recommend features that have not been tried. It writes locally and sends nothing, so it runs whether or not analytics is enabled.

Analytics (Silent):

Call track_event with event_name prompt_improved and properties:

  • (no properties)

This only fires if the user has opted into analytics. No action needed if it returns "analytics_disabled".

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

Files

Just SKILL.md in .agents/skills/prompt-improver of davekilleen/Dex.

Open the folder on GitHubat commit d0ffc6b

Compare with similar skills

Prompt Improver 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.

Prompt Improver compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Prompt Improver this skilldavekilleen/Dex494—~1.9kAutomated safety check: NotesMIT
Prompt Improverseverity1/claude-code-prompt-improver1.9k1 repos~1.7kAutomated safety check: PassMIT
Prompt Engineering Patternsynulihao/AgentSkillOS61814 repos~1.7kAutomated safety check: PassNone
Patch CreationPiebald-AI/tweakcc2.5k—~1.6kAutomated safety check: PassMIT
Senior Prompt Engineermaslennikov-ig/claude-code-orchestrator-kit2603 repos~1.4kAutomated safety check: PassCustom licence
Codex Fable5baskduf/FableCodex437—~1.6kAutomated safety check: PassAGPL-3.0

Similar skills

  • Prompt Improver

    severity1/claude-code-prompt-improver

    This skill enriches vague prompts with targeted research and clarification before execution.

    1.9k GitHub starsUsed in 1 repo~1.7k tokens
    AI & LLM EngineeringAuto-check passed
  • Prompt Engineering Patterns

    ynulihao/AgentSkillOS

    Master advanced prompt engineering techniques to maximize LLM performance, reliability, and controllability in production.

    618 GitHub starsUsed in 14 repos~1.7k tokens
    AI & LLM EngineeringAuto-check passed
  • Patch Creation

    Piebald-AI/tweakcc

    Create and register new patches for tweakcc. An agent skill from Piebald-AI/tweakcc.

    2.5k GitHub stars~1.6k tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Senior Prompt Engineer

    maslennikov-ig/claude-code-orchestrator-kit

    Provides reference guides and Python scripts for prompt optimization, RAG evaluation, and agent orchestration when building or tuning LLM systems.

    260 GitHub starsUsed in 3 repos~1.4k tokens
    AI & LLM EngineeringAuto-check passed
  • Codex Fable5

    baskduf/FableCodex

    Apply a Claude Fable 5 inspired operating style inside Codex.

    437 GitHub stars~1.6k tokensUpdated 2 mo ago
    AI & LLM EngineeringAuto-check passed
  • Reference for designing and tuning production LLM prompts: few-shot examples, chain-of-thought, structured outputs, templates and system prompts.

    40k GitHub stars~1.3k tokensUpdated 5 days ago
    AI & LLM EngineeringAuto-check passed

More from davekilleen/Dex

All 61 skills in this repo
  • Dspy Ruby

    davekilleen/Dex

    This skill should be used when working with DSPy.rb, a Ruby framework for building type-safe, composable LLM applications.

    494 GitHub starsUsed in 1 repo~3.9k tokens
    Auto-check passed
  • Diff Adopt Profile

    davekilleen/Dex

    Adopt a full published Heydex profile by handle ('set me up like @davekilleen').

    494 GitHub stars~2.1k tokensUpdated today
    Auto-check passed
  • Diff Generate

    davekilleen/Dex

    Package one workflow — how you use Dex for a specific job — into a shareable DexDiff methodology doc.

    494 GitHub stars~1.4k tokensUpdated today
    Auto-check passed
  • Creating Agent Skills

    davekilleen/Dex

    Expert guidance for creating, writing, and refining Claude Code Skills.

    494 GitHub starsUsed in 1 repo~1.7k tokens
    Auto-check passed
  • Feedback

    davekilleen/Dex

    Report a Dex bug to the Dex team with zero homework — Dex investigates locally, builds a privacy-safe report, shows it to you (or auto-sends if you've chosen that), and tracks the ticket until it's…

    494 GitHub stars~2.4k tokensUpdated today
    Auto-check passed
  • Dhh Rails Style

    davekilleen/Dex

    This skill should be used when writing Ruby and Rails code in DHH's distinctive 37signals style.

    494 GitHub starsUsed in 1 repo~1.7k tokens
    Auto-check passed

Questions about Prompt Improver

What does Prompt Improver do?

Rewrite a vague prompt into a rich, structured one, with automatic fallback. Prompt Improver is an agent skill from davekilleen/Dex. Rewrite a vague prompt into a rich, structured one, with automatic fallback.

When should I use Prompt Improver?

Prompt Improver fits situations like: the user says improve this prompt; make this prompt better; hands over a thin instruction.

How do I install Prompt Improver in Claude Code?

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

How do I install Prompt Improver in Codex?

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

Can I use Prompt Improver 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 davekilleen/Dex --skill prompt-improver -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/prompt-improver, .gemini/skills/prompt-improver, .github/skills/prompt-improver and .opencode/skills/prompt-improver in your project.

What does Prompt Improver need to run?

Going by SKILL.md and its folder, Prompt Improver needs the command-line tools its instructions call (node) and credentials named ANTHROPIC_API_KEY. Our summary lists: A credential in ANTHROPIC_API_KEY.

Does Prompt Improver 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 Prompt Improver safe to install?

Our automated static check of SKILL.md found notes only (mentions a .env file), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Prompt Improver use?

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

How many tokens does Prompt Improver use?

About 1.9k tokens (SKILL.md is roughly 7.4k 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 Prompt Improver?

Skills that share tags, products or a category with Prompt Improver: Prompt Improver (severity1/claude-code-prompt-improver, 1.9k stars), Prompt Engineering Patterns (ynulihao/AgentSkillOS, 618 stars), Patch Creation (Piebald-AI/tweakcc, 2.5k stars) and Senior Prompt Engineer (maslennikov-ig/claude-code-orchestrator-kit, 260 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Prompt Improver?

davekilleen (a GitHub user) maintains it in davekilleen/Dex, which has 494 GitHub stars. The repository holds 61 skills in this directory. The repository was last updated on October 9, 2026.

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