compose-multiplatform
Skill0 starsChanged 32 days agoMITView on GitHub
Compose Multiplatform discipline: shared UI in commonMain, multiplatform resources (Res, not R), Android-only Compose APIs kept in androidMain, and the single-Activity no-Fragments architecture. Use when writing or reviewing CMP UI code, wiring resources, or moving a screen from Android to shared code. Core rules have machine checks in checks/.
4 other projects use a version of this.
Adopted by
Most recently taken up by
- davidanthonyn/claude-skillstheir own version, first seen Oct 20, 2026
- jwuthri-cloud/Tracely-aitheir own version, first seen Oct 20, 2026
- AThevon/genjutsutheir own version, first seen Sep 28, 2026
- Jwuthri/Tracely-aitheir own version, first seen Jul 28, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- Jwuthri/Tracely-ai★ 1.3ksame name
- jwuthri-cloud/Tracely-ai★ 979same name
- AThevon/genjutsu★ 758same name
- davidanthonyn/claude-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository11 other files it gives its agents.
- android-testingSkill
- compose-architectureSkill
- compose-migrationSkill
- compose-performanceSkill
- compose-testingSkill
- dependency-injectionSkill
- gradle-build-logicSkill
- kmp-fundamentalsSkill
- material3-themingSkill
- offline-firstSkill
- release-engineeringSkill
The file
We split this skill into the rules it gives an agent
6 rules. 0 are common, 5 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
5
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 15
After ANY shared-UI edit, run the Verification step (bottom of this file).
- Very specific: line 27
MUST use Compose Multiplatform resources in common code: files under composeResources/, accessed through the generated Res accessors with …
- Distinctive: line 53
MUST NOT import Android-only Compose APIs from common code — they are "closely tied to the Android platform and are therefore not available …
- Distinctive: line 80
MUST NOT use Fragments or AppCompat classes in common UI code: "For Compose-only apps, do not use Fragments and instead use the recommended …
- Distinctive: line 109
Run after any shared-UI edit (from the module's src root):
- Distinctive: line 117
All three must pass (exit 0) before declaring the task done.
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Compose Multiplatform
Operational rules for a coding agent. RIGHT/WRONG pairs are canonical. After ANY shared-UI edit, run the Verification step (bottom of this file).
1. Share the UI, split only the edges
CMP "shares the Compose compiler and runtime with Jetpack Compose and uses
the same APIs" — screens, themes, components, navigation, and ViewModels
belong in commonMain. Keep in platform source sets only entry points and
platform quirks (Android MainActivity + setContent, iOS MainViewController),
platform interop, and window handling.
2. Resources — Res, not R
MUST use Compose Multiplatform resources in common code: files under
composeResources/, accessed through the generated Res accessors with
stringResource(Res.string.x) / painterResource(Res.drawable.x) from
org.jetbrains.compose.resources. MUST NOT use the Android R class in
common code — "Compose Multiplatform uses the Res class via its resources
library; Android uses the R class".
WRONG:
// commonMain
import com.example.app.R
Text(text = stringResource(R.string.feed_title))RIGHT:
// commonMain
import org.jetbrains.compose.resources.stringResource
import com.example.composeapp.generated.resources.Res
Text(text = stringResource(Res.string.feed_title))3. Android-only Compose APIs stay in androidMain
MUST NOT import Android-only Compose APIs from common code — they are
"closely tied to the Android platform and are therefore not available from
common Compose Multiplatform code". The usual suspects the check flags:
LocalContext / LocalView / LocalConfiguration,
androidx.compose.ui.res.* (Android stringResource, painterResource),
and AndroidView. Reach them through expect/actual, or use the CMP
equivalents (org.jetbrains.compose.resources.*; on iOS LocalUIViewController
/ UIKitView).
WRONG:
// commonMain
import androidx.compose.ui.platform.LocalContext
val context = LocalContext.currentRIGHT:
// commonMain
expect fun appContext(): PlatformContext // actualized per platform
// androidMain
actual fun appContext(): PlatformContext = LocalContext.current4. No Fragments in a Compose-only app
MUST NOT use Fragments or AppCompat classes in common UI code: "For Compose-only apps, do not use Fragments and instead use the recommended Compose-only architecture with a single Activity". Fragments exist only during a View→Compose migration (see the compose-migration skill).
WRONG:
// commonMain
class FeedFragment : Fragment()RIGHT:
// commonMain
@Composable
fun FeedScreen(viewModel: FeedViewModel = koinViewModel()) // screen-level composable5. Version compatibility (review-verified)
CMP "builds on code and releases published by Google"; on Android the Google artifacts are used directly and elsewhere the JetBrains multiplatform mirrors — substitution is automatic via Gradle Module Metadata. When bumping Kotlin or CMP, consult the "Compatibility and versions" map (references/multiplatform.md #2) before touching code; the Compose compiler ships inside the Kotlin plugin since Kotlin 2.0.
Verification
Run after any shared-UI edit (from the module's src root):
bash <skill-dir>/checks/check_no_r_class_in_common.sh <src-root>
bash <skill-dir>/checks/check_no_android_only_compose_apis.sh <src-root>
bash <skill-dir>/checks/check_no_fragments_in_common.sh <src-root>All three must pass (exit 0) before declaring the task done. Checks are deterministic import/usage heuristics over commonMain/commonTest; the Android-only API list in §3 is the documented heuristic subset — extend it for stricter setups. §1 and §5 are review-verified against references/multiplatform.md.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

