---
title: "Making AI Write Android Code Our Way: A Practical Guide to Agent Skills"
description: "An Android team at Medium describes how it encoded its project conventions so AI assistants generate code aligned with Clean Architecture, Kotlin, Jetpack Compose, Hilt, Apollo GraphQL, and feature modules. An AGENTS.md file provides persistent context about module structure, dependency injection, state management, navigation, testing, and commands, while Markdown skills in .agents/skills/ provide ordered runbooks for specific tasks. Examples cover scaffolding screens and feature modules, migrating Material 2 to Material 3, enforcing ViewModel feature-flag handling, and adding deeplinks, analytics, translations, and tests. Detailed patterns include ViewModel-injecting and @VisibleForTesting composables, assisted injection, StateFlow, Result, MockK, Turbine, and Robolectric. The team iterates skills from review feedback, keeps them version-controlled, and plans file-aware rules plus commands for release diffs and reporting."
---

# Making AI Write Android Code Our Way: A Practical Guide to Agent Skills

[Medium](https://yomu.fyi/company/medium) · Pierrick CAEN · Mar 17, 2026

**Type:** Tutorial

## Summary

An Android team at Medium describes how it encoded its project conventions so AI assistants generate code aligned with Clean Architecture, Kotlin, Jetpack Compose, Hilt, Apollo GraphQL, and feature modules. An AGENTS.md file provides persistent context about module structure, dependency injection, state management, navigation, testing, and commands, while Markdown skills in .agents/skills/ provide ordered runbooks for specific tasks. Examples cover scaffolding screens and feature modules, migrating Material 2 to Material 3, enforcing ViewModel feature-flag handling, and adding deeplinks, analytics, translations, and tests. Detailed patterns include ViewModel-injecting and @VisibleForTesting composables, assisted injection, StateFlow, Result, MockK, Turbine, and Robolectric. The team iterates skills from review feedback, keeps them version-controlled, and plans file-aware rules plus commands for release diffs and reporting.

## Context

The team’s coding conventions were distributed across pull-request comments, Slack threads, and experienced engineers’ knowledge. Generic AI-generated Kotlin missed the team’s architecture, component library, conventions, and testing style.

## Approach / What changed

The team uses a root AGENTS.md file for broad project context and version-controlled Markdown skills in .agents/skills/ for detailed, step-by-step workflows. The skills cover scaffolding, migrations, pattern enforcement, and repetitive tasks, and are refined from review feedback and example pull requests.

## Takeaways

- AGENTS.md documents module structure, Hilt dependency injection, StateFlow and SharedFlow state management, centralized navigation, repository patterns, testing strategy, and common Gradle and Detekt commands.
- The create-compose-screen skill produces a ViewModel-injecting composable and a separate @VisibleForTesting overload, along with previews, test tags, listeners, and supporting files.
- The team plans to replace the broad AGENTS.md context with file-aware rules that activate for relevant Compose, repository, testing, or ViewModel files.

**Tags:** [AI Agents](https://yomu.fyi/topic/ai-agents), [Android](https://yomu.fyi/topic/android), [Jetpack Compose](https://yomu.fyi/topic/jetpack-compose), [Kotlin](https://yomu.fyi/topic/kotlin)

- Source: [Medium](https://medium.engineering/making-ai-write-android-code-our-way-a-practical-guide-to-agent-skills-4e7b085d8e50)
- Source URL: https://medium.engineering/making-ai-write-android-code-our-way-a-practical-guide-to-agent-skills-4e7b085d8e50
- Ingested by Yomu: 2026-09-09T16:03:35.687Z

[Read original post](https://medium.engineering/making-ai-write-android-code-our-way-a-practical-guide-to-agent-skills-4e7b085d8e50)
