regression-detect
Skill0 starsChanged 6 months agoMITView on GitHub
Diffs test results before and after a code change to identify regressions — new test failures not present in the baseline
In this repository13 other files it gives its agents.
- AGENTS.mdAGENTS.md
- build-loop-initSkill
- build-loop-iterateSkill
- build-loopSkill
- frontend-designSkill
- handle-pr-reviewSkill
- orchestrateSkill
- phase-goal-reviewSkill
- phase-retroSkill
- review-prSkill
- spec-authorSkill
- test-gateSkill
- verify-gateSkill
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 7 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 17
Read both files: If the baseline file does not exist, output PASS with note "No baseline available — skipping regression check.
- Very specific: line 24
When parsing, extract the most specific test identifier available (e.g., test_foo.py::test_bar not just test_bar).
- Distinctive: line 32
FAIL: if any regressions exist
- Distinctive: line 33
PASS: if zero regressions (fixes and new tests are fine)
- Distinctive: line 60
If there are no entries in a section, print "(none)" under that heading.
- Very specific: line 66
After verify passes (step 3), the build-loop saves verify output to docs/plan/test-baseline-current.txt.
- Very specific: line 67
After quality checks pass (step 5), the build-loop calls: /sabs:regression-detect baseline=docs/plan/test-baseline.txt …
- Distinctive: line 68
If FAIL (regressions found): treat as task failure.
- Very specific: line 69
If PASS: proceed to commit gates.
- Distinctive: line 75
Run standalone to compare any two test output files:
- Distinctive: line 84
When parsing test output, be lenient with formats.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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.
Files
<!-- version: 1 -->Diff test results before and after a code change to identify regressions — new test failures that weren't present in the baseline.
Parameters
baseline— file path to the previous verify output (the "before" snapshot)current— file path to the current verify output (the "after" snapshot)project— project path (optional, used only for display)
How it works
- Read both files. If the baseline file does not exist, output PASS with note "No baseline available — skipping regression check. Current output will become the baseline." and stop.
- Parse test results from each file. Extract individual test outcomes (test name -> pass/fail). Support these common output formats:
- pytest: lines matching
PASSED,FAILED,ERRORwith test path (e.g.,tests/test_foo.py::test_bar PASSED) - jest / vitest: lines matching
✓or✕orPASS/FAILwith test name, or summary lines likeTests: N passed, M failed - go test: lines matching
--- PASS:or--- FAIL:with test name - Generic: lines containing
PASSorFAILadjacent to an identifier that looks like a test name (word containingtestorTestor_testor.test) - Verify-gate format: lines starting with
### PASS:or### FAIL:followed by check name When parsing, extract the most specific test identifier available (e.g.,test_foo.py::test_barnot justtest_bar). If a line doesn't match any known format, skip it.
- pytest: lines matching
- Build two maps:
baseline_results = { test_name: "pass"|"fail" }andcurrent_results = { test_name: "pass"|"fail" }. - Diff the maps:
- Regressions: tests that are
passin baseline butfailin current - Fixes: tests that are
failin baseline butpassin current - New tests: tests in current but not in baseline (informational, not a regression)
- Removed tests: tests in baseline but not in current (informational, flag as warning)
- Regressions: tests that are
- Determine verdict:
- FAIL if any regressions exist
- PASS if zero regressions (fixes and new tests are fine)
- Output the result in the format below.
Output format
## Regression Detection Results
Baseline: N tests (M passed, F failed)
Current: N tests (M passed, F failed)
### REGRESSIONS (new failures)
- `test_name` — was PASS, now FAIL
### FIXES (new passes)
- `test_name` — was FAIL, now PASS
### NEW TESTS
- `test_name` — PASS|FAIL
### REMOVED TESTS (warning)
- `test_name` — was in baseline, missing from current
### Verdict: PASS | FAIL
Regressions found: NIf there are no entries in a section, print "(none)" under that heading.
Integration with build-loop
The build-loop calls this skill during Branch A between quality checks (step 5) and commit gates (step 6). The flow:
- After verify passes (step 3), the build-loop saves verify output to
docs/plan/test-baseline-current.txt. - After quality checks pass (step 5), the build-loop calls:
/sabs:regression-detect baseline=docs/plan/test-baseline.txt current=docs/plan/test-baseline-current.txt - If FAIL (regressions found): treat as task failure. Do NOT commit. Queue a fix task naming the regressed tests.
- If PASS: proceed to commit gates. After successful commit, promote
test-baseline-current.txt->test-baseline.txt.
The baseline file (test-baseline.txt) persists across tasks within a phase. It represents the last known-good test state.
Standalone usage
Run standalone to compare any two test output files:
/sabs:regression-detect baseline=path/to/before.txt current=path/to/after.txtRules
- This skill is read-only — it never modifies files. The build-loop handles file promotion.
- When parsing test output, be lenient with formats. If you can't parse a line, skip it. If you can't parse either file at all, output PASS with a warning: "Could not parse test results — regression check inconclusive."
- Removed tests (in baseline but not in current) are a warning, not a regression. The agent may have intentionally removed or renamed tests. Flag them for visibility but do not fail.
- This skill is stateless — it has no knowledge of the build-loop's orchestration state. It takes two files and produces a diff.
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
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.

