본문으로 건너뛰기
cccskills
무료GitHub에 공개

regression-test

Manage golden dataset regression tests for LLM prompts using Promptfoo. Commands — init, add, run, report. Use when user says "regression", "golden dataset", "prompt regression", "eval run", "test my prompts", or after shipping prompt changes.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(2)

  • SKILL.md5.8 KB
  • skill-report.json40.5 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Regression Test: Golden Dataset Management

Manage golden test datasets for LLM prompt regression testing using Promptfoo. Ensures prompt changes don't degrade output quality.

One eval tells you today's score. A kept set tells you what your change did. There is a recorded three-run walkthrough of exactly that, runnable with no API key, at https://github.com/7alexhale5-rgb/alexhale-skills/tree/main/example

Prerequisite: npm install -g promptfoo (check with which promptfoo)


Commands

/regression-test init

Scaffold regression testing infrastructure in the current project.

  1. Create directory structure:

    mkdir -p .promptfoo/golden
    
  2. Generate .promptfoo/promptfooconfig.yaml (the path matters: tests: "golden/*.yaml" below resolves relative to this file, and /regression-test run looks for it here):

    description: "Golden dataset regression tests"
    # Without this, promptfoo has no prompt to send and every case scores an empty string.
    # The vars come from the golden files that `/regression-test add` writes.
    prompts:
      - |
        [{"role":"system","content":"{{system_prompt}}"},{"role":"user","content":"{{user_input}}"}]
    providers:
      - id: anthropic:messages:claude-sonnet-5
        config:
          temperature: 0
    tests: "golden/*.yaml"
    defaultTest:
      assert:
        - type: llm-rubric
          value: "Output should match the expected behavior described in the test case"
    
  3. Add .promptfoo/results/ to .gitignore if not already present. Ignore the results, commit the goldens: a golden dataset nobody else can see is not a shared baseline, and the whole point is that your teammates and your CI run the same cases you do. If a prompt in a golden case is genuinely sensitive, keep that one case out of the repo rather than hiding the dataset.

  4. Report: "Initialized .promptfoo/golden/ — run /regression-test add <name> to capture test cases."


/regression-test add <name>

