Agent skill

Firebase

by ericrisco in ericrisco/rsc-harness

A skill your agent uses when building on Firebase — Firestore data modeling, Security Rules, Auth and custom claims, Cloud Functions, Storage, modular Web/Admin SDK imports — including symptoms like…

MITAuto-check passedDatabases

Install Firebase

skills CLI
$ npx skills add ericrisco/rsc-harness --skill firebase -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install ericrisco/rsc-harness firebase --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/ericrisco/rsc-harness.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/firebase .claude/skills/firebase && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
firebase
GitHub stars
156
Token cost
~3.3k tokens
SKILL.md length
1,345 words
Files
7 (incl. scripts, references)
Skills in repo
229
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when building on Firebase — Firestore data modeling, Security Rules, Auth and custom claims, Cloud Functions, Storage, modular Web/Admin SDK imports — including symptoms like…

  • Building on Firebase — Firestore data modeling
  • SKILL.md covers Data modeling, Security Rules — the…, Auth and Cloud Functions (2nd gen), plus 4 more sections
  • Runs Shell scripts from its folder; calls firebase; needs STRIPE_KEY
  • Auth and custom claims

What it does

Firebase is an agent skill from ericrisco/rsc-harness. Use when building on Firebase — Firestore data modeling, Security Rules, Auth and custom claims, Cloud Functions, Storage, modular Web/Admin SDK imports — including symptoms like a database open to the internet, a query rejected by rules, or a doc stuck at ~1 write/sec. NOT managed-Postgres BaaS with SQL and RLS (that is supabase).

Its SKILL.md is about 3.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 9 other files, including scripts and reference files (for example `evals/README.md`, `evals/cases.yaml` and `references/cloud-functions.md`).

It sits in Databases, covering Database schema design, Serverless and NoSQL databases. It works with Firebase, Cloud Firestore, SQL and PostgreSQL. The repository describes itself as: Your agent invents things because it has no memory, and can't touch your database because it has no arms. rsc is the meta-harness that gives it both, plus the trade to know the… The licence is MIT.

When your agent uses it

  • Building on Firebase — Firestore data modeling
  • Auth and custom claims
  • Cloud Functions
  • Modular Web/Admin SDK imports — including symptoms like a database open to the internet

Example prompts

  • “/firebase”

Requirements

  • Node.js
  • A Bash shell
  • A credential in STRIPE_KEY

What it can do on your machine

Read from SKILL.md and the folder at commit 92fde8f. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Shell), which the agent can run.

    Shell commands in SKILL.md call:

    • firebase

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use firebase, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • STRIPE_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Firebase loads about 3.3k tokens when it runs, and up to ~6.6k if it reads all its reference files. Until then it costs about 86 tokens; SKILL.md has 1,345 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~86
When it runs · the whole SKILL.md, loaded when a task matches
~3.3k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~6.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from ericrisco/rsc-harness at commit 92fde8f, republished under its MIT licence (© ericrisco). 1,345 words, ~3,327 tokens.

