Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an android/AGENTS.md guide intended to help LLM agents work effectively within the Android Source design-system library, documenting structure, patterns, and common workflows.
Changes:
- Introduces
android/AGENTS.mddescribing architecture, module layout, key component patterns, and day/night + theming conventions. - Documents common Gradle build/test/release commands (Paparazzi, Kotlinter, Detekt, Metalava, publishing).
- Provides a step-by-step checklist for adding new components (code, previews/tests, README updates, sample wiring, release/approval steps).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| components/ ← Composable UI components (buttons, chips, banner, pager, rating, promosticker) | ||
| foundation/ ← Design tokens (palette, typography, icons) | ||
| daynight/ ← AppColour + AppColourMode (light/dark abstraction) | ||
| utils/ ← PreviewAnnotations, Size (isTabletDevice), FontFamilyResource |
| ## Key Patterns | ||
|
|
||
| ### Day/Night Colours | ||
| All colours are `AppColour(light: Color, dark: Color)`. Never use raw `Color` directly in components — always wrap in `AppColour` so `.current` resolves correctly via `LocalIsDarkModeActive`. Wrap the composition root in `AppColourMode { ... }`. |
|
|
||
| ## Testing Approach | ||
|
|
||
| All tests in `:source` are **Paparazzi screenshot tests** (no instrumentation/emulator needed). Test files mirror component files and directly call internal `@VisibleForTesting` `*Preview()` composables: |
|
|
||
| # Publish to local build directory (for bundling into news app) | ||
| ./gradlew :source:publishReleasePublicationToCustomRepository | ||
| # Output: source/build/custom/ (or override with -Prepo.local=<path>) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add an AGENTS.md file to provide guidance to LLM agents for working on the Android library.
Testing notes/instructions:
Use copilot agent mode in Android studio and confirm it picks up the Agent file as an input.
Checklist