Modern-Apps.git
Publicgit clone https://git.maproj.org/Modern-Apps.gitModern-Apps.git / flashcards / AGENTS.md
| 1 | # AGENTS.md — flashcards/ (':flashcards') |
| 2 | |
| 3 | > Scoped supplement. Global rules in root `AGENTS.md` apply. Stay inside `flashcards/` + allowed shared modules. Do not root-scan. |
| 4 | |
| 5 | _Install: ./install flashcards (dev by default)._ |
| 6 | <!-- last-reviewed: 2026-10-16 --> |
| 7 | - Gradle: :flashcards / dir: flashcards/ |
| 8 | - Package roots present: ui, data |
| 9 | - Entry files: MainActivity.kt (no Route.kt — decks/notes/review/stats flow) |
| 10 | - Deps: :library:room, :library:image |
| 11 | - Metadata: metadata_data/flashcards.md (present) |
| 12 | - Rust: no / screenshotTest: yes |
| 13 | |
| 14 | ## Overview |
| 15 | **Purpose:** Offline spaced-repetition flashcards — Anki-style notes/templates/decks with FSRS scheduling, review reminders, deck file sharing, APKG import/export. 100% offline. |
| 16 | **Key features:** Note-type editor + templating (`TemplateEngine`, `HtmlConvert`), card generation, review sessions with grading, FSRS optimizer, stats/charts, TTS speaker, media store; reminders via `ReviewReminderWorker`. |
| 17 | **Entry points:** `MainActivity.kt` → `ui/DeckListPage.kt` → `util/FlashcardsViewModel.kt` → `data/FlashcardsRepository.kt` → `util/Scheduler.kt` → `ui/ReviewPage.kt`. |
| 18 | **Gotchas:** |
| 19 | - `util/` is NOT a closed package root — pending migration; don't add more files there |
| 20 | - Scheduling correctness (FSRS) is the product — scheduler changes need review-log-driven tests, not just UI checks |
| 21 | - APKG import/export must stay compatible with Anki's format — test round-trips, not just one direction |
| 22 | |
| 23 | ## Key files |
| 24 | ### Root — entry (no Route.kt) |
| 25 | - com/vayunmathur/flashcards/MainActivity.kt |
| 26 | ### data/ — notes, decks, review log (Room) |
| 27 | - com/vayunmathur/flashcards/data/FlashcardsDatabase.kt |
| 28 | - com/vayunmathur/flashcards/data/FlashcardsRepository.kt |
| 29 | - com/vayunmathur/flashcards/data/Note.kt |
| 30 | - com/vayunmathur/flashcards/data/NoteType.kt |
| 31 | - com/vayunmathur/flashcards/data/NoteTypeField.kt |
| 32 | - com/vayunmathur/flashcards/data/Card.kt |
| 33 | - com/vayunmathur/flashcards/data/CardTemplate.kt |
| 34 | - com/vayunmathur/flashcards/data/Deck.kt |
| 35 | - com/vayunmathur/flashcards/data/ReviewLog.kt |
| 36 | ### util/ — ViewModel, scheduler, import/export (pending migration to closed roots) |
| 37 | - com/vayunmathur/flashcards/util/FlashcardsViewModel.kt |
| 38 | - com/vayunmathur/flashcards/util/FlashcardsViewModelHelper.kt |
| 39 | - com/vayunmathur/flashcards/util/FlashcardsUiContract.kt |
| 40 | - com/vayunmathur/flashcards/util/Scheduler.kt |
| 41 | - com/vayunmathur/flashcards/util/FsrsOptimizer.kt |
| 42 | - com/vayunmathur/flashcards/util/ReviewSession.kt |
| 43 | - com/vayunmathur/flashcards/util/CardGenerator.kt |
| 44 | - com/vayunmathur/flashcards/util/TemplateEngine.kt |
| 45 | - com/vayunmathur/flashcards/util/HtmlConvert.kt |
| 46 | - com/vayunmathur/flashcards/util/ApkgImport.kt |
| 47 | - com/vayunmathur/flashcards/util/ApkgExport.kt |
| 48 | - com/vayunmathur/flashcards/util/DeckIo.kt |
| 49 | - com/vayunmathur/flashcards/util/MediaStore.kt |
| 50 | - com/vayunmathur/flashcards/util/TtsSpeaker.kt |
| 51 | - com/vayunmathur/flashcards/util/ReviewReminderWorker.kt |
| 52 | - com/vayunmathur/flashcards/util/AppBackupAgent.kt |
| 53 | ### ui/ — decks, notes, review, stats |
| 54 | - com/vayunmathur/flashcards/ui/DeckListPage.kt |
| 55 | - com/vayunmathur/flashcards/ui/ReviewPage.kt |
| 56 | - com/vayunmathur/flashcards/ui/ReviewGradeButtons.kt |
| 57 | - com/vayunmathur/flashcards/ui/StudyModeRow.kt |
| 58 | - com/vayunmathur/flashcards/ui/CustomStudyDialog.kt |
| 59 | - com/vayunmathur/flashcards/ui/NoteListPage.kt |
| 60 | - com/vayunmathur/flashcards/ui/NoteListScreen.kt |
| 61 | - com/vayunmathur/flashcards/ui/NoteRowItem.kt |
| 62 | - com/vayunmathur/flashcards/ui/NoteEditPage.kt |
| 63 | - com/vayunmathur/flashcards/ui/NoteListFileHelpers.kt |
| 64 | - com/vayunmathur/flashcards/ui/ReorderableNoteList.kt |
| 65 | - com/vayunmathur/flashcards/ui/NoteTypeEditorPage.kt |
| 66 | - com/vayunmathur/flashcards/ui/NoteTypeEditorSection.kt |
| 67 | - com/vayunmathur/flashcards/ui/TagDialog.kt |
| 68 | - com/vayunmathur/flashcards/ui/TagFilterRow.kt |
| 69 | - com/vayunmathur/flashcards/ui/StatsPage.kt |
| 70 | - com/vayunmathur/flashcards/ui/FlashcardsCharts.kt |
| 71 | - com/vayunmathur/flashcards/ui/MarkdownContent.kt |
| 72 | - com/vayunmathur/flashcards/ui/MoveDeckDialog.kt |
| 73 | - com/vayunmathur/flashcards/ui/SettingsPage.kt |
| 74 | |
| 75 | ## Verify (this module only) |
| 76 | ``` |
| 77 | ./gradlew :flashcards:compileDevKotlin |
| 78 | ./gradlew :flashcards:lint |
| 79 | ./gradlew :flashcards:checkMetadata |
| 80 | ``` |