# Kotlin Core

> Use for Kotlin null safety, data classes, sealed classes/interfaces, coroutines, Flow, Result, extension functions and error handling.

- **Type:** Skill
- **Install:** `agentstack add skill-gdvega-super-android-kotlin-firebase-skill-kotlin-core`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [GDvega](https://agentstack.voostack.com/s/gdvega)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [GDvega](https://github.com/GDvega)
- **Source:** https://github.com/GDvega/super-android-kotlin-firebase-skill/tree/main/skills/kotlin-core

## Install

```sh
agentstack add skill-gdvega-super-android-kotlin-firebase-skill-kotlin-core
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Purpose

Keep Kotlin code idiomatic, cancellable, explicit and testable.

# When to use

- Refactoring Kotlin domain, data or ViewModel code.
- Modeling UI state, domain results or errors.
- Fixing coroutine, Flow, cancellation or nullability issues.

# Inputs to inspect

- Kotlin version and compiler/plugin setup.
- Code under change and tests.
- Coroutine scopes, dispatchers and Flow operators.
- Expected error and state behavior.

# Required workflow

1. Read the current Kotlin style and version.
2. Identify state, error and async boundaries.
3. Choose sealed types, Result or domain errors intentionally.
4. Preserve cancellation and structured concurrency.
5. Add or update unit tests for changed behavior.

# Rules

- Never use GlobalScope.
- Do not swallow CancellationException.
- Avoid !! except at hard verified boundaries.
- Keep extension functions focused and discoverable.
- Expose immutable state to consumers.

# Related existing skills

## Local skills to invoke

- android-architecture
- testing
- dependency-injection
- ui-state-design

## External companion skills to use when installed

Do not assume these companion skills are installed. Prefer the local skills above first, then consult [Companion Skills](../../docs/COMPANION_SKILLS.md) for install and verification commands.

- android/skills — use for official Android workflow alignment when a first-party companion skill exists for the task.

# Files commonly touched

- `*.kt`
- `ViewModel files`
- `domain models`
- `repository interfaces`
- `test files`

# Commands to validate

```bash
./gradlew test
./gradlew compileDebugKotlin
./gradlew lint
```

# Common mistakes to avoid

- Launching coroutines without lifecycle or owner scope.
- Mixing UI strings into domain errors.
- Using nullable types where a sealed state is clearer.
- Creating magical extensions that hide side effects.

# Checklist

- Nullability explicit.
- Cancellation preserved.
- Flow/state testable.
- Errors modeled.
- Tests added or recommended.

# Example prompts

- Use $super-android-kotlin-firebase to convert this callback API to Flow.
- Use $super-android-kotlin-firebase to model loading/success/error state in Kotlin.

# Expected response style

Respond with: brief diagnosis, change plan, affected files, code or diff summary, validation commands, tests added or recommended, risks, and next step. For review tasks, lead with findings ordered by severity.

# References

- ../../docs/audits/FUENTES_LOCALES.md
- references/kotlin-state-and-errors.md
- templates/result-state-template.md

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [GDvega](https://github.com/GDvega)
- **Source:** [GDvega/super-android-kotlin-firebase-skill](https://github.com/GDvega/super-android-kotlin-firebase-skill)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-gdvega-super-android-kotlin-firebase-skill-kotlin-core
- Seller: https://agentstack.voostack.com/s/gdvega
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
