compose-resources-kmp

Organize shared images, fonts, and strings in Compose Multiplatform composeResources.

Updated Sep 12, 2026
One-click install
npx skills add https://github.com/Vierco/citoVisionApp --skill compose-resources-kmp-vierco
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: compose-resources-kmp
Source: https://github.com/Vierco/citoVisionApp/tree/main/.claude/skills/compose-resources-kmp
Command: npx skills add https://github.com/Vierco/citoVisionApp --skill compose-resources-kmp-vierco

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Managing images, fonts, and UI strings across Android, iOS, and Desktop often leads to duplicated resources, hardcoded strings, and inconsistent translations. This Skill defines how to use the official Compose Multiplatform composeResources system so all shared resources live once in commonMain and are accessed through the type-safe generated Res accessor. ## Core Features & Use Cases - Shared resource organization: Places images in drawable/, fonts in font/, strings in values/strings.xml, and other files in files/ under commonMain/composeResources. - Type-safe access: Enforces access via the generated Res object with painterResource(), Font(), and stringResource() instead of raw paths or hardcoded literals. - i18n consistency: Requires every supported language to have a values-<locale>/strings.xml containing exactly the same keys as the default file. - Use Case: Add the Dongle font and a welcome string to a Kotlin Multiplatform app, then render them identically on Android, iOS, and Desktop without duplicating files per platform. ## Quick Start Ask the assistant to add a shared image, font, or translatable UI string to the Compose Multiplatform project using composeResources and reference it from a Composable.

Frequently Asked Questions about compose-resources-kmp

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add shared images in Compose Multiplatform?▼

Place PNG, JPEG, WebP, or compatible vector XML files in commonMain/composeResources/drawable, then sync the project to regenerate the Res class. Reference them in Composables with painterResource(Res.drawable.your_image) instead of raw paths.

How to load custom fonts in Kotlin Multiplatform Compose?▼

Put .ttf or .otf files in composeResources/font and load them with Font(Res.font.your_font, FontWeight.Normal) inside a FontFamily. This replaces the old manual expect/actual font pattern, which is obsolete since Compose Multiplatform 1.6.

Does composeResources support multiple languages for strings?▼

Yes, create a values-<locale>/strings.xml for each language with exactly the same keys as the default values/strings.xml. Missing keys in any supported language cause inconsistent fallback behavior across platforms.

Why does my code show unresolved reference Res in Compose Multiplatform?▼

The Res class is generated during build, so you must sync or compile the project after adding resources before referencing them. Also verify the compose.components.resources dependency is declared in commonMain.

When should resources stay in androidMain instead of composeResources?▼

Platform-specific resources like Android notification icons or native Xcode splash assets should remain in androidMain/res or the Xcode project. Only resources shared across multiple platforms belong in commonMain/composeResources.