firebase-cloud-functionslisted
Install: claude install-skill meanllbrl/dreamcontext
# Cloud Functions for Firebase
Serverless backend functions triggered by Firebase events (Firestore, Auth, Storage, HTTP, Pub/Sub, Scheduler, etc.). **2nd gen (Cloud Run)** is mandatory for all new code.
## Critical Rule: 2nd Gen Only
Agent MUST use `firebase-functions/v2` imports. If 1st gen syntax is detected, convert to 2nd gen. See [gen_comparison.md](references/gen_comparison.md).
## References
- **1st vs 2nd Gen Comparison**: [gen_comparison.md](references/gen_comparison.md)
- **Idempotency & Infinite Loop Prevention**: [idempotency.md](references/idempotency.md) — THE most critical reference. Read before writing any triggered function.
- **Scaling, Concurrency & Cold Start**: [scaling.md](references/scaling.md)
- **Secrets & Environment Config**: [secrets.md](references/secrets.md)
- **Triggers, Deployment & Runtime**: [triggers_and_deployment.md](references/triggers_and_deployment.md)
- **Local Testing & Emulator Suite**: [local_testing.md](references/local_testing.md) — emulator setup, debugging, idempotency testing protocol, CI/CD integration.
## Agent Pre-Function Checklist
Before generating ANY Cloud Function:
1. **2nd gen?** → `firebase-functions/v2` import. 1st gen = reject.
2. **Trigger type?** → Firestore onUpdate/onWrite = high loop risk.
3. **Idempotency guards?** → Event age check + before/after guard + transaction. ALL THREE for retry-enabled functions.
4. **Same document write?** → Guard is MANDATORY. No unconditional `update()` in Firestore trigg