Debugging guide for Android Kotlin and Jetpack Compose development.

Install

mkdir -p .claude/skills/debug-woliveiras && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/10732" && unzip -o skill.zip -d .claude/skills/debug-woliveiras && rm skill.zip

Installs to .claude/skills/debug-woliveiras

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Debugging workflow for the Android (Kotlin + Jetpack Compose) app. Use when tracking down runtime errors, unexpected behavior, network issues, or state problems. Trigger phrases: "debug", "não está funcionando", "erro em runtime", "por que isso falha", "breakpoint", "/debug".
276 chars✓ has a “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Intermediate

Key capabilities

  • Analyze logcat
  • Inspect layout trees
  • Profile network requests
  • Diagnose runtime crashes

How it works

It provides a structured workflow for diagnosing Android issues using standard tools like Logcat, Layout Inspector, and Profilers.

Inputs & outputs

You give it
Symptom or error
You get back
Diagnostic report

When to use debug

  • Debugging runtime crashes
  • Inspecting ui trees
  • Debugging network request issues
  • Investigating state management problems

About this skill

Debugging — Android / Jetpack Compose

Tools available

ToolWhat it debugs
Logcat (adb logcat)Runtime logs, crashes, ANRs
Android Studio DebuggerBreakpoints, step-through, evaluate
Layout InspectorCompose tree, recomposition counts
Network ProfilerOkHttp requests/responses
./gradlew test --infoUnit test failures with stack traces

Step-by-step workflow

1. Identify the layer

SymptomLikely layerStart here
Compilation errorKotlin / Gradle./gradlew compileDebugKotlin 2>&1 | grep "^e:"
Test failureUnit logic./gradlew test --tests "ClassName" --info
Crash on startupHilt / ActivityLogcat for FATAL EXCEPTION
Wrong data shownRepository / APIArxivApiServiceImpl.kt, repository layer
State not updatingViewModelStateFlow emissions, check viewModelScope
Navigation brokenNavHostMainActivity.kt routes
PDF not openingIntent / FileProviderDetailViewModel.kt download logic
DataStore lostPersistenceSettingsDataStore.kt

2. Check Logcat first

adb logcat -s "paperstack" "*:E"   # errors only
adb logcat | grep -E "FATAL|Exception|Error"

Or filter by package:

adb logcat --pid=$(adb shell pidof com.paperstack)

3. Inspect network (arXiv API)

Add temporary logging in ArxivApiServiceImpl.kt:

Log.d("ArxivApi", "request: $url")
Log.d("ArxivApi", "response code: ${response.code}")
Log.d("ArxivApi", "body: ${response.body?.string()}")  // remove after debug

Never commit Log.d calls — remove before PR.

4. Inspect ViewModel state

Add temporary logging in the ViewModel:

Log.d("FeedVM", "state: ${_state.value}")

Or use the debugger: set a breakpoint in the ViewModel and inspect _state.value.

5. Isolate with a unit test

If the bug is in a service or repository, write a failing test:

./gradlew test --tests "com.paperstack.data.remote.ArxivApiServiceImplTest" --info

This is often faster than running the full app.

6. XML parsing issues

If the arXiv response parses incorrectly:

  1. Log the raw XML (step 3)
  2. Create a test fixture in the test class
  3. Run parseResponse() against it with MockWebServer
  4. Adjust XmlPullParser logic — do NOT switch to regex parsing

7. Hilt / DI issues

IssueFix
UninitializedPropertyAccessExceptionMissing @Inject or @HiltViewModel
MissingBindingCheck @Module / @Provides in di/
Kotlin metadata unsupportedClean build: ./gradlew clean assembleDebug
Hilt compilation errorVerify KSP + Hilt versions are compatible

8. Compose-specific

IssueFix
Recomposition loopCheck mutable state reads in composables
@OptIn requiredAdd @OptIn(ExperimentalMaterial3Api::class)
Unresolved referenceVerify import + dependency in build.gradle.kts
Preview crashEnsure @Preview composable has no Hilt deps

Anti-patterns

  • ❌ Leaving Log.d in committed code
  • ❌ Using !! to silence nullability — fix the null check
  • ❌ Suppressing lint warnings to work around a bug
  • ❌ Debugging state by reading DataStore directly — use ViewModel StateFlow
  • ❌ Guessing at XML structure — always log the raw response first

When not to use it

  • Non-Android development

Prerequisites

ADBAndroid Studio

Limitations

  • Requires physical or virtual device

How it compares

It is specifically optimized for Kotlin and Jetpack Compose development patterns.

Compared to similar skills

debug side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
debug (this skill)03moReviewIntermediate
android-kotlin-development2685moReviewAdvanced
kotlin-multiplatform323moReviewAdvanced
android-kotlin74moNo flagsIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

android-kotlin-development

aj-geddes

Develop native Android apps with Kotlin. Covers MVVM with Jetpack, Compose for modern UI, Retrofit for API calls, Room for local storage, and navigation architecture.

268679

kotlin-multiplatform

vitorpamplona

Platform abstraction decision-making for Amethyst KMP project. Guides when to abstract vs keep platform-specific, source set placement (commonMain, jvmAndroid, platform-specific), expect/actual patterns. Covers primary targets (Android, JVM/Desktop, iOS) with web/wasm future considerations. Integrates with gradle-expert for dependency issues. Triggers on: abstraction decisions ("should I share this?"), source set placement questions, expect/actual creation, build.gradle.kts work, incorrect placement detection, KMP dependency suggestions.

32156

android-kotlin

alinaqi

Android Kotlin development with Coroutines, Jetpack Compose, Hilt, and MockK testing

729

testing-android-code

bitwarden

This skill should be used when writing or reviewing tests for Android code in Bitwarden. Triggered by "BaseViewModelTest", "BitwardenComposeTest", "BaseServiceTest", "stateEventFlow", "bufferedMutableSharedFlow", "FakeDispatcherManager", "expectNoEvents", "assertCoroutineThrows", "createMockCipher", "createMockSend", "asSuccess", "Why is my Bitwarden test failing?", or testing questions about ViewModels, repositories, Compose screens, or data sources in Bitwarden.

611

gradle-expert

vitorpamplona

Build optimization, dependency resolution, and multi-module KMP troubleshooting for AmethystMultiplatform. Use when working with: (1) Gradle build files (build.gradle.kts, settings.gradle), (2) Version catalog (libs.versions.toml), (3) Build errors and dependency conflicts, (4) Module dependencies and source sets, (5) Desktop packaging (DMG/MSI/DEB), (6) Build performance optimization, (7) Proguard/R8 configuration, (8) Common KMP + Android Gradle issues (Compose conflicts, secp256k1 JNI variants, source set problems).

19

reviewing-changes

bitwarden

Guides Android code reviews with type-specific checklists and MVVM/Compose pattern validation. Use when reviewing Android PRs, pull requests, diffs, or local changes involving Kotlin, ViewModel, Composable, Repository, or Gradle files. Triggered by "review PR", "review changes", "check this code", "Android review", or code review requests mentioning bitwarden/android. Loads specialized checklists for feature additions, bug fixes, UI refinements, refactoring, dependency updates, and infrastructure changes.

12

Search skills

Search the agent skills registry