Skip to content
Back to skills

Rules Kotlin

ASecurity

ANVIL coding rules for kotlin code (**/*.kt, **/*.kts, **/*Test.kt, **/*Tests.kt): Kotlin, Kotlin Testing.

  • 5 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 30, 2026
ai-agentskotlintesting

Security analysis

A100/100

Scanned November 30, 2026

npx -y skills add AdityaaaTiwari/ANVIL --skill rules-kotlin --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Rules Kotlin?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Rules Kotlin
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/adityaaatiwari-rules-kotlin/badge)](https://www.skillsdirectory.com/skills/adityaaatiwari-rules-kotlin)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: rules-kotlin
description: "ANVIL coding rules for kotlin code (**/*.kt, **/*.kts, **/*Test.kt, **/*Tests.kt): Kotlin, Kotlin Testing."
---

<!-- Generated by `anvil plugin build` from catalog/. Edit the catalog, not this file. -->

# ANVIL rules: kotlin

Follow these rules for kotlin code (**/*.kt, **/*.kts, **/*Test.kt, **/*Tests.kt).

## Kotlin

# Kotlin
- Prefer `val` and immutable collections; no `!!` outside tests.
- Structured concurrency: scoped coroutines, never `GlobalScope`; rethrow `CancellationException`.
- Sealed classes or interfaces for closed result and state types; exhaustive `when`.
- Data classes for values; keep side effects out of `init` blocks.

## Kotlin Testing

# Kotlin Testing

- Use `runTest` from `kotlinx-coroutines-test` with virtual time instead of `runBlocking` and real `delay`.
- Inject `CoroutineDispatcher` and fakes via constructors rather than hardcoding `Dispatchers.IO`.
- Use backtick descriptive test names selectively for readability and test exhaustive sealed-state transitions cleanly.
- Assert collected `StateFlow` / `Flow` emissions deterministically (for example with Turbine) instead of timing guesses.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.