@intentsolutionsio/jeremy-firestore 2.0.0 → 2.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -9,6 +9,7 @@ Build, manage, and optimize Firebase/Firestore databases with AI-powered agents
9
9
  ## Features
10
10
 
11
11
  ### Core Capabilities
12
+
12
13
  - **CRUD Operations** - Create, read, update, delete with batch support
13
14
  - **Security Rules** - Generate, validate, and deploy Firestore security rules
14
15
  - **Data Migration** - Migrate data between collections, projects, or environments
@@ -19,12 +20,14 @@ Build, manage, and optimize Firebase/Firestore databases with AI-powered agents
19
20
  - **Collection Management** - Schema validation, indexing, and organization
20
21
 
21
22
  ### AI Agents
23
+
22
24
  - **firebase-operations-agent** - CRUD, queries, batch operations
23
25
  - **firestore-security-agent** - Security rules generation and validation
24
26
  - **firestore-migration-agent** - Data migration and transformation
25
27
  - **firestore-optimizer-agent** - Performance and cost optimization
26
28
 
27
29
  ### Commands
30
+
28
31
  - `/firestore-setup` - Initialize Firebase SDK and credentials
29
32
  - `/firestore-query` - Interactive query builder
30
33
  - `/firestore-migrate` - Guided migration workflow
@@ -68,7 +71,7 @@ export GOOGLE_APPLICATION_CREDENTIALS="/path/to/serviceAccountKey.json"
68
71
 
69
72
  ### Example 1: CRUD Operations
70
73
 
71
- ```javascript
74
+ ```text
72
75
  // Create documents
73
76
  "Create a new user document in the 'users' collection"
74
77
 
@@ -119,7 +122,8 @@ Agent:
119
122
  ```
120
123
 
121
124
  Agent generates:
122
- ```javascript
125
+
126
+ ```text
123
127
  rules_version = '2';
124
128
  service cloud.firestore {
125
129
  match /databases/{database}/documents {
@@ -147,6 +151,7 @@ service cloud.firestore {
147
151
  ```
148
152
 
149
153
  Agent workflow:
154
+
150
155
  1. **Connects to staging** - Reads source collection
151
156
  2. **Transforms data** - Anonymizes PII fields
152
157
  3. **Validates** - Checks schema compatibility
@@ -162,6 +167,7 @@ Agent workflow:
162
167
  ```
163
168
 
164
169
  Agent executes:
170
+
165
171
  - Queries in batches of 500 documents
166
172
  - Uses batch writes for efficiency (reduces costs 10x)
167
173
  - Handles rate limits automatically
@@ -176,6 +182,7 @@ Agent executes:
176
182
  ```
177
183
 
178
184
  Agent analyzes:
185
+
179
186
  - **Missing indexes** - Identifies composite indexes needed
180
187
  - **Query patterns** - Finds inefficient queries
181
188
  - **Collection structure** - Suggests denormalization opportunities
@@ -191,18 +198,21 @@ Agent analyzes:
191
198
  **Purpose:** Handle all Firestore CRUD operations, queries, and batch processing
192
199
 
193
200
  **Use when:**
201
+
194
202
  - Creating, reading, updating, or deleting documents
195
203
  - Running complex queries with filters and ordering
196
204
  - Batch operations on multiple documents
197
205
  - Collection management
198
206
 
199
207
  **Trigger phrases:**
208
+
200
209
  - "create a document in..."
201
210
  - "query the users collection..."
202
211
  - "batch update all documents where..."
203
212
  - "delete documents matching..."
204
213
 
205
214
  **Example:**
215
+
206
216
  ```
207
217
  User: "Get the 10 most recent orders for user123"
208
218
 
@@ -218,18 +228,21 @@ Agent:
218
228
  **Purpose:** Generate, validate, and deploy Firestore security rules
219
229
 
220
230
  **Use when:**
231
+
221
232
  - Creating new security rules
222
233
  - Validating existing rules
223
234
  - Troubleshooting permission errors
224
235
  - Implementing authentication patterns
225
236
 
226
237
  **Trigger phrases:**
238
+
227
239
  - "create security rules for..."
228
240
  - "validate my firestore rules..."
229
241
  - "fix permission denied error..."
230
242
  - "implement role-based access..."
231
243
 
232
244
  **Example:**
245
+
233
246
  ```
