/wicked-garden:wicked-garden-qe-snapshot-hygiene-auditorfrom wicked-garden
Audits snapshot test directories for stale, over-broad, rubber-stamped, and dead snapshots. Outputs ranked remediation list for targeted cleanup.
Ships in wicked-garden. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Snapshot tests rot silently. An accepted-but-wrong baseline is worse than a missing test because it pretends to be coverage. You audit the four rot classes — stale, over-broad, rubber-stamped, dead — and produce a ranked top-N list so a reviewer can spend 30 minutes, not 30 hours.
Script-backed steps use the wicked-garden launcher: wicked-garden run <plugin-root-relative path, e.g. scripts/…> [args]. It is on PATH after npm i -g wicked-garden; otherwise use npx wicked-garden run …; inside a wicked-crew run it is "$WICKED_GARDEN_ROOT/scripts/wicked-garden".
If none of these is available, or Python 3 is missing, skip the script-backed step, say so, and follow the manual alternative where one is given next to it — never invent the script's output.
Relative paths in this skill are relative to the directory that contains this SKILL.md.
target_dirs: list of directories to audit; default scan the whole
repo for the patterns listed below.age_days: stale threshold; default 90.over_broad_lines: threshold flagging a single snapshot wider than
N lines; default 200.rubber_stamp_window: number of commits back to look for baseline-
regenerated-same-commit patterns; default 1.top_n: number of items in the remediation list; default 25.run_id — UUID of the current runs row; defines EVIDENCE_DIR.git log -p drives rubber-stamp
detection. Refuse if the scenario's target_dirs are not inside a
git repo..wicked-qe/evidence/<run_id>/context.md — optional rules
like "ignore cassettes/external/ — those are vendor fixtures".Run all four detectors; each writes its own JSON result to
EVIDENCE_DIR/detectors/ for traceability.
# The canonical snapshot-bearing patterns. Each match is a candidate for
# the four rot checks below.
# - Jest / vitest: __snapshots__/*.snap
# - Go / golden: *.golden, testdata/
# - VCR / pytest-recording: cassettes/
# - Syrupy (pytest): .syrupy/ or __snapshots__/*.ambr
find "${TARGET_DIRS}" \
\( -path '*/__snapshots__/*' -o -name '*.snap' -o -name '*.golden' \
-o -path '*/cassettes/*' -o -path '*/.syrupy/*' -o -name '*.ambr' \) \
-type f \
> "${EVIDENCE_DIR}/snapshot-files.txt"
age_days AND still referenced)# Age via git log of the snapshot file itself. A snapshot with no commit
# activity in N days that IS still referenced by a test is rot.
while read -r snap; do
last_ts=$(git log -1 --format=%ct -- "${snap}" 2>/dev/null || echo 0)
age_days=$(( ( $(date +%s) - last_ts ) / 86400 ))
if [ "${age_days}" -gt "${AGE_DAYS}" ]; then
# Is the snapshot still referenced by any *.test.* or *_test.* file?
base=$(basename "${snap}" | sed -e 's/\.snap$//' -e 's/\.golden$//' -e 's/\.ambr$//')
refs=$(git grep -l "${base}" -- '*.test.*' '*_test.*' 'test_*' | wc -l)
[ "${refs}" -gt 0 ] && printf '%s\t%d\t%d\n' "${snap}" "${age_days}" "${refs}"
fi
done < "${EVIDENCE_DIR}/snapshot-files.txt" \
> "${EVIDENCE_DIR}/detectors/stale.tsv"
# Long single-snapshot serializations are suspect: they assert on too many
# unrelated fields at once, so any change in any field forces a review.
while read -r snap; do
lines=$(wc -l < "${snap}")
if [ "${lines}" -gt "${OVER_BROAD_LINES}" ]; then
printf '%s\t%d\n' "${snap}" "${lines}"
fi
done < "${EVIDENCE_DIR}/snapshot-files.txt" \
> "${EVIDENCE_DIR}/detectors/over-broad.tsv"
# Classic anti-pattern: the same commit that changes behavior also
# regenerates the baseline. That commit's diff will contain BOTH the
# source change AND the snapshot change.
node {WT_LIB}/snapshot/rubber-stamp.mjs \
--window "${RUBBER_STAMP_WINDOW}" \
--snapshot-files "${EVIDENCE_DIR}/snapshot-files.txt" \
> "${EVIDENCE_DIR}/detectors/rubber-stamped.json"
{WT_LIB}/snapshot/rubber-stamp.mjs walks git log -p per snapshot, and
for each commit that touched the snap file, checks whether the same
commit ALSO touched a non-test source path in the same package. Matches
are surfaced with commit_sha, source_paths_touched, snap_line_delta.
# A snapshot whose name/key is referenced by no active test.
while read -r snap; do
base=$(basename "${snap}" | sed -e 's/\.snap$//' -e 's/\.golden$//' -e 's/\.ambr$//')
refs=$(git grep -l "${base}" -- '*.test.*' '*_test.*' 'test_*' 'spec/**' | wc -l)
[ "${refs}" -eq 0 ] && printf '%s\n' "${snap}"
done < "${EVIDENCE_DIR}/snapshot-files.txt" \
> "${EVIDENCE_DIR}/detectors/dead.txt"
Each flagged snapshot gets a score from the detectors; the top-N is sorted descending.
score = (stale ? 1 : 0) * 2
+ (over_broad_lines > threshold ? 1 : 0) * 1
+ (rubber_stamped ? 1 : 0) * 3 # highest weight — false confidence
+ (dead ? 1 : 0) * 1
Ties break by lines descending (larger files first — more reviewer
leverage).
Under .wicked-qe/evidence/<run_id>/:
| File | manifest kind | Required |
|---|---|---|
snapshot-files.txt | log | Yes |
detectors/stale.tsv | log | Yes |
detectors/over-broad.tsv | log | Yes |
detectors/rubber-stamped.json | log | Yes |
detectors/dead.txt | log | Yes |
snapshot-audit.md | log | Yes |
snapshot-top-n.csv | log | Yes |
snapshot-audit.md has one section per detector with summary counts,
then a ## Remediation section listing the top-N with per-item: path,
score, which detectors fired, age, lines, rubber-stamp commit sha (if
any), suggested action (narrow / delete / regenerate-with-review).
snapshot-top-n.csv columns:
path,score,stale,over_broad,rubber_stamped,dead,age_days,lines,commit_sha,action.
// Default to CONDITIONAL — this audit is advisory unless the scenario
// escalates the threshold. A FAIL verdict is issued when rubber-stamped
// rot crosses a hard limit (see rules below).
const anyRubberStamped = rubberStamped.length > 0;
const severeRot = rubberStamped.length > 25 || dead.length > 100;
const verdict = severeRot ? "FAIL" : "CONDITIONAL";
store.create("verdicts", {
run_id: RUN_ID,
verdict,
reviewer: "wicked-garden-qe-snapshot-hygiene-auditor",
reason: `stale=${stale.length} over_broad=${overBroad.length} rubber_stamped=${rubberStamped.length} dead=${dead.length}; top_n=${topN.length}. See snapshot-audit.md for the ranked remediation list.`,
evidence_path: `evidence/${RUN_ID}/`,
// Inside a governed wicked-crew run, name it, so crew attributes this verdict by stamp.
...(process.env.WICKED_RUN_ID ? { crew_run_id: process.env.WICKED_RUN_ID } : {}),
});
// One open task per top-N item so they surface in the reviewer's queue.
for (const item of topN) {
store.create("tasks", {
project_id: PROJECT_ID,
title: `Snapshot rot: ${item.path} (score ${item.score})`,
status: "open",
assignee_skill: "snapshot-hygiene-auditor:remediation",
body: JSON.stringify({
path: item.path, score: item.score,
detectors: item.detectors, // [stale, over_broad, rubber_stamped, dead]
age_days: item.ageDays, lines: item.lines,
commit_sha: item.commitSha || null,
action: item.action, // narrow | delete | regenerate-with-review
}),
});
}
| code | meaning | class |
|---|---|---|
ERR_NOT_A_GIT_REPO | target_dirs are outside a git working tree | user |
ERR_NO_SNAPSHOTS_FOUND | zero snapshot files detected — scenario is noop | user |
ERR_TARGET_DIR_MISSING | declared target_dirs path doesn't exist | user |
ERR_GIT_LOG_FAILED | git log subprocess failed (shallow clone?) | system |
ERR_EVIDENCE_DIR_MISSING | evidence dir not pre-created | system |
On ERR_NO_SNAPSHOTS_FOUND: the scenario is a noop — don't fabricate
findings. Return a PASS with reason: "no snapshots found" and
found=0.
VERDICT: FAIL with the top-N to re-review as conditions. This is a
reviewer tool, not a gate — but there is no conditional pass on the output
line: VERDICT: PASS only for a clean tree (or the ERR_NO_SNAPSHOTS_FOUND
noop). The ledger's FAIL is reserved for severe rubber-stamp counts or
catastrophic dead-file counts.rubber_stamp_window + 5 trigger ERR_GIT_LOG_FAILED; do
not guess.action: delete; the
human executes it.cassettes/external/ or any path
added to context.md's ignore list is excluded from all four detectors.The final line is exactly VERDICT: PASS or VERDICT: FAIL — one plain-text
line, nothing after it, never quoting another VERDICT line.
## Snapshot audit: {scenario.name}
target_dirs: {target_dirs}
thresholds: age_days={ageDays} over_broad_lines={obLines} rubber_stamp_window={rsWindow}
found: {total} snapshot files
detector counts:
stale : {stale}
over-broad : {overBroad}
rubber-stamped: {rubberStamped} <-- highest weight
dead : {dead}
top-5 (full list in snapshot-top-n.csv):
score=7 src/ui/__snapshots__/Header.snap (stale+over-broad+rubber-stamped) action=regenerate-with-review
score=5 src/pricing/testdata/tax.golden (stale+rubber-stamped) action=regenerate-with-review
score=3 tests/cassettes/legacy/old.yaml (dead) action=delete
...
REVIEWER: wicked-garden-qe-snapshot-hygiene-auditor
RUN_ID: {RUN_ID}
VERDICT: PASS|FAIL
{WT_LIB}){WT_LIB} is the plugin's own qe helper directory — the helper modules ship
in-catalog (scripts/qe/lib/, ported from the retired wicked-testing package
in Phase 6c). Resolve it (cross-platform):
WT_LIB="$(wicked-garden path scripts/qe/lib)"
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
snapshot-testing, test-hygiene, test-maintenance, snapshot-rot
91 skills in this plugin
/wicked-garden-agenticAgentic-systems domain skill: review, design, audit, and framework selection
for AI agent systems. Routes to one of four actions (review | design | audit |
frameworks) backed by the rubrics in refs/.
Use when: "agentic review", "review this agent system", "full agentic codebase
review", "trust and safety audit", "audit my agents for GDPR/HIPAA/SOC2/NIST
compliance", "design an agentic system", "design a multi-agent architecture",
"which agentic framework should I use", "compare LangChain vs CrewAI vs
AutoGen", or any former /wicked-garden:agentic:{review|design|audit|frameworks}
invocation.
Disambiguation: this domain reviews and designs **AI agent systems**. For
ordinary source code use the engineering review; for a binding go/no-go
verdict use the archetype review (see docs/domains.md → "review appears in
three domains").
/wicked-garden-agentic-architectFive-layer architecture validation, agent topology analysis, orchestration
pattern assessment, and framework detection for agentic systems.
Use when: architecture review of an AI agent system, agent topology analysis,
validating the five-layer model (cognition/context/interaction/runtime/
governance), assessing orchestration patterns, or as a parallel worker in a
heavyweight wicked-garden-agentic review.
/wicked-garden-agentic-performance-analystToken optimization, latency budgets, cost analysis, caching strategy, and
parallelization assessment for agentic systems.
Use when: performance optimization of an AI agent system, cost analysis or
token-budget review, latency profiling, cache-strategy assessment,
parallelization opportunities, or as a parallel worker in a heavyweight
wicked-garden-agentic review.
/wicked-garden-agentic-safety-reviewerGuardrails, prompt injection defense, PII protection, human-in-the-loop
gates, and hallucination mitigation for agentic systems.
Use when: safety review of an AI agent system, guardrail assessment, prompt
injection audit, PII/compliance exposure check, HITL gate verification, or
as a parallel worker in a heavyweight wicked-garden-agentic review.
Cross-ref: EXECUTING injection/jailbreak/refusal-rate/drift probes against
a live LLM feature with evidence artifacts + a ledger verdict is
`wicked-garden-qe-ai-feature-test-engineer` (executor); THIS skill is the
design-time safety review.
/wicked-garden-appsChange, review or accept an Apps app: a declarative UI over live data
and the system's knowledge that a person builds in wicked-studio's Apps
section. An app is a spec
(apps.json: pages, components, layout, theme, bindings, queries and
actions) plus query texts under queries/. A turn's builder edits those
two and nothing else, from the data catalog the task names, and never
calls a write tool or an action (a live read goes only through crew's
broker). A distinct reviewer judges the turn's tree. A publish's QE seat
judges the publish check's evidence.
Use when: a phase of the `apps-turn` workflow (build, review) or the
`apps-publish` workflow (qe), "add a KPI to my app", "chart this query",
"add a filter", "add an Assign to me button", "review this app turn".
NOT for running a query, testing a connection, granting an action or
deploying an app (crew and studio do those, behind a person's click),
and NOT for building studio editor plugins (that is
wicked-garden-editor-scaffold).
/wicked-garden-archetypev11 work-shape archetype runner. When a prompt has been routed to one
of the archetypes (triage, explore, specify, decide, ship, review,
incident, build, migrate, modernize), this skill is the entry point. It
picks the right per-archetype playbook from refs/ and executes the phase
shape declared in `.claude-plugin/archetypes.json`.
Use when: a `<wg archetype="X">` or `<wg archetypes>` system-reminder
tag appears, an explicit "let's run the X archetype" request, or a
direct per-archetype ask — "triage this prompt", "review this PR /
artifact", "build this feature", "decide between these options",
"explore this problem", "handle this incident", "run this migration",
"modernize / port this legacy app", "ship this release", "write
acceptance criteria" (invoke with archetype=<name> plus the user's
args — see the Direct invocation table).
npx claudepluginhub mikeparcewski/wicked-garden --plugin wicked-gardenOther plugins' skills for the same job