Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

prompt-tester

БесплатноБез исполняемых скриптовНе проверен

Design, test, and iterate on AI prompts systematically using structured evaluation criteria. Use when building AI features, optimizing agent instructions…

TerminalSkillsот TerminalSkills★ 221 звезда на GitHub

Об этом скилле

Prompt Tester

Overview

Build a systematic approach to prompt engineering. Design test cases, define evaluation rubrics, run prompt variants against edge cases, and compare results to find the best-performing prompt for your use case.

Instructions

1. Define the evaluation criteria

Before testing prompts, establish what "good" looks like:

## Evaluation Rubric: Customer Support Classifier

| Criterion     | Weight | Description                              |
|---------------|--------|------------------------------------------|
| Accuracy      | 40%    | Correct category assigned                |
| Consistency   | 25%    | Same input → same output across runs     |
| Latency       | 15%    | Response time under threshold            |
| Format        | 10%    | Output matches expected JSON schema      |
| Edge cases    | 10%    | Handles ambiguous/unusual inputs         |

2. Create test cases

Build a test suite covering normal cases, edge cases, and adversarial inputs:

test_cases:
  - id: TC-001
    input: "My order hasn't arrived and it's been 2 weeks"
    expected_category: "shipping_delay"
    expected_priority: "high"
    tags: [normal, shipping]

  - id: TC-002
    input: "I love your product! Also my payment failed"
    expected_category: "payment_issue"
    expected_priority: "high"
    tags: [mixed-intent, edge-case]

  - id: TC-003
    input: "asdf jkl; 12345"
    expected_category: "unclassifiable"
    expected_priority: "low"
    tags: [adversarial, garbage-input]

  - id: TC-004
    input: ""
    expected_category: "unclassifiable"
    expected_priority: "low"
    tags: [adversarial, empty-input]

3. Design prompt variants

Create 2-3 prompt variants to compare:

Variant A (Concise):

Classify this support ticket into one category: payment_issue, shipping_delay,
product_defect, account_access, feature_request, unclassifiable.
Return JSON: {"category": "...", "priority": "high|medium|low"}

Variant B (Detailed with examples):

You are a support ticket classifier. Analyze the customer message and
assign exactly one category and priority level.

Categories: payment_issue, shipping_delay, product_defect, account_access,
feature_request, unclassifiable

Rules:
- If the message contains multiple issues, classify by the most urgent
- If the message is gibberish or empty, use "unclassifiable"
- Priority is "high" for payment/shipping issues, "medium" for product
  issues, "low" for feature requests

Examples:
Input: "I was charged twice for my subscription"
Output: {"category": "payment_issue", "priority": "high"}

Input: "It would be nice to have dark mode"
Output: {"category": "feature_request", "priority": "low"}

Now classify this message:

4. Run the evaluation

Run each variant against every case several times with the same model id and temperature 0 (or the lowest the provider allows), and score automatically wherever the answer can be checked by code. This harness (Python 3.9+, pip install pyyaml) works with any provider: fill in call_model with your SDK call, and run python run_eval.py cases.yml A=variant_a.txt B=variant_b.txt.

"""run_eval.py: score prompt variants against a YAML test suite."""
import json
import statistics
import sys
import time

import yaml  # pip install pyyaml


def call_model(prompt: str, user_input: str) -> str:
    """Replace the body with your provider call (temperature 0, a pinned model id).
    Return the raw text of the reply."""
    raise NotImplementedError


def score_case(case: dict, raw: str) -> dict:
    try:
        out = json.loads(raw)
    except json.JSONDecodeError:
        return {"format": False, "correct": False, "got": raw[:60]}
    if not isinstance(out, dict):  # valid JSON but not an object, e.g. a list or null
        return {"format": False, "correct": False, "got": raw[:60]}
    return {
        "format": set(out) == {"category", "priority"},
        "correct": out.get("category") == case["expected_category"]
        and out.get("priority") == case["expected_priority"],
        "got": out.get("category"),
    }


def evaluate(prompt: str, cases: list, runs: int = 3) -> dict:
    rows = []
    for case in cases:
        answers, latencies = [], []
        for _ in range(runs):
            start = time.perf_counter()
            raw = call_model(prompt, case["input"])
            latencies.append(time.perf_counter() - start)
            answers.append(score_case(case, raw))
        rows.append({
            "id": case["id"],
            "accuracy": sum(a["correct"] for a in answers) / runs,
            "format": sum(a["format"] for a in answers) / runs,
            "consistent": len({a["got"] for a in answers}) == 1,
            "p50_latency_s": statistics.median(latencies),
        })
    return {
        "accuracy": statistics.mean(r["accuracy"] for r in rows),
        "format": statistics.mean(r["format"] for r in rows),
        "consistency": statistics.mean(
Полный SKILL.md на GitHub

Установить prompt-tester в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

_scores.json

FAQ

Что делает скилл prompt-tester?

Design, test, and iterate on AI prompts systematically using structured evaluation criteria. Use when building AI features, optimizing agent instructions, comparing prompt variants, or evaluating output quality across edge cases. Trigger words: prompt engineering, prompt testing, eval, LLM evaluation, prompt comparison, A/B test prompts, prompt optimization, system prompt, instruction tuning.

Как установить скилл prompt-tester?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл prompt-tester запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить prompt-tester с