Agent skill
firebase-operations
Performs Firebase Firestore operations. Use when querying collections, creating/updating/deleting documents, using batch writes, or working with Timestamps. Includes pagination, transactions, and security rules patterns.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/documents/firebase-operations
SKILL.md
Firebase Operations Skill
Instructions
- Import
getAdminDb, COLLECTIONSfrom@/lib/firebase-admin - Use
Timestamp.now()for timestamps - Convert to ISO string for API responses:
createdAt.toDate().toISOString() - Use batch writes for multiple operations (max 500)
- Use transactions for atomic operations
Quick Reference
import { getAdminDb, COLLECTIONS } from '@/lib/firebase-admin'
import { Timestamp, FieldValue } from 'firebase-admin/firestore'
// Get document
const doc = await db.collection(COLLECTIONS.PROJECTS).doc(id).get()
// Create with timestamps
const now = Timestamp.now()
await docRef.set({ ...data, createdAt: now, updatedAt: now })
// Update
await docRef.update({ field: value, updatedAt: Timestamp.now() })
// Increment counter
await docRef.update({ likes: FieldValue.increment(1) })
For complete operations (batch writes, transactions, pagination, queries), see reference.md.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?