test-suite-builder
Skill18 starsChanged 9 months agoMITView on GitHub
Design and generate layered Kotlin + Spring tests that balance speed, realism, and regression value across unit, slice, and integration levels. Use when adding coverage for business logic, controllers, repositories, security, serialization, or end-to-end workflows, and when generic AI output would otherwise overuse `@SpringBootTest`, misuse mocks, or ignore MockK and coroutine testing idioms.
1 other project uses a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- JetBrains/skillsedited, first seen Apr 28, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 1
- JetBrains/skills★ 36096% same
Wrote their own version · 0
None found.
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 repository24 other files it gives its agents.
- ci-cd-containerization-advisorSkill
- configuration-properties-profiles-kotlin-safeSkill
- dependency-conflict-resolverSkill
- domain-decomposition-api-design-advisorSkill
- error-model-validation-architectSkill
- gradle-kotlin-dsl-doctorSkill
- integration-resilience-engineerSkill
- jackson-kotlin-serialization-specialistSkill
- java-kotlin-migration-assistantSkill
- jpa-spring-data-kotlin-mapperSkill
- kotlin-idiomatic-refactorer-spring-awareSkill
- kotlin-spring-proxy-compatibilitySkill
- observability-integratorSkill
- performance-concurrency-advisorSkill
- production-incident-responderSkill
- project-context-ingestionSkill
- schema-migration-plannerSkill
- spring-context-di-reasoningSkill
- spring-kotlin-code-reviewSkill
- spring-mvc-webflux-api-builderSkill
- spring-security-configurator-auditorSkill
- stacktrace-log-triageSkill
- transaction-consistency-designerSkill
- upgrade-breaking-change-navigatorSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
21 rules. About 0 are common, 18 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈18
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
- Distinctive: line 17
Before writing code, classify what needs to be proven:
- Distinctive: line 29
Use unit tests for domain logic, calculations, decision tables, and deterministic branching.
- Distinctive: line 30
Use slice tests for framework boundaries:
- Very specific: line 34
Use @SpringBootTest and Testcontainers only when a realistic application graph or infrastructure boundary must be proven.
- Distinctive: line 39
Prefer MockK over Mockito unless the repository already standardizes on something else.
- Distinctive: line 40
Use readable backtick test names when that matches the project style.
- Very specific: line 41
Use runTest and the coroutine test toolkit for coroutine-heavy code.
- Very specific: line 54
Do not default to @SpringBootTest when a slice test or unit test is enough.
- Distinctive: line 55
Do not write tests that only verify mock interactions and prove nothing observable.
- Distinctive: line 56
Do not couple assertions to private implementation details when public behavior is enough.
- Distinctive: line 57
Do not use real time, random values, or shared mutable state without control.
- Distinctive: line 73
If serialization or validation is the bug, include a test that proves the wire contract, not only the service logic.
- Distinctive: line 74
If transaction behavior matters, add a test that proves rollback or uniqueness behavior in the real persistence layer.
- Distinctive: line 85
Use deterministic time and ID providers when business logic depends on clocks or UUIDs.
- Distinctive: line 89
If a bug was caused by framework wiring, add at least one test above unit level.
- Distinctive: line 90
If a bug was caused by domain branching, do not drag the whole Spring context into the fix.
- Distinctive: line 91
When in doubt, choose the smallest test that would have failed before the change.
- Distinctive: line 92
Treat test code as production code for readability and maintenance.
- Distinctive: line 97
Keep setup explicit and local to the scenario.
- Distinctive: line 98
Prefer one clear reason for failure per test.
- Distinctive: line 99
Do not silently introduce slow infrastructure-heavy tests into fast unit test suites.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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
Test Suite Builder
Source mapping: Tier 1 critical skill derived from Kotlin_Spring_Developer_Pipeline.md (SK-14).
Mission
Choose the lightest test that proves the behavior. Generate tests that catch regressions instead of reproducing the implementation line by line.
Start With A Test Strategy
Before writing code, classify what needs to be proven:
- pure business logic
- HTTP contract and validation
- repository query behavior
- serialization behavior
- security rules
- cross-component integration
- database or message-broker integration
Three-Layer Strategy
- Use unit tests for domain logic, calculations, decision tables, and deterministic branching.
- Use slice tests for framework boundaries:
@WebMvcTestorWebTestClientfor HTTP@DataJpaTestfor repositories- focused JSON or security slices when available in the project
- Use
@SpringBootTestand Testcontainers only when a realistic application graph or infrastructure boundary must be proven.
Kotlin Testing Rules
- Prefer JUnit 5.
- Prefer MockK over Mockito unless the repository already standardizes on something else.
- Use readable backtick test names when that matches the project style.
- Use
runTestand the coroutine test toolkit for coroutine-heavy code. - Build reusable fixtures, builders, or object mothers instead of duplicating inline object construction.
What To Cover
- Success path.
- Validation failures.
- Business rule failures.
- Edge cases around nullability, optional fields, empty collections, and duplicates.
- At least one regression-oriented test for the bug or change that motivated the work.
What Not To Do
- Do not default to
@SpringBootTestwhen a slice test or unit test is enough. - Do not write tests that only verify mock interactions and prove nothing observable.
- Do not couple assertions to private implementation details when public behavior is enough.
- Do not use real time, random values, or shared mutable state without control.
Output Contract
Return these sections:
Test plan: which layers to use and why.Generated tests: the concrete test classes or patch plan.Test data support: builders, fixtures, or factories to add.Coverage gaps: important cases still not covered.Verification: commands to run and which tests should fail before the fix.
Framework-Specific Checks
- Match
MockMvcvsWebTestClientto MVC vs WebFlux. - Match Testcontainers setup to the actual database or broker in the repository.
- If serialization or validation is the bug, include a test that proves the wire contract, not only the service logic.
- If transaction behavior matters, add a test that proves rollback or uniqueness behavior in the real persistence layer.
Advanced Testing Nuances
- A transactional test that always rolls back can hide commit-time failures. Use explicit flush or real commit boundaries when unique constraints, triggers, or transaction listeners matter.
- H2 is not a safe stand-in for Postgres or MySQL when dialect, JSON, locking, index use, or transaction semantics matter. Prefer the real engine with Testcontainers for those cases.
@MockBeanis powerful but expensive. Overusing it turns integration tests into slow unit tests with hidden wiring.- Security tests should usually prove both
401and403, not just the happy authorized path. - Async and event-driven flows need deterministic waiting strategies such as controlled schedulers, latches, or Awaitility. Do not scatter sleeps.
- Concurrency and deadlock behavior cannot be proven in a single-threaded rollback test. Use multiple transactions and explicit synchronization when reviewing those cases.
- Reused containers improve speed but require strict state isolation. Do not trade determinism away for a faster green build.
- Use deterministic time and ID providers when business logic depends on clocks or UUIDs.
Expert Heuristics
- If a bug was caused by framework wiring, add at least one test above unit level.
- If a bug was caused by domain branching, do not drag the whole Spring context into the fix.
- When in doubt, choose the smallest test that would have failed before the change.
- Treat test code as production code for readability and maintenance. Fixtures and helpers should reduce noise, not hide behavior.
Guardrails
- Keep tests deterministic.
- Keep setup explicit and local to the scenario.
- Prefer one clear reason for failure per test.
- Do not silently introduce slow infrastructure-heavy tests into fast unit test suites.
Quality Bar
A good run of this skill produces a test suite that is fast where possible and realistic where necessary. A bad run floods the project with context-heavy tests, brittle mocks, and no clear explanation of why each test level exists.
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.