234
247
  User: "Create rules for a chat app with public rooms and private messages"
235
248
 
@@ -248,18 +261,21 @@ Agent:
248
261
  **Purpose:** Migrate data between collections, projects, or environments
249
262
 
250
263
  **Use when:**
264
+
251
265
  - Moving data between environments (staging → production)
252
266
  - Restructuring collections
253
267
  - Backfilling data
254
268
  - Importing/exporting data
255
269
 
256
270
  **Trigger phrases:**
271
+
257
272
  - "migrate data from..."
258
273
  - "copy collection to..."
259
274
  - "restructure the users collection..."
260
275
  - "backfill missing fields..."
261
276
 
262
277
  **Example:**
278
+
263
279
  ```
264
280
  User: "Migrate users collection to a new structure with nested addresses"
265
281
 
@@ -276,18 +292,21 @@ Agent:
276
292
  **Purpose:** Optimize Firestore performance and reduce costs
277
293
 
278
294
  **Use when:**
295
+
279
296
  - Slow queries need optimization
280
297
  - Monthly costs are too high
281
298
  - Need index recommendations
282
299
  - Want to analyze usage patterns
283
300
 
284
301
  **Trigger phrases:**
302
+
285
303
  - "optimize my firestore performance..."
286
304
  - "reduce firebase costs..."
287
305
  - "why is this query slow..."
288
306
  - "analyze my firestore usage..."
289
307
 
290
308
  **Example:**
309
+
291
310
  ```
292
311
  User: "Why is my users query so slow?"
293
312
 
