agentleFS
thunderbirdthunderbird/thunderbird-android/AGENTS.md

thunderbird-android

AGENTS.md14k starsChanged 56 days agoApache-2.0View on GitHub

This file defines requirements for AI coding agents and automated systems contributing to this repository. AI-generated or AI-assisted contributions are acceptable only if they comply with these rules and meet the same standards as human-written contributions. These requirements apply to: Thunderbird for Android is a privacy-focused email client. The repository implements a white-label architecture producing: Project documentation resides in the docs/ directory. Architectural Decision Records (ADRs) are located in docs/engineering/adr/. Agents MUST consult relevant documentation before making architectural or structural…

We split this AGENTS.md into the rules it gives an agent

40 rules. About 1 is common, 29 are distinctive, and 10 are very specific to this project.

  • ≈1

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈29

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 10

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    All modules in this repository

    line 12
  2. Distinctive:

    All pull requests created fully or partially using AI tools

    line 13
  3. Distinctive:

    Before making changes, agents MUST:

    line 32
  4. Distinctive:

    If requirements are incomplete, ambiguous, or conflicting:

    line 37
  5. Very specific:

    Read README.md, docs/CONTRIBUTING.md, and relevant documentation in docs/

    line 44
  6. Very specific:

    Check for related ADRs in docs/engineering/adr/

    line 46
  7. Distinctive:

    Follow existing patterns and conventions in the affected modules

    line 52
  8. Distinctive:

    Run appropriate Gradle tasks (see Build and Verification Requirements)

    line 57
  9. Distinctive:

    Ensure all checks pass before proposing changes

    line 58
  10. Very specific:

    Never depend on another module's :internal or :internal-* modules

    line 76
  11. Very specific:

    Only app-common, app-thunderbird, and app-k9mail may depend on :internal modules (for DI wiring)

    line 77
  12. Very specific:

    Keep implementation details internal using the internal modifier

    line 78
  13. Distinctive:

    If existing code violates this boundary, agents MUST NOT replicate the pattern and SHOULD move the code toward the intended architecture …

    line 83
  14. Distinctive:

    Prefer fakes over mocks (see Testing Guide)

    line 107
  15. Distinctive:

    Avoid mocking frameworks unless strongly justified

    line 108
  16. Distinctive:

    Use Arrange-Act-Assert (AAA) pattern

    line 109
  17. Distinctive:

    Follow the exact naming and formatting conventions of the file and module being modified

    line 121
  18. Distinctive:

    NOT reformat, modernize, or clean up unrelated code

    line 122
  19. Very specific:

    Use Atomic Design components from the design system (see docs/architecture/design-system.md)

    line 127
  20. Distinctive:

    Do NOT introduce new design systems.

    line 130
  21. Very specific:

    Use net.thunderbird.core.logging.Logger via dependency injection

    line 138
  22. Distinctive:

    NEVER log PII (Personally Identifiable Information)

    line 139
  23. Common:

    NEVER log credentials, passwords, or authentication tokens

    line 140
  24. Distinctive:

    NEVER log message content or email addresses

    line 141
  25. Distinctive:

    Add telemetry, analytics, ads, or tracking of any kind

    line 149
  26. Distinctive:

    Add permissions without explicit request and justification

    line 150
  27. Distinctive:

    All external input MUST be treated as untrusted.

    line 157
  28. Distinctive:

    Before proposing changes, agents MUST run the narrowest relevant Gradle tasks and ensure they pass.

    line 161
  29. Distinctive:

    When fixing bugs, agents MUST:

    line 184
  30. Distinctive:

    Add or update tests to cover the bug

    line 186
  31. Distinctive:

    Ensure tests fail before the fix (when applicable)

    line 187
  32. Distinctive:

    Ensure all relevant tasks pass after the fix

    line 188
  33. Very specific:

    Run at least: ./gradlew test lint detekt spotlessCheck

    line 189
  34. Very specific:

    If required tasks cannot be executed locally (e.g., no Android device/emulator for connectedAndroidTest):

    line 193
  35. Very specific:

    Use appropriate prefixes (feat:, fix:, refactor:, style:, test:, chore:)

    line 204
  36. Distinctive:

    Keep commits small and logically scoped

    line 205
  37. Distinctive:

    Avoid mixing behavior changes and formatting in a single commit

    line 208
  38. Distinctive:

    Stop — Do not proceed with uncertain changes

    line 236
  39. Distinctive:

    Document assumptions — Write down what you understand and what's unclear

    line 237
  40. Distinctive:

    When in doubt, ask. It's always better to clarify than to guess wrong.

    line 250

