
Ready to transform how you build Android apps? Today, we're going on an exciting journey into the world of AI-assisted development. You'll learn how to collaborate with AI agents using the Antigravity CLI by creating clear, structured documents that make them incredibly effective. Think of it as learning to speak the language of your new AI partner!
By the end of this adventure, you'll have a fully functional Android app and a toolkit of AI prompting skills that you can use on any project. Ready to dive in? π
β¨ A rock-solid Product Requirements Document (PRD.md)
π€ A personalised AI Agent configuration (android-specialist.md)
π οΈ A reusable State Management Skill (state-management.md)
π§ͺ Unit Testing Skill (Bonus)
π A sleek Note Taker Android app with up-to-date documentation via Context7
In this workshop, we will use the Antigravity CLI, a powerful terminal-based agent that can read your codebase, manage project files, and help you architect your app from the ground up.
A personal @gmail.com account (see Prerequisites)
About 45 minutes of focused time
A basic understanding of Android development (Kotlin & Compose)
Android Studio installed (to run and test your app easily)
To ensure a smooth experience during this workshop, please review and complete these prerequisites.
Install the CLI:Run the following command in your terminal:
# macOS/Linux
curl -fsSL https://antigravity.google/cli/install.sh | bash
# Windows
curl -fsSL https://antigravity.google/cli/install.cmd -o install.cmd && install.cmd && del install.cmd
Authenticate:Run the CLI in your terminal and select "Sign in with Google":
agy

Download and install the latest version of Android Studio to build and run your application:
downloadDownload Android StudioDuring the workshop, the workflow remains the same regardless of what you build:
Guided: Follow this Codelab to build a sample application from scratch.
Independent: Bring a specific idea, a small feature, or a prototype you want to build using these AI tools.
Now that you've installed the Antigravity CLI, let's get your project workspace ready!
Create your project space:Open your terminal and run:
mkdir -p my-note-taker/.gemini/{prd,skills,agents}
cd my-note-taker
Verify Authentication:Run agy in your terminal to ensure you're signed in. If not, follow the prompt to "Sign in with Google."
Let's start with the most important part: the Product Requirements Document (PRD). This is the heart of your projectβit's the source of truth that helps your AI assistant understand exactly what you're dreaming of building!
Copy this prompt and get ready to see Gemini's magic in action:
Act as a Senior Android Architect.
Create a Product Requirements Document (PRD) for a "Note Taker" Android app and save it to `.gemini/prd/PRD.md`.
Please ensure that the markdown file begins with the following frontmatter:
---
name: Note Taker Android App
description: An Android application for taking notes.
version: 0.1.0
---
REQUIREMENTS:
- Kotlin & Jetpack Compose
- MVVM Architecture
- In-memory storage (StateFlow) for simplicity
- Material 3 Expressive Design
Ask me clarifying questions, one at a time.
Launch Antigravity CLI:
agy
Paste the prompt into the interactive shell.
Once generated, the tool will ask for permission to write the file.

