android-room-database
Model Room entities, DAOs, transactions, migrations, schema exports, and test-safe local persistence.
What this skill does
# Android Room Database ## When To Use - Use this skill when the request is about: room database android, dao query migration android, room schema export. - Primary outcome: Model Room entities, DAOs, transactions, migrations, schema exports, and test-safe local persistence. - Reach for this skill when the hard part is schema design, DAO queries, transactions, migrations, or Room testing. Hand off to `android-rxjava-to-coroutines-migration` only if the main work is reactive API migration rather than the database contract itself. - Handoff skills when the scope expands: - `android-local-persistence-datastore` - `android-testing-unit` ## Workflow 1. Start with the persistence contract: entities, keys, indexes, relations, and whether the data is source-of-truth, cache, or offline-first state. 2. Model DAO access patterns explicitly, including transaction boundaries, query shape, paging, and invalidation behavior. 3. Plan schema evolution before changing entities: exported schemas, migration steps, auto-migration eligibility, and destructive-fallback policy. 4. Validate migration and query behavior with deterministic tests rather than assuming Room annotations are enough. 5. Hand off DataStore, sync, or reactive API questions only after the Room boundary is correct. ## Guardrails - Export schemas and treat them as part of the contract, not optional tooling noise. - Keep entities persistence-focused; map to domain/UI models instead of leaking table shape upward. - Use explicit transactions for multi-step writes that must remain consistent. - Test migrations against real old schemas before trusting them in release builds. ## Anti-Patterns - Treating Room entities as the app's domain model everywhere. - Editing schemas without exporting or validating migration paths. - Writing broad `SELECT *` queries when the screen only needs a narrow projection. - Collapsing database, sync, and reactive-stream migration problems into one undifferentiated task. ## Review Focus - Entity keys, indexes, relations, and schema ownership. - DAO query shape, transactions, and invalidation behavior. - Migration safety, schema exports, and test coverage. - Clear boundaries between Room models and higher-level app models. ## Examples ### Happy path - Scenario: Persist task items and reminder flags with schema-aware entities. - Command: `cd examples/orbittasks-compose && ./gradlew :app:testDebugUnitTest` ### Edge case - Scenario: Recover from a failed schema change with an explicit migration path. - Command: `python3 scripts/eval_triggers.py --skill android-room-database` ### Failure recovery - Scenario: Keep Room requests separate from DataStore, networking, and modernization prompts. - Command: `cd examples/orbittasks-xml && ./gradlew :app:testDebugUnitTest` ## Done Checklist - Entities, DAOs, and transactions match the real persistence contract. - Schema export and migration strategy are explicit. - Query and migration tests cover the risky paths. - Non-Room concerns are handed off instead of mixed into the database task. ## Official References - [https://developer.android.com/training/data-storage/room](https://developer.android.com/training/data-storage/room) - [https://developer.android.com/training/data-storage/room/migrating-db-versions](https://developer.android.com/training/data-storage/room/migrating-db-versions) - [https://developer.android.com/training/data-storage/room/accessing-data](https://developer.android.com/training/data-storage/room/accessing-data) - [https://developer.android.com/training/data-storage/room/prepopulate](https://developer.android.com/training/data-storage/room/prepopulate) - [https://developer.android.com/topic/performance/sqlite-performance-best-practices](https://developer.android.com/topic/performance/sqlite-performance-best-practices)
Related in Code Review
gstack
IncludedFast headless browser for QA testing and site dogfooding. Navigate pages, interact with elements, verify state, diff before/after, take annotated screenshots, test responsive layouts, forms, uploads, dialogs, and capture bug evidence. Use when asked to open or test a site, verify a deployment, dogfood a user flow, or file a bug with screenshots. (gstack)
startup-due-diligence
IncludedLegal due diligence review for seed-stage and Series A startups (US, Delaware C-Corp focus). Supports both investor and founder perspectives. Capabilities include: (1) Interactive document review and issue spotting; (2) Document request list generation; (3) Cap table and SAFE/convertible note analysis; (4) Red flag identification with severity ratings; (5) Diligence report generation. TRIGGERS: due diligence, DD, startup investment, cap table review, Series A, seed round, investor diligence, legal review startup, SAFE analysis, convertible note, 409A, founder vesting.
interview-master
IncludedThis skill should be used when the user asks to "generate interview questions", "prepare for interview", "optimize resume", "conduct mock interview", "analyze git commits for resume", "generate resume from code", "review my resume", or mentions interview preparation, career assistance, or extracting project experience from git history. Provides comprehensive interview and career development guidance for both job seekers and interviewers.
fix-issue
IncludedFixes GitHub issues using parallel analysis agents for root cause investigation, code exploration, and regression detection. Reads issue context from gh CLI, searches codebase and memory for related patterns, generates a fix with tests, and links the resolution back to the issue via PR. Includes prevention analysis to avoid recurrence. Use when debugging errors, resolving regressions, fixing bugs, or triaging issues.
sf-apex
IncludedGenerates and reviews Salesforce Apex code with 150-point scoring. TRIGGER when: user writes, reviews, or fixes Apex classes, triggers, test classes, batch/queueable/schedulable jobs, or touches .cls/.trigger files. DO NOT TRIGGER when: LWC JavaScript (use sf-lwc), Flow XML (use sf-flow), SOQL-only queries (use sf-soql), or non-Salesforce code.
swift-development
IncludedComprehensive Swift development for building, testing, and deploying iOS/macOS applications. Use when Claude needs to: (1) Build Swift packages or Xcode projects from command line, (2) Run tests with XCTest or Swift Testing framework, (3) Manage iOS simulators with simctl, (4) Handle code signing, provisioning profiles, and app distribution, (5) Format or lint Swift code with SwiftFormat/SwiftLint, (6) Work with Swift Package Manager (SPM), (7) Implement Swift 6 concurrency patterns (async/await, actors, Sendable), (8) Create SwiftUI views with MVVM architecture, (9) Set up Core Data or SwiftData persistence, or any other Swift/iOS/macOS development tasks.