≈ “Common” is an estimate: at least 1 in 5 of the 36,368 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

AI Agent Guide for Thunderbird for Android

This file defines requirements for AI coding agents and automated systems contributing to this repository.

AI-generated or AI-assisted contributions are acceptable only if they comply with these rules and meet the same standards as human-written contributions.

Applicability

These requirements apply to:

  • All modules in this repository
  • All pull requests created fully or partially using AI tools
  • Automated refactoring, formatting, or code generation

Repository Context

Thunderbird for Android is a privacy-focused email client.

The repository implements a white-label architecture producing:

  • app-thunderbird: Thunderbird for Android
  • app-k9mail: K-9 Mail

Project documentation resides in the docs/ directory. Architectural Decision Records (ADRs) are located in docs/engineering/adr/.

Agents MUST consult relevant documentation before making architectural or structural changes.

Required Agent Workflow

Before making changes, agents MUST:

1. Understand the Request

  • Confirm that requirements are clear and consistent with project rules
  • If requirements are incomplete, ambiguous, or conflicting:
    • Do NOT guess
    • Document assumptions
    • Request clarification before proceeding

2. Research Context

  • Read README.md, docs/CONTRIBUTING.md, and relevant documentation in docs/
  • Review existing implementations in affected modules
  • Check for related ADRs in docs/engineering/adr/
  • Understand the module's role in the white-label architecture

3. Make Changes

  • Modify only files directly related to the requested change
  • Follow existing patterns and conventions in the affected modules
  • Maintain consistency with the established architecture

4. Verify Changes

  • Run appropriate Gradle tasks (see Build and Verification Requirements)
  • Ensure all checks pass before proposing changes

Architectural Requirements

Module Types

  • app-* — Application entry points (app-thunderbird, app-k9mail)
  • app-common — Wiring layer for features and dependency injection
  • feature:* — User-facing features (split into :api and :internal modules per ADR-0009)
  • core:* — Shared infrastructure and utilities (split into :api and :internal modules per ADR-0009)
  • library:* — Reusable libraries
  • legacy:* — Migration targets (contains original K-9 Mail codebase; avoid adding new logic here)

API / Internal Boundary

Agents MUST:

  • Depend only on other modules' :api modules
  • Never depend on another module's :internal or :internal-* modules
  • Only app-common, app-thunderbird, and app-k9mail may depend on :internal modules (for DI wiring)
  • Keep implementation details internal using the internal modifier
  • Bind implementations in app-common or app modules only

New code MUST NOT violate the API/internal boundary, see ADR-0009.

If existing code violates this boundary, agents MUST NOT replicate the pattern and SHOULD move the code toward the intended architecture when modifying it.

Agents MUST NOT change module structure, dependency graphs, or architectural boundaries unless explicitly requested.

Technology Requirements

Agents MUST use:

  • Kotlin for new code
  • Jetpack Compose for UI (mandatory for new features)
  • Atomic Design system components (see docs/architecture/design-system.md)
  • Koin for dependency injection (constructor injection)
  • Coroutines and Flow for concurrency
  • MVI (Unidirectional Data Flow) pattern (see docs/architecture/ui-architecture.md)

Testing libraries:

  • assertk
  • kotlinx-coroutines-test
  • Turbine

Testing policy:

  • Prefer fakes over mocks (see Testing Guide)
  • Avoid mocking frameworks unless strongly justified
  • Use Arrange-Act-Assert (AAA) pattern
  • Name the object under test testSubject

Agents MUST NOT introduce alternative frameworks.

Coding Requirements

Agents MUST:

  • Make small, focused, reviewable changes
  • Prioritize privacy, security, and correctness over convenience or shorter code
  • Modify only files directly related to the requested change
  • Follow the exact naming and formatting conventions of the file and module being modified
  • NOT reformat, modernize, or clean up unrelated code
  • Avoid speculative refactoring

