building-regression-tests
Skill1 starsChanged 3 months agoMITView on GitHub
Use when a bug, outage, production defect, or failed higher-level test must become a durable automated guard before the implementation is changed.
In this repository65 other files it gives its agents.
- analyzing-change-blast-radiusSkill
- analyzing-developer-career-opportunitiesSkill
- art-directing-web-interfacesSkill
- assessing-developer-proficiencySkill
- auditing-dependency-riskSkill
- auditing-pixel-perfect-frontendSkill
- bootstrapping-modern-web-appsSkill
- brag-slimSkill
- building-brand-guidelinesSkill
- building-conversion-product-pagesSkill
- building-developer-career-roadmapsSkill
- building-hybrid-game-assetsSkill
- building-premium-nextjs-interfacesSkill
- building-project-showcasesSkill
- building-reliable-node-api-boundariesSkill
- choosing-application-architectureSkill
- craft-premium-motionSkill
- creating-character-sprite-pipelinesSkill
- defining-brand-strategySkill
- designing-action-combatSkill
- designing-developer-portfolio-evidenceSkill
- designing-relational-data-modelsSkill
- designing-software-boundariesSkill
- designing-test-strategiesSkill
- designing-ui-systemsSkill
- designing-visual-identitiesSkill
- documenting-architecture-decisionsSkill
- editing-for-clarity-and-toneSkill
- engineering-gsap-animationsSkill
- evaluating-developer-proficiencySkill
- evolving-postgres-schemas-safelySkill
- humanizing-generated-proseSkill
- implementing-reference-faithful-uiSkill
- investigating-codebase-semanticallySkill
- managing-implementation-slicesSkill
- mapping-existing-codebase-structureSkill
- naming-brands-and-productsSkill
- optimizing-frontend-motion-performanceSkill
- orchestrating-cinematic-web-motionSkill
- planning-codebase-changes-with-evidenceSkill
- planning-engineering-workSkill
- planning-launch-distributionSkill
- planning-safe-refactorsSkill
- planning-written-communicationSkill
- preparing-project-launchSkill
- profiling-postgres-query-performanceSkill
- reconstructing-images-as-threejsSkill
- reviewing-api-securitySkill
- reviewing-apple-platform-interfacesSkill
- reviewing-pull-requestsSkill
- reviewing-web-securitySkill
- selecting-working-methodsSkill
- shipping-github-vercel-changesSkill
- teaching-developer-conceptsSkill
- testing-integration-boundariesSkill
- testing-playable-gamesSkill
- testing-web-applications-end-to-endSkill
- threat-modeling-applicationsSkill
- tracing-code-execution-pathsSkill
- translating-figma-to-nextjsSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 8 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 15
Write one test that fails on the current buggy implementation.
- Distinctive: line 17
Run the new test and the relevant surrounding suite.
- Distinctive: line 18
If the bug suggests a family of nearby failures, add only the distinct cases justified by the same root cause.
- Distinctive: line 19
Keep the regression test after the fix.
- Distinctive: line 28
avoid broad fixtures and unrelated assertions.
- Distinctive: line 34
Do not call an intermittently failing test a regression guard.
- Distinctive: line 37
Before declaring the bug fixed, prove the full cycle:
- Distinctive: line 43
If RED was never observed, the test has not demonstrated that it guards this regression.
≈ “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
Building Regression Tests
Core principle
A known defect is not safely fixed until an automated test can reproduce it and fail for the right reason before the fix. Keep that test at the narrowest layer that still proves the broken contract.
Regression workflow
- Reproduce the defect from a concrete report, failing test, log, trace, request, data shape, or user sequence. Do not encode a guessed failure mode.
- State the violated contract in observable terms: expected output, persisted state, emitted event, UI behavior, error handling, authorization, or side effect.
- Find the narrowest layer that can reproduce the real defect. A bug found by E2E may belong in an integration or unit regression test once the failing boundary is understood.
- Write one test that fails on the current buggy implementation. Confirm the failure message and evidence correspond to the defect, not a setup error.
- Apply the minimal production fix.
- Run the new test and the relevant surrounding suite. The new test must turn GREEN without weakening its assertion.
- If the bug suggests a family of nearby failures, add only the distinct cases justified by the same root cause.
- Keep the regression test after the fix. Remove it only if the protected behavior disappears or another test demonstrably supersedes the same contract.
Test quality
A regression test should:
- reproduce the smallest meaningful failing case;
- assert behavior, not the implementation detail you plan to change;
- be deterministic and isolated;
- have a name that describes the protected contract;
- fail if the bug is intentionally reintroduced;
- avoid broad fixtures and unrelated assertions.
Higher-level discoveries
When a broad system or browser test exposes a defect, first preserve the evidence that proves the user-visible failure. Then trace the defect downward. If a smaller test can reproduce the same root cause, add the durable regression there and keep the broad test only when it proves additional integration or journey value.
Flakiness
Do not call an intermittently failing test a regression guard. If the same code can produce pass and fail outcomes, isolate nondeterminism before relying on the test as a release signal.
Verification
Before declaring the bug fixed, prove the full cycle:
- the new test fails against the buggy behavior;
- the production fix is applied;
- the same test passes;
- relevant neighboring tests still pass.
If RED was never observed, the test has not demonstrated that it guards this regression.
References
- Martin Fowler, Self Testing Code: https://martinfowler.com/bliki/SelfTestingCode.html
- Martin Fowler, Goto Fail, Heartbleed, and Unit Testing Culture: https://martinfowler.com/articles/testing-culture.html
- Google Testing Blog, Where do our flaky tests come from?: https://testing.googleblog.com/2017/04/where-do-our-flaky-tests-come-from.html
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.

