firestore-rules-creation
Designs, authors, refactors, and hardens production-grade Cloud Firestore Security Rules (firestore.rules).
Skill by Google LLC
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/ozcanorhandemirci-firestore-rules-creation
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: security, agent-building
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/firestore-rules-creation
What's inside
- Skill name
firestore-rules-creation- Description
- Designs, authors, refactors, and hardens production-grade Cloud Firestore Security Rules (firestore.rules). IMPORTANT: If subagent delegation AND the firestore-rules-author subagent are available in your environment, delegate authoring firestore.rules to the firestore-rules-author subagent. If subagent delegation is unavailable (e.g. not enabled in the IDE), firestore-rules-author is not installed, or you are running inside firestore-rules-author, follow this skill directly.
- License
- Apache-2.0
- Metadata
- author: Google LLC · category: Databases
- Instructions
- 593 lines in SKILL.md · view on GitHub
Agent Skills spec issues
- body: 593 lines (spec recommends under 500)
Files (2)
- LICENSE.source
- SKILL.md
SKILL.md (first lines)
# Firestore Security Rules Creation
> [!IMPORTANT] **Subagent Delegation vs. Direct Authoring**
>
> - **If subagent delegation AND the `firestore-rules-author` subagent are
> available** in your active environment: **DO NOT** author `firestore.rules`
> directly in the main agent. Invoke the `firestore-rules-author` subagent and
> delegate the analysis and creation of `firestore.rules` to it.
> - **If subagent delegation is unavailable** (e.g., in IDE environments where
> subagent tools are not enabled) **OR the `firestore-rules-author` subagent
> is not installed**, **OR if you are already executing inside
> `firestore-rules-author`**: proceed with the workflow below to author
> `firestore.rules` directly.
You are an expert Firebase Security Rules engineer with deep knowledge of
Firestore security best practices. Your task is to generate comprehensive,
secure Firebase Security rules for the user's project. To minimize the risk of
security incidents and avoid misleading the user about the security of their
application, you must be extremely humble about the rules you generate. Always
present the rules you've written as a prototype that needs review.
After generating the rules, you MUST explicitly communicate to the user exactly
like this: "I've set up prototype Security Rules to keep the data in Firestore
safe. They are designed to be secure for <explain reasons here>. However, you
should review and verify them before broadly sharing your app. If you'd like, I
can help you harden these rules."
### Workflow
Follow this structured workflow strictly:
#### Phase-1: Codebase Analysis
1. **Scan the entire codebase** to identify:
- Programming language(s) used (for understanding context only)
- All Firestore collection and document paths
- **All Firestore Queries:** Identify every `where()`, `orderBy()`, and
`limit()` clause. The security rules **MUST** allow these specific queries.
- Data models and schemas (interfaces, classes, types)
- Data types for each field (strings, numbers, booleans, timestamps, URLs,
emails, etc.)
- Required vs. optional fields
- Field constraints (min/max length, format patterns, allowed values)
- CRUD operations (create, read, update, delete)
- Authentication patterns (Firebase Auth, custom tokens, anonymous)
- Access patterns and business logic rules
1. **Synthesize your findings** concisely (in memory; do not create extra
untracked scratch files in the workspace) and refer to them when generating
the security rules.
#### Phase-2: Security Rules Generation
**CRITICAL**: Follow the following principles **every time you modify the
security rules file**
Generate Firebase Security Rules following these principles:
- **Default deny:** Start with denying all access, then explicitly allow only
what's needed
- **Least privilege:** Grant minimum permissions required
- **Validate data:** Check data types, allowed fields, and constraints on both
creates and updates.
- **MANDATORY:** You **MUST** use the **Validator Function Pattern** described
in the "Critical Directives" section below. This involves defining a
specific validation function (e.g., `isValidUser`) and calling it in
**BOTH** `create` and `update` rules.
- **MANDATORY:** For **ALL** creates **AND ALL** updates, ensure that after
the operation, the required fields are still available and that the data is
valid.
- **Authentication checks:** Verify user identity before granting access
- **Authorization logic:** Implement role-based or ownership-based access
control
- **UID Protection:** Prevent users from changing ownership of data
- **Initially restricted:** Never make any collection or data publicly readable,
always require authentication for any access to data unless the user makes an
*explicit* request for unauthenticated data.
This means the first firestore.rules file you generate must never have any
"allow read: true" statements.
**Structure Requirements:**
1. **Document assumed data models at the beginning of the rules file:**
```javascript
// ===============================================================
// Assumed Data Model
// ===============================================================
//
// This security rules file assumes the following data structures:
//
// Collection: [name]
// Document ID: [pattern]
// Fields:
// - field1: type (required/optional, constraints) - description
// - field2: type (required/optional, constraints) - description
// [List all fields with types, constraints, and whether immutable]
//
// [Repeat for all collections]
//
// ===============================================================
```
1. **Include comprehensive helper functions to avoid repetition:**
```javascript
// ===============================================================
// Helper Functions
// ===============================================================
//
// Check if the user is authenticated
function isAuthenticated() {
return request.auth != null;
}
//
// Check if user owns the resource (for user-owned documents)
function isOwner(userId) {
return isAuthenticated() && request.auth.uid == userId;
}From OzcanOrhanDemirci/Mode_Code, Apache-2.0.
More from OzcanOrhanDemirci/Mode_Code
- 0.570score
i2c-bringup-diagnostician
OzcanOrhanDemirci
Use when users need to diagnose I2C bring-up failures on Arduino or ESP32-class boards, including no devices found, wrong readings, address conflicts…
SkillAFreshness: AClaude Code +9 - 0.565score
playstore-review
OzcanOrhanDemirci
Checks an Android app project against Google Play's Developer Program Policies before submission.
SkillAFreshness: AClaude Code +9 - 0.565score
dart-3-updates
OzcanOrhanDemirci
Use when writing switch statements, refactoring if-else chains, creating data classes, choosing records vs classes, destructuring values, or modernizing…
SkillAFreshness: AClaude Code +9 - 0.565score
firebase-cloud-firestore
OzcanOrhanDemirci
Use when setting up Firestore, designing schemas, doing CRUD, creating listeners, paginating queries, configuring indexes, enabling offline persistence, or…
SkillAFreshness: AClaude Code +9 - 0.565score
cuda-profiling
OzcanOrhanDemirci
CUDA profiling skill for NVIDIA GPU performance analysis.
SkillAFreshness: AClaude Code +9 - 0.565score
appstore-review
OzcanOrhanDemirci
Checks an iOS/iPadOS/macOS app project against Apple's App Store Review Guidelines before submission.
SkillAFreshness: AClaude Code +9 - 0.561score
openscad
OzcanOrhanDemirci
Create and render OpenSCAD 3D models.
SkillAFreshness: AClaude Code +9 - 0.558score
firebase-security-rules-auditor
Google LLC
Audits Firebase (Firestore, Cloud Storage) security rules for vulnerabilities, privilege escalation, role bypasses, create vs update inconsistencies, resource…
SkillAFreshness: AClaude Code +9 - 0.539score
codebase-design
OzcanOrhanDemirci
Shared vocabulary for designing deep modules.
SkillAFreshness: AClaude Code +9 - 0.539score
domain-modeling
OzcanOrhanDemirci
Build and sharpen a project's domain model.
SkillAFreshness: AClaude Code +9
Signals
- Stars
- 0
- Forks
- 0
- Open issues
- 5
- Last commit (this folder)
- Oct 18, 2026 (10 days ago)
- Last release
- Oct 15, 2026 (13 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- Apache-2.0
- Repository
- github.com/OzcanOrhanDemirci/Mode_Code
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from Google LLC
- 0.861score
secops-cases
Google LLCOfficial
Manage Google Security Operations (SecOps) SOAR cases throughout their lifecycle.
SkillAFreshness: A★ 21.5KClaude Code +9 - 0.861score
secops-triage
Google LLCOfficial
Expert guidance for security alert triage in Google SecOps.
SkillAFreshness: A★ 21.5KClaude Code +9 - 0.861score
secops-investigate
Google LLCOfficial
Expert guidance for deep security incident and entity investigations in Google SecOps.
SkillAFreshness: A★ 21.5KClaude Code +9 - 0.861score
secops-hunt
Google LLCOfficial
Expert guidance for proactive threat hunting in Google SecOps.
SkillAFreshness: A★ 21.5KClaude Code +9 - 0.861score
secops-detection-engineering
Google LLCOfficial
Author, validate, test, and deploy YARA-L 2.0 detection rules and evaluate end-to-end detection coverage gaps in Google SecOps.
SkillAFreshness: A★ 21.5KClaude Code +9 - 0.815score
ima-sdk-client-side
Google LLCOfficial
Supports Interactive Media Ads (IMA) SDK.
SkillBFreshness: B★ 21.5KClaude Code +9
Cite this page
firestore-rules-creation skill. Agent Mart. https://agentmart.dev/skills/ozcanorhandemirci-firestore-rules-creation (last updated 2026-10-24)