Download SKILL.mdSave it as .claude/skills/firebase/SKILL.md (or your agent's skills folder). This skill also uses 6 other files; get the full folder from GitHub.
name
firebase
description
Use when building on Firebase — Firestore data modeling, Security Rules, Auth and custom claims, Cloud Functions, Storage, modular Web/Admin SDK imports — including symptoms like a database open to the internet, a query rejected by rules, or a doc stuck at ~1 write/sec. NOT managed-Postgres BaaS with SQL and RLS (that is supabase).
tags
firebase, firestore, security-rules, cloud-functions, auth
recommends
secure-coding, gcp-essentials, nextjs
origin
risco

Firebase — Firestore, Rules, Auth, Functions, Storage

The Firebase product surface that sits on top of GCP, on the modular Web SDK (v12) and the Admin SDK. The whole skill exists to stop two failure modes: dragging relational/SQL habits into a NoSQL document store, and leaving the database open to the internet.

Two facts drive everything below:

  • It is a NoSQL document store, shaped for the read path. No joins, no server-side OR across different fields without a composite index, no SELECT * across collections. Denormalize and fan-out so a screen is one cheap query — reads are what you pay for and what users wait on.
  • Rules ARE the access control. Firestore is reachable directly from untrusted clients. There is no app server in the trust path by default — firestore.rules (CEL) is the only thing between a browser and your data. App Check attests the request even came from your app before Rules evaluate.

Not this skill:

Instead of FirebaseGo to
Relational schema, SQL, EXPLAIN, indexing a SQL engine../postgresdb/SKILL.md
Managed Postgres BaaS (SQL + Postgres RLS + PostgREST) — the most-confused sibling: same "backend-as-a-service" shape, completely different data model and rules languagesupabase
AWS document/key-value store with its own capacity modeldynamodb
Self-hosted Mongo document modelingmongodb
Generic GCP project/IAM/billing not specific to a Firebase productgcp-essentials
React/Next.js component or rendering work that merely calls Firebasereact / ../nextjs/SKILL.md

Data modeling

Firestore charges and waits on reads. Model so the common screen is one query against one collection.

Collection vs subcollection vs root + denormalized field — decide by access pattern:

ShapeUse whenWhy
Subcollection (rooms/{id}/messages)Child list is only ever read inside its parent, can grow unboundedSubcollections don't bloat the parent doc; deleting a parent does NOT delete them (handle that)
Separate root collection + foreign idChild must be queried across all parents (collection-group query)A collectionGroup('messages') query needs the docs in same-named subcollections OR a root collection
Denormalized field on the parentA few values are shown alongside the parent and rarely changeAvoids a second read; you accept writing the copy on every change

Hard limits — design around them, don't discover them in prod:

  • A document maxes out at 1 MiB (1,048,576 bytes). Don't accumulate an unbounded array (chat messages, audit log) inside one doc — it will hit the wall and every read pays for the whole blob. Use a subcollection.
  • A single document tolerates only ~1 sustained write/sec. Monotonic IDs and indexed sequential timestamps create a hotspot on one index range. Use scattered auto-IDs (doc(collection(db,'x'))), and for high-frequency counters use a sharded counter (N shard docs, sum on read).

Query reality: no joins; range/inequality filters on a field plus an orderBy on another field require a composite index; in / array-contains-any are capped (~30 values). If a query needs an index, declare it in firestore.indexes.json — see the emulator gotcha below.

ts
// Bad — unbounded array inside one doc; hits 1 MiB, every read pays for all of it
await setDoc(doc(db, "rooms", roomId), { messages: [...allMessages, newMsg] });

// Good — one doc per message in a subcollection, scattered auto-ID, no hotspot
await addDoc(collection(db, "rooms", roomId, "messages"), {
  text, authorId, createdAt: serverTimestamp(),
});

Denormalization recipes, counter sharding, cursor pagination, getCountFromServer, collection-group queries, and composite-index design live in references/data-modeling.md.

Security Rules — the load-bearing section

Rules are NOT filters. A query is rejected outright unless the rules can guarantee every matched document is readable — Firestore will not silently drop the docs you can't see. So a list rule and the query that runs against it must agree: if the rule allows reading only your own docs, the query must itself be constrained (where("ownerId","==",uid)), or the whole query fails.

javascript
// Bad — the entire database is readable AND writable by anyone on the internet
rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} { allow read, write: if true; }
  }
}

// Good — default-deny, ownership-scoped, with create-time validation
rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    match /posts/{postId} {
      allow get:    if resource.data.ownerId == request.auth.uid;
      allow list:   if request.auth != null;            // query MUST add where(ownerId == uid)
      allow create: if request.auth.uid == request.resource.data.ownerId;
      allow update, delete: if resource.data.ownerId == request.auth.uid;
    }
    // everything else: no rule = denied
  }
}

Rules to internalize:

  • Default-deny. No matching allow = denied. Never add a /{document=**} catch-all with if true. That single line is the "open to the internet" headline risk.
  • request.auth is the authenticated identity (null when signed out); request.auth.token carries custom claims for RBAC (e.g. request.auth.token.admin == true).
  • resource.data is the existing doc; request.resource.data is the incoming write. Validate the incoming write on create/update (types, immutable ownerId, no privilege escalation).
  • get() / exists() read another doc for cross-document checks (e.g. role lookup) — each costs a billed read and counts against rule-evaluation limits, so keep them shallow.
  • get vs list are distinct: a single-doc read vs a query. read = both; split them so a query can't leak documents a single get would also have blocked.

Set custom claims with the Admin SDK, never from the client. Add App Check in production so Rules only run for requests that provably came from your real app.

Full CEL patterns — RBAC via claims, ownership, validation functions, time-based throttling, and the complete @firebase/rules-unit-testing recipe — are in references/security-rules.md.

Auth

  • Client sign-in with getAuth() + a provider; the SDK manages the refresh of the ID token.
  • Server-side, verify the ID token with getAuth(adminApp).verifyIdToken(idToken) before trusting any caller. A raw UID from the client is not proof of anything.
  • Custom claims for RBAC: getAuth(adminApp).setCustomUserClaims(uid, { admin: true }). Claims land in request.auth.token in Rules and in the decoded token on the server. They refresh on the client's next token refresh, not instantly — force a refresh if you need it immediately.
  • Session cookies (createSessionCookie) suit SSR / server-rendered apps where you want an httpOnly cookie instead of shipping the ID token to every request — pairs with ../nextjs/SKILL.md.
Show full SKILL.md (523 more words)Show less

Cloud Functions (2nd gen)

2nd gen is the default and the only generation that runs Node.js 22. Use firebase-functions v7 modular triggers and firebase-admin.

ts
import { onDocumentWritten } from "firebase-functions/v2/firestore";
import { onCall, HttpsError } from "firebase-functions/v2/https";
import { defineSecret } from "firebase-functions/params";

const STRIPE_KEY = defineSecret("STRIPE_KEY"); // never hard-code secrets

export const onPostWrite = onDocumentWritten(
  { document: "posts/{postId}", region: "europe-west1" },
  async (event) => {
    // Background events deliver AT-LEAST-ONCE — make this idempotent.
    const eventId = event.id; // dedupe on this (e.g. a processed/{eventId} marker doc)
  }
);

export const setAdminClaim = onCall(async (request) => {
  if (request.auth?.token.admin !== true) throw new HttpsError("permission-denied", "admins only");
  // ... verify, then setCustomUserClaims via admin SDK
});
  • Callable (onCall) gives you request.auth already verified; raw onRequest HTTPS does not — you must verify the ID token yourself.
  • Idempotency is mandatory for background triggers (onDocumentWritten etc.): events can fire more than once, so guard side effects with the event id.
  • Pin region, set secrets with defineSecret (not env literals), and tune concurrency for cost.
  • Functions require the Blaze plan; outbound networking from a function also requires Blaze.

Trigger catalogue, callable-vs-HTTPS auth, idempotency keys, cold-start/cost, Auth blocking functions, and region pinning are in references/cloud-functions.md.

Cloud Storage

Storage paths are gated by their own Rules; clients can hit them directly.

javascript
// Bad — any signed-in user can overwrite any other user's avatar
match /avatars/{fileName} { allow write: if request.auth != null; }

// Good — path-scoped to the owner, with a size/type guard
match /avatars/{uid}/{fileName} {
  allow read:  if true;                          // public avatars
  allow write: if request.auth.uid == uid
               && request.resource.size < 5 * 1024 * 1024
               && request.resource.contentType.matches('image/.*');
}

For server-issued time-limited access (private downloads), generate a signed URL from the Admin SDK rather than loosening the Rules.

SDK & project mechanics

Use the modular SDK so the bundler tree-shakes unused Firebase code. The old namespaced firebase.firestore() API is gone in v9+.

ts
// Bad — pulls the entire SDK; defeats tree-shaking (and the compat/namespaced API is legacy)
import firebase from "firebase";
firebase.firestore().collection("posts").get();

// Good — named imports, only what you use ships (Web SDK v12)
import { initializeApp } from "firebase/app";
import { getFirestore, collection, getDocs } from "firebase/firestore";
const db = getFirestore(initializeApp(config));
const snap = await getDocs(collection(db, "posts"));
  • firebase.json configures emulators, rules/index file paths, and hosting; firestore.indexes.json declares composite indexes.
  • Run the Local Emulator Suite (firebase emulators:start) for local dev and tests.
  • Emulator gotcha: the Firestore emulator does NOT enforce composite indexes — it runs any valid query. So "works in the emulator, fails in prod with requires an index" is expected. Verify index coverage separately by keeping firestore.indexes.json in sync and deploying it.
  • The Firebase API key in client config is not a secret (it identifies the project, not authorizes access — Rules + App Check do that). Service-account JSON keys ARE secrets; keep them server-side.

Anti-patterns

Anti-patternWhy it's wrongDo instead
allow read, write: if true; catch-allWhole DB is open to the internetDefault-deny; scope each match to request.auth + ownership
Treating rules as query filtersQuery is rejected, not filtered — it fails entirelyConstrain the query to match what list allows
Unbounded array in one documentHits the 1 MiB limit; every read pays for the whole blobSubcollection, one doc per item
Monotonic IDs / sequential indexed timestampsIndex hotspot → ~1 write/sec/doc wallScattered auto-IDs; sharded counters for high write rate
Trusting client writes for sensitive fieldsClient can set role: "admin" on itselfValidate request.resource in Rules; set claims via Admin SDK only
No App Check in productionRules run for any caller, including scripts/scrapersEnable App Check (reCAPTCHA / Play Integrity / App Attest)
Service-account key in client / repoFull admin access leaksKeep service-account JSON server-side; client API key is fine
Namespaced/compat SDK (firebase.firestore())Legacy, not tree-shakeable, gone in modularModular named imports from firebase/firestore
No emulator / rules testsOpen or broken rules ship silently@firebase/rules-unit-testing via firebase emulators:exec
Background trigger with non-idempotent side effectsAt-least-once delivery double-charges/double-writesDedupe on event.id

Verify

scripts/verify.sh is read-only and runs from your project root. It locates firestore.rules and fails if a root match /{document=**} carries an allow read, write: if true; catch-all or the rules file is empty; validates firestore.indexes.json parses as JSON; and, when the Firebase CLI is present, points at the firebase emulators:exec rules-test path. It exits 0 and skips cleanly when no Firebase artifacts are in the working directory — not every repo has them.

© ericrisco, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 6 other files (scripts, references) in skills/firebase of ericrisco/rsc-harness.

  • SKILL.md
  • evals/README.md
  • evals/cases.yaml
  • references/cloud-functions.md
  • references/data-modeling.md
  • references/security-rules.md
  • scripts/verify.sh

Open the folder on GitHubat commit 92fde8f

Compare with similar skills

Firebase next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Firebase compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Firebase this skillericrisco/rsc-harness156—~3.3kAutomated safety check: PassMIT
Database FundamentalsDanielPodolsky/ownyourcode2901 repos~1.6kAutomated safety check: PassMIT
Expert DatabaseReJeCtAll/ExpertTeam-Codex113—~692Automated safety check: PassMIT
Database Domain Specialistmodu-ai/moai-adk1.2k—~2.8kAutomated safety check: PassApache-2.0
Discover Databaserand/cc-polymath181—~2kAutomated safety check: PassMIT
Memstack Security Rls Guardiancwinvestments/memstack423—~3.4kAutomated safety check: PassProprietary

Similar skills

  • Database Fundamentals

    DanielPodolsky/ownyourcode

    Reviews schema design, SQL queries, ORM patterns. An agent skill from DanielPodolsky/ownyourcode.

    290 GitHub starsUsed in 1 repo~1.6k tokens
    DatabasesAuto-check passed
  • Expert Database

    ReJeCtAll/ExpertTeam-Codex

    数据库优化专家入口。用于 Codex CLI 的 $expert-database 调用. An agent skill from ReJeCtAll/ExpertTeam-Codex.

    113 GitHub stars~692 tokensUpdated 3 mo ago
    DatabasesAuto-check passed
  • Database guidance for PostgreSQL, MongoDB, Redis and Oracle plus Neon, Supabase and Firestore: schema design, indexing, query tuning and cloud database choice.

    1.2k GitHub stars~2.8k tokensUpdated today
    DatabasesAuto-check passed
  • Discover Database

    rand/cc-polymath

    Automatically discover database skills when working with SQL, PostgreSQL, MongoDB, Redis, database schema design, query optimization, migrations, connection pooling, ORMs, or database selection.

    181 GitHub stars~2k tokensUpdated 7 mo ago
    DatabasesAuto-check passed
  • Memstack Security Rls Guardian

    cwinvestments/memstack

    A skill your agent uses when creating or altering database tables in Supabase or PostgreSQL projects.

    423 GitHub stars~3.4k tokensUpdated 10 days ago
    DatabasesAuto-check passed
  • Database

    aiskillstore/marketplace

    Database development and operations workflow covering SQL, NoSQL, database design, migrations, optimization, and data engineering.

    430 GitHub starsUsed in 3 repos~1.2k tokens
    DatabasesAuto-check passed

More from ericrisco/rsc-harness

