NutriSport: Skill for Claude Code

.claude/skills/gen-test/SKILL.md

gen-test is a skill for Claude Code from satanyakiv/NutriSport. It costs 89 tokens per session (775 once invoked), scanned A, original, MIT.

A test-writing process for Kotlin classes in a Kotlin Multiplatform project, where shared code can run on several platforms.

In plain words
What is it for?
Writing unit tests for ViewModels, UseCases, Mappers, and Repositories, including state changes, errors, data mapping, and Kotlin Flow streams.
Why use it?
It ensures tests follow the project's existing folder structure, libraries, mocking approach, and class-specific checks.

Skill for Claude Code

Written for Claude Code: disable-model-invocation in frontmatter.

This is satanyakiv/NutriSport's own configuration. It tells Claude Code how to work on NutriSport itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything NutriSport configures →

Reuse

Borrowing it

Nothing to install: this file belongs to satanyakiv/NutriSport. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/satanyakiv/NutriSport/main/.claude/skills/gen-test/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/satanyakiv/NutriSport

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for gen-test

README.md
[![agentmods](https://agentmods.dev/badge/skills/satanyakiv/nutrisport/gen-test/github.svg)](https://agentmods.dev/skills/satanyakiv/nutrisport/gen-test)
Your own site
<a href="https://agentmods.dev/skills/satanyakiv/nutrisport/gen-test"><img src="https://agentmods.dev/badge/skills/satanyakiv/nutrisport/gen-test/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for gen-test

Your own site · 80×15
<a href="https://agentmods.dev/skills/satanyakiv/nutrisport/gen-test"><img src="https://agentmods.dev/badge/skills/satanyakiv/nutrisport/gen-test.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 89 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 775 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00089 $0.00775
Opus 5 $0.00044 $0.00387
Sonnet 5 $0.00018 $0.00155
Haiku 4.5 $0.00009 $0.00077

Measured 10d ago against content hash 0e02c1817ba0, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

gen-test scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/gen-test/SKILL.md · 49 lines

How it starts

The opening of the file, as written. The whole thing — 49 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Generate tests for: $ARGUMENTS

Context

This is a KMP project. Tests go in src/commonTest/kotlin/ mirroring source structure. The project uses kotlin.test, Turbine for Flows, Mokkery for mocking, assertk for assertions.

What to test by class type

Type What to test Mocking Flow testing
UseCase (pure) invoke() success/error paths Fake repository No (unless returns Flow)
UseCase (with repo) invoke() delegates correctly, error propagation Fake repository Turbine if returns Flow
ViewModel State transitions (Loading→Content), error handling, user actions Fake repos via constructor Turbine for StateFlow
Mapper Field mapping, edge cases (null, empty), enum conversion None (pure functions) No
Repository DTO→Domain mapping, error wrapping Mock data source Turbine for Flow returns

Process

  1. Read the source file to understand what to test
  2. Determine the class type (see table above) to pick the right testing approach
  3. Check for existing tests, fake data factories, and Fake repositories in the module's commonTest
  4. If ViewModel/UseCase test needs a Flow-based repository — create Fake{Entity}Repository with MutableSharedFlow (see examples/fake-repository.kt)
  5. Reference examples/usecase-test.kt for pure UseCase tests
  6. Reference examples/viewmodel-test.kt for ViewModel tests with Turbine
  7. Reference examples/mapper-test.kt for pure mapper tests
  8. For full recipes and pitfalls → see references/testing-patterns.md
  9. Create fake data factories (fakeProduct(), fakeCustomer()) if not yet present
  10. Write tests covering: happy path, error path, edge cases
  11. Run: ./gradlew :{module}:allTests --tests "*{TestClass}"
  12. Verify all pass

Conventions

  • Naming: `should X when Y` backtick format
  • AAA pattern: // Arrange// Act// Assert comments
  • Flows: Always Turbine (test { awaitItem() }) — never .first() or .toList()
  • Mocking: Mokkery — every { }, verify { }, mock<Interface>()
  • Coroutines: runTest + StandardTestDispatcher() + Dispatchers.setMain()
  • Assertions: assertk — assertThat(x).isEqualTo(y), isInstanceOf<Type>()
  • Fakes: Prefer Fake{Entity}Repository classes over inline object : Interface for reuse
  • One assertion per test (or one logical group)
  • No real I/O — mock everything external

Read the full file on GitHub · 49 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 49 lines · 89 tokens per session scan A 0e02c1817ba0

Subscribe to this mod's changes

gen-test is a skill published in the GitHub repository satanyakiv/NutriSport (11 stars, last pushed 3mo ago), licensed MIT. It adds 89 tokens to every session and 775 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.