software-testing
Skill0 starsChanged 2 months agoMITView on GitHub
Use whenever tests are in play — writing, adding, naming, structuring, or running them, or deciding how to verify a change — in any stack, even when the user only says 'add tests' without details, and keep it in force across the session. Picks the level (unit/integration/e2e), resolves the configured runner and command from the detected stack (Maven/Gradle/Angular/Node — committed wrapper or package script, never plain mvn), guides naming and structure ([method]_[scenario]_[result], AAA, TestBuilder), and requires a regression test for every bugfix (red before, green after). Always asks before running a test runner — never launches it without explicit confirmation. Low or absent coverage is a gap to remediate, never a pattern to copy (no skipTests=true, no contextLoads-only). Optional complements, if available: the `coding-standards` skill (and the `java-spring-standards` skill or the `angular-standards` skill) for authoring the code under test; the `git-conventions` skill for commit conventions.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- Rutvik552k/claude-skillstheir own version, first seen May 14, 2026
- moogah/claude_skillstheir own version, first seen Mar 6, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- moogah/claude_skills★ 1same name
- Rutvik552k/claude-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository21 other files it gives its agents.
- authoring-skillsSkill
- creating-toolsSkill
- system-diagramsSkill
- java-spring-standardsSkill
- sql-authoringSkill
- exploring-designs-with-agentsSkill
- ui-authoringSkill
- project-docsSkill
- technical-writingSkill
- coding-standardsSkill
- critical-thinkingSkill
- github-workflowsSkill
- reviewing-codeSkill
- security-practicesSkill
- version-evolutionSkill
- angular-standardsSkill
- git-conventionsSkill
- resolving-merge-conflictsSkill
- releasing-android-appsSkill
- coordinating-agentsSkill
- masterSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. About 0 are common, 6 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Run this once, when the skill loads and before its other steps.
- Very specific: line 12
Run node <skill dir>/scripts/permissions.mjs check --root <session folder> --host <claude|codex|agy>.
- Very specific: line 13
If node is missing or the command fails, say so, list the needs in <skill dir>/permissions.json and go on with the skill.
- Very specific: line 14
Read hosts.<host> in the output.
- Very specific: line 16
Run the command of the option the person chose, exactly as given.
- Distinctive: line 18
After "Skip for now", do not run this step again in the session.
- Distinctive: line 45
Write the test that fails with the current code (red) — it proves the bug exists.
- Very specific: line 62
Fixtures age and flatter: use dates relative to now or an injected clock, cross numeric widths (999 against 1000) when testing an order, …
- Very specific: line 84
Never propose or leave <skipTests>true</skipTests>.
- Very specific: line 85
Never treat a lone contextLoads() as coverage — it is boot smoke, not logic testing.
- Distinctive: line 95
When touching a repo without tests, treat it as debt to remediate in what you modify — never as a license to skip.
- Distinctive: line 166
If the manifest has no runnable command for the requested level, report the missing configuration.
- Very specific: line 237
Run the resolved command per stack and level.
- Distinctive: line 239
If the human already validated manually, do not repeat.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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
software-testing — Test strategy and execution
Step 0 — Permissions this skill uses
Run this once, when the skill loads and before its other steps. It keeps the session from stopping on a prompt for a command this skill is known to run. It is not a security check: the host and its hooks still decide.
- Run
node <skill dir>/scripts/permissions.mjs check --root <session folder> --host <claude|codex|agy>.<skill dir>is the folder of thisSKILL.md;<session folder>is the folder where the session started; the host is the one you run in. - If
nodeis missing or the command fails, say so, list the needs in<skill dir>/permissions.jsonand go on with the skill. - Read
hosts.<host>in the output. Show itsnoticewhen there is one. - Ask each entry of its
questionswith the host's structured question tool, in the person's language: itstext, then its options in the given order, the one markedrecommendedfirst. Low-risk and high-risk needs are separate questions; ask them separately and never recommend allowing a high-risk need. - Run the
commandof the option the person chose, exactly as given. An option without a command writes nothing. Write nothing the person did not choose. - Tell the person the
appliesline of the result: whether the change works now or after a restart. If the command fails, say so and go on. - After "Skip for now", do not run this step again in the session.
Purpose
Reason about tests: which level to apply, with which command, with which naming/structure convention. It never runs tests autonomously — it first asks the human whether to run them, whether they will run them manually, or whether none are needed.
This skill covers how to test. If available, the style of the code under test can come from the coding-standards skill (+ the java-spring-standards skill / the angular-standards skill), and commits from the git-conventions skill.
Knowledge
Execution rule
By default, never run tests automatically. Before launching any test runner, ask the human, with the host's structured question tool if it has one; otherwise with a numbered markdown list.
Run the tests?
[a] Yes, run them now
[b] I will run them manually
[c] Not neededSkip the question only if the user already asked to run them, or in a validation step the user explicitly requested.
Verification-first (bugfix => regression test)
A bugfix requires a regression test that reproduces the defect:
- Write the test that fails with the current code (red) — it proves the bug exists.
- Apply the fix.
- The same test now passes (green).
Without the prior red there is no guarantee the test covers the bug. For new features, the test accompanies the new logic — never deferred.
Reproduce before fixing: choose the fix from a reproduction, never from a hypothesis that merely sounds right.
Make the test bite
A green suite proves little until a broken version turns it red.
- Mutate the guarantee. For each guarantee a change adds, break the code on purpose (restore the defect, delete the guard) and run the test: it must fail. A surviving mutant means the test asserts less than the code promises, usually a final state that the broken version also reaches. Restore from a backup copy of the file;
git checkout -- <file>would also discard your uncommitted work. - Test the caller, not only the primitive. A correct function that nothing calls is dead, and a harness that supplies the missing wiring by hand is a structural false green. Run the real entry point (the built binary, the HTTP route) at least once and find who consumes each new function.
- A double is never more permissive than the real thing. Give the fake the invariants of the service it replaces, and keep at least one contract test against the real service or its real validation. Mocks on both sides of a boundary leave a broken contract green on both.
- An exception added so a check passes is as suspect as a deleted test. Ask which mutation would stay green with it.
- Guard against vacuous passes: a scan that found zero elements, a scenario another rule already excludes, a
catchthat turns a crash into data. Assert a floor (at least one item checked) and write one case that varies only what each guard protects. - Fixtures age and flatter: use dates relative to now or an injected clock, cross numeric widths (
999against1000) when testing an order, and use realistic names instead ofone/two.
A red you did not cause still has to be proven
A failing test in a repo you just touched is not preexisting because it looks unrelated. Demonstrate it: run the same command against the untouched base — another checkout of the same commit, or a clean worktree — and compare the failure, by name, not by count. An equal count with different names hides a new regression behind an old one.
git stash is the wrong instrument for this. It mutates the tree you are measuring, and on a clone
shared with other worktrees or other agent sessions the stash stack is shared too, so a pop can take
somebody else's work. Prefer a second checkout.
Report a preexisting failure with its evidence — the command, the environment, the cause — and never as an aside. "It was already broken" without that is indistinguishable from not having looked.
Coverage is a GAP, not a convention
In many codebases testing is nearly absent: a repository has only a @SpringBootTest contextLoads() (or no src/test at all), a pom.xml carries maven-surefire-plugin with <skipTests>true</skipTests> so declared tests never run, a frontend has a handful of specs, or a static-analysis gate stands in for a suite.
Never emulate this anti-pattern. Rules:
- Never propose or leave
<skipTests>true</skipTests>. - Never treat a lone
contextLoads()as coverage — it is boot smoke, not logic testing. - Empty stub tests (a
@Testmethod with a blank body) do not count; either complete them or do not add them.
// ANTI-PATTERN: a repository whose only real tests
// leave two cases as empty shells — do NOT replicate.
@Test public void testActive_CronNotFound() { } // no Arrange/Act/Assert
@Test public void testActive_CronInactive() { }When touching a repo without tests, treat it as debt to remediate in what you modify — never as a license to skip.
Test levels
Three universal levels, adapted to the detected stack:
| Level | Scope | When |
| a) Unit | Isolated logic (services, utils, mappers) with mocked dependencies | Targeted fix, logic without external dependencies |
| b) Integration | Unit + API/controller layer | New or modified endpoint |
| c) Full / e2e | Integration + full context | Complete feature, critical cross-layer flow |
Stack resolution
Detect the stack, test engine, runner version and command from the repository's manifests, build
files, wrapper, package-manager declaration and test configuration. Those declarations are the
current compatibility baseline; never add or upgrade a runner merely because it appears in an
example below. For a new project or explicit runner/toolchain migration, use the version-evolution
skill if it is available, and select a supported release compatible with the chosen language/framework baseline.
Never use global mvn/gradle — always the committed wrapper. If an existing repository lacks
one, report that reproducibility gap. A new project must generate, pin and commit its wrapper before
the first verification command.
Spring Boot (Maven)
| Level | Typical scope | Command |
| a) Unit | configured Java test engine + mocking library | ./mvnw test -Dtest=ClassTest |
| b) Integration | configured controller/API test support | ./mvnw test |
| c) Full | configured full-context/integration suites | ./mvnw verify |
Windows:
mvnw.cmdinstead of./mvnw.
Spring Boot (Gradle)
| Level | Command |
| a) Unit | ./gradlew <declared-unit-task> --tests ClassTest when that task supports filtering |
| b) Integration | ./gradlew <declared-integration-task> |
| c) Full | ./gradlew <declared-verification-task> |
Resolve the placeholders from tasks registered by the target build. test, integrationTest and
check are common examples, not guaranteed task names.
Angular
| Level | Typical scope | Command |
| a) Unit | configured Angular unit runner | the repository's test script with its supported non-watch flag |
| b) Integration | configured Angular component test support | the repository's test script with its supported non-watch flag |
| c) Full | configured browser/e2e runner, if present | the repository's e2e script |
Karma/Jasmine, Jest, Vitest, Cypress and Playwright are examples found in different generations, not defaults to install. Use only the runner and flags supported by the selected Angular builder.
Generic Node / TypeScript
| Level | Command |
| a) Unit | the declared package manager's test script |
| b) Integration | its configured integration script/suite |
| c) Full | its configured e2e script |
Automatic resolution
mvnw/mvnw.cmd→ Maven wrapper and the project's configured test plugins.gradlew/gradlew.bat→ Gradle wrapper and declared test tasks.package.json→ honorpackageManager, lockfile and scripts; use the declared package manager.angular.json→ inspect its test/e2e builders when scripts delegate to the Angular CLI.
If the manifest has no runnable command for the requested level, report the missing configuration; do not silently substitute a globally installed tool or introduce a historical runner.
Naming conventions
Java: class [Target]Test.java, method [method]_[scenario]_[result]. Arrange-Act-Assert structure. @Mock for collaborators, @InjectMocks for the SUT.
@Test
void active_cronInactive_throwsException() {
// Arrange
var parameter = new ParameterDTO(/* ... inactive status ... */);
when(parameterService.findByAppCode(APP, PRM_CRON))
.thenReturn(parameter);
// Act + Assert
assertThrows(BusinessException.class,
() -> validateCronService.active(PRM_CRON));
}Note: existing code may use ad-hoc names (
testActive_CronActive); prefer the[method]_[scenario]_[result]pattern for new cases.
Angular / TypeScript: file [name].spec.ts, describe / it blocks. TestBed for components; it messages describe the behavior, not the implementation.
describe('AuthService', () => {
it('should return a token on login', () => {
// Arrange / Act / Assert
});
});TestBuilder pattern (Java)
Build reusable fixtures without coupling tests to the production constructor. Useful with entities/DTOs that carry audit or status fields:
public class RequestTestBuilder {
private Integer status = 1; // 1 = active (soft status)
private String document = "12345678";
public static RequestTestBuilder builder() { return new RequestTestBuilder(); }
public RequestTestBuilder document(String v) { this.document = v; return this; }
public RequestTestBuilder status(Integer v) { this.status = v; return this; }
public Request build() {
var r = new Request();
r.setDocument(document);
r.setStatus(status);
return r;
}
}Level selection prompt (shown to the human, in the user's language)
Adapt to the resolved stack. Spring Boot example:
Which test level do we apply?
a) Unit — configured runner and mocks (fast, isolated)
b) Integration — configured API/controller support
c) Full — configured context/integration suitesThe human can switch levels at any time or decide not to run.
Execution and logging
- Confirm the human wants execution (see "Execution rule").
- Run the resolved command per stack and level. Read the runner's own exit code: in
<runner> | tail; echo $?the code istail's, so use${PIPESTATUS[0]}or redirect the output to a log. - On failures, if the human wants to continue: fix and re-run.
- If the human already validated manually, do not repeat; note one brief line if it adds traceability.
Output
It produces no artifacts autonomously. When the human confirms execution:
- Runs the resolved command and reports the result inline.
- Writes a brief test log only when explicitly requested.
- For a bugfix, records the added regression test (red→green).
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.