All 229 skills in this repo
  • Ab Testing

    ericrisco/rsc-harness

    A skill your agent uses when designing or analyzing a controlled experiment — falsifiable hypothesis, sample size from an MDE, reading significance/CI/power, CUPED, or rescuing tests that won't go…

    156 GitHub stars~2.4k tokensUpdated today
    Auto-check passed
  • Accessibility

    ericrisco/rsc-harness

    A skill your agent uses when making a web UI conform to WCAG 2.2 Level AA — axe-core or Lighthouse a11y violations, keyboard operability, focus management, ARIA roles/names/live regions, contrast…

    156 GitHub stars~3.4k tokensUpdated today
    Auto-check passed
  • Ads

    ericrisco/rsc-harness

    A skill your agent uses when running or fixing paid acquisition on Google or Meta — campaign structure (Performance Max, Demand Gen, Search, Advantage+), platform-fit creative, budget/scaling rules…

    156 GitHub stars~2.2k tokensUpdated today
    Auto-check passed
  • Agent Eval

    ericrisco/rsc-harness

    A skill your agent uses when measuring whether an LLM or agent system actually got better and gating merges on it: golden sets, fixing an inflated LLM-as-judge, scoring RAG (faithfulness, contextual…

    156 GitHub stars~3.2k tokensUpdated today
    Auto-check passed
  • AI Media

    ericrisco/rsc-harness

    A skill your agent uses when a creative goal must become a finished media file: pick and order generative-media models per modality — AI voiceover, image-to-video clips, score — then glue them with…

    156 GitHub stars~3.3k tokensUpdated today
    Auto-check passed
  • Analytics

    ericrisco/rsc-harness

    A skill your agent uses when instrumenting product or web analytics — GA4/PostHog SDK wiring, event taxonomy, funnels, double-counted events, consent gating, PII scrubbing.

    156 GitHub stars~2.8k tokensUpdated today
    Auto-check passed

Categories

Questions about Firebase

What does Firebase do?

A skill your agent uses when building on Firebase — Firestore data modeling, Security Rules, Auth and custom claims, Cloud Functions, Storage, modular Web/Admin SDK imports — including symptoms like…. Firebase is an agent skill from ericrisco/rsc-harness. Use when building on Firebase — Firestore data modeling, Security Rules, Auth and custom claims, Cloud Functions, Storage, modular Web/Admin SDK imports — including symptoms like a database open to the internet, a query rejected by rules, or a doc stuck at ~1 write/sec.

When should I use Firebase?

Firebase fits situations like: building on Firebase — Firestore data modeling; auth and custom claims; cloud Functions; modular Web/Admin SDK imports — including symptoms like a database open to the internet.

How do I install Firebase in Claude Code?

Run `npx skills add ericrisco/rsc-harness --skill firebase -a claude-code`. Or copy the skill folder (skills/firebase in ericrisco/rsc-harness) into .claude/skills/firebase in your project. Claude Code loads it when a task matches its description.

How do I install Firebase in Codex?

Run `npx skills add ericrisco/rsc-harness --skill firebase -a codex`. Or copy the skill folder (skills/firebase in ericrisco/rsc-harness) into .agents/skills/firebase in your project. Codex loads it when a task matches its description.

Can I use Firebase in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ericrisco/rsc-harness --skill firebase -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/firebase, .gemini/skills/firebase, .github/skills/firebase and .opencode/skills/firebase in your project.

What does Firebase need to run?

Going by SKILL.md and its folder, Firebase needs a shell for the scripts in its folder, the command-line tools its instructions call (firebase) and credentials named STRIPE_KEY. Our summary lists: Node.js; A Bash shell; A credential in STRIPE_KEY.

Does Firebase access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Firebase safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Firebase use?

Firebase is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Firebase use?

About 3.3k tokens (SKILL.md is roughly 13k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 3.2k tokens, read only when the agent opens those files.

What are the alternatives to Firebase?

Skills that share tags, products or a category with Firebase: Database Fundamentals (DanielPodolsky/ownyourcode, 290 stars), Expert Database (ReJeCtAll/ExpertTeam-Codex, 113 stars), Database Domain Specialist (modu-ai/moai-adk, 1.2k stars) and Discover Database (rand/cc-polymath, 181 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Firebase?

ericrisco (a GitHub user) maintains it in ericrisco/rsc-harness, which has 156 GitHub stars. The repository holds 229 skills in this directory. The repository was last updated on October 6, 2026.

Source: ericrisco/rsc-harness on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.