USE THIS when writing or reviewing Jetpack Compose / Kotlin code in packages/cds-android or apps/android-app - @Composable APIs, Modifier parameters, CompositionLocal, state hoisting, or naming. Not for React or React Native work.
67
80%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
references/compose-api-guidelines.md is the official AOSP Compose API guidelines document,
vendored verbatim. Read it before writing or reviewing a Compose API. It is the authority here;
do not invent house style that contradicts it, and do not paraphrase it from memory.
The document assigns different requirement levels to different audiences. CDS Android is
"Library development based on Jetpack Compose" — we publish @Composable functions and
supporting types for other teams to consume. Read the MUST/SHOULD/MAY markers for that audience,
not the app-development ones. In practice we hold close to the framework-development bar, because
anything we ship publicly is expensive to change later.
These are the ones worth checking on every change. The document explains each in full.
Modifier parameter. It is the first optional
parameter, defaults to Modifier, is applied to the outermost layout node the element emits, and
is used exactly once. Never accept a Modifier and drop it.Unit and are named as PascalCase nouns (Button,
SlideButton) — they declare a piece of UI rather than performing an action.onValueChange callback
over ones that own their state internally.CompositionLocal is for cross-cutting context, not for passing parameters. In this
codebase that means theme. A local should have a sensible default and should not be how a caller
configures a specific component.modifier, then other optional parameters, then a
trailing @Composable content lambda if there is one.Complementary to the guidelines, not covered by them. packages/cds-android/AGENTS.md is the full
version:
:cds compiles with Kotlin explicit API mode. Every public declaration is a customer promise —
make it a decision, not a compiler-satisfying reflex, and default to internal.CdsTheme.colors / CdsTheme.space; author themes with cdsTheme { }.
LocalCdsTheme is public only so custom Modifier nodes can read theme outside composition.apps/android-app compile.The separate component API guidelines go deeper on designing individual components (slots, state holders, styling). Not vendored here; consult it when designing a new component from scratch.
5e282a3
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.