Skip to content

Commit ee5b9b3

Browse files
committed
Update AGENTS.md
1 parent cd383b9 commit ee5b9b3

1 file changed

Lines changed: 29 additions & 39 deletions

File tree

AGENTS.md

Lines changed: 29 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This document provides context and guidelines for AI agents assisting with the *
44

55
## Project Overview
66

7-
**OUDS Android** is an Android design system library that provides Orange-branded UI components and tokens for building consistent, accessible Android applications across all Orange brands and affiliates.
7+
**OUDS Android** is an Android design system library that provides Orange-branded UI components and tokens for building consistent, accessible Android applications across all Orange brands and affiliates. This library is the Android implementation of the [Orange Unified Design System](https://unified-design-system.orange.com/).
88

99
- **Language**: Kotlin
1010
- **UI Framework**: Jetpack Compose
@@ -19,24 +19,23 @@ This document provides context and guidelines for AI agents assisting with the *
1919

2020
The project is organized into the following modules:
2121

22-
### Core Modules
22+
### Essential Modules
2323

2424
- **`:core`** - Core library containing reusable UI components (e.g., `OudsTag`, buttons, etc.)
25-
- **`:foundation`** - Foundation layer with basic design primitives
25+
- **`:foundation`** - Foundation layer containing code used in all modules (extension methods, annotations, etc.)
2626
- **`:global-raw-tokens`** - Raw design tokens (colors, typography, spacing, etc.)
27-
- **`:theme-contract`** - Theme abstraction layer and token interfaces (e.g., `OudsDrawableResources`, `OudsAlertTokens`)
27+
- **`:theme-contract`** - Theme abstraction layer and token interfaces (e.g., `OudsThemeContract`, `OudsAlertTokens`)
2828

2929
### Theme Modules
3030

3131
- **`:theme-orange`** - Orange brand theme implementation
3232
- **`:theme-orange-compact`** - Compact variant of Orange theme
33-
- **`:theme-orange-business-tools`** - Orange Business Tools theme variant
3433
- **`:theme-sosh`** - Sosh brand theme implementation
3534
- **`:theme-wireframe`** - Wireframe theme for development/prototyping
3635

3736
### Application & Testing
3837

39-
- **`:app`** - Demo application "Design Toolbox" showcasing components (e.g., `AlertMessageDemoState`, `InlineAlertDemoState`, `ComponentCode`)
38+
- **`:app`** - Demo application "Design Toolbox" showcasing components and design tokens
4039
- **`:core-test`** - Shared testing utilities
4140
- **`:dokka-plugin`** - Custom Dokka plugin for documentation generation
4241

@@ -70,8 +69,9 @@ OudsTheme(
7069
### 2. Token-Based Design
7170

7271
- **Raw Tokens** (`global-raw-tokens`) - Base design values
72+
- **Semantic Tokens** (`theme-contract`) - Semantic token definitions (e.g., `OudsColorActionSemanticTokens`)
7373
- **Component Tokens** (`theme-contract`) - Component-specific token definitions (e.g., `OudsAlertTokens`)
74-
- **Theme Implementations** - Concrete values for each brand
74+
- **Theme Implementations** - Concrete semantic and component token values for each brand, as well as brand-specific raw tokens
7575

7676
### 3. Component Structure
7777

@@ -80,41 +80,46 @@ Components follow a consistent pattern:
8080
- Token-driven styling via theme
8181
- Preview functions for development
8282
- Accessibility support built-in
83+
- KDoc-based documentation for public methods that includes simple code samples
8384

8485
## Development Guidelines
8586

8687
### Code Style
8788

88-
1. **Kotlin Conventions**: Follow official Kotlin coding conventions
8989
2. **Compose Best Practices**: Use modern Jetpack Compose patterns
90+
1. **Coding Conventions**: Follow [Style guidelines for Jetpack Compose APIs](https://developer.android.com/develop/ui/compose/api-guidelines) which basically includes:
91+
- The [API Guidelines for Jetpack Compose](https://android.googlesource.com/platform/frameworks/support/+/androidx-main/compose/docs/compose-api-guidelines.md) (based on [Kotlin Coding Conventions](https://kotlinlang.org/docs/coding-conventions.html))
92+
- The [API Guidelines for @Composable components in Jetpack Compose](https://android.googlesource.com/platform/frameworks/support/+/androidx-main/compose/docs/compose-component-api-guidelines.md)
9093
3. **Naming**:
9194
- Prefix components with `Ouds` (e.g., `OudsTag`, `OudsButton`)
9295
- Token classes end with `Tokens` (e.g., `OudsAlertTokens`)
93-
- Theme-related resources use `Ouds` prefix (e.g., `OudsDrawableResources`)
9496

9597
### File Organization
9698

9799
- Component files in `:core/src/main/java/com/orange/ouds/core/component/`
98100
- Token definitions in `:theme-contract/src/main/java/com/orange/ouds/theme/tokens/`
99-
- Demo/preview code in `:app/src/main/java/com/orange/ouds/app/ui/components/`
101+
- Demo app code in `:app/src/main/java/com/orange/ouds/app`
100102

101103
### Adding New Components
102104

103105
When adding new components:
104106

105-
1. Create the composable in `:core` module
106-
2. Define component tokens in `:theme-contract`
107-
3. Implement token values in theme modules (`:theme-orange`, etc.)
108-
4. Add demo screens in `:app` module
107+
1. Verify that component tokens generated by Tokenator are defined in `:theme-contract` and implemented in theme modules (`:theme-orange`, etc.)
108+
2. Create one or more composables in `:core` module, trying to match the equivalent Material APIs as much as possible
109+
3. Ensure accessibility semantics are properly implemented
110+
4. Add a sample code for each component composable
109111
5. Include `@Preview` annotations for IDE preview
110-
6. Ensure accessibility semantics are properly implemented
112+
6. Add snapshot tests in `:core-test` module and generate snapshots for each theme
113+
7. Add instrumented Compose UI tests for user interactions such as clicks
114+
8. Add demo screen in `:app` module
111115

112116
### State Management
113117

114118
Demo screens use state classes (e.g., `AlertMessageDemoState`, `InlineAlertDemoState`) to:
115119
- Manage component configuration
116120
- Provide interactive controls in demo app
117121
- Showcase different component variants
122+
Customization parameters in demo screens match the parameters of the component APIs
118123

119124
### Resource Handling
120125

@@ -124,9 +129,8 @@ Demo screens use state classes (e.g., `AlertMessageDemoState`, `InlineAlertDemoS
124129

125130
## Testing
126131

127-
- Unit tests for logic and state management
132+
- Snapshot tests for visual regression
128133
- Compose UI tests for component behavior
129-
- Visual regression testing (where applicable)
130134
- Accessibility testing should be considered
131135

132136
## Documentation
@@ -138,33 +142,27 @@ Demo screens use state classes (e.g., `AlertMessageDemoState`, `InlineAlertDemoS
138142

139143
## Common Tasks
140144

141-
### Adding a New Theme Variant
145+
### Adding a New Theme
142146

143147
1. Create new module (e.g., `:theme-newbrand`)
144148
2. Implement `OudsTheme` interface from `:theme-contract`
145-
3. Define all required token values
149+
3. Use concrete token values generated by Tokenator
146150
4. Add to `:app` for testing
147151
5. Update documentation
148152

149153
### Modifying Existing Components
150154

151155
1. Check token definitions in `:theme-contract`
152156
2. Update component implementation in `:core`
153-
3. Verify changes across all theme modules
157+
3. Update reference snapshots in all theme modules
154158
4. Update demo screens if needed
155-
5. Test in light and dark modes
156-
157-
### Working with Tokens
158-
159-
1. Raw tokens → `:global-raw-tokens`
160-
2. Component contracts → `:theme-contract/tokens/components/`
161-
3. Theme implementations → specific theme modules
162159

163160
## Build & Deploy
164161

165162
- **Build**: `./gradlew build`
166-
- **Run app**: `./gradlew :app:installDebug`
167-
- **Tests**: `./gradlew test`
163+
- **Run demo app**: `./gradlew :app:installProdDebug`
164+
- **Snapshot tests**: `./gradlew verifyPaparazziDebug`
165+
- **Instrumented tests**: `./gradlew :core:connectedCheck`
168166
- **Distribution**: Maven Central via `com.orange.ouds.android` group
169167

170168
## Important Considerations
@@ -173,6 +171,7 @@ Demo screens use state classes (e.g., `AlertMessageDemoState`, `InlineAlertDemoS
173171

174172
Always consider that changes affect multiple brands. Test components with:
175173
- Orange theme
174+
- Orange Compact theme
176175
- Sosh theme
177176
- Wireframe theme
178177
- Light and dark modes
@@ -196,15 +195,6 @@ Always consider that changes affect multiple brands. Test components with:
196195
- Avoid unnecessary recompositions
197196
- Optimize preview rendering
198197

199-
## Files to Watch
200-
201-
Based on recent edits, key areas of active development:
202-
203-
- **Alert Components**: `OudsAlertTokens`, demo states
204-
- **Tag Component**: `OudsTag.kt`
205-
- **Theme Resources**: `OudsDrawableResources.kt`
206-
- **Demo Infrastructure**: `ComponentCode.kt`, demo state classes
207-
208198
## Contributing
209199

210200
See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed contribution guidelines.
@@ -215,6 +205,7 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed contribution guidelines.
215205
- **Repository**: https://github.com/Orange-OpenSource/ouds-android
216206
- **Demo App**: http://oran.ge/designtoolbox
217207
- **Issues**: https://github.com/Orange-OpenSource/ouds-android/issues
208+
- **Orange Unified Design System**: https://unified-design-system.orange.com/
218209

219210
## Data Privacy & Permissions
220211

@@ -224,5 +215,4 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed contribution guidelines.
224215

225216
---
226217

227-
**Last Updated**: 2025
228218
**For AI Agents**: This document is specifically designed to provide context for AI assistants. When making changes, consider the multi-module, multi-brand nature of this design system.

0 commit comments

Comments
 (0)