APE Prompt Improver

VerifiedCaution

Improves user prompts using the APE (Automatic Prompt Engineer) pipeline, generating, scoring, and ranking improved variants before execution.

Sby Skills Guide Bot
Data & AIBeginner
7/25/2026
Claude Code
#prompt-engineering#prompt-optimization#cli#llm#ape

Recommended for

Automated summary

This skill rewrites user prompts through the `ape` CLI, which generates, scores and ranks several improved variants before the task is executed.

Strengths

  • Generates and ranks multiple prompt variants, with single, JSON, or multi-variant output modes
  • Returns detailed scores (clarity, specificity, effectiveness) plus evaluator feedback to justify the changes
  • Offers three clear usage modes: silent improvement, suggestion to the user, or presenting ranked options
  • Flexible configuration through flags (provider, model, base-url, number of variants)

Limitations

  • Requires the `ape` CLI to be installed and an API key (OpenAI or Anthropic) set in the environment
  • Each call adds latency and API cost, making it unsuitable for trivial or time-critical tasks
  • Scores come from an LLM judge and remain heuristic: a higher-ranked variant may drift from the original intent
When to use it

Use it when a prompt is vague or underspecified, or when the user explicitly asks for help writing or refining a prompt.

When not to use it

Avoid it when the request is already precise, the task is trivial, the user refuses any rewording, or speed is critical.

Security analysis

Caution
Quality score86/100

The skill is not overtly malicious: there are no destructive commands, credential exfiltration instructions, or obfuscated payloads. However, it relies on executing a third-party CLI via `bunx` and transmits user prompts to external APIs, while declaring no allowed-tools. That combination warrants caution rather than a safe rating.

Findings
  • •No allowed-tools are declared even though the skill instructs shell execution and network use.
  • •Uses `bunx @rodkings/ape-cli`, which downloads and executes a third-party package; supply-chain trust is not established.
  • •Sends user prompts to an external LLM provider using `OPENAI_API_KEY` or `ANTHROPIC_API_KEY`, creating potential exposure of sensitive prompt content.
  • •Recommends 'silent improvement' of user prompts, which can materially change user intent without explicit consent.
How this analysis is made

Examples

Improve a vague prompt
Can you improve this prompt: "make me a website"?
Prompt help for code generation
Help me write a better prompt for generating Python unit tests with pytest.
Show ranked variants
Run the APE pipeline on my prompt and show me the top 3 ranked variants with their clarity and specificity scores.

name: ape-prompt-improver description: Improves user prompts using the APE (Automatic Prompt Engineer) pipeline. Calls the ape CLI tool to generate, score, and rank improved variants of any prompt before executing it.

APE Prompt Improver

Automatically improve user prompts before acting on them by invoking the ape CLI — a tool inspired by the Automatic Prompt Engineer paper (Zhou et al., ICLR 2023).

When to use

Use this skill when:

  • A user provides a vague, underspecified, or low-quality prompt
  • The user explicitly asks you to improve or refine their prompt
  • You want to ensure the best possible prompt is used before executing a complex task
  • The user asks for help writing prompts for LLMs
  • You are chaining prompts and want to optimize an intermediate step

Do not use this skill when:

  • The user's prompt is already highly specific and well-structured
  • The task is trivial (e.g. "what time is it")
  • The user explicitly says not to modify their prompt
  • Speed is critical and the extra API call would cause unacceptable delay

Prerequisites

The ape CLI must be installed and available:

bunx @rodkings/ape-cli --help

One of these environment variables must be set:

  • OPENAI_API_KEY — for OpenAI-compatible providers
  • ANTHROPIC_API_KEY — for Claude

