Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Skill for converting an installed Firebase Extension (or extension source) to a standalone Cloud Functions for Firebase codebase or publishable npm package, including upgrading triggers from V1 to V2 and configuring lifecycle hooks and declarative security
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-02 | ✗→✓ | ▲ Improved | 9% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 40% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 7% | 0% |
| case-07 | ✗→✓ | ▲ Improved | -6% | 0% |
| case-08 | ✗→✓ | ▲ Improved | -3% | 0% |
Migrates a Firebase Extension into either:
functions/src/ for app integration).functions).
Leverages native Cloud Functions features (declarative IAM, Parameterized Config, SDK Lifecycle Hooks) and modernizes 1st Gen triggers to 2nd Gen using the Destructuring Compatibility Shim.
______________________________________________________________________
functions/src/. Config in .env.firebase deploy --only functions.package.json specifying exports map,engines: { "node": ">=22" }, and peerDependencies: { "firebase-functions": ">=6.0.0" }.
index.ts(export * from "<package-name>").
______________________________________________________________________
Use native SDK declarations instead of manual gcloud scripts or console instructions:
requiresRole("roles/...") for required GCP IAM permissions.requiresAPI("service.googleapis.com", "Description") for Google APIs..value() at top-level module load scope.onInit() or lazy getters:typescript import { defineString } from "firebase-functions/params"; import { onInit } from "firebase-functions/v2";
const dataset = defineString("DATASET_ID"); let client: BigQuery;
onInit(() => { client = new BigQuery({ datasetId: dataset.value() }); });
V2 enables concurrency (up to 80 requests). To preserve V1 single-concurrency pricing, set cpu: "gcf_gen1".
______________________________________________________________________
extension.yaml:params → defineString, defineInt, defineBoolean, defineSecret.apis → requiresAPI(...).roles → requiresRole(...).lifecycleEvents → afterFirstDeploy & afterRedeploy.resources → Upgrade 1st Gen triggers to 2nd Gen (onDocumentWritten,onTaskDispatched, onRequest).
jest), andtest scripts.
package.jsonname: "<package-name>", engines: { "node": ">=22" }.peerDependencies:json "peerDependencies": { "firebase-admin": "^11.0.0 || ^12.0.0", "firebase-functions": ">=6.0.0" }
exports map targeting ESM/CommonJS and TypeScript declarations(lib/index.js, lib/index.d.ts).
onDocumentWritten from firebase-functions/v2/firestore.onTaskDispatched from firebase-functions/v2/tasks. RemoveEXT_INSTANCE_ID when enqueueing tasks.
onRequest from firebase-functions/v2/https.{ change, context },{ snapshot, context }) where legacy 1st Gen handlers expect (change, context).
Map extension lifecycle events to SDK lifecycle hooks in src/index.ts:
onInstall → afterFirstDeploy({ task: { function: "initTask" } })onUpdate / onConfigure →afterRedeploy({ task: { function: "setupTask" } })
Generate README.md containing:
npm install).export * from "<package-name>")..env reference table._Reminder: NEVER execute npm publish._
Other measured skills in the registry, with their headline benchmark lift.