agentleFS
prasad-vennamprasad-vennam/Awesome-Android-AI-Agent-Skills/skills/android-design-to-code/SKILL.md

android-design-to-code

Skill11 starsChanged 8 months agoMITView on GitHub

Use when translating Figma, Sketch, or Adobe XD designs into Jetpack Compose code for Android.

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 3 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Semantic Match: Use MaterialTheme tokens (Primary, BodyLarge) instead of raw hex/pixel values.

    line 30
  2. Distinctive:

    Interaction Fidelity: Add the correct hover, press, and click ripple effects.

    line 32
  3. Very specific:

    Use 8.dp, 16.dp, 24.dp, etc.

    line 39
  4. Very specific:

    Don't just copy the 0xFFAABBCC.

    line 43
  5. Distinctive:

    Use the M3 Typography scale (HeadlineLarge, BodyMedium) to match the designer's intent.

    line 44
  6. Very specific:

    Ripple Effects: Ensure all clickable modifiers have the standard ripple or custom Indication.

    line 58
  7. Very specific:

    Haptics: Add LocalHapticFeedback for tactile confirmation on success/error.

    line 60

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Android Design to Code (The Bridge) 📐🌉

Professional strategies for translating high-fidelity design specifications into clean, semantic, and pixel-perfect Jetpack Compose code.

⚡ When to Use

  • UI Handover: Implementing a new screen from Figma/Sketch.
  • Micro-Copy: Translating exact text styles and case formatting.
  • Grid Alignment: Replicating specific spacing and layout grids.
  • Component Building: Creating atoms/molecules from design symbols.
  • Pixel Perfection: Verifying accuracy through developer tools.

🏗️ The 4 Principles of High-Fidelity Translation

  1. Semantic Match: Use MaterialTheme tokens (Primary, BodyLarge) instead of raw hex/pixel values.
  2. Structural Accuracy: Replicate Flexbox (Row, Column) and Constraint systems as intended.
  3. Interaction Fidelity: Add the correct hover, press, and click ripple effects.
  4. Responsive Layouts: Handle how the design should shrink or grow beyond the mock's dimensions.

🛠️ Translation Workflow

1. Spacing & Grids (The 8dp Rule)

  • Rule: Most modern Android designs use an 8dp grid.
  • Use 8.dp, 16.dp, 24.dp, etc.
  • In Compose: Spacer(Modifier.height(16.dp)) or PaddingValues(16.dp).

2. Colors & Typography

  • Don't just copy the 0xFFAABBCC. Check if it's already in the colorScheme.primary or surface.
  • Use the M3 Typography scale (HeadlineLarge, BodyMedium) to match the designer's intent.

3. Shadows & Elevation

  • Designs often have custom "Soft Shadows".
  • Rule: In Android, use Modifier.shadow() with a high elevation for M2, or use MaterialTheme.colorScheme.surfaceColorAtElevation() for modern M3 designs.

🚀 Speeding Up Implementation

  • Figma Plugins: Use "Relay" or "Copy as Compose" plugins to generate base code.
  • Lottie/Rive: Export complex animations as JSON or RIV files for pixel-perfect motion.
  • Vector Assets: Export as SVG or VectorDrawable (AVD) for sharp rendering.

📐 Interaction Best Practices

  • Ripple Effects: Ensure all clickable modifiers have the standard ripple or custom Indication.
  • States: Implement all design states (Enabled, Disabled, Pressed, Hovered).
  • Haptics: Add LocalHapticFeedback for tactile confirmation on success/error.

🧪 Verification & Checklist

  • The "Overlay" Test: Use a semi-transparent screen capture of the design overlaid on the running app.
  • Layout Inspector: Verify all margins, paddings, and alignment match the specs.
  • Dynamic Font Scales: Does the design survive a 200% font size increase?
  • Localization: Does the layout break with long German or Russian strings?

📜 Key Terms for Designers

  • dp: Density-independent pixels (The standard).
  • sp: Scalable pixels (For text only).
  • Material 3: The framework we use to build.
  • Composable: The UI function we are creating.

🔗 Related Resources

  • Android Adaptive Layouts
  • Design System (M3) Skill
  • Accessibility Skill

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.