You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: AGENTS.md
+29-39Lines changed: 29 additions & 39 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ This document provides context and guidelines for AI agents assisting with the *
4
4
5
5
## Project Overview
6
6
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/).
8
8
9
9
-**Language**: Kotlin
10
10
-**UI Framework**: Jetpack Compose
@@ -19,24 +19,23 @@ This document provides context and guidelines for AI agents assisting with the *
19
19
20
20
The project is organized into the following modules:
-**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
75
75
76
76
### 3. Component Structure
77
77
@@ -80,41 +80,46 @@ Components follow a consistent pattern:
80
80
- Token-driven styling via theme
81
81
- Preview functions for development
82
82
- Accessibility support built-in
83
+
- KDoc-based documentation for public methods that includes simple code samples
83
84
84
85
## Development Guidelines
85
86
86
87
### Code Style
87
88
88
-
1.**Kotlin Conventions**: Follow official Kotlin coding conventions
89
89
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)
90
93
3.**Naming**:
91
94
- Prefix components with `Ouds` (e.g., `OudsTag`, `OudsButton`)
92
95
- Token classes end with `Tokens` (e.g., `OudsAlertTokens`)
93
-
- Theme-related resources use `Ouds` prefix (e.g., `OudsDrawableResources`)
94
96
95
97
### File Organization
96
98
97
99
- Component files in `:core/src/main/java/com/orange/ouds/core/component/`
98
100
- 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`
100
102
101
103
### Adding New Components
102
104
103
105
When adding new components:
104
106
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
109
111
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
111
115
112
116
### State Management
113
117
114
118
Demo screens use state classes (e.g., `AlertMessageDemoState`, `InlineAlertDemoState`) to:
115
119
- Manage component configuration
116
120
- Provide interactive controls in demo app
117
121
- Showcase different component variants
122
+
Customization parameters in demo screens match the parameters of the component APIs
118
123
119
124
### Resource Handling
120
125
@@ -124,9 +129,8 @@ Demo screens use state classes (e.g., `AlertMessageDemoState`, `InlineAlertDemoS
124
129
125
130
## Testing
126
131
127
-
-Unit tests for logic and state management
132
+
-Snapshot tests for visual regression
128
133
- Compose UI tests for component behavior
129
-
- Visual regression testing (where applicable)
130
134
- Accessibility testing should be considered
131
135
132
136
## Documentation
@@ -138,33 +142,27 @@ Demo screens use state classes (e.g., `AlertMessageDemoState`, `InlineAlertDemoS
138
142
139
143
## Common Tasks
140
144
141
-
### Adding a New Theme Variant
145
+
### Adding a New Theme
142
146
143
147
1. Create new module (e.g., `:theme-newbrand`)
144
148
2. Implement `OudsTheme` interface from `:theme-contract`
145
-
3.Define all required token values
149
+
3.Use concrete token values generated by Tokenator
@@ -224,5 +215,4 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed contribution guidelines.
224
215
225
216
---
226
217
227
-
**Last Updated**: 2025
228
218
**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