agentleFS
nfeuernfeuer/project-foundation-kit/.claude/skills/prompt-regression/SKILL.md

prompt-regression

Skill0 starsChanged 4 months agoMITView on GitHub

When a PR touches a prompt template or model config, run the affected task_type's eval fixtures on both branches and report score deltas so prompt changes are evidence-based

3 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 3 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run this skill whenever a PR modifies anything under prompts/, config/ (model aliases, routing), or schemas/ so the change arrives with a …

    line 19
  2. Distinctive:

    If the output is empty, this skill is done.

    line 31
  3. Very specific:

    If a baseline score is already recorded in docs/eval-baselines.md, use that instead of re-running — re-running is more trustworthy but …

    line 49
  4. Very specific:

    If the harness supports a --compare-prompt flag or a prompt_variant fixture field, run old and new prompts side-by-side on the same inputs.

    line 61
  5. Distinctive:

    If fixtures for the affected task_type don't exist yet, treat that as a P0 gap: create tier-1 baseline fixtures before merging the prompt …

    line 89
  6. Distinctive:

    Never run live-model evals in CI without a cost guard — use mocked tools or a spend-capped test account.

    line 92

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Prompt Regression

Applies when capabilities.llm.enabled is true (else skip, report N/A).

Profile-driven. The fixture directory used in steps 3–4 is capabilities.llm.eval_dir from .claude/kit.yaml (default: fixtures).

Prompt changes are code changes. A reworded instruction, a shifted few-shot example, or a model alias swap can quietly regress a tier that was passing. Run this skill whenever a PR modifies anything under prompts/, config/ (model aliases, routing), or schemas/ so the change arrives with a score delta — not a vibe. This skill delegates all fixture execution to eval-harness; read that skill first to understand tiers, pass-gates, and fixture layout.

Workflow

1. Detect what changed

git diff main...HEAD --name-only | grep -E '^(prompts/|config/models|config/routing|schemas/)'

If the output is empty, this skill is done. If it hits, note which files.

2. Map changed files to affected task_types

# prompt files are named prompts/<task_type>/<template>.md (or .j2)
# model config keys map to task_type entries in config/models.yaml
git diff main...HEAD --name-only | grep '^prompts/' | cut -d/ -f2 | sort -u

For model/routing config changes, open the file and read which task_type entries reference the changed alias — those are all affected.

3. Run the eval-harness baseline (main branch)

git stash   # or use a worktree if you can't stash cleanly
# kit.yaml → capabilities.llm.eval_dir (fixture root)
uv run pytest fixtures/<task_type>/ -m "eval" --tb=short -q 2>&1 | tee /tmp/baseline_<task_type>.txt
git stash pop

If a baseline score is already recorded in docs/eval-baselines.md, use that instead of re-running — re-running is more trustworthy but costs tokens.

4. Run the eval-harness on the branch

# kit.yaml → capabilities.llm.eval_dir (fixture root)
uv run pytest fixtures/<task_type>/ -m "eval" --tb=short -q 2>&1 | tee /tmp/branch_<task_type>.txt

Both runs MUST use mocked tools (no live API calls) for tiers 1–2. The eval-harness skill explains how tool_mocks work.

5. (Optional) Shadow A/B within a single run

If the harness supports a --compare-prompt flag or a prompt_variant fixture field, run old and new prompts side-by-side on the same inputs. This is more reliable than comparing two separate runs across time.

6. Compute and report the delta

For each tier, compute:

delta = branch_pass_rate − baseline_pass_rate

A negative delta on a gated tier (1 or 2) is a regression. Flag it. An accepted tradeoff (e.g., tier-1 gains +3 pts, tier-3 loses −5 pts, and tier 3 is ungated) must be logged in docs/followups.md before the PR merges — a silent tradeoff is not an accepted one.

Guardrails

  • A prompt change that regresses a gated tier (pass_gate not met on branch) blocks the PR. This skill reports and blocks; fixing the prompt or lowering the expectation and documenting why is a separate, explicit step the author takes, not something this skill does for you. Exception: at prototype strictness (gates.strictness in kit.yaml), the delta is reported as ADVISORY instead of blocking — but still reported; a prompt change without a score delta is never acceptable.
  • Model alias changes that touch a gated task_type follow the same rule. An alias change that resolves to a retired claude-3-* ID is flagged regardless of score delta — current set: claude-opus-5, claude-sonnet-5, claude-haiku-4-5, claude-fable-5 (keep in sync with kit-doctor check 16, which validates models.* in kit.yaml against this same set).
  • If fixtures for the affected task_type don't exist yet, treat that as a P0 gap: create tier-1 baseline fixtures before merging the prompt change. (Reference the eval-harness skill for fixture structure.)
  • Never run live-model evals in CI without a cost guard — use mocked tools or a spend-capped test account.

Output

## Prompt Regression — <task_type(s)>

Changed files: <list>
Affected task_types: <list>

| Tier | Baseline | Branch | Delta | Gate | Result |
|------|----------|--------|-------|------|--------|
| 1 baseline | 0.92 | 0.88 | −0.04 | 0.90 | REGRESSION |
| 2 nuance   | 0.78 | 0.81 | +0.03 | 0.80 | PASS |
| 3 complexity | 0.61 | 0.65 | +0.04 | none | (diagnostic) |

Regressions: <tier + failing cases + root cause>
Accepted tradeoffs logged: <yes (followups.md entry) / none>

Verdict: PASS / BLOCK — <detail>

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.