Skip to content

docs: Add AGENTS.md files for root and each module - #304

Open
NicolasBourdin88 with Copilot wants to merge 2 commits into
mainfrom
copilot/add-agents-md-files
Open

docs: Add AGENTS.md files for root and each module#304
NicolasBourdin88 with Copilot wants to merge 2 commits into
mainfrom
copilot/add-agents-md-files

Conversation

Copilot AI commented May 22, 2026

Copy link
Copy Markdown
Contributor

Adds AGENTS.md files to give AI agents (and new contributors) a fast, accurate map of the repo, inspired by the equivalents in Infomaniak/android-kMail and Infomaniak/android-SwissTransfer.

Files added

  • AGENTS.md (root) — Repository overview, module dependency graph (STCore → STCommon/STNetwork/STDatabase), build/test/publish commands, buildTools convention plugins, release flow (./buildRelease, nmcpAggregation, Versions.mavenVersionName, Package.swift), semantic-commit/PR title regex, and cross-cutting Kotlin/KMP conventions.
  • STCommon/AGENTS.md — Shared interfaces, models, exceptions, Matomo constants, utils. Highlights that it is the only module re-exported in the STCore XCFramework (appleExportedProjects), so its public surface = the iOS Swift surface.
  • STNetwork/AGENTS.mdApiClientProvider (Ktor + OkHttp/Darwin), v1/v2 repositories, typed exception mapping (UnauthorizedException, TooManyRequestException, UploadErrorsException, …), ApiUrlMatcher strictness, kotlinx.serialization conventions.
  • STDatabase/AGENTS.md — Parallel Realm (legacy) + Room/KSP (new) stacks, controllers vs DAOs, RealmMigrations, committed schemas/, and the Realm concurrency reason CI splits testDebugUnitTest / iosSimulatorArm64Test instead of running allTests.
  • STCore/AGENTS.mdSwissTransferInjection facade and lazy managers, loadUser(userId) lifecycle, mapper boundary, expect/actual pattern (EmailLanguageUtils.android.kt / .apple.kt), and rules for keeping iOS-visible types in STCommon.

Conventions captured

Each file follows the same structure: Summary → Tech Stack → Layout → Local Norms → Conventions → Commands → JIT Index (rg/find recipes) → Gotchas. Module files cross-link back to the root and to their siblings.

No source or build configuration was changed.

Agent-Logs-Url: https://github.com/Infomaniak/multiplatform-SwissTransfer/sessions/f3b1f57b-f18f-4670-93e0-8bc43e012ccb

Co-authored-by: NicolasBourdin88 <167090505+NicolasBourdin88@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds AGENTS.md documentation at the repository root and per-module level to provide a structured “map” of the codebase (modules, conventions, commands, and common gotchas) for AI agents and new contributors.

Changes:

  • Added a top-level AGENTS.md describing repo structure, build/test/publish flows, and cross-cutting conventions.
  • Added module-specific AGENTS.md files for STCommon, STNetwork, STDatabase, and STCore documenting responsibilities, layouts, and local norms.
  • Included “JIT index” command snippets (rg/find) to speed up navigation.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
AGENTS.md Top-level repository overview, commands, conventions, release and CI guidance.
STCommon/AGENTS.md Documents shared contracts/public surface expectations for Swift via XCFramework export.
STNetwork/AGENTS.md Documents Ktor client setup, repositories, error mapping, and URL helper strictness.
STDatabase/AGENTS.md Documents Realm+Room migration, controllers/DAOs, schemas/migrations, and test strategy.
STCore/AGENTS.md Documents SwissTransferInjection facade wiring, managers, and KMP patterns.
Comments suppressed due to low confidence (1)

STCore/AGENTS.md:142

  • This gotcha refers to loadUser(userId), but SwissTransferInjection doesn’t expose that method. Consider updating this to point to accountManager.loadUser(...) / logoutCurrentUser(...) (or whatever the intended public flow is) so the guidance matches the current API.
- The `userAgent` parameter on `SwissTransferInjection` is part of the public constructor signature — renaming or
  removing it is a breaking change for all consumers.
- Don't bypass `loadUser(userId)` to swap accounts; the realm / database providers depend on it for per-user
  isolation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread STDatabase/AGENTS.md Outdated
Comment thread STCore/AGENTS.md Outdated
Comment thread STCore/AGENTS.md Outdated
Comment thread STCommon/AGENTS.md Outdated
Comment thread STNetwork/AGENTS.md
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@NicolasBourdin88
NicolasBourdin88 force-pushed the copilot/add-agents-md-files branch from 93d8ba9 to aec3925 Compare May 22, 2026 09:27
@sonarqubecloud

Copy link
Copy Markdown

Comment thread AGENTS.md
`infomaniak/.github/.github/workflows/semantic-commit.yml@v2`). Every commit message **and** PR title must match:

```
^Merge .+|(^(feat|fix|chore|docs|style|refactor|perf|ci|test)(\(.+\))?: [A-Z0-9].+)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't put the regex in static here, because it's not evolutive and defeat the purpose of the ./github repo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants