firebase
Skill15 starsChanged 42 days agoMITView on GitHub
Expert Firebase & Cloud Firestore assistance covering collection/document models, real-time listeners, security rules, and offline caching. Use when building mobile/web apps with real-time sync and client auth.
9 other projects use a version of this.
Adopted by
Most recently taken up by
- darknecrocities/SkillBuildertheir own version, first seen Nov 1, 2026
- xfstudio/skillstheir own version, first seen Oct 13, 2026
- alinaqi/claude-bootstraptheir own version, first seen Oct 8, 2026
- muxammadmamajonov/dot-claudetheir own version, first seen Jul 6, 2026
- alinaqi/maggytheir own version, first seen Jun 12, 2026
- Fandry96/k3-agentic-skillstheir own version, first seen May 12, 2026
Used with
Projects with it also use security.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
0xSeroSkillsecurity
Also in 4 projects that use this
Other versions9 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 9
- alinaqi/maggy★ 711same name
- alinaqi/claude-bootstrap★ 708same name
- alanalvestech/hitank★ 38same name
- Fandry96/k3-agentic-skills★ 27same name
- darknecrocities/SkillBuilder★ 13same name
- xfstudio/skills★ 9same name
- ai4brands-design/claude-skills★ 2same name
- tuannv14/claude-team-toolkit★ 1same name
- muxammadmamajonov/dot-claude★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository350 other files it gives its agents.
- airflowSkill
- catboostSkill
- claudeSkill
- comfyuiSkill
- cursor-aiSkill
- dalleSkill
- daskSkill
- dbtSkill
- deepseekSkill
- fastaiSkill
- geminiSkill
- github-copilotSkill
- huggingfaceSkill
- jaxSkill
- jupyterSkill
- kerasSkill
- langchainSkill
- lightgbmSkill
- llamaindexSkill
- llamaSkill
- matplotlibSkill
- midjourneySkill
- mistralSkill
- mlflowSkill
- nltkSkill
- numpySkill
- ollamaSkill
- openai-gptSkill
- opencvSkill
- pandasSkill
- perplexitySkill
- plotlySkill
- polarsSkill
- pytorchSkill
- raySkill
- scikit-learnSkill
- seabornSkill
- spacySkill
- sparkSkill
- stable-diffusionSkill
- tensorflowSkill
- vaexSkill
- weights-biasesSkill
- whisperSkill
- xgboostSkill
- api-gatewaySkill
- clean-architectureSkill
- cqrsSkill
- domain-driven-designSkill
- event-drivenSkill
- event-sourcingSkill
- graphqlSkill
- grpcSkill
- hexagonalSkill
- microservicesSkill
- modular-monolithSkill
- monolithSkill
- rest-apiSkill
- sagaSkill
- serverlessSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
5 rules. 0 are common, 1 is distinctive, and 4 are very specific to this project.
0
Common
Most of the 9 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 90
Use FieldValue.increment for atomic database updates:
- Very specific: line 109
Write Strict Security Rules: Never ship rules with allow read, write: if true;.
- Very specific: line 110
Always Unsubscribe from Listeners: Call the returned unsubscribe function (unsub()) when UI components unmount to prevent memory leaks.
- Very specific: line 111
Use Composite Indexes for Complex Queries: Define composite indexes in firestore.indexes.json for queries with multiple filters and sort …
- Distinctive: line 118
Write sensitive secrets in client Firebase config: Firebase API keys in client code identify projects.
“Common” is measured: kept by at least 6 in 10 of the 9 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Firebase (Firestore & Realtime Database)
Firebase provides two NoSQL databases:
- Cloud Firestore: The newer, recommended scalable database.
- Realtime Database: The original low-latency JSON tree sync.
When to Use
- Real-Time Client Synchronization: Pushing document and collection updates instantly to mobile and web clients via Firestore snapshot listeners.
- Rapid Prototyping & MVPs: Building complete web and mobile apps with drop-in Auth, Firestore, Cloud Functions, and Hosting.
- Offline-First Mobile Apps: Native offline caching and latency compensation out of the box in mobile and web SDKs.
- Client-Direct Database Access: Allowing client applications to query databases directly while enforcing access via declarative Security Rules.
Quick Start
import { getFirestore, collection, addDoc } from "firebase/firestore";
const db = getFirestore(app);
// Add document
await addDoc(collection(db, "users"), {
first: "Ada",
last: "Lovelace",
born: 1815,
});Core Concepts
Document & Collection Hierarchy (Firestore)
Data is organized into documents containing fields, nested inside collections and subcollections:
users (Collection)
└── user_101 (Document)
├── name: "Alex"
└── orders (Subcollection)
└── order_99 (Document)Real-Time Snapshot Listeners
Subscribes to live document updates with zero polling boilerplate:
import { doc, onSnapshot } from "firebase/firestore";
import { db } from "./firebase-config";
const unsub = onSnapshot(doc(db, "projects", "proj_415"), (docSnap) => {
if (docSnap.exists()) {
console.log("Current Project Data:", docSnap.data());
}
});Declarative Security Rules Architecture
Enforces authorization and schema validation at the database layer:
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /users/{userId} {
allow read, write: if request.auth != null && request.auth.uid == userId;
}
match /posts/{postId} {
allow read: if resource.data.isPublished == true;
allow create: if request.auth != null && request.resource.data.authorId == request.auth.uid;
}
}
}Common Patterns
Atomic Counter Increment with Firestore Transactions
Problem: Concurrent client clicks reading and updating the same counter cause race condition data corruption.
Solution:
Use FieldValue.increment for atomic database updates:
import { doc, updateDoc, increment } from "firebase/firestore";
import { db } from "./firebaseConfig";
async function upvotePost(postId) {
const postRef = doc(db, "posts", postId);
await updateDoc(postRef, {
upvotes: increment(1),
lastActivity: new Date(),
});
}Best Practices
Do:
- Write Strict Security Rules: Never ship rules with
allow read, write: if true;; validate user auth and required fields. - Always Unsubscribe from Listeners: Call the returned unsubscribe function (
unsub()) when UI components unmount to prevent memory leaks. - Use Composite Indexes for Complex Queries: Define composite indexes in
firestore.indexes.jsonfor queries with multiple filters and sort orders. - Batch Writes with
writeBatch(): Execute up to 500 document writes atomically to ensure consistency and minimize network roundtrips.
Don't:
- Store large collections in single documents: Avoid unbounded document arrays; single documents cannot exceed 1MB.
- Query without limits in mobile apps: Always append
.limit(20)to prevent consuming excessive read quotas. - Write sensitive secrets in client Firebase config: Firebase API keys in client code identify projects; protect data via Security Rules.
Troubleshooting
| Error | Cause | Solution |
Missing or insufficient permissions | Firestore Security Rules rejecting the request. | Check request.auth in firestore.rules and verify client authentication token. |
The query requires an index | Query filters across multiple fields or orders on a different field. | Click the generated index link in the Firebase error console to create the composite index. |
Resource Exhausted: Quota exceeded | Daily free tier document read/write limits exceeded. | Upgrade to Blaze plan or optimize listener queries with limit() clauses. |
References
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

