From agent-auto-kit
Apply Firebase best practices when writing, reviewing, correcting, or hardening Firebase code and config — Firestore/Storage security rules, composite & single-field indexes (firestore.indexes.json), Firebase Auth, role/permission (RBAC) design, Cloud Functions, Realtime Database, and Remote Config. Use when asked to "fix/optimize Firestore indexes", "audit/tighten security rules", "standardize roles", "set up custom claims", "harden a Cloud Function", "write Realtime Database rules", "make this Firebase project production-safe", or when reviewing any .rules / indexes.json / Auth / functions / RTDB / Remote Config code. For project-specific Firestore config editing/seeding/deploys, defer to firestore-config-edit.
How this skill is triggered — by the user, by Claude, or both
Slash command
/agent-auto-kit:firebase-best-practicesThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Reference discipline for **correcting and hardening** Firebase: security rules, RBAC/roles, Auth, and index optimization. Apply these rules when writing or reviewing any Firebase code — treat findings as things to *fix*, not just flag.
Reference discipline for correcting and hardening Firebase: security rules, RBAC/roles, Auth, and index optimization. Apply these rules when writing or reviewing any Firebase code — treat findings as things to fix, not just flag.
This skill is framework-level and reusable. It is NOT about one project's data model. If a repo already ships a project-specific config skill (e.g. firestore-config-edit), that skill owns where config lives and how to deploy it in this repo; this skill owns what correct looks like. When both apply, follow the project skill's deploy/safety workflow and this skill's correctness bar.
match starts from no access. Never ship allow read, write: if true; or a top-level match /{document=**} that grants access.firestore.indexes.json entries blind. Indexes cost write latency + storage; missing ones fail queries at runtime. Optimize deliberately. Read indexes.md.Consult these based on what you're doing:
security-rules.md — deny-by-default structure, helper functions, request.auth checks, custom-claims vs get()/exists() lookups (and their read cost), data validation on request.resource.data, immutable/ownership fields, multi-tenant isolation, "rules aren't filters", Storage rules, and the emulator/rules-unit-test loop.
rbac-roles.md — the decision matrix for custom claims vs Firestore role docs, a canonical role schema, least-privilege hierarchies, tenant-scoped roles, setting claims with the Admin SDK, and the token-propagation gotcha (getIdToken(true)).
auth.md — App Check, email-enumeration protection, MFA, password policy/reCAPTCHA, session & token lifetime, revoking sessions, and safe Admin SDK usage.
indexes.md — single-field (auto) vs composite (manual) indexes, when a composite index is required, single-field exemptions to cut write cost / dodge limits, collection-group indexes, query optimization (cursor pagination, count(), denormalization), the missing-index error→link→CLI flow, TTL policies, and the storage/write cost model.
cloud-functions.md — onCall vs onRequest vs background triggers and their auth models, never-trust-the-client, idempotency for at-least-once delivery, cold-start/concurrency/cost tuning, secrets via Secret Manager, and HttpsError handling.
realtime-database.md — the RTDB rules dialect (cascading .read/.write, .validate, .indexOn), RTDB-vs-Firestore choice, flatten-don't-nest modeling, atomic fan-out writes, query indexing, and bandwidth/cost.
remote-config.md — the public-config trust boundary (no secrets, no security gates), in-app defaults, parameter naming, fetch throttling / fetch-vs-activate, and staged rollouts with version-history rollback.
review-checklist.md — the audit → correct → verify protocol: which files to open, the red-flag list, and the dev-first deploy gate.
When asked to "make this Firebase project correct/optimized":
firestore.rules, storage.rules, database.rules.json (RTDB), firestore.indexes.json, firebase.json, the functions/ source, and Auth/custom-claims code (search for setCustomUserClaims, request.auth.token, getIdToken, onCall, onRequest).firebase deploy unprompted.npx claudepluginhub slenderman2511/agentautokit --plugin agent-auto-kitCreates structured, bite-sized implementation plans from specs or requirements before writing code. Useful for breaking down multi-step tasks into testable steps with file structure and task boundaries.