Now, let's give your AI assistant a personality and some clear instructions. This android-specialist.md file will define how your AI partner thinks and works, ensuring they always follow your lead and technical standards.
Create an agent configuration for an AI coding assistant and save it to `.gemini/agents/android-specialist.md`.
Please ensure that the markdown file begins with the following frontmatter:
---
name: Android Specialist
description: A senior Android engineer specialising in Kotlin and Compose.
skills: [state-management]
prompt: "You are a Senior Android Engineer specialising in Kotlin and Jetpack Compose..."
version: 0.1.0
---
CONTEXT:
- Kotlin & Jetpack Compose
- MVVM Architecture
- In-memory data management
- Material 3 Expressive Design
STRUCTURE:
1. ROLE: Persona (senior Android engineer, Kotlin/Compose specialist)
2. BEHAVIOR: How to work (read PRD first, use tools, test code)
3. COMMUNICATION: Style (concise, direct, professional)
4. TECHNICAL STANDARDS:
- Modern Android Development (MAD)
- Google's ViewModel (Architecture Components)
- Repository Pattern (using in-memory data)
- Material 3 Expressive Design
- Gradle (Kotlin DSL) as the build system, generate all the files required for building the app in Android Studio
- Use gradle wrapper and latest gradle and AGP versions
- Version Catalogs (libs.versions.toml) for dependencies
5. PROHIBITED:
- No legacy View system (XML layouts)
- No hardcoded dependency versions (use TOML)
- No God-objects
Format as markdown with clear sections.
Paste the prompt into the agy shell.
Review the generated configuration.
Once generated, the tool may ask for permission to write the file if you have not allowed it for the session.
Skills are like "mini-manuals" that teach your AI exactly how to handle specific tasks. Let's create one for managing data, giving your assistant the expertise it needs to be super reliable!
Create a SKILL document: "State Management with StateFlow" and save it to `.gemini/skills/state-management.md`.
Please ensure that the markdown file begins with the following frontmatter:
---
name: State Management with StateFlow
description: Manage app state safely using Kotlin StateFlow and Compose.
version: 0.1.0
---
STRUCTURE:
## SKILL: State Management
### Purpose
Safe, reactive state management using StateFlow in ViewModels.
### When to Use
- Managing UI state for lists, forms, or navigation.
- Caching data in memory during the app session.
### Mandates (REQUIRED)
1. Use `MutableStateFlow` for internal state and `StateFlow` for exposure.
2. Update state atomically using `.update { ... }`.
3. Use `collectAsStateWithLifecycle()` in Compose.
4. Keep the ViewModel agnostic of the UI.
### Prohibited (FORBIDDEN)
- Never use `MutableState` (Compose State) inside a ViewModel; prefer StateFlow.
- Don't expose `MutableStateFlow` directly to the View.
### Example Implementation
```kotlin
data class NoteUiState(
val notes: List<Note> = emptyList(),
val isLoading: Boolean = false
)
class NoteViewModel : ViewModel() {
private val _uiState = MutableStateFlow(NoteUiState())
val uiState: StateFlow<NoteUiState> = _uiState.asStateFlow()
fun addNote(note: Note) {
_uiState.update { it.copy(notes = it.notes + note) }
}
}
```
Paste the prompt into the agy shell.
Review the skill documentation.
Once generated, the tool may ask for permission to write the file.
Now for the best part! We're going to use all those documents you just created to build your actual app. It's time to see your hard work pay off!
It's time to let the AI do the heavy lifting while you take the lead as the architect. This is where your vision truly becomes reality!
Prompt:
Build a note taker app following these documents:
PRD: @.gemini/prd/PRD.md
AGENT: @.gemini/agents/android-specialist.md
SKILL: @.gemini/skills/state-management.md
Create the following components:
1. Note data class
2. ViewModel using the State Management SKILL
3. Compose UI for listing and adding notes
Features:
- Add note
- Delete note
- List notes in a scrollable list
- Material 3 styling
Follow ALL PRD constraints. Use in-memory storage for now.
Paste the build prompt into the agy shell.
The agent will read your documents and propose file creations/updates.
Review the code and allow the tool to write the files if needed.
To run your app, we'll use Android Studio. It provides a pre-configured environment with everything you need.
Open Android Studio.
Open your project folder (my-note-taker).
Wait for Gradle to sync (this might take a minute).
Run the app on an emulator or a real device by clicking the green "Play" icon.
Verify your features:
β Add notes
β Delete notes
β See them appear in the list
Want to take things to the next level? You can give your AI assistant access to the latest documentation and code examples using Context7. This ensures your partner is always up-to-date and helps you avoid "AI hallucinations" from outdated training data!
Context7 is an open-source Model Context Protocol (MCP) server developed by Upstash designed to provide AI coding assistants (like Cursor, Claude, and Windsurf) with up-to-date, version-specific documentation.
Go to the Context7 Dashboard:
Create an account (using your GitHub or Google account).
Sign in and generate your Context7 API key.