Capture a prompt+response pair as a golden test case.

  1. Parse <name> from user input (slug format, e.g., auth-flow, error-handling)

  2. Prompt user for:

    • System prompt (or detect from current project's CLAUDE.md/skill)
    • User input (the test prompt)
    • Expected behavior (natural language description of good output)
    • Vars (optional template variables)
  3. Write golden test case:

    # .promptfoo/golden/{name}.yaml
    - description: "{name}"
      vars:
        system_prompt: |
          {system prompt content}
        user_input: |
          {user input}
      assert:
        - type: llm-rubric
          value: |
            {expected behavior description}
        - type: not-contains
          value: "error"
    
  4. Report: "Added golden test {name} — {N} total test cases."


/regression-test run

Execute Promptfoo evaluation against all golden datasets.

  1. Check prerequisites:

    which promptfoo 2>&1  # must return path
    ls .promptfoo/golden/*.yaml 2>/dev/null | wc -l  # must be > 0
    
  2. Run evaluation:

    cd {project_root}
    promptfoo eval --config .promptfoo/promptfooconfig.yaml \
      --output .promptfoo/results/eval-$(date +%Y%m%d-%H%M%S).json \
      --no-cache 2>&1
    
  3. Parse results JSON:

    • Count PASS/FAIL per test case
    • Extract failure details (expected vs actual)
  4. Report:

    Regression Test Results
    ├─ Total: {N} test cases
    ├─ Pass: {N} ({%})
    ├─ Fail: {N} ({%})
    └─ Duration: {N}s
    
    Failures:
    - {test_name}: {assertion_type} — expected "{expected}", got "{actual}"
    
  5. If all pass: "All golden tests pass — safe to ship." If failures: "Regressions detected — review before shipping."


/regression-test report

Show regression trends over the last 5 evaluations.

  1. Read result files:

    ls -t .promptfoo/results/eval-*.json | head -5
    
  2. For each result file, extract:

    • Date (from filename)
    • Pass/fail counts
    • Any new failures vs previous run
  3. Report:

    Regression Trends (last 5 evals)
    ├─ 2026-03-31 14:30: 12/12 PASS ✓
    ├─ 2026-03-30 09:15: 11/12 PASS (1 fail: auth-flow)
    ├─ 2026-03-29 16:45: 12/12 PASS ✓
    ├─ 2026-03-28 11:00: 10/12 PASS (2 fail)
    └─ 2026-03-27 08:30: 12/12 PASS ✓
    
    Trend: STABLE (4/5 clean)
    

Where to wire it in

The value shows up when the run is automatic, not when you remember to type it.

MomentWhat to do
After changing any prompt/regression-test run before you commit. This is the one that catches most regressions.
Before a releaseRun it in CI and fail the build on a new failure. promptfoo eval returns non-zero when an assertion fails.
After a model or version changeRe-run the whole set. A provider upgrade is a silent prompt change.
Weekly, on a schedule/regression-test report to see whether quality is drifting rather than breaking.

If your agent harness supports hooks or a pre-commit step, put the run there. A check that depends on discipline is a check you will lose.


Graceful Degradation

ComponentIf MissingFallback
promptfoo CLINot installedPrompt user: npm install -g promptfoo
.promptfoo/ directoryNot initializedPrompt: /regression-test init
Golden datasetsNo .yaml filesSkip with note: "No golden tests — add with /regression-test add"
Results directoryMissingCreate on first run

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials, and use cases from Claude Academy (academy.claude.com), Anthropic's learning hub. Trigger on: "how do I", "how can I", "getting started with", "what can Claude do", "teach me", "learn to use"; questions about artifacts, projects, skills, plugins, connectors, MCP; requests about rolling Claude out to a team, class, or organization; and any ask for training materials, onboarding content, or learning resources. Use it when the user is learning how to use a feature or product — not when they are mid-task and just want the task done. This skill composes with other skills: after consulting product documentation to answer how a Claude feature works, also check here for a matching course or tutorial — a docs-grounded answer and an Academy recommendation belong together. Only recommend on a strong match; never invent Academy content.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

aiskillstore/marketplace4402026년 10월 21일 업데이트

Trigger for: explaining current FAR, DFARS, or agency-supplement text; determining documented acquisition-policy status for an agency and FAR part; comparing codified text, RFO model text, and agency deviations; tracing acquisition rulemaking; finding procurement comment periods; analyzing public comments; refreshing prior policy analysis; or producing an Acquisition Policy Impact Brief. Use published federal sources and supplied policy documents without making legal or procurement-specific applicability determinations. Do not use for clause selection, market research execution, opportunities, pricing, grants, or cooperative agreements.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

aiskillstore/marketplace4402026년 10월 21일 업데이트

Systematic framework for extracting actionable items from documents and organizing them into prioritized, trackable checklists. Use when converting reports, meeting notes, audits, or any document with embedded action items into structured TODO lists.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

aiskillstore/marketplace4402026년 10월 21일 업데이트

Browser automation for AI agents via inference.sh. Navigate web pages, interact with elements using @e refs, take screenshots, record video. Capabilities: web scraping, form filling, clicking, typing, drag-drop, file upload, JavaScript execution. Use for: web automation, data extraction, testing, agent browsing, research. Triggers: browser, web automation, scrape, navigate, click, fill form, screenshot, browse web, playwright, headless browser, web agent, surf internet, record video

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

aiskillstore/marketplace4402026년 10월 21일 업데이트

This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

aiskillstore/marketplace4402026년 10월 21일 업데이트

Run AI apps via inference.sh CLI - image generation, video creation, LLMs, search, 3D, Twitter automation. Models: FLUX, Veo, Gemini, Grok, Claude, Seedance, OmniHuman, Tavily, Exa, OpenRouter, and many more. Use when running AI apps, generating images/videos, calling LLMs, web search, or automating Twitter. Triggers: inference.sh, infsh, ai model, run ai, serverless ai, ai api, flux, veo, claude api, image generation, video generation, openrouter, tavily, exa search, twitter api, grok

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

aiskillstore/marketplace4402026년 10월 21일 업데이트

aiskillstore의 스킬 모두 보기

이 스킬의 문제 신고