firestore-rules-test-generator

Generate Firestore security rule unit tests with TypeScript and Vitest.

1|Updated Jan 21, 2026
One-click install
npx skills add https://github.com/dfrabik/dev-portfolio --skill firestore-rules-test-generator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: firestore-rules-test-generator
Source: https://github.com/dfrabik/dev-portfolio/tree/main/.cursor/skills/firestore-rules-test-generator
Command: npx skills add https://github.com/dfrabik/dev-portfolio --skill firestore-rules-test-generator

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Firestore security rules can be brittle and hard to validate in large projects; this skill generates robust unit tests that verify access control, cross-workspace isolation, and data immutability.

Core Features & Use Cases

  • Generates deterministic, repeatable tests for role-based access control across multiple workspaces and collections.
  • Validates cross-workspace data isolation and enforces immutable data constraints.
  • Provides test scaffolding compatible with TypeScript, Vitest, and the Firestore emulator to support quick audits during rule updates.

Quick Start

Describe the collection and access patterns you want to test and specify user roles and permissions so the skill can generate comprehensive test suites.

Frequently Asked Questions about firestore-rules-test-generator

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write unit tests for Firestore security rules to validate role-based access control?

Firestore security rules testing validates access control, cross-workspace isolation, and data immutability by running emulator-driven unit tests that simulate authenticated user contexts and verify collection-level read and write permissions.

How do I test cross-workspace data isolation and immutability constraints in Firestore rules?

You test cross-workspace data isolation and immutability constraints in Firestore rules by generating test scaffolding that simulates multiple role-based contexts and asserts that users cannot access or mutate data outside their assigned workspace boundaries.

Can I use Vitest and the Firebase emulator to run automated security rules tests for new collections?

Yes, Vitest and the Firebase emulator are fully supported for running automated security rules tests, providing TypeScript-compatible test scaffolding that enables quick audits during rule updates or when adding new collections with complex permissions.

What should I provide to generate a comprehensive Firestore rules test suite?

To generate a comprehensive Firestore rules test suite, you should describe your collection structure, access patterns, user roles, and specific permissions so the generator can output deterministic tests covering those exact scenarios.

What are the limitations of testing Firestore security rules with generated unit tests?

Generated unit tests for Firestore security rules are limited to validating access control, cross-workspace isolation, and immutability logic within the emulator environment, and require you to accurately define collection schemas and user roles to avoid missing edge cases.