Choose the method that fits your workflow:
Install the Context7 CLI to automatically configure your MCP server.
Install the CLI: Choose your preferred package manager:
# Using npm
npm install -g ctx7
# OR using Homebrew (macOS)
brew install ctx7
Run the setup:
ctx7 setup
Follow the prompts to sign in. The CLI will automatically detect and configure your MCP clients (Antigravity CLI, Cursor, etc.).
If you prefer not to install it globally, you can manually configure the settings.
Get your API Key: Follow the "Get Your API Key" steps above.
Open settings file:
# Create if doesn't exist
mkdir -p ~/.gemini
touch ~/.gemini/settings.json
Edit ~/.gemini/settings.json:
~/.gemini/settings.json
{
"mcpServers": {
"context7": {
"httpUrl": "https://mcp.context7.com/mcp",
"headers": {
"CONTEXT7_API_KEY": "YOUR_API_KEY",
"Accept": "application/json, text/event-stream"
}
}
}
}
Verify:
agy
# In the CLI, type: /mcp list
Natural prompts:
Use context7 to find the latest documentation for StateFlow and Coroutines.
What is the newest way to handle navigation in Jetpack Compose? Use context7.
Check context7 for the correct API usage for the latest Material 3 components.
Why it matters:By using Context7, your AI assistant stays informed about the latest tools and libraries, reducing bugs and ensuring you're using modern, secure patterns. π
Available MCP tools:
resolve-library-id - Find library identifiers
get-library-docs - Fetch latest documentation
Ready for one last skill? Let's teach your AI how to write tests for your code, ensuring everything is rock-solid and works perfectly every single time.
Prompt:
Create a SKILL document: "Unit Testing for Android" and save it to `.gemini/skills/unit-testing.md`.
Please ensure that the markdown file begins with the following frontmatter:
---
name: Unit Testing for Android
description: Ensure code reliability using JUnit and Turbine for Flow testing.
version: 0.1.0
---
STRUCTURE:
## SKILL: Unit Testing
### Purpose
Ensure business logic is correct using unit tests.
### When to Use
- Testing ViewModels
- Testing Repositories
- Testing utility functions
### Mandates (REQUIRED)
1. Use JUnit 4/5.
2. **Use Turbine for all Flow/StateFlow testing.**
3. Test both success and error states.
4. Keep tests isolated from Android framework dependencies.
### Example Implementation
```kotlin
class NoteViewModelTest {
@Test
fun `when adding a note, uiState emits new state`() = runTest {
val viewModel = NoteViewModel()
viewModel.uiState.test {
// Initial state
assert(awaitItem().notes.isEmpty())
viewModel.addNote(Note(title = "Title", content = "Content"))
// Updated state
val updatedState = awaitItem()
assert(updatedState.notes.size == 1)
assert(updatedState.notes[0].title == "Title")
}
}
}
```
Run the above prompt and watch Gemini write unit tests for you.
Run tests in Android Studio: Open the test file and click the double green arrows next to the class name.
You did it! π You've gone from zero to a fully functional, AI-powered Android app using the Antigravity CLI. More importantly, you've mastered the art of "guiding" AI with structured documentation.
β¨ Structured AI Docs: You created a PRD, AGENT, and SKILL files for Android.
π± A Real Android App: You built a complete note taker using Compose and StateFlow.
π§ Up-to-date Intelligence: You gave your AI the latest documentation via Context7.
π New Workflows: You've learned a faster, more architectural way to build mobile apps using a hybrid CLI-IDE approach.
The Old Way:
Fighting with Gradle and XML layouts
Endless searching for "how to handle state" on SO
Writing repetitive boilerplate manually
The New Way (The AI Way!):
Defining clear, high-level requirements
Guiding AI with structure and context
Focusing on architecture and reviewing outcomes
Leveraging the best of both worlds: CLI for AI collaboration and IDE for stable execution.
Antigravity CLI
Context7
Android Studio (for building, running, and testing)
The sky's the limit! Why not try:
Adding persistent storage using Room (the next step!)
Building a new skill for WorkManager (syncing notes)
Sharing your PRD template with your mobile team
Integrating Context7 into your professional Android projects
Android Developers: developer.android.com
Google Skills: github.com/google/skills
Context7: github.com/upstash/context7