android-design-system-m3
Skill11 starsChanged 8 months agoMITView on GitHub
Use when creating Material 3 design systems, custom themes, or dynamic color implementations in Android apps with Jetpack Compose.
In this repository40 other files it gives its agents.
- .github/copilot-instructions.mdCopilot instructions
- android-accessibilitySkill
- android-adaptive-layoutsSkill
- android-adb-terminalSkill
- android-background-executionSkill
- android-bluetooth-bleSkill
- android-build-verificationSkill
- android-camerax-mlkitSkill
- android-ci-cd-expertSkill
- android-clean-architectureSkill
- android-code-review-expertSkill
- android-coroutines-expertSkill
- android-custom-drawing-canvasSkill
- android-design-to-codeSkill
- android-detekt-expertSkill
- android-enterprise-securitySkill
- android-gemini-nanoSkill
- android-google-workspace-expertSkill
- android-gradle-expertSkill
- android-hardware-testingSkill
- android-jetpack-composeSkill
- android-kmp-compose-uiSkill
- android-kmp-platform-channelsSkill
- android-kmp-sharedSkill
- android-ktlint-formattingSkill
- android-lint-and-qualitySkill
- android-local-stt-ttsSkill
- android-location-mapsSkill
- android-macrobenchmarkSkill
- android-media3-exoplayerSkill
- android-media-and-image-expertSkill
- android-motion-animationsSkill
- android-navigation-expertSkill
- android-offline-firstSkill
- android-performance-auditSkill
- android-rag-localSkill
- android-screenshot-testingSkill
- android-security-hardenedSkill
- android-unit-testingSkill
- android-wear-os-composeSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 4 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 37
Rule: NEVER use hex codes in your UI code.
- Very specific: line 62
When a user asks to "create a new project" or "set up a screen", ALWAYS ensure these three files are explicitly created in the ui/theme …
- Very specific: line 69
Use CompositionLocal or colorScheme extensions to add extra colors not in M3 (e.g., "SuccessGreen").
- Distinctive: line 73
Role: If using XML themes or resources alongside Compose, you MUST use the Material Components for Android XML bridge.
- Very specific: line 74
Dependency: Add com.google.android.material:material to the project.
- Very specific: line 75
Standard Parent: Use Theme.Material3.DayNight.NoActionBar (or variations) as the base parent for your XML themes.
- Very specific: line 76
Attribute Matching: Ensure your XML colorPrimary matches your Compose theme.colorScheme.primary.
- Distinctive: line 96
Contrast Check: Verify your color pairs using accessibility tools.
- Distinctive: line 97
Component Preview: Create a "Kitchen Sink" screen (via Showkase) to see all variations in one place.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Android Design Systems (Material 3) 🎨🛠️
Advanced strategies for building scalable, cohesive, and professional design systems for modern Android applications using the Material 3 (M3) framework.
⚡ When to Use
- Branding Architecture: Defining custom color tokens, typography, and shapes.
- Dark Mode Support: Implementing unified themes that swap automatically.
- Dynamic Color: Using
DynamicColorfor personalized system-wide tinting. - Component Libraries: Building reusable Atom/Molecule components.
- Multi-Brand Support: Creating one app code for multiple visual identities.
🏗️ The 3 Pillars of M3 Design Systems
- Color Scheme: Light/Dark palettes, surface variations, and semantic tokens (Primary, Error, OnPrimary).
- Typography: Defined scales (HeadlineLarge, BodyMedium, LabelSmall) based on modern fonts.
- Shapes: Corner radii for cards, buttons, and surfaces.
🧱 Creating Your Theme
- Rule: NEVER use hex codes in your UI code. ALWAYS use semantic tokens from your theme.
- Bad:
color = Color(0xFFAA44CC) - Good:
color = MaterialTheme.colorScheme.primary
1. The Theme Composable
@Composable
fun AppTheme(
darkTheme: Boolean = isSystemInDarkTheme(),
dynamicColor: Boolean = true,
content: @Composable () -> Unit
) {
val colorScheme = when {
dynamicColor && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S -> {
if (darkTheme) dynamicDarkColorScheme(context) else dynamicLightColorScheme(context)
}
darkTheme -> DarkColorScheme
else -> LightColorScheme
}
MaterialTheme(colorScheme = colorScheme, typography = Typography, shapes = Shapes, content = content)2. Mandatory Scaffold Files
When a user asks to "create a new project" or "set up a screen", ALWAYS ensure these three files are explicitly created in the ui/theme package to prevent Theme not found errors:
Theme.kt(containing the main Theme composable)Color.kt(containing hex colors and M3 ColorSchemes)Type.kt(containing Compose Typography)
- Provide these files outright if they are missing.
2. Custom Color Extensions
Use CompositionLocal or colorScheme extensions to add extra colors not in M3 (e.g., "SuccessGreen").
3. XML Theme Interoperability (Mandatory Bridge)
- Role: If using XML themes or resources alongside Compose, you MUST use the Material Components for Android XML bridge.
- Dependency: Add
com.google.android.material:materialto the project. - Standard Parent: Use
Theme.Material3.DayNight.NoActionBar(or variations) as the base parent for your XML themes. - Attribute Matching: Ensure your XML
colorPrimarymatches your Composetheme.colorScheme.primary.
🚀 Premium Implementation Best Practices
- Design Tokens: Match your variable names exactly with Figma tokens (e.g.,
md_sys_color_primary). - Material 3 Shapes: Use RoundedCornerShape(8dp) for cards but (32dp) for buttons for modern hierarchy.
- Elevation: Use
SurfaceorMaterialTheme.colorScheme.surfaceColorAtElevation()instead of shadow modifiers for modern translucent effects. - Icons: Use the Material Symbols official icons with uniform sizes (typically 24dp).
📐 Typography Rules
- Display: For landing pages or large hero text.
- Headline: For navigation or section headers.
- Title: For list items or subtitles.
- Body: For main readable content.
- Label: For metadata or button text.
🧪 Testing Your Design System
@PreviewLightDark: See both light and dark themes at a glance.- Contrast Check: Verify your color pairs using accessibility tools.
- Component Preview: Create a "Kitchen Sink" screen (via Showkase) to see all variations in one place.
📜 Checklist for Consistency
- Surface Tones: Are secondary surfaces (e.g., Background vs Surface) distinct?
- Focus States: Do interactive elements have clear focus states for keyboard/stylus users?
- Loading States: Are shimmer and progress indicators consistent with the theme?
- Empty States: Do all screens have a themed "No data" or "Error" state?
🔗 Related Resources
- Official Material 3 Guide
- Design to Code Skill
- Accessibility Skill
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.

