Skip to content
Agentmart
Submit a tool

kmp-verify-patterns

How to verify KMP builds: compile checks, lint, common Compose compiler errors, Gradle dependency resolution issues

Skill by giolaq

IndexedMIT-0★ 4
Write a review

Chalk Labs

Need help deploying kmp-verify-patterns?

Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.

Book a call

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/giolaq-kmp-verify-patterns

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

How to verify KMP builds: compile checks, lint, common Compose compiler errors, Gradle dependency resolution issues

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/kmp-verify-patterns

What's inside

Skill name
kmp-verify-patterns
Description
How to verify KMP builds: compile checks, lint, common Compose compiler errors, Gradle dependency resolution issues
License
MIT-0
Instructions
233 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

# KMP Verify Patterns

> After any code change, verify it compiles. Kotlin's type system catches most issues at compile time — if it compiles, it's likely correct. The cost of skipping verification is runtime crashes on the TV.

## Quick verification commands

### Type checking (fastest feedback)

```bash
# Compile shared-core for all targets (Kotlin multiplatform)
./gradlew :shared-core:compileKotlinAndroid

# Compile Android TV app (includes Compose compiler)
./gradlew :androidtv-app:compileDebugKotlin

# Full project compilation (use module-specific tasks to avoid ambiguity)
./gradlew :androidtv-app:compileDebugKotlin :shared-core:compileKotlinMetadata
```

**Use `:shared-core:compileKotlinAndroid`** after editing models/repositories — it's fast (10-20s) and catches type errors across the shared layer.

**Use `:androidtv-app:compileDebugKotlin`** after editing Compose screens — it runs the Compose compiler plugin which catches composable-specific errors.

### Lint / static analysis

```bash
# Android lint (catches common issues)
./gradlew :androidtv-app:lint

# Lint report location
# androidtv-app/build/reports/lint-results-debug.html
```

### Run tests

```bash
# Shared-core unit tests (contract tests for repositories)
./gradlew :shared-core:allTests

# Android TV instrumented tests (requires emulator)
./gradlew :androidtv-app:connectedDebugAndroidTest
```

## Common Compose compiler errors

### 1. `@Composable invocations can only happen from the context of a @Composable function`

**Cause:** Calling a composable from a non-composable (lambda, regular function).

**Fix:** Mark the containing function or lambda as `@Composable`:

```kotlin
// WRONG
val items = list.map { item -> Text(item.title) }

// RIGHT
list.forEach { item ->
    Text(item.title)  // Already inside a @Composable context
}
```

### 2. `Type mismatch: inferred type is Unit but ... was expected`

**Cause:** Compose content lambdas return Unit. If you're assigning the result of a composable call, that's wrong.

**Fix:** Composables are side-effects, not return values. Use state instead:

```kotlin
// WRONG
val text = Text("hello")  // Text returns Unit

// RIGHT
Text("hello")  // Just call it in the composition
```

### 3. `None of the following functions can be called with the arguments supplied`

**Cause:** Often the wrong `Surface` import. `androidx.tv.material3.Surface` vs `androidx.compose.material3.Surface` have different signatures.

**Fix:** Use TV Surface for focusable containers:

```kotlin
import androidx.tv.material3.Surface  // TV version with onClick
// NOT: import androidx.compose.material3.Surface
```

### 4. `Unresolved reference: ExperimentalTvMaterial3Api`

**Cause:** Missing TV Material dependency.

**Fix:** Ensure `build.gradle.kts` has:

```kotlin
implementation("androidx.tv:tv-material:1.0.0-alpha10")
```

And opt-in at the function level:

```kotlin
@OptIn(ExperimentalTvMaterial3Api::class)
@Composable
fun MyTVComponent() { ... }
```

### 5. `Modifier.focusRequester must be used with a FocusRequester that is remember'd`

**Cause:** Creating FocusRequester without `remember`.

**Fix:**
```kotlin
val focusRequester = remember { FocusRequester() }  // Always remember it
```

### 6. `kotlinCompilerExtensionVersion` mismatch

**Cause:** Compose compiler version doesn't match Kotlin version.

**Fix:** For Kotlin 1.9.24, use:
```kotlin

From giolaq/tv-build-harness, MIT-0.

More from giolaq/tv-build-harness

Signals

Stars
4
Forks
0
Open issues
3
Last commit (this folder)
Jun 24, 2026 (4 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT-0
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from giolaq

Done for you

Rather not set it up yourself?

Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.

See how we build AI agents →Read the case studies

Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.

launches shipped
50+
launches shipped
media placements
500+
media placements
founders on every account
2
founders on every account

Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block

Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.

Get kmp-verify-patterns running in your business

Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.

Goes to the Chalk Labs founders, not the newsletter. Privacy

Need help deploying kmp-verify-patterns?

CallGet help
Cite this page

kmp-verify-patterns skill. Agent Mart. https://agentmart.dev/skills/giolaq-kmp-verify-patterns (last updated 2026-10-24)