A

kotlin-testing

by affaan-m

kotlin-testing is a practical guide for Kotlin test automation with Kotest, MockK, coroutine testing, property-based tests, and Kover coverage. Use this kotlin-testing skill to follow a TDD-friendly workflow, write clearer unit and component tests, and reduce guesswork when mocking dependencies or testing suspending code.

Stars156.2k
Favorites0
Comments0
AddedApr 15, 2026
CategoryTest Automation
Install Command
npx skills add affaan-m/everything-claude-code --skill kotlin-testing
Curation Score

This skill scores 78/100 and is worth listing: it gives agents a clear Kotlin testing workflow, concrete tool choices, and enough structure for a useful install decision. Directory users should view it as a solid but not fully polished skill, since it lacks supporting files and some operational packaging that would reduce adoption friction further.

78/100
Strengths
  • Clear, triggerable use cases for Kotlin test creation, coverage, TDD, and property-based testing.
  • Operational workflow is explicit: identify code, write Kotest spec, mock with MockK, run RED/GREEN, refactor, and check Kover coverage.
  • Large body with detailed examples and repository/file references suggests more than a thin placeholder.
Cautions
  • No install command or support files, so setup and integration may require more manual interpretation.
  • Contains placeholder markers ('todo'), which suggests some sections may be incomplete or less reliable for edge cases.
Overview

Overview of kotlin-testing skill

What kotlin-testing is for

The kotlin-testing skill is a practical guide for writing and improving tests in Kotlin projects. It centers on the work most teams actually need: choosing a Kotest style, mocking dependencies with MockK, testing coroutines correctly, and using property-based tests and Kover coverage without turning test code into boilerplate.

Who should install it

Install the kotlin-testing skill if you are adding tests to a Kotlin app, standardizing a team’s test approach, or want a TDD-friendly workflow that fits idiomatic Kotlin. It is most useful for developers working in JVM Kotlin projects who need repeatable patterns instead of ad hoc test prompts.

Where it fits best

This skill fits test automation tasks where the goal is reliable unit or component coverage, not end-to-end framework setup. It helps when you need to write the first test, refactor brittle assertions, or understand how to isolate code with mocks and coroutines in a Kotlin-specific way.

How to Use kotlin-testing skill

Install kotlin-testing in your workspace

Use the repository install flow for the skill, then point your agent at the skills/kotlin-testing context before asking for test code. The baseline install command shown in the repo is:
npx skills add affaan-m/everything-claude-code --skill kotlin-testing

For best results, install it in the same workspace where the Kotlin code lives so the skill can be used against real files, package names, and build tooling.

Give the skill a testable Kotlin target

The kotlin-testing skill works best when your prompt names one concrete target and one desired test outcome. Good inputs include the class or function name, the framework you already use, and any constraints such as coroutine behavior, mocking rules, or coverage thresholds.

Example prompt shape:
Use kotlin-testing to write Kotest tests for UserService.createUser. Mock the repository with MockK, cover success and duplicate-email failure paths, and keep the tests compatible with our Gradle/Kover setup.

Read the right files first

Start with SKILL.md, then inspect README.md, AGENTS.md, metadata.json, and any rules/, resources/, references/, or scripts/ folders if they exist. For this repo, SKILL.md is the main source of truth, so the quickest path is to read its “When to Use,” “How It Works,” and “Examples” sections before drafting prompts.

Use the workflow, not just the snippets

The repo is organized around a test-first flow: identify the target, write a Kotest spec, mock dependencies, run the failing test, implement the code, then verify coverage with ./gradlew koverHtmlReport. That makes the skill more useful when you want an execution plan, not just sample assertions.

kotlin-testing skill FAQ

Is kotlin-testing only for TDD?

No. TDD is the default workflow in the skill, but the patterns are also useful when you are retrofitting tests onto existing Kotlin code. If you already have implementation code, use the skill to add focused coverage and cleaner mocks.

Does this replace a normal prompt?

It improves on a normal prompt when you need Kotlin-specific decisions: which Kotest style to use, how to mock coroutines, and how to think about coverage. A generic prompt can write tests, but kotlin-testing reduces guesswork around framework fit and test structure.

Is it beginner-friendly?

Yes, if you can describe one Kotlin unit or class and want a guided test plan. It is less helpful if you do not know your build system, do not have a test target yet, or need broad architecture advice instead of concrete test code.

When should I not use kotlin-testing?

Do not use it as a substitute for browser automation, API contract testing, or non-Kotlin testing stacks. If your problem is mainly infrastructure, flaky integration environments, or test data management, a broader test automation skill is a better fit than kotlin-testing.

How to Improve kotlin-testing skill

Give stronger context than “write tests”

The best kotlin-testing results come from precise inputs: the class under test, public methods, important branches, and any existing test style you want to match. Mention whether you want Kotest StringSpec, FunSpec, or BehaviorSpec, because that affects readability and structure.

State the hard constraints up front

If your code uses suspending functions, flows, private collaborators, or strict coverage gates, say so before generation. For example: Use MockK for the repository, test this suspend function with coroutine test support, and keep the assertions compatible with Kover coverage goals.

Ask for coverage around failure paths

The skill is most valuable when you ask for both happy-path and failure-path tests, not just “one passing test.” If a function can return null, throw, retry, or validate input, ask for those cases explicitly so the generated suite is decision-ready.

Iterate by tightening the test design

After the first output, refine the prompt with what was missing: edge cases, naming conventions, fixture setup, or flaky dependencies. The fastest improvement loop for kotlin-testing is to review the generated spec, note what feels overmocked or undercovered, and ask for a narrower rewrite with the exact branch you still need.

Ratings & Reviews

No ratings yet
Share your review
Sign in to leave a rating and comment for this skill.
G
0/10000
Latest reviews
Saving...