Améliorateur de prompts APE

VérifiéPrudence

Améliore automatiquement les invites utilisateur en utilisant le pipeline APE (Automatic Prompt Engineer). Génère, évalue et classe des variantes améliorées avant exécution.

Spar Skills Guide Bot
Data & IADébutant
25/07/2026
Claude Code
#prompt-engineering#prompt-optimization#cli#llm#ape

Recommandé pour

Synthèse automatique

Ce skill réécrit les prompts des utilisateurs via la CLI `ape`, qui génère, note et classe plusieurs variantes améliorées avant l'exécution de la tâche.

Points forts

  • Génère et classe plusieurs variantes d'un prompt, avec un mode sortie unique, JSON ou multi-variantes
  • Fournit des scores détaillés (clarté, spécificité, efficacité) et un feedback exploitable pour expliquer les changements
  • Propose trois modes d'usage clairs : amélioration silencieuse, suggestion à l'utilisateur ou présentation d'options
  • Configuration souple via des flags (provider, modèle, base-url, nombre de variantes)

Limites

  • Nécessite l'installation de la CLI `ape` et une clé API (OpenAI ou Anthropic) dans l'environnement
  • Chaque appel ajoute de la latence et un coût API, ce qui le rend inadapté aux tâches triviales ou urgentes
  • Les scores sont produits par un évaluateur LLM et restent heuristiques : une variante mieux notée peut s'éloigner de l'intention d'origine
Quand l'utiliser

À utiliser quand un prompt est vague, mal structuré, ou lorsque l'utilisateur demande explicitement de l'aide pour rédiger ou affiner un prompt.

Quand l'éviter

À éviter lorsque la demande est déjà précise, que la tâche est triviale, que l'utilisateur refuse toute reformulation ou que la vitesse prime.

Analyse de sécurité

Prudence
Score qualité86/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.

Points d'attention
  • •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.
Comment cette analyse est faite

Exemples

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.

Du fichier au premier essai

Le téléchargement contient exactement le contenu affiché sur cette fiche. Cette copie peut différer de la dernière version du dépôt source.

Consulter la source et ses fichiers annexes

Ce téléchargement contient uniquement SKILL.md. Les scripts, références, modèles et dépendances éventuels ne sont pas inclus. Récupérez les fichiers nécessaires depuis la source en conservant leur arborescence avant de poursuivre.

1. Télécharger le fichier

Télécharger SKILL.md

Depuis la racine d’un projet de test, enregistrez le fichier sous .skill-downloads/ape-prompt-improver-mrzxuq9d/SKILL.md, ou utilisez la commande suivante. Ce dossier sert à examiner la skill avant son installation.

Commande pour macOS/Linux ou WSL : un shell POSIX et curl sont nécessaires. Sous Windows sans WSL, utilisez le bouton de téléchargement et créez le dossier manuellement.

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. Vérifier les prérequis

Lisez SKILL.md avant de l’utiliser. Si le fichier cite des scripts ou services externes, examinez-les et préparez les accès nécessaires dans votre environnement de test.

Extrait original : 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

Les plateformes de la fiche sont des indications du catalogue. Les chemins ci-dessous suivent la documentation des outils ; ils ne prouvent pas que cette skill y a été exécutée. Aucune version minimale de ces outils n’est attestée pour cette fiche.

3. Charger la skill

Après vérification, copiez le dossier complet dans le projet avec l’une des commandes ci-dessous, puis ouvrez une nouvelle session de l’outil. La commande s’arrête si un dossier du même nom existe déjà : comparez les fichiers avant de le remplacer.

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 doit déjà être installé. La procédure locale install/read est contrôlée avec OpenSkills 1.5.0, qui exige Node.js ≥ 20.6.0. Aucun slug du catalogue n’est résolu automatiquement.

Installation officielle d’OpenSkills
openskills install './.skill-downloads/ape-prompt-improver-mrzxuq9d'

openskills read 'ape-prompt-improver-mrzxuq9d'

La lecture doit afficher le contenu du fichier installé et son dossier de base. Elle ne lance ni la skill ni ses dépendances.

Pour un agent qui lit AGENTS.md, synchronisez ensuite l’index. Cette commande modifie AGENTS.md : relisez le diff avant de l’utiliser.

openskills sync

Mode manuel ou autre outil : joignez SKILL.md à une conversation, ou ouvrez-le dans un agent capable de lire les fichiers. Ajoutez les ressources annexes nécessaires. Il n’existe pas de dossier universel reconnu par tous les outils.

4. Faire un premier essai

Utilisez une entrée courte et fictive : un endpoint d’API, un petit document ou un brief d’interface. Dans une nouvelle conversation, joignez le fichier ou donnez son chemin à l’agent, puis adaptez cette demande :

Lis .skill-downloads/ape-prompt-improver-mrzxuq9d/SKILL.md et applique ses instructions à cet exemple : [décrire une entrée de test]. Indique les fichiers, dépendances ou accès qui manquent. Produis le résultat demandé par la skill sans inventer de données ni exécuter de script non examiné.

Résultat attendu : une sortie correspondant aux instructions de la skill, ou une liste précise des prérequis manquants. Une simple confirmation de lecture ne valide pas le premier usage. Si une ressource externe est indisponible, ce parcours reste à tester.

Skills similaires