Skip to content

armgit / ente

Public Imported from GitHub
0

💚 End-to-end encrypted cloud for everything.

Remove per-app CLAUDE.md and AGENTS.md from mobile apps

Manav Rathi89623c076639
diff --git a/mobile/apps/locker/CLAUDE.md b/mobile/apps/locker/CLAUDE.md
deleted file mode 100644
index be2e1ded99..0000000000
--- a/mobile/apps/locker/CLAUDE.md
+++ /dev/null
@@ -1,327 +0,0 @@
-# CLAUDE.md
-
-This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
-
-## Project Philosophy
-
-Ente is focused on privacy, transparency and trust. It's a fully open-source, end-to-end encrypted platform for storing data in the cloud. When contributing, always prioritize:
-
-- User privacy and data security
-- End-to-end encryption integrity
-- Transparent, auditable code
-- Zero-knowledge architecture principles
-
-## Project Overview
-
-Ente Locker is a Flutter application for securely storing important documents. It's part of the Ente mobile monorepo and shares multiple packages with the Ente Photos app. The app provides encrypted file storage with collections, sharing capabilities, and cross-platform support (iOS, Android, Linux, Windows, macOS).
-
-## Commit & PR Guidelines
-
-### Pre-commit/PR Checklist (RUN BEFORE EVERY COMMIT OR PR!)
-
-**CRITICAL: CI will fail if ANY of these checks fail. Run ALL commands and ensure they ALL pass.**
-
-```sh
-# 1. Format Dart code for ente/mobile/app/locker
-dart format .
-
-# 2. Analyze flutter code for errors and warnings
-flutter analyze
-```
-
-**Why CI might fail even after running these:**
-
-- Skipping any command above
-- Assuming auto-fix tools handle everything (they don't)
-- Not fixing warnings that flutter reports
-- Making changes after running the checks
-
-### Commit & PR Message Rules
-
-**These rules apply to BOTH commit messages AND pull request descriptions**
-
-- Keep messages CONCISE (no walls of text)
-- Subject line under 72 chars (no body text unless critical)
-- NO emojis
-- NO promotional text or links
-- NO Co-Authored-By lines
-
-### Additional Guidelines
-
-- Check `git status` before committing to avoid adding temporary/binary files
-- Never commit to main branch
-- All CI checks must pass - run the checklist commands above before committing or creating PR
-
-## Development Commands
-
-### Build & Run
-
-```sh
-# From mobile/ directory - bootstrap all packages
-melos bootstrap
-
-# Clean the locker app specifically
-melos run clean:locker
-
-# Run the app (from this directory)
-flutter run
-
-# Build for specific platforms
-flutter build apk # Android
-flutter build ios # iOS
-flutter build macos # macOS
-flutter build windows # Windows
-flutter build linux # Linux
-```
-
-### Code Quality
-
-```sh
-# Run linter
-flutter analyze
-
-# Auto-format code
-dart format .
-
-# Run lint on specific file
-flutter analyze lib/path/to/file.dart
-```
-
-### Testing
-
-There are currently no tests in the `test/` directory. When adding tests:
-
-```sh
-flutter test # Run all tests
-flutter test test/path/to/file_test.dart # Run specific test
-```
-
-## Architecture
-
-### Monorepo Structure
-
-Locker is one of multiple apps in `/apps/` that share common packages from `/packages/`:
-
-**Shared Packages:**
-
-- `ente_accounts` - User authentication and account management
-- `ente_base` - Base utilities and common code
-- `ente_configuration` - App configuration (extended by local `services/configuration.dart`)
-- `ente_crypto_dart` - Encryption/decryption primitives
-- `ente_events` - Event bus for app-wide events
-- `ente_legacy` - Legacy services (e.g., emergency contacts)
-- `ente_lock_screen` - App lock/authentication UI
-- `ente_logging` - Structured logging
-- `ente_network` - HTTP client and network layer
-- `ente_sharing` - Sharing models and utilities
-- `ente_strings` - Localization strings
-- `ente_ui` - Common UI components and theming
-- `ente_utils` - Platform utilities and helpers
-
-### Core Services (Singletons)
-
-All major services follow the singleton pattern with `instance` getters:
-
-1. **CollectionService** (`lib/services/collections/collections_service.dart`)
- - Manages collections (folders) and files within them
- - Syncs with server and maintains local cache (`_collectionIDToCollections`)
- - Handles collection CRUD operations
- - Provides encryption key management for collections and files
-
-2. **Configuration** (`lib/services/configuration.dart`)
- - Extends `BaseConfiguration` from `ente_configuration` package
- - Stores user settings, account info, and app state
- - Initialized with database instances in `main.dart`
-
-3. **UserService** (from `ente_accounts`)
- - Manages user authentication and account details
- - Fires `SignedInEvent` and `SignedOutEvent` via event bus
-
-4. **TrashService** (`lib/services/trash/trash_service.dart`)
- - Manages deleted files and trash operations
-
-5. **LinksService** (`lib/services/files/links/links_service.dart`)
- - Handles shareable public links for collections
-
-### Database Layer
-
-SQLite databases managed via `sqflite`:
-
-- **CollectionDB** (`lib/services/collections/collections_db.dart`) - Collections and files
-- **TrashDB** (`lib/services/trash/trash_db.dart`) - Deleted items
-
-Both databases track sync times to enable incremental syncing.
-
-### Event-Driven Architecture
-
-The app uses an event bus (`ente_events` package) for cross-component communication:
-
-**Key Events:**
-
-- `SignedInEvent` / `SignedOutEvent` - Authentication state changes
-- `CollectionsUpdatedEvent` - Triggers UI refresh when collections change
-- `BackupUpdatedEvent` - File upload progress/completion
-
-**Pattern:** Services fire events, UI components listen and call `setState()`.
-
-### UI Structure
-
-**Main Pages:**
-
-- `HomePage` - Main dashboard with collections grid, recents, and FAB
-- `CollectionPage` - Single collection view with files
-- `AllCollectionsPage` - Full collection list (by type: home/incoming/outgoing)
-- `SettingsPage` - User settings and account management
-- `InformationPage` - Add/edit structured information (notes, credentials, contacts, etc.)
-
-**Key UI Patterns:**
-
-- Pages extend `StatefulWidget` with mixins for reusable behavior (e.g., `SearchMixin`)
-- `UploaderPage`/`UploaderPageState` - Base class for pages that handle file uploads
-- Collections use `CollectionFlexGridView` for responsive grid layouts
-- Search functionality integrated via `SearchMixin` with search bar in AppBar
-
-### File Upload Flow
-
-1. User selects file via `file_picker` package
-2. `UploaderPage.uploadFiles()` picks collection (or creates one)
-3. `FileUploadService` encrypts and uploads to server
-4. `CollectionService.sync()` called to fetch updated state
-5. `CollectionsUpdatedEvent` fired → UI refreshes
-
-### Crypto & Encryption
-
-Files and collections are end-to-end encrypted:
-
-- **Collection keys:** Encrypted with user's master key
-- **File keys:** Encrypted with collection key
-- `CryptoHelper` (`utils/crypto_helper.dart`) provides key derivation utilities
-- `ente_crypto_dart` provides low-level encryption primitives
-
-### Platform-Specific Code
-
-**Desktop (Windows/Linux/macOS):**
-
-- Window management via `window_manager` package
-- System tray support via `tray_manager` package
-- Initialized in `main.dart` before `runApp()`
-
-**Mobile (iOS/Android):**
-
-- Share intent handling via `listen_sharing_intent` package
-- `HomePage.initializeSharing()` processes shared files from other apps
-- High refresh rate support on Android via `flutter_displaymode`
-
-### Localization
-
-- Uses Flutter's built-in `l10n` system
-- Localization files in `lib/l10n/`
-- Generated code via `flutter gen-l10n` (configured in `l10n.yaml`)
-- Shared strings from `ente_strings` package
-- Access in widgets via `context.l10n.keyName`
-
-## Code Style & Linting
-
-The project uses strict linting rules defined in `ente/mobile/analysis_options.yaml`:
-
-**Key enforced rules:**
-
-- `require_trailing_commas` (ERROR) - All function/constructor calls must have trailing commas
-- `always_use_package_imports` (WARNING) - Use `package:` imports, not relative
-- `prefer_final_fields` (ERROR) - Prefer `final` for non-reassigned fields
-- `prefer_const_constructors` (WARNING) - Use `const` constructors where possible
-- `unawaited_futures` (WARNING) - Explicitly handle or ignore futures
-- `cancel_subscriptions` (ERROR) - Cancel StreamSubscriptions in `dispose()`
-- `prefer_double_quotes` - Use double quotes for strings
-
-**To fix trailing comma errors:** Run `dart format .` which auto-adds them.
-
-## Important Patterns
-
-### Service Initialization
-
-Services are initialized in `main.dart` in a specific order:
-
-1. Crypto initialization (`CryptoUtil.init()`)
-2. Database initialization (CollectionDB, TrashDB)
-3. Configuration with databases
-4. Network layer
-5. Service-specific initialization
-
-### Sync Pattern
-
-Many operations follow this pattern:
-
-```dart
-// 1. Call API
-await _apiClient.someOperation(params);
-
-// 2. Sync to update local state
-await CollectionService.instance.sync();
-
-// 3. Event bus notifies UI (optional, sync may fire it)
-Bus.instance.fire(CollectionsUpdatedEvent());
-```
-
-**Important:** Avoid calling `setState()` or manual reloads after operations that trigger `sync()`, as the sync fires `CollectionsUpdatedEvent` which already refreshes the UI.
-
-### File References
-
-When referencing code locations in messages, use the format:
-
-```
-lib/services/collections/collections_service.dart:123
-```
-
-## Known TODOs
-
-From README.md:
-
-- Verify `PackageInfoUtil.getPackageName()` correctness on Linux and Windows
-- Update `file_url.dart` to download only via CF worker when necessary
-
-## Common Gotchas
-
-1. **Pub workspace:** `mobile/` is a Dart pub workspace — running `flutter pub get` anywhere inside it resolves and links all local packages (`melos bootstrap` does the same, delegating to it)
-2. **Window management:** Desktop window initialization must happen before `runApp()` in `main.dart`
-3. **Trailing commas:** The linter is strict about this - always add them to avoid CI failures
-4. **Package imports:** Never use relative imports for files in other packages; always use `package:` syntax
-5. **Sync timing:** File upload operations should NOT manually call `_loadCollections()` in the callback to avoid duplicate UI refreshes (see `HomePage.onFileUploadComplete()`)
-
-## Critical Coding Requirements
-
-### 1. Code Quality - MANDATORY
-
-**Every code change MUST pass `dart format .` and `flutter analyze` with zero issues**
-
-- Run `dart format .` first to format all Dart code
-- Run `flutter analyze` after EVERY code modification
-- Resolve ALL issues (info, warning, error) - no exceptions
-- The codebase has zero issues by default, so any issue is from your changes
-- DO NOT commit or consider work complete until both commands pass cleanly
-
-### 2. Component Reuse - MANDATORY
-
-**Always try to reuse existing components**
-
-- Use a subagent to search for existing components before creating new ones
-- Only create new components if none exist that meet the requirements
-- Check both UI components in `lib/ui/` and shared components in `../../packages/`
-
-### 3. Design System - MANDATORY
-
-**Never hardcode colors or text styles**
-
-- Always use the Ente design system for colors and typography
-- Use a subagent to find the appropriate design tokens
-- Access colors via theme: `getEnteColorScheme(context)`
-- Access text styles via theme: `getEnteTextTheme(context)`
-- Call above theme getters only at the top of (`build`) methods and re-use them throughout the component
-- If you MUST use custom colors/styles (extremely rare), explicitly inform the user with a clear warning
-
-### 4. Database Methods - BEST PRACTICE
-
-**Prioritize readability in database methods**
-
-- For small result sets (e.g., 1-2 stale entries), prefer filtering in Dart for cleaner, more readable code
-- For large datasets, use SQL WHERE clauses for performance - they're much more efficient in SQLite
diff --git a/mobile/apps/photos/AGENTS.md b/mobile/apps/photos/AGENTS.md
deleted file mode 100644
index f1dc2af837..0000000000
--- a/mobile/apps/photos/AGENTS.md
+++ /dev/null
@@ -1,50 +0,0 @@
-# Repository Guidelines
-
-## Project Philosophy
-
-- Protect user privacy and preserve end-to-end encryption integrity in every change.
-- Keep implementations transparent and auditable to sustain user trust.
-- Design with zero-knowledge architecture assumptions so sensitive data never leaves the user’s control.
-
-## Monorepo Context
-
-- This Photos app lives inside the Ente monorepo alongside Auth, Locker, web, desktop, CLI, and backend code.
-- Shared Flutter packages sit under `mobile/packages/`; Photos-specific Flutter plugins live in `mobile/apps/photos/plugins/`.
-
-## Project Structure & Module Organization
-
-`lib/` houses the Flutter client (`core/`, `services/`, `ui/`, `db/`). Tests live in `test/` (unit & widget) and `integration_test/`. Platform shells are `android/` and `ios/`; the Photos Rust bridge crate lives at repo-root `rust/bindings/frb/photos/`, with local build glue in `rust_builder/`. Assets, fonts, and localization configs are in `assets/`, `fonts/`, `l10n.yaml`, with generated code in `lib/generated/`. Automation scripts live under `scripts/`.
-
-## Build, Test & Development Commands
-
-Run `flutter pub get` after dependency edits. Launch the app with `flutter run --flavor independent`. Regenerate Rust bindings from `rust/` with `cargo codegen frb` before builds. Android releases rely on `flutter build apk --release --flavor independent`; for iOS run `cd ios && pod install` then `flutter build ios`.
-
-## Coding Style & Naming Conventions
-
-Use 2-space indentation and format with `dart format .` (trailing commas preserved). `analysis_options.yaml` enforces rules such as `prefer_const_constructors`, `require_trailing_commas`, and `always_use_package_imports`. Keep files `snake_case.dart`, classes `PascalCase`, private members `_camelCase`. Avoid `print`; rely on the log utilities under `lib/core/`.
-
-## Testing Guidelines
-
-Mirror source names with `*_test.dart`. Run only suites that cover your changes—`flutter test` (or a filtered target) when relevant tests exist, and skip it if no tests touch your work. Device flows stay in `integration_test/` (`flutter test integration_test`). Rust-facing updates should extend coverage with `cargo test` plus Dart adapter checks. Document new fixtures or goldens in `docs/`.
-
-## Commit & Pull Request Guidelines
-
-Commits should stay concise and imperative, summarising all substantial code changes. PR titles must tag the scope: `[mob][photos] …` for this app, else `[mob][auth]`, `[mob][locker]`, `[mob][packages]`, `[web]`, `[desktop]`, `[server]`, `[infra]`, or package-specific tags like `[mob][native_video_editor]`. Use `.github/pull_request_template.md` as your outline. Populate the Tests section with Markdown checkboxes covering only the validations needed pre-merge (keep it tight, relevant, and ≤5 items); omit the entire section when nothing needs to run. Add QA notes and UI captures when applicable, and verify `flutter analyze .` plus only the applicable tests from above before submitting.
-
-## Rust & Localization Notes
-
-Regenerate Dart bindings when Rust APIs change and keep generated code in `lib/src/rust/`. Exercise Rust crates with `cargo test` during such updates. For copy edits, update `lib/l10n/intl_en.arb` then run `flutter gen-l10n` (configured by `l10n.yaml`) to refresh `lib/generated/`, and coordinate Crowdin syncs through `crowdin.yml`.
-
-## Development Setup Requirements
-
-1. Install Flutter `3.38.10` with a Dart SDK between `>=3.10.0 <4.0.0`.
-2. Install Rust.
-3. Regenerate Rust bindings whenever native APIs shift from `rust/` using `cargo codegen frb`.
-
-## Critical Practices
-
-- `dart format .` must run before you commit so the tree stays uniformly formatted.
-- Follow each edit with `flutter analyze` and resolve every warning or info message introduced by the change.
-- Reuse existing UI and service components; search both `lib/ui/` and `../../packages/` before creating new primitives.
-- Respect the design system—pull colors from `getEnteColorScheme(context)` and text styles from `getEnteTextTheme(context)`, caching the theme at the top of `build`.
-- Keep specs and docs in sync with code updates; when behavior shifts, revise the relevant files under `docs/` or adjacent directories.
diff --git a/mobile/apps/photos/CLAUDE.md b/mobile/apps/photos/CLAUDE.md
deleted file mode 100644
index a32d702b40..0000000000
--- a/mobile/apps/photos/CLAUDE.md
+++ /dev/null
@@ -1,228 +0,0 @@
-# CLAUDE.md
-
-This file provides guidance to Claude, Codex, and any other agent when working with code in this repository.
-
-## Project Philosophy
-
-Ente is focused on privacy, transparency and trust. It's a fully open-source, end-to-end encrypted platform for storing data in the cloud. When contributing, always prioritize:
-
-- User privacy and data security
-- End-to-end encryption integrity
-- Transparent, auditable code
-- Zero-knowledge architecture principles
-
-## Monorepo Context
-
-This is the Ente Photos mobile app within the Ente monorepo. The monorepo contains:
-
-- Mobile apps (Photos, Auth, Locker) at `mobile/apps/`
-- Shared packages at `mobile/packages/`
-- Web, desktop, CLI, and server components in parent directories
-
-### Package Architecture
-
-The Photos app uses two types of packages:
-
-- **Shared packages** (`../../packages/`): Common code shared across multiple Ente apps (Photos, Auth, Locker)
-- **Photos-specific plugins** (`./plugins/`): Custom Flutter plugins specific to Photos app for separation and testability
-
-## Commit & PR Guidelines
-
-### Pre-commit/PR Checklist (RUN BEFORE EVERY COMMIT OR PR!)
-
-**CRITICAL: CI will fail if ANY of these checks fail. Run ALL commands and ensure they ALL pass.**
-
-```sh
-# 1. Format Dart code
-dart format .
-
-# 2. Analyze flutter code for errors and warnings
-flutter analyze
-```
-
-**Why CI might fail even after running these:**
-
-- Skipping any command above
-- Assuming auto-fix tools handle everything (they don't)
-- Not fixing warnings that flutter reports
-- Making changes after running the checks
-
-### Commit & PR Message Rules
-
-**These rules apply to BOTH commit messages AND pull request descriptions**
-
-- Keep messages CONCISE (no walls of text)
-- Subject line under 72 chars (no body text unless critical)
-- NO emojis
-- NO promotional text or links
-- NO Co-Authored-By lines
-
-### Additional Guidelines
-
-- Check `git status` before committing to avoid adding temporary/binary files
-- Never commit to main branch
-- All CI checks must pass - run the checklist commands above before committing or creating PR
-
-## Development Commands
-
-### Using Melos (Monorepo Management)
-
-```sh
-# From mobile/ directory - bootstrap all packages
-melos bootstrap
-
-# Run Photos app specifically
-melos run:photos:apk
-
-# Build Photos APK
-melos build:photos:apk
-
-# Clean Photos app
-melos clean:photos
-```
-
-### Direct Flutter Commands
-
-```sh
-# Development run
-flutter run --flavor independent
-
-# Build release APK
-flutter build apk --release --flavor independent
-
-# iOS build
-cd ios && pod install && cd ..
-flutter build ios
-```
-
-### Code Quality
-
-```sh
-# Static analysis and linting
-flutter analyze .
-
-# Run tests
-flutter test
-```
-
-## Architecture Overview
-
-### Service-Oriented Architecture
-
-The app uses a service layer pattern with 28+ specialized services:
-
-- **collections_service.dart**: Album and collection management
-- **search_service.dart**: Search functionality with ML support
-- **smart_memories_service.dart**: AI-powered memory curation
-- **sync_service.dart**: Local/remote synchronization
-- **Machine Learning Services**: Face recognition, semantic search, similar images
-
-### Key Patterns
-
-- **Service Locator**: Dependency injection via `lib/service_locator.dart`
-- **Event Bus**: Loose coupling via `lib/core/event_bus.dart`
-- **Repository Pattern**: Database abstraction in `lib/db/`
-- **Rust Integration**: Performance-critical operations via Flutter Rust Bridge
-
-### Security Architecture
-
-- End-to-end encryption with `ente_crypto` package
-- BIP39 mnemonic-based key generation (24 words)
-- Secure storage using platform-specific implementations
-- App lock and privacy screen features
-
-## Project Structure
-
-```
-lib/
-├── core/ # Configuration, constants, networking
-├── services/ # Business logic (28+ services)
-├── ui/ # UI components (18 subdirectories)
-├── models/ # Data models (17 subdirectories)
-├── db/ # SQLite database layer
-├── utils/ # Utilities and helpers
-├── gateways/ # API gateway interfaces
-├── events/ # Event system
-├── l10n/ # Localization files (intl_*.arb)
-└── generated/ # Auto-generated code including localizations
-```
-
-## Localization (Flutter)
-
-- Add new strings to `lib/l10n/intl_en.arb` (English base file)
-- Use `AppLocalizations` to access localized strings in code
-- Example: `AppLocalizations.of(context).yourStringKey`
-- Run code generation after adding new strings: `flutter pub get`
-- Translations managed via Crowdin for other languages
-
-## Key Dependencies
-
-- **Flutter 3.38.10** with Dart SDK >=3.10.0 <4.0.0
-- **Media**: `photo_manager`, `video_editor`, `ffmpeg_kit_flutter`
-- **Storage**: `sqlite_async`, `flutter_secure_storage`
-- **ML/AI**: Custom ONNX runtime, `ml_linalg`
-- **Rust**: Flutter Rust Bridge for performance
-
-## Development Setup Requirements
-
-1. Install Flutter v3.38.10 and Rust
-2. Generate Rust bindings from `rust/`: `cargo codegen frb`
-
-## Critical Coding Requirements
-
-### 1. Code Quality - MANDATORY
-
-**Every code change MUST pass `dart format .` and `flutter analyze` with zero issues**
-
-- Run `dart format .` first to format all Dart code
-- Run `flutter analyze` after EVERY code modification
-- Resolve ALL issues (info, warning, error) - no exceptions
-- The codebase has zero issues by default, so any issue is from your changes
-- DO NOT commit or consider work complete until both commands pass cleanly
-
-### 2. Component Reuse - MANDATORY
-
-**Always try to reuse existing components**
-
-- Use a subagent to search for existing components before creating new ones
-- Only create new components if none exist that meet the requirements
-- Check both UI components in `lib/ui/` and shared components in `../../packages/`
-
-### 3. Design System - MANDATORY
-
-**Never hardcode colors or text styles**
-
-- Always use the Ente design system for colors and typography
-- Use a subagent to find the appropriate design tokens
-- Access colors via theme: `getEnteColorScheme(context)`
-- Access text styles via theme: `getEnteTextTheme(context)`
-- Call above theme getters only at the top of (`build`) methods and re-use them throughout the component
-- If you MUST use custom colors/styles (extremely rare), explicitly inform the user with a clear warning
-
-### 4. Documentation Sync - MANDATORY
-
-**Keep spec documents synchronized with code changes**
-
-- When modifying code, also update any associated spec documents
-- Check for related spec files in `docs/` or project directories
-- Ensure documentation reflects the current implementation
-- Update examples in specs if behavior changes
-
-### 5. Database Methods - BEST PRACTICE
-
-**Prioritize readability in database methods**
-
-- For small result sets (e.g., 1-2 stale entries), prefer filtering in Dart for cleaner, more readable code
-- For large datasets, use SQL WHERE clauses for performance - they're much more efficient in SQLite
-
-## Important Notes
-
-- Large service files (some 70k+ lines) - consider file context when editing
-- 400+ dependencies - check existing libraries before adding new ones
-- When adding functionality, check both `../../packages/` for shared code and `./plugins/` for Photos-specific plugins
-- Performance-critical paths use Rust integration
-- Always follow existing code conventions and patterns in neighboring files
-
-# Individual Preferences
-
-- @~/.claude/ente-photos-instructions.md