Instructions

  1. Identify the user's prompt that would benefit from improvement.

  2. Run the ape CLI to generate and rank improved variants:

    For the single best variant (recommended for most cases):

    echo "<user's prompt>" | bunx @rodkings/ape-cli --single
    

    For the best variant as structured JSON:

    echo "<user's prompt>" | bunx @rodkings/ape-cli --json --single
    

    For multiple ranked variants to present as options:

    echo "<user's prompt>" | bunx @rodkings/ape-cli --json --count 3
    
  3. Use the improved prompt. Depending on the context:

    • Silent improvement: Use the top-ranked variant directly as if the user wrote it. Best when the user won't notice or care about the rewording.
    • Suggest to user: Present the improved prompt and ask if they'd like to use it. Best when the change is significant or the user might want control.
    • Present options: Show 2–3 ranked variants and let the user pick. Best when the user explicitly asked for prompt help.
  4. When presenting improvements to the user, explain what changed using the reasoning and feedback from the JSON output:

    echo "<prompt>" | bunx @rodkings/ape-cli --json --single
    

    The JSON output includes:

    • text — the improved prompt
    • reasoning — what was changed and why
    • scores.clarity — how clear the prompt is (1–10)
    • scores.specificity — how specific and detailed (1–10)
    • scores.effectiveness — how likely to produce a quality response (1–10)
    • overall — mean score (1–10)
    • feedback — brief evaluator commentary
  5. Optional flags for fine-tuning:

    | Flag | Usage | |------|-------| | --provider claude | Use Claude instead of OpenAI | | --model <name> | Specify a particular model | | --base-url <url> | Point at a custom API endpoint | | --count <n> | Generate more or fewer variants (default: 5) | | --verbose | See the full scored table with color-coded ratings |

Examples

Silent improvement before executing a task

User: "summarize this article"
Agent thinks: This prompt is vague. Let me improve it.
Agent runs: echo "summarize this article" | bunx @rodkings/ape-cli --single
Agent gets: "Provide a concise summary of the following article, highlighting the key arguments, supporting evidence, and conclusions in 3-5 bullet points."
Agent uses the improved prompt internally.

Presenting an improved prompt to the user

User: "help me write a better prompt for generating code"
Agent runs: echo "generate code" | bunx @rodkings/ape-cli --json --single
Agent responds:
  "Here's an improved version of your prompt (scored 8.7/10):

   'You are an expert software engineer. Given the following requirements,
   generate clean, well-documented code with error handling...'

   Changes: Added role assignment, specified code quality expectations,
   and included error handling requirement."

Offering multiple options

User: "can you improve this prompt for me: explain quantum computing"
Agent runs: echo "explain quantum computing" | bunx @rodkings/ape-cli --json --count 3
Agent presents the top 3 variants with scores and lets the user choose.

How it works

The ape CLI implements a simplified version of the APE (Automatic Prompt Engineer) pipeline:

  1. Generate — An LLM produces N improved variants of the prompt (high temperature for diversity)
  2. Score — The same LLM judges each variant on clarity, specificity, and effectiveness (low temperature for consistency)
  3. Rank — Variants are sorted by overall score, best first

This mirrors the proposal → scoring → selection stages from the APE paper (Zhou et al., ICLR 2023), which demonstrated that LLMs can engineer prompts at human-level or better.

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/ape-prompt-improver-mrzxuq9d/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/ape-prompt-improver-mrzxuq9d' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/ape-prompt-improver-mrzxuq9d/download' --output '.skill-downloads/ape-prompt-improver-mrzxuq9d/SKILL.md.part' && mv '.skill-downloads/ape-prompt-improver-mrzxuq9d/SKILL.md.part' '.skill-downloads/ape-prompt-improver-mrzxuq9d/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

Original excerpt: Prerequisites

The ape CLI must be installed and available:

bunx @rodkings/ape-cli --help

One of these environment variables must be set:

  • OPENAI_API_KEY — for OpenAI-compatible providers
  • ANTHROPIC_API_KEY — for Claude

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/ape-prompt-improver-mrzxuq9d/SKILL.md' && test -s '.skill-downloads/ape-prompt-improver-mrzxuq9d/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/ape-prompt-improver' && cp -R '.skill-downloads/ape-prompt-improver-mrzxuq9d' '.claude/skills/ape-prompt-improver'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/ape-prompt-improver-mrzxuq9d'

openskills read 'ape-prompt-improver-mrzxuq9d'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/ape-prompt-improver-mrzxuq9d/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills