Firestore Review

Review Firestore security rules, collection structure, indexes, and queries for correctness and cost

ERP-CORE-DEV Updated

File contents

Firestore Review

Review Firestore for security rules, collection structure, composite indexes, listeners, offline persistence, and cost.

Key Checks

  • Security rules: no open-access (allow read, write: if true is CRITICAL), auth checks, field validation
  • Subcollection vs root collection decision based on access patterns
  • Composite indexes for multi-field queries, collection group indexes for cross-parent queries
  • Listeners detached on unmount, query-scoped (not full collection), error callbacks
  • Offline persistence configured, cache size bounded, hasPendingWrites monitored
  • Batch/transaction operations: batch.commit() for multiple writes, transactions for read-then-write
  • Query limits: no multi-field inequality, max 10 values in in/array-contains-any
  • Cost: select() for field masks, limit() on all lists, count() over full fetch

Output

Severity-sorted: CRITICAL, HIGH, MEDIUM, LOW, PASSED.

ERP-CORE-DEV/eagles-claude-config/tree/main/skills/firestore-review commit e098328511

Frequently asked questions

npx skillmds@latest add erp-core-dev/firestore-review