Agent Skills for CF3 V1-V2 Migration#60
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a new skill for migrating Firebase Functions from V1 to V2 using a destructuring compatibility shim, including architectural documentation and a function mapping reference. Feedback suggests clarifying that the context shim is unavailable for https.onCall functions and noting that test mock keys must match the specific trigger type, such as 'data' for Firestore or 'message' for PubSub, to ensure correct test updates.
inlined
left a comment
There was a problem hiding this comment.
Looks mostly good:
- We should possibly get my params rewrite code into main instead of a staging branch so you can reference it
- We should add instructions on how to convert runWith into either a global setGlobalOptions or per-function options objects
- We can maybe explain the value of concurrency and ask if they want to pay for more CPU if they want concurrency or set CPU to "gcfv1" to restore the old CPU?
- As a smoke/integration test can you run this against our samples repo and post a git commit to the description for code reviewing the output?
|
Addressing the Comments by inlined:
|
inlined
left a comment
There was a problem hiding this comment.
This shares a LOT of content from the extensions skill. I wonder if we should be considering a mega skill with lots of sub-references.
Also, this makes me realize that the extensions skill assumed that extensions are always written with functions-like code which isn't the case. They had (have?) a different namespace in V1 which I forbade to pollute V2 as well.
| 4. **HTTPS Callables (Flattened Context)**: Unlike event triggers, Callables do **not** use `V1Compat` or a `context` object. Instead, all context properties are flattened onto the request object. | ||
| * **V1 Priority**: `(data, context) => { ... }` | ||
| * **V2 Equivalent**: `({ data, auth, app }) => { ... }` | ||
| 1. **Do NOT attempt to rewrite variable access inside the body.** It is |
There was a problem hiding this comment.
I saw this in the other review. What does this mean?
This PR introduces a new skill for AI agents to safely migrate Firebase Functions from V1 to V2 using the v1-v2 compat layer(destructuring). It provides step-by-step guidance for migrating function signatures without rewriting internal business logic, and includes checks for configurations(if functions.config() has been migrated from) and unit test signature mismatches.
It also adds reference documentation containing a comprehensive V1-to-V2 function parity table and an deep dive into the compat layer itself. This is to ensure that the agent has enough context and reference to understand how the signature has changed from v1 to v2 and also understand what the compat layer intends to do.