# firestore-schema-designer

> Use when a Firebase app needs Firestore collection design, document shape, subcollection strategy, security rule implications, or query-aware data modeling. Trigger on requests to design Firestore data structures before implementation.

- Skill: `saranskumar/firestore-schema-designer` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds add saranskumar/firestore-schema-designer`
- Raw SKILL.md: https://api.skillmd.com/api/skills/saranskumar/firestore-schema-designer/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Security
- Author: saranskumar (https://skillmd.com/u/saranskumar)
- Updated: 2026-08-19
- Page: https://skillmd.com/skills/saranskumar/firestore-schema-designer

---


# Goal
Design Firestore data models that match query patterns, permissions, and operational constraints.

# When to Use
- The app uses Firestore.
- Collections and document ownership need planning.
- Security rules and queries depend on document shape.

# Instructions
1. Start from access patterns, not relational habits.
2. Define top-level collections, document IDs, and any subcollections.
3. Plan denormalization where query needs justify it.
4. Call out rule-sensitive fields, counters, and aggregate patterns.
5. Consult `references/firestore-patterns.md` when query and rule tradeoffs matter.

# Constraints
- Do not mirror SQL table design mechanically.
- Avoid deep nesting unless access patterns truly require it.
- Keep rule checks cheap and document ownership obvious.

# Output Format
- Collection map
- Document sketches
- Query/rule implications
- Denormalization notes

# Examples
- "Design Firestore for a chat and notifications app."
- "How should we model team projects in Firestore?"