UI Constraints

  • Use Atomic Design components from the design system (see docs/architecture/design-system.md)
  • Raw Material components are NOT allowed outside design system modules and the catalog app
  • For existing View-based code, maintain consistency using legacy design system components
  • Do NOT introduce new design systems; extend the existing system within its modules

Logging and Privacy

Privacy is a core value of this project.

Agents MUST:

  • Use net.thunderbird.core.logging.Logger via dependency injection
  • NEVER log PII (Personally Identifiable Information)
  • NEVER log credentials, passwords, or authentication tokens
  • NEVER log message content or email addresses

Security Requirements

This is a privacy-focused email client. Security is non-negotiable.

Agents MUST NOT:

  • Add telemetry, analytics, ads, or tracking of any kind
  • Add permissions without explicit request and justification
  • Introduce insecure cryptography or unsafe networking
  • Hardcode secrets, credentials, API keys, or tokens
  • Modify OAuth configuration unless explicitly instructed
  • Change licensing headers or license terms
  • Introduce dependencies with known vulnerabilities

All external input MUST be treated as untrusted. Validate and sanitize user input.

Build and Verification Requirements

Before proposing changes, agents MUST run the narrowest relevant Gradle tasks and ensure they pass.

Build

  • ./gradlew assemble
  • ./gradlew build
  • ./gradlew :app-thunderbird:assembleDebug
  • ./gradlew :app-k9mail:assembleDebug

Tests

  • ./gradlew test
  • ./gradlew connectedAndroidTest

Code Quality

  • ./gradlew lint
  • ./gradlew detekt
  • ./gradlew spotlessCheck
  • ./gradlew spotlessApply (to fix formatting issues)

Bug Fix Requirements

When fixing bugs, agents MUST:

  • Add or update tests to cover the bug
  • Ensure tests fail before the fix (when applicable)
  • Ensure all relevant tasks pass after the fix
  • Run at least: ./gradlew test lint detekt spotlessCheck

Limitations

If required tasks cannot be executed locally (e.g., no Android device/emulator for connectedAndroidTest):

  • Agents MUST explicitly state which tasks were not run and why
  • Include this information in the pull request description

Commit Requirements

This repository uses Conventional Commits for all commit messages.

Agents MUST:

  • Use appropriate prefixes (feat:, fix:, refactor:, style:, test:, chore:)
  • Keep commits small and logically scoped
  • Separate formatting-only changes into style: commits
  • Separate refactoring from functional changes
  • Avoid mixing behavior changes and formatting in a single commit

Pull Request Requirements

Pull requests MUST include:

  • A clear description of changes
  • The reason for the change
  • Exact Gradle commands used for testing
  • Known risks or trade-offs
  • Disclosure of AI assistance (if applicable)

AI assistance does not reduce review standards.

Escalation

When to Stop and Ask

If uncertain about:

  • Requirements (incomplete, ambiguous, or conflicting)
  • Architectural decisions
  • Module boundaries or dependencies
  • Technology choices
  • Security implications

Then:

  1. Stop — Do not proceed with uncertain changes
  2. Document assumptions — Write down what you understand and what's unclear
  3. Request clarification — Ask specific questions

What NOT to Do

Agents MUST NOT:

  • Invent architecture or design patterns
  • Bypass module boundaries to "make it work"
  • Prioritize elegance over established project conventions
  • Guess at requirements or implementation details
  • Make breaking changes without explicit approval

When in doubt, ask. It's always better to clarify than to guess wrong.

Download now (ZIP)

Trending

Less talk lately.about the whole repository

Dec 2025: 3 mentionsJan 2026: 1 mentionFeb 2026: 3 mentionsMar 2026: 2 mentionsApr 2026: 2 mentionsMay 2026: 4 mentionsJun 2026: 3 mentionsJul 2026: 2 mentionsAug 2026: 2 mentionsSep 2026: 2 mentionsOct 2026: 3 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the thunderbird/thunderbird-android repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about thunderbird/thunderbird-android

The biggest 5 of 82 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 82

Talked about on GitHub, YouTube, Bluesky, Hacker News and the web (82 times).

On GitHub · 50

45 more on GitHub

On YouTube · 24

19 more on YouTube

On Bluesky · 6

1 more on Bluesky

On Hacker News · 1

On the web · 1

  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.

    Of the AGENTS.md files we read, the 28,693 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.