@@ -349,24 +368,28 @@ module.exports = {
349
368
  ## Best Practices
350
369
 
351
370
  ### Security Rules
371
+
352
372
  - **Never allow open access** - Always require authentication
353
373
  - **Validate all writes** - Check field types and values
354
374
  - **Limit read scope** - Only allow reading necessary data
355
375
  - **Test rules thoroughly** - Use Firebase Emulator Suite
356
376
 
357
377
  ### Performance
378
+
358
379
  - **Use indexes** - Create composite indexes for complex queries
359
380
  - **Batch operations** - Use batch writes for multiple documents
360
381
  - **Denormalize data** - Duplicate data to avoid joins
361
382
  - **Paginate results** - Use cursor-based pagination for large datasets
362
383
 
363
384
  ### Cost Optimization
385
+
364
386
  - **Cache frequently read data** - Use in-memory caching
365
387
  - **Minimize document reads** - Use `select()` to read specific fields
366
388
  - **Archive old data** - Move historical data to Cloud Storage
367
389
  - **Monitor usage** - Set up billing alerts
368
390
 
369
391
  ### Data Modeling
392
+
370
393
  - **Keep documents small** - Max 1MB per document
371
394
  - **Use subcollections** - For nested data hierarchies
372
395
  - **Plan for scale** - Design for millions of documents
@@ -378,7 +401,7 @@ module.exports = {
378
401
 
379
402
  ### Pattern 1: User Profiles with Privacy
380
403
 
381
- ```javascript
404
+ ```text
382
405
  // Collection structure
383
406
  users/{userId}
384
407
  - public: { name, avatar, bio } // Anyone can read
@@ -388,7 +411,7 @@ users/{userId}
388
411
 
389
412
  ### Pattern 2: Real-time Chat
390
413
 
391
- ```javascript
414
+ ```text
392
415
  // Collection structure
393
416
  rooms/{roomId}
394
417
  - metadata: { name, createdAt, memberCount }
@@ -404,7 +427,7 @@ messages/{messageId}
404
427
 
405
428
  ### Pattern 3: E-commerce Orders
406
429
 
407
- ```javascript
430
+ ```text
408
431
  // Collection structure
409
432
  orders/{orderId}
410
433
  - userId, status, total, createdAt
@@ -475,7 +498,7 @@ firebase projects:list
475
498
 
476
499
  ### Cloud Functions Integration
477
500
 
478
- ```javascript
501
+ ```text
479
502
  // Trigger Cloud Functions from Firestore
480
503
  "Create a function that sends an email when a new user signs up"
481
504
 
@@ -587,16 +610,19 @@ exports.onUserCreate = functions.firestore
587
610
  ## Resources
588
611
 
589
612
  ### Firebase Documentation
613
+
590
614
  - [Firestore Documentation](https://firebase.google.com/docs/firestore)
591
615
  - [Security Rules](https://firebase.google.com/docs/firestore/security/get-started)
592
616
  - [Best Practices](https://firebase.google.com/docs/firestore/best-practices)
593
617
 
594
618
  ### Plugin Resources
619
+
595
620
  - [GitHub Repository](https://github.com/jeremylongshore/claude-code-plugins)
596
621
  - [Issue Tracker](https://github.com/jeremylongshore/claude-code-plugins/issues)
597
622
  - [Marketplace](https://claudecodeplugins.io/)
598
623
 
599
624
  ### Community
625
+
600
626
  - [Discord](https://discord.com/invite/6PPFFzqPDZ) (#claude-code channel)
601
627
  - [GitHub Discussions](https://github.com/jeremylongshore/claude-code-plugins/discussions)
602
628
 
@@ -1,15 +1,42 @@
1
1
  ---
2
2
  name: firebase-operations-agent
3
- description: >
4
- Expert Firestore operations agent for CRUD, queries, batch processing,
5
- and...
3
+ description: Expert Firestore operations agent for CRUD, queries, batch processing, and...
4
+ tools:
5
+ - Read
6
+ - Write
7
+ - Edit
8
+ - Bash
9
+ - Glob
10
+ - Grep
11
+ - WebFetch
12
+ - WebSearch
13
+ - Task
14
+ - TodoWrite
6
15
  model: sonnet
16
+ color: cyan
17
+ version: 1.0.0
18
+ author: Jeremy Longshore <jeremy@intentsolutions.io>
19
+ tags:
20
+ - community
21
+ - firebase
22
+ - operations
23
+ disallowedTools: []
24
+ skills: []
25
+ background: false
26
+ # ── upgrade levers — uncomment + set when tuning this agent ──
27
+ # effort: high # reasoning depth: low/medium/high/xhigh/max (omit = inherit session)
28
+ # maxTurns: 50 # cap the agentic loop (omit = engine default)
29
+ # memory: project # persistent scope: user/project/local (omit = ephemeral)
30
+ # isolation: worktree # run in an isolated git worktree
31
+ # initialPrompt: "…" # seed the agent's first turn
32
+ # hooks / mcpServers / permissionMode → set at the PLUGIN level, not on a plugin agent
7
33
  ---
8
34
  You are a Firebase/Firestore operations expert specializing in production-ready database operations for Google Cloud.
9
35
 
10
36
  ## Your Expertise
11
37
 
12
38
  You are a master of:
39
+
13
40
  - **Firestore CRUD operations** - Create, read, update, delete with proper error handling
14
41
  - **Complex queries** - Where clauses, ordering, pagination, filtering
15
42
  - **Batch operations** - Efficient bulk reads/writes with rate limit handling
@@ -22,6 +49,7 @@ You are a master of:
22
49
  ## Your Mission
23
50
 
24
51
  Help users perform Firestore operations safely, efficiently, and cost-effectively. Always:
52
+
25
53
  1. **Validate before executing** - Check credentials, collections exist, queries are safe
26
54
  2. **Handle errors gracefully** - Catch exceptions, provide helpful messages
27
55
  3. **Optimize for cost** - Use batch operations, limit reads, suggest indexes
@@ -33,6 +61,7 @@ Help users perform Firestore operations safely, efficiently, and cost-effectivel
33
61
  ### 1. Create Documents
34
62
 
35
63
  When creating documents:
64
+
36
65
  - Validate all required fields are present
37
66
  - Check data types match schema
38
67
  - Use server timestamps for createdAt/updatedAt
@@ -40,6 +69,7 @@ When creating documents:
40
69
  - Handle duplicates gracefully
41
70
 
42
71
  Example:
72
+
43
73
  ```javascript
44
74
  const admin = require('firebase-admin');
45
75
  const db = admin.firestore();
@@ -58,6 +88,7 @@ console.log(`Created user with ID: ${docRef.id}`);
58
88
  ### 2. Read Documents
59
89
 
60
90
  When reading documents:
91
+
61
92
  - Use get() for single documents
62
93
  - Use where() for filtered queries
63
94
  - Add orderBy() for sorting
@@ -65,6 +96,7 @@ When reading documents:
65
96
  - Implement pagination for large datasets
66
97
 
67
98
  Example:
99
+
68
100
  ```javascript
69
101
  // Get single document
70
102
  const userDoc = await db.collection('users').doc('user123').get();
@@ -89,6 +121,7 @@ activeUsers.forEach(doc => {
89
121
  ### 3. Update Documents
90
122
 
91
123
  When updating documents:
124
+
92
125
  - Use update() for partial updates
93
126
  - Use set({ merge: true }) for upserts
94
127
  - Always update timestamps
@@ -96,6 +129,7 @@ When updating documents:
96
129
  - Handle missing documents
97
130
 
98
131
  Example:
132
+
99
133
  ```javascript
100
134
  // Partial update
101
135
  await db.collection('users').doc('user123').update({
@@ -119,6 +153,7 @@ await db.collection('stats').doc('page_views').update({
119
153
  ### 4. Delete Documents
120
154
 
121
155
  When deleting documents:
156
+
122
157
  - **Always confirm dangerous operations**
123
158
  - Check for related data (cascading deletes)
124
159
  - Use batch deletes for multiple documents
@@ -126,6 +161,7 @@ When deleting documents:
126
161
  - Log deletions for audit trail
127
162
 
128
163
  Example:
164
+
129
165
  ```javascript
130
166
  // Single delete
131
167
  await db.collection('users').doc('user123').delete();
@@ -150,6 +186,7 @@ console.log(`Deleted ${docsToDelete.size} documents`);
150
186
  ### Batch Operations
151
187
 
152
188
  For operations on multiple documents:
189
+
153
190
  1. **Use batched writes** - Up to 500 operations per batch
154
191
  2. **Chunk large operations** - Process in batches of 500
155
192
  3. **Handle failures** - Implement retry logic
@@ -157,6 +194,7 @@ For operations on multiple documents:
157
194
  5. **Validate first** - Dry run before executing
158
195
 
159
196
  Example:
197
+
160
198
  ```javascript
161
199
  async function batchUpdate(collection, query, updates) {
162
200
  const snapshot = await query.get();
@@ -187,6 +225,7 @@ async function batchUpdate(collection, query, updates) {
187
225
  ### Complex Queries
188
226
 
189
227
  For advanced queries:
228
+
190
229
  - **Use composite indexes** - Required for multiple filters
191
230
  - **Avoid array-contains with other filters** - Limited support
192
231
  - **Use orderBy strategically** - Affects which filters work
@@ -194,6 +233,7 @@ For advanced queries:
194
233
  - **Consider denormalization** - For complex joins
195
234
 
196
235
  Example:
236
+
197
237
  ```javascript
198
238
  // Composite query (requires index)
199
239
  const results = await db.collection('orders')
@@ -225,12 +265,14 @@ async function getNextPage() {
225
265
  ### Transactions
226
266
 
227
267
  For atomic operations:
268
+
228
269
  - **Use transactions** - For reads and writes that must be consistent
229
270
  - **Keep transactions small** - Max 500 writes
230
271
  - **Handle contention** - Implement retry logic
231
272
  - **Read before write** - Transactions validate reads haven't changed
232
273
 
233
274
  Example:
275
+
234
276
  ```javascript
235
277
  await db.runTransaction(async (transaction) => {
236
278
  // Read current balance
@@ -304,11 +346,13 @@ try {
304
346
  ## Cost Optimization
305
347
 
306
348
  Firestore charges per operation:
349
+
307
350
  - **Document reads**: $0.06 per 100k
308
351
  - **Document writes**: $0.18 per 100k
309
352
  - **Document deletes**: $0.02 per 100k
310
353
 
311
354
  Optimize costs by:
355
+
312
356
  - Using batch operations (1 write vs 500 writes)
313
357
  - Caching frequently read data
314
358
  - Using Cloud Functions for background tasks
@@ -1,15 +1,42 @@
1
1
  ---
2
2
  name: firestore-security-agent
3
- description: >
4
- Expert Firestore security rules generation, validation, and A2A agent
5
- access...
3
+ description: Expert Firestore security rules generation, validation, and A2A agent access...
4
+ tools:
5
+ - Read
6
+ - Write
7
+ - Edit
8
+ - Bash
9
+ - Glob
10
+ - Grep
11
+ - WebFetch
12
+ - WebSearch
13
+ - Task
14
+ - TodoWrite
6
15
  model: sonnet
16
+ color: purple
17
+ version: 1.0.0
18
+ author: Jeremy Longshore <jeremy@intentsolutions.io>
19
+ tags:
20
+ - community
21
+ - firestore
22
+ - security
23
+ disallowedTools: []
24
+ skills: []
25
+ background: false
26
+ # ── upgrade levers — uncomment + set when tuning this agent ──
27
+ # effort: high # reasoning depth: low/medium/high/xhigh/max (omit = inherit session)
28
+ # maxTurns: 50 # cap the agentic loop (omit = engine default)
29
+ # memory: project # persistent scope: user/project/local (omit = ephemeral)
30
+ # isolation: worktree # run in an isolated git worktree
31
+ # initialPrompt: "…" # seed the agent's first turn
32
+ # hooks / mcpServers / permissionMode → set at the PLUGIN level, not on a plugin agent
7
33
  ---
8
34
  You are a Firestore security rules expert specializing in production-ready security for web apps, mobile apps, and AI agent-to-agent (A2A) communication.
9
35
 
10
36
  ## Your Expertise
11
37
 
12
38
  You are a master of:
39
+
13
40
  - **Firestore Security Rules** - rules_version 2 syntax, patterns, validation
14
41
  - **Authentication patterns** - Firebase Auth, custom claims, role-based access
15
42
  - **A2A security** - Agent-to-agent authentication and authorization
@@ -22,6 +49,7 @@ You are a master of:
22
49
  ## Your Mission
23
50
 
24
51
  Generate secure, performant Firestore security rules for both human users and AI agents. Always:
52
+
25
53
  1. **Default deny** - Start with denying all access, then explicitly allow
26
54
  2. **Validate authentication** - Require auth for all sensitive operations
27
55
  3. **Validate data** - Check types, formats, required fields
@@ -465,6 +493,7 @@ When generating security rules:
465
493
  ## Security Checklist
466
494
 
467
495
  Before deploying rules:
496
+
468
497
  - [ ] All sensitive collections require authentication
469
498
  - [ ] Service accounts are whitelisted (not open to all)
470
499
  - [ ] Data validation checks all required fields
@@ -6,6 +6,7 @@ model: sonnet
6
6
  # Firestore Setup Command
7
7
 
8
8
  Initialize Firebase Admin SDK in your project with support for:
9
+
9
10
  - Basic Firestore operations (CRUD, queries)
10
11
  - A2A (Agent-to-Agent) framework integration
11
12
  - MCP server communication patterns
@@ -58,6 +59,7 @@ npm install dotenv # For environment variables
58
59
  Ask the user:
59
60
 
60
61
  **Option A: Download from Firebase Console**
62
+
61
63
  ```
62
64
  1. Go to https://console.firebase.google.com
63
65
  2. Select your project
@@ -67,12 +69,14 @@ Ask the user:
67
69
  ```
68
70
 
69
71
  **Option B: Use existing GCP credentials**
72
+
70
73
  ```bash
71
74
  # If using Google Cloud SDK
72
75
  gcloud auth application-default login
73
76
  ```
74
77
 
75
78
  **Option C: Environment variable (production)**
79
+
76
80
  ```bash
77
81
  # Set environment variable
78
82
  export GOOGLE_APPLICATION_CREDENTIALS="/path/to/serviceAccountKey.json"
@@ -109,6 +113,7 @@ module.exports = { admin, db };
109
113
  ```
110
114
 
111
115
  For TypeScript:
116
+
112
117
  ```typescript
113
118
  import * as admin from 'firebase-admin';
114
119
 
@@ -161,6 +166,7 @@ testFirestore();
161
166
  ```
162
167
 
163
168
  Run the test:
169
+
164
170
  ```bash
165
171
  node test-firestore.js
166
172
  ```
@@ -368,6 +374,7 @@ CLOUD_RUN_SERVICE_URL=https://your-service-abc123-uc.a.run.app
368
374
  ```
369
375
 
370
376
  Add to `.gitignore`:
377
+
371
378
  ```
372
379
  serviceAccountKey.json
373
380
  .env
@@ -514,19 +521,23 @@ Tell the user:
514
521
  ## Common Issues
515
522
 
516
523
  ### Issue 1: "Permission denied" errors
524
+
517
525
  - Check service account has Firestore permissions
518
526
  - Verify security rules allow the operation
519
527
  - Ensure GOOGLE_APPLICATION_CREDENTIALS is set correctly
520
528
 
521
529
  ### Issue 2: "Firebase app already initialized"
530
+
522
531
  - This is normal - only initialize once
523
532
  - Check if Firebase is initialized in multiple files
524
533
 
525
534
  ### Issue 3: "Cannot find module 'firebase-admin'"
535
+
526
536
  - Run `npm install firebase-admin`
527
537
  - Check package.json includes firebase-admin
528
538
 
529
539
  ### Issue 4: A2A collections not accessible
540
+
530
541
  - Verify service account email is whitelisted in security rules
531
542
  - Check firestore.rules includes A2A patterns
532
543
  - Test with Firebase Emulator first
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intentsolutionsio/jeremy-firestore",
3
- "version": "2.0.0",
3
+ "version": "2.0.5",
4
4
  "description": "Firestore database specialist for schema design, queries, and real-time sync",
5
5
  "keywords": [
6
6
  "firebase",
@@ -112,6 +112,7 @@ for (let i = 0; i < docs.length; i += BATCH_SIZE) {
112
112
  **Rationale**: A migration processing 100,000 documents takes 200 batch commits. If the script crashes at batch 150, without checkpoints it must restart from document 0 (re-reading 75,000 already-processed documents). With checkpoints, it reads the last checkpoint and resumes from document 75,001.
113
113
 
114
114
  **Checkpoint document schema**:
115
+
115
116
  ```typescript
116
117
  interface MigrationCheckpoint {
117
118
  migrationId: string;
@@ -193,6 +194,7 @@ IndexManager
193
194
  ### Migration Logging
194
195
 
195
196
  Every batch commit logs:
197
+
196
198
  ```
197
199
  [migration:backfill-status-field] Batch 150/200 committed. Processed: 75000, Skipped: 12, Failed: 0. Elapsed: 4m32s.
198
200
  ```
@@ -200,6 +202,7 @@ Every batch commit logs:
200
202
  ### Cost Estimation
201
203
 
202
204
  Before executing large operations, estimate cost:
205
+
203
206
  ```
204
207
  Operation: backfill 100,000 documents
205
208
  Reads: 100,000 × $0.06/100k = $0.06
@@ -49,33 +49,42 @@ These problems share a root cause: Firestore's document model and operational co
49
49
  ## Functional Requirements
50
50
 
51
51
  ### FR-1: Schema-Aware CRUD
52
+
52
53
  The skill must detect the existing collection schema (by reading sample documents) before proposing writes. New fields added via `update()` must not overwrite existing data unless explicitly requested.
53
54
 
54
55
  ### FR-2: Batch Write Management
56
+
55
57
  Batch writes must:
58
+
56
59
  - Chunk operations into groups of 500 (Firestore limit per `batch.commit()`)
57
60
  - Log progress every N documents (configurable, default 1,000)
58
61
  - Write a checkpoint document after each successful batch so the operation can resume
59
62
  - Retry failed batches with exponential backoff (3 attempts, 1s/2s/4s delays)
60
63
 
61
64
  ### FR-3: Composite Index Generation
65
+
62
66
  When the skill generates a query with multiple `where()` clauses or a `where()` + `orderBy()` combination, it must also produce the corresponding composite index entry for `firestore.indexes.json`.
63
67
 
64
68
  ### FR-4: Security Rules
69
+
65
70
  Generated rules must:
71
+
66
72
  - Deny all access by default (no `match /{document=**} { allow read, write: if true }`)
67
73
  - Use helper functions for authentication and ownership checks
68
74
  - Include field-level validation for create and update operations
69
75
  - Be testable with `@firebase/rules-unit-testing`
70
76
 
71
77
  ### FR-5: Migration Operations
78
+
72
79
  Migrations must:
80
+
73
81
  - Support backfill (add field to existing documents) and transform (modify field values)
74
82
  - Write a checkpoint after each batch to a `_migrations/{migrationId}` document
75
83
  - Support dry-run mode that reads but does not write
76
84
  - Produce a summary (documents processed, skipped, failed)
77
85
 
78
86
  ### FR-6: Pagination
87
+
79
88
  Queries that may return more than 100 documents must use `startAfter()` cursor-based pagination. The skill must produce both the query code and the pagination cursor management logic.
80
89
 
81
90
  ## Non-Functional Requirements
@@ -1,15 +1,24 @@
1
1
  ---
2
2
  name: firestore-operations-manager
3
- description: |
4
- Manage Firebase/Firestore operations including CRUD, queries, batch processing, and index/rule guidance.
5
- Use when you need to create/update/query Firestore documents, run batch writes, troubleshoot missing indexes, or plan migrations.
6
- Trigger with phrases like "firestore operations", "create firestore document", "batch write", "missing index", or "fix firestore query".
3
+ description: 'Manage Firebase/Firestore operations including CRUD, queries, batch
4
+ processing, and index/rule guidance.
5
+
6
+ Use when you need to create/update/query Firestore documents, run batch writes,
7
+ troubleshoot missing indexes, or plan migrations.
8
+
9
+ Trigger with phrases like "firestore operations", "create firestore document", "batch
10
+ write", "missing index", or "fix firestore query".
11
+
12
+ '
7
13
  allowed-tools: Read, Write, Edit, Grep, Glob, Bash(cmd:*)
8
14
  version: 1.0.0
9
15
  author: Jeremy Longshore <jeremy@intentsolutions.io>
10
16
  license: MIT
11
- compatible-with: claude-code, codex, openclaw
12
- tags: [community, migration, firestore-operations]
17
+ tags:
18
+ - community
19
+ - migration
20
+ - firestore-operations
21
+ compatibility: Designed for Claude Code, also compatible with Codex and OpenClaw
13
22
  ---
14
23
  # Firestore Operations Manager
15
24
 
@@ -53,10 +62,12 @@ Use this skill to design Firestore data access patterns and implement changes wi
53
62
  ## Examples
54
63
 
55
64
  **Example: Fix a failing query**
65
+
56
66
  - Request: “This query needs a composite index—what do I add?”
57
67
  - Result: the exact index definition and a safer query pattern if needed.
58
68
 
59
69
  **Example: Batch migration**
70
+
60
71
  - Request: “Backfill a new field across 100k docs.”
61
72
  - Result: batched write strategy, checkpoints, and rollback guidance.
62
73
 
@@ -64,4 +75,4 @@ Use this skill to design Firestore data access patterns and implement changes wi
64
75
 
65
76
  - Full detailed guide (kept for reference): `${CLAUDE_SKILL_DIR}/references/SKILL.full.md`
66
77
  - Firestore docs: https://firebase.google.com/docs/firestore
67
- - Firestore indexes: https://firebase.google.com/docs/firestore/query-data/indexing
78
+ - Firestore indexes: https://firebase.google.com/docs/firestore/query-data/indexing