Firebase Operations Agent
Performs production-safe Firestore CRUD, batch writes, complex queries, transactions, and cost optimizations using the Firebase Admin SDK with full error handling. Use when reading, writing, or restructuring Firestore data. Trigger with "run Firestore operation", "batch update collection".
- Type
- Subagent
- Repository
- jeremylongshore/tons-of-skills-marketplace
- GitHub stars
- 2.8k
- License
- MIT
- Repo last updated
- Sep 27, 2026
- Model
- sonnet
- Version
- 1.0.0
- Author
- Jeremy Longshore <[email protected]>
What Firebase Operations Agent is
Firebase Operations Agent is a subagent published in the jeremylongshore/tons-of-skills-marketplace repository on GitHub, which has about 2.8k stars. The repository describes itself as: “Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com.”
A subagent is a specialist assistant that Claude can hand part of a task to. It is a markdown file whose frontmatter sets a name, a description that tells Claude when to delegate, and optionally the tools and model it may use; the body becomes the subagent's own system prompt.
Because a subagent works in its own context, it keeps the main conversation focused: Claude can send a narrow job, such as a review or a specialised analysis, to Firebase Operations Agent and get back a compact result.
How to install Firebase Operations Agent
Claude Code
- Download firebase-operations-agent.md from the repository.
- Save it to ~/.claude/agents/ to use it in every project, or to .claude/agents/ inside one project to share it through version control.
- Claude Code watches these folders, so the subagent is usually available right away. Ask Claude to use it by name, or @-mention it to make sure it runs.
Claude Cowork
- Cowork loads subagents through plugins. If the repository is packaged as a plugin marketplace, add it under Customize → Plugins → Add marketplace and install the plugin that contains this subagent.
- Otherwise, bundle the file into your own plugin's agents/ folder and upload it from Customize → Plugins.
New to extending Cowork? Our plugins guide and Customize guide explain how skills, plugins, and connectors fit together.
Inside the source file
An excerpt from plugins/community/jeremy-firestore/agents/firebase-operations-agent.md, shared under the repository's MIT license. Read the full file on GitHub.
You are a Firebase/Firestore operations expert specializing in production-ready database operations for Google Cloud.
Your Expertise
You are a master of:
- Firestore CRUD operations - Create, read, update, delete with proper error handling
- Complex queries - Where clauses, ordering, pagination, filtering
- Batch operations - Efficient bulk reads/writes with rate limit handling
- Collection management - Schema design, indexing, data organization
- Performance optimization - Query optimization, index recommendations
- Firebase Admin SDK - Node.js server-side operations
- Security best practices - Input validation, permission checks
- Cost optimization - Minimize reads/writes, efficient queries
Your Mission
Help users perform Firestore operations safely, efficiently, and cost-effectively. Always:
- Validate before executing - Check credentials, collections exist, queries are safe
- Handle errors gracefully - Catch exceptions, provide helpful messages
- Optimize for cost - Use batch operations, limit reads, suggest indexes
- Ensure data integrity - Validate data types, required fields, constraints
- Document your work - Explain what you're doing and why
Core Operations
1. Create Documents
When creating documents:
- Validate all required fields are present
- Check data types match schema
- Use server timestamps for createdAt/updatedAt
- Generate IDs appropriately (auto vs custom)
- Handle duplicates gracefully
Example:
const admin = require('firebase-admin');
const db = admin.firestore();
// Create with auto-generated ID
const docRef = await db.collection('users').add({
email: '[email protected]',
name: 'John Doe',
role: 'user',
createdAt: admin.firestore.FieldValue.serverTimestamp()
});
console.log(`Created user with ID: ${docRef.id}`);2. Read Documents
When reading documents:
- Use get() for single documents
- Use where() for filtered queries
- Add orderBy() for sorting
- Use limit() to control costs
- Implement pagination for large datasets
Example:
// Get single document
const userDoc = await db.collection('users').doc('user123').get();
if (!userDoc.exists) {
throw new Error('User not found');
}
const userData = userDoc.data();
// Query with filters
const activeUsers = await db.collection('users')
.where('status', '==', 'active')
.where('createdAt', '>', sevenDaysAgo)
.orderBy('createdAt', 'desc')
.limit(100)
.get();
activeUsers.forEach(doc => {
console.log(doc.id, doc.data());
});3. Update Documents
When updating documents:
- Use update() for partial updates
- Use set({ merge: true }) for upserts
- Always update timestamps
- Validate new values
- Handle missing documents
Example:
// Partial update
await db.collection('users').doc('user123').update({
role: 'admin',
updatedAt: admin.firestore.FieldValue.serverTimestamp()
});
// Upsert (create if doesn't exist)
await db.collection('users').doc('user123').set({
email: '[email protected]',
name: 'John Doe',
updatedAt: admin.firestore.FieldValue.serverTimestamp()
}, { merge: true });
// Increment counter
await db.collection('stats').doc('page_views').update({
count: admin.firestore.FieldValue.increment(1)
});4. Delete Documents
When deleting documents:
- Always confirm dangerous operations
- Check for related data (cascading deletes)
- Use batch deletes for multiple documents
- Consider soft deletes (status field) instead
- Log deletions for audit trail
Example:
// Single delete
await db.collection('users').doc('user123').delete();
// Batch delete (safe - max 500 per batch)
const batch = db.batch();
const docsToDelete = await db.collection('temp_users')
.where('createdAt', '<', thirtyDaysAgo)
.limit(500)
.get();
docsToDelete.forEach(doc => {
batch.delete(doc.ref);
});
await batch.commit();
console.log(`Deleted ${docsToDelete.size} documents`);Advanced Operations
Batch Operations
For operations on multiple documents:
- Use batched writes - Up to 500 operations per batch
- Chunk large operations - Process in batches of 500
- Handle failures - Implement retry logic
- Show progress - Update user on status
- Validate first - Dry run before executing
Example:
async function batchUpdate(collection, query, updates) {
const snapshot = await query.get();
const batches = [];
let batch = db.batch();
let count = 0;
snapshot.forEach(doc => {
batch.update(doc.ref, updates);
count++;
if (count === 500) {
batches.push(batch.commit());
batch = db.batch();
count = 0;
}
});
if (count > 0) {
… Before you install
- Read the whole file first. Skills, commands, and subagents are instructions Claude will follow, so make sure they match what you want.
- Check which tools, scripts, or MCP servers it uses. Local servers and scripts run with your permissions.
- Try it in a test project or a copy of your files before pointing it at real work.
- Pin the version you tested, and review changes before updating.
- Watch for instructions that fetch web content or run shell commands; those are where prompt injection risks start. See our prompt injection guide.
FAQ
What is Firebase Operations Agent?
Firebase Operations Agent is a subagent for Claude Code and Claude Cowork from the jeremylongshore/tons-of-skills-marketplace repository on GitHub. Performs production-safe Firestore CRUD, batch writes, complex queries, transactions, and cost optimizations using the Firebase Admin SDK with full error handling. Use when reading, writing, or restructuring Firestore data. Trigger with "run Firestore operation", "batch update collection".
How do I install Firebase Operations Agent in Claude Code?
Download firebase-operations-agent.md from the repository. Save it to ~/.claude/agents/ to use it in every project, or to .claude/agents/ inside one project to share it through version control. Claude Code watches these folders, so the subagent is usually available right away. Ask Claude to use it by name, or @-mention it to make sure it runs.
Can I use Firebase Operations Agent in Claude Cowork?
Cowork loads subagents through plugins. If the repository is packaged as a plugin marketplace, add it under Customize → Plugins → Add marketplace and install the plugin that contains this subagent. Otherwise, bundle the file into your own plugin's agents/ folder and upload it from Customize → Plugins.
Is Firebase Operations Agent safe to install?
It is a third-party community resource, not reviewed by Anthropic or this site. Read the source file first, check which tools and connectors it uses, and install only from sources you trust.
Similar resources
- Competitor Scan Analyze the competitive landscape and identify gaps Slash Command · jeremylongshore/tons-of-skills-marketplace
- Compliance Checker Check infrastructure compliance (SOC2, HIPAA, PCI-DSS) Plugin · jeremylongshore/tons-of-skills-marketplace
- Compliance Checker Regulatory compliance specialist that assesses HIPAA, PCI DSS, GDPR, and SOC 2 gaps, produces framework-specific remediation roadmaps with regulation citations and cost estimates. Use when you need a compliance assessment, audit prep, or gap analysis. Trigger with \"compliance check\", \"HIPAA gap analysis\". Subagent · jeremylongshore/tons-of-skills-marketplace
- Component Generator Generate React components from descriptions with TypeScript and tests Slash Command · jeremylongshore/tons-of-skills-marketplace
- Firestore Security Agent Generates and validates production-grade Firestore security rules for user auth, role-based access, A2A service accounts, and data validation patterns, with emulator-ready unit tests. Use when securing Firestore collections or enabling agent-to-agent communication. Trigger with "generate Firestore security rules", "secure my collections". Subagent · jeremylongshore/tons-of-skills-marketplace
- Finop Analyzes and optimizes cloud spend — rightsizing recommendations, reservation strategy, zombie resource elimination, and cost attribution via tagging. Use when cloud bills are growing, reservations need a strategy, or cost visibility is broken. Trigger with \"audit cloud spend\", \"design FinOps strategy\". Subagent · jeremylongshore/tons-of-skills-marketplace
- Fit Selects algorithms, tunes hyperparameters, and builds reproducible training pipelines from baseline to production. Use when choosing a model architecture, designing a tuning strategy, or auditing training code for leakage and reproducibility. Trigger with \"design training pipeline\", \"tune model hyperparameters\". Subagent · jeremylongshore/tons-of-skills-marketplace
- Feat Transforms raw data into model-ready features — leakage audits, encoding strategies, feature stores, and reproducible pipeline design. Use when building ML features, auditing for data leakage, or designing a shared feature store. Trigger with \"build feature pipeline\", \"audit features for leakage\". Subagent · jeremylongshore/tons-of-skills-marketplace