Skip to content

Commit b372138

Browse files
authored
Merge pull request #296 from Automattic/ai/add-agent-readiness-configuration
[AI] Add Agent Readiness Configuration
2 parents 6538857 + b66e127 commit b372138

4 files changed

Lines changed: 89 additions & 6 deletions

File tree

.aiexclude

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.gradle/
2+
build/
3+
!build/reports/
4+
*/build/
5+
!*/build/reports/
6+
!*/build/outputs/
7+
!*/build/test-results/
8+
local.properties
9+
gradle.properties

.gitignore

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,6 @@ proguard/
3131
# Log Files
3232
*.log
3333

34-
# Intellij project files
35-
*.iml
36-
*.ipr
37-
*.iws
38-
.idea/
39-
4034
# private config file
4135
gradle.properties
4236
!/benchmark/gradle.properties
@@ -47,3 +41,13 @@ gradle.properties
4741
# OS X generated file
4842
.DS_Store
4943

44+
# Agent config local files (Claude, Codex, Gemini, Cursor, Windsurf, etc.)
45+
# Keep main config files under version control, ignore user-local overrides
46+
**/AGENTS.local.md
47+
**/CLAUDE.local.md
48+
**/.claude/**/*.local.*
49+
**/.codex/**/*.local.*
50+
**/.gemini/**/*.local.*
51+
**/.cursor/**/*.local.*
52+
**/.windsurf/**/*.local.*
53+

AGENTS.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# AGENTS.md
2+
3+
This file provides guidance to coding agents when working with code in this repository.
4+
5+
## Project Overview
6+
7+
Android client library for tracking user events (Nosara/Tracks), A/B testing (ExPlat), and crash logging (Sentry). Published to Automattic's S3 Maven repository. Used internally by Automattic mobile apps. Includes a `sampletracksapp` app module that can be used for manual testing.
8+
9+
## Build Commands
10+
11+
```bash
12+
./gradlew assembleDebug # Build all modules
13+
./gradlew testDebugUnitTest # Run all unit tests
14+
./gradlew lintDebug # Run lint checks
15+
./gradlew ktlint # Check Kotlin code style (custom task from ktlint.gradle)
16+
./gradlew ktlintFormat # Fix Kotlin code style deviations (custom task from ktlint.gradle)
17+
./gradlew ciktlint # Same as ktlint but with checkstyle XML output for CI (custom task from ktlint.gradle)
18+
./gradlew buildHealth # Dependency analysis
19+
./gradlew :experimentation:apiCheck # Binary compatibility check (`experimentation` module only)
20+
./gradlew :benchmark:assembleDebugAndroidTest # Build benchmark instrumented tests
21+
./gradlew :benchmark:connectedDebugAndroidTest # Run benchmark instrumented tests on a connected device
22+
```
23+
24+
To run a single test class:
25+
26+
```bash
27+
./gradlew :experimentation:testDebugUnitTest --tests "com.automattic.android.experimentation.ExPlatTest"
28+
./gradlew :crashlogging:testDebugUnitTest --tests "com.automattic.android.tracks.crashlogging.SentryCrashLoggingTest"
29+
```
30+
31+
**Note:** `gradle.properties` is gitignored. CI copies `gradle.properties-example` before building. Locally, copy it manually if needed: `cp gradle.properties-example gradle.properties`.
32+
33+
## Architecture
34+
35+
Three independently published library modules plus a sample app and benchmark module:
36+
37+
| Module | Artifact | Language | Description |
38+
|--------|----------|----------|-------------|
39+
| `AutomatticTracks` | `com.automattic:Automattic-Tracks-Android` | Java + Kotlin | Core event tracking with SQLite storage and background network transmission |
40+
| `experimentation` | `com.automattic.tracks:experimentation` | Kotlin | ExPlat A/B testing SDK with file-based caching and OkHttp REST client |
41+
| `crashlogging` | `com.automattic.tracks:crashlogging` | Kotlin | Sentry-based crash logging, performance monitoring, and error tracking |
42+
| `sampletracksapp` || Kotlin | Sample app demonstrating library usage |
43+
| `benchmark` || Kotlin | Performance benchmarking via `androidTest` instrumented tests using `androidx.benchmark` |
44+
45+
### Key architectural details
46+
47+
- **AutomatticTracks** uses a queue-based architecture with background threads for event buffering, DB-to-network transfer, and network transmission. Events expire after 14 days.
48+
- **experimentation** has `explicitApi()` enabled and uses binary compatibility validation (`apiCheck`). Public API surface is tracked in `experimentation/api/experimentation.api`.
49+
- **crashlogging** wraps Sentry SDK via `SentryErrorTrackerWrapper` and exposes a `CrashLoggingDataProvider` interface for host apps to supply user/app context.
50+
- Modules publish independently to S3. No product flavors or build variants.
51+
52+
## Testing Conventions
53+
54+
- **Frameworks:** JUnit 4, AssertJ, Mockito-Kotlin, kotlinx-coroutines-test, MockWebServer
55+
- **Assertions:** Use AssertJ (`assertThat`), not kotlin.test assertions
56+
- **Naming:** Backtick-quoted names: `` `given ..., when ..., then ...` ``
57+
- **Coroutines:** Use `runTest` from `kotlinx.coroutines.test`
58+
59+
## Important Gotchas
60+
61+
- Build files use **Groovy** (`build.gradle`, `settings.gradle`), not Kotlin DSL — except `benchmark/build.gradle.kts` which uses Kotlin DSL
62+
- Dependency versions are defined as `ext` properties in root `build.gradle`, not a version catalog
63+
64+
## Publishing
65+
66+
CI publishes on every PR commit and trunk merge:
67+
- PR: `{pr-number}-{commit-full-sha1}`
68+
- Trunk merge: `trunk-{commit-full-sha1}`
69+
- Tag: `{tag-name}`

CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@AGENTS.md

0 commit comments

Comments
 (0)