Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
docs: Add CLAUDE.md — AI agent context file for FLW-Mobile-App #463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Uh oh!
There was an error while loading. Please reload this page.
docs: Add CLAUDE.md — AI agent context file for FLW-Mobile-App #463
Changes from all commits
32f1b5fcfa0567File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
CLAUDE.md ΓÇö FLW Mobile App
This file gives AI coding agents (Claude Code, Cursor, Copilot) instant contextual knowledge of the FLW-Mobile-App codebase so they can assist without requiring manual context pasting.
What this app is
The FLW (Field-Level Worker) Mobile App is an Android application built on the AMRIT platform. It digitises the daily work of ASHA community health workers across India ΓÇö household registration, pregnancy and delivery tracking, child health records, NCD screening, and immunization.
Critical constraint: The app is offline-first. ASHA workers operate in low-connectivity rural environments. Every feature must work without internet and sync when connectivity returns.
Tech stack
Package structure
Critical conventions
1. Database (Room)
DB class:
InAppDbΓÇö NOTAppDatabase. Located atdatabase/room/InAppDb.kt. Current version: 58.Never bump the version without adding a migration.
Entity pattern:
syncState convention: Always
Int, neverBoolean isSynced.Migration pattern ΓÇö always use guards:
tableExists()andcolumnExists()are companion object functions onInAppDb. Always use them ΓÇö never assume a table or column exists.Adding a new entity checklist:
model/MyCache.ktwith@Entitydatabase/room/dao/MyDao.ktwith@DaoMyCache::classto entities list in@Databaseannotation inInAppDbabstract val myDao: MyDaotoInAppDbMIGRATION_X_YwithtableExistsguardbuilder.addMigrations(...)di/module2. DAO pattern
3. Repository pattern
4. ViewModel pattern
5. Fragment pattern
6. WorkManager worker pattern
7. Getting the logged-in user
Never access SharedPreferences directly ΓÇö always use
PreferenceDao.8. API 25 compatibility rules
java.time.*ΓÇö requires API 26. Usejava.util.Calendar+SimpleDateFormatpaddingHorizontal/paddingVerticalXML attributes ΓÇö usepaddingStart/paddingEnd/paddingTop/paddingBottomThreadLocal.withInitial {}ΓÇö useobject : ThreadLocal<T>() { override fun initialValue() = ... }9. Localization
All user-facing strings must exist in three files:
res/values/strings.xmlΓÇö Englishres/values-hi/strings.xmlΓÇö Hindires/values-as/strings.xmlΓÇö AssameseNever hardcode user-visible text in Kotlin or XML layout files.
10. What NOT to do
LiveDataΓÇö the project usesFlow+StateFlowkotlin-android-extensions(deprecated) ΓÇö use ViewBindingsyncState = 2(SYNCED) before confirmed API successPreferenceDaojava.time.*ΓÇö minSdk 25Health domain context
The app tracks:
BenRegCache, identified bybeneficiaryId: LongHouseholdCache, identified byhouseholdId: LongPregnantWomanRegistrationCache, ANC viaPregnantWomanAncCacheDeliveryOutcomeCacheChildRegCache,InfantRegCacheImmunizationCacheHRPPregnantAssessCache,HRPPregnantTrackCacheThe
BenBasicCacheis a Room@DatabaseViewthat joins most of these into a single queryable view used by the main beneficiary list screen.Gamification module (added in v58)
Located at
gamification/. Consists of:GamificationEventΓÇö sealed class of health worker actionsGamificationEngineΓÇö processes events, awards XP, updates streaks, unlocks badgesBadgeCatalogΓÇö trilingual badge definitionsTo trigger gamification from a health form after a successful save:
gamificationViewModel.onHealthEvent( userId, GamificationEvent.AncVisitCompleted(benId.toString()) )Available events:
HouseholdRegistered,BeneficiaryRegistered,AncVisitCompleted,DeliveryOutcomeRecorded,PncVisitCompleted,ImmunizationRecorded,HrpCaseIdentified,NcdScreeningCompleted,CbacFormFilled,DailyLogin.