Skip to content
Back to skills

Data Rules

ASecurity

Model the collections from the spec and open each one explicitly in firestore.rules, proven by emulator tests.

  • 234 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 28, 2026
ai-agentssecurity

Works with

  • cli

Security analysis

A100/100

Scanned September 28, 2026

npx -y skills add receptron/mulmoterminal --skill data-rules --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Data Rules?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Data Rules
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/receptron-data-rules/badge)](https://www.skillsdirectory.com/skills/receptron-data-rules)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: blueprint-firebase-data-rules
description: "Model the collections from the spec and open each one explicitly in firestore.rules, proven by emulator tests."
---

# Data model and security rules

The spec has a table per collection: who may read, create, update and delete. That table IS the rules.

1. For each collection, add a `match` block above the final deny-all. Open only what the table says.
2. On create, pin ownership (`request.resource.data.ownerUid == request.auth.uid`) and the fields a client may set
   (`request.resource.data.keys().hasOnly([...])`).
3. On update, forbid changing ownership and any field the table does not let that role change
   (`diff(resource.data).affectedKeys().hasOnly([...])`).
4. Write `test/blueprint/rules.spec.ts` with BOTH directions for every row of the table: the allowed operation
   succeeds (`assertSucceeds`) and every other role is refused (`assertFails`). A rule with only a success test is
   not tested.
5. If the table is ambiguous, ask — do not open more than it says.

Done when the check passes: `emulator-test.sh rules`.

## Always

- Read `.blueprint/spec.md` first. It is the agreed specification; do not widen it.
- When you need a decision, ask it through the blueprint question tool and stop. Do not guess.
- Never enable billing, deploy to production, delete data or handle a credential unless this step's gates say the
  user approved exactly that.
- Say you are done by stopping; the executor runs the check. Do not claim success yourself.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.