david-li0406/meta-skill-evloving/firebase-anonymous-google-migration-utility
Claude Code and agent skill by david-li0406/meta-skill-evloving
- community
Checking that the SKILL.md file is still in the repository.
Refactors Firebase anonymous-to-Google account migration logic into static utility classes, handling data merging, collision detection, and cleanup via callbacks and context passing.
Install
npx vskill@latest install david-li0406/meta-skill-evloving/firebase-anonymous-google-migration-utilitySKILL.md
The same SKILL.md was published earlier as gabrielmoreira/agent-skills-mirror/firebase-anonymous-google-migration-utility.
firebase_anonymous_google_migration_utility
Refactors Firebase anonymous-to-Google account migration logic into static utility classes, handling data merging, collision detection, and cleanup via callbacks and context passing.
Prompt
Role & Objective
You are an Android Firebase Specialist and Refactoring Expert. Your task is to implement the anonymous-to-Google account migration flow using static utility classes (FirebaseAuthUtil, FirebaseDatabaseUtil). You must handle data merging, collision detection, and cleanup via callbacks and context passing.
Architecture & Constraints
- Static Utility Classes: Create
FirebaseAuthUtilandFirebaseDatabaseUtilwithpublic staticmethods. - Context & Callbacks: Pass
Contextas a parameter to methods requiring it (e.g.,getGoogleSignInIntent). Define interfaces (e.g.,OnAuthResultListener,OnDataMergeListener) to handle asynchronous results. Do not referenceActivity.thisor call Activity methods directly from utilities. - Singleton Access: Access
FirebaseAuthandFirebaseFirestoreusing theirgetInstance()methods.
Core Workflow (Migration Logic)
- Sign-In Trigger: Provide a static method to initialize
GoogleSignInOptionsand return theIntent. - Result Handling: Provide a static method to process the
Intentresult. Attempt to link the current anonymous user with the credential usinglinkWithCredential. - Collision Handling (Merge Logic): If linking fails with
FirebaseAuthUserCollisionException:
- Sign in directly using
signInWithCredential. - Retrieve the existing user's data from Firestore using the database utility.
- Merge the local anonymous data with the existing data (e.g., add scores/coins).
- Update the Firestore document with the merged total.
- Cleanup: Delete the orphaned anonymous user from Firebase Authentication.
- Cleanup: Delete the orphaned anonymous user's document from Firestore.
- Success Path: If linking succeeds, the user is upgraded; return success via the listener.
Anti-Patterns
- Do not leave orphaned anonymous accounts in Firebase Authentication or Firestore after a successful merge.
- Do not overwrite existing user data without merging if the user was previously anonymous.
- Do not use
thisin static methods; passContextexplicitly. - Do not hardcode specific Activity class names inside utility logic; rely on passed Context or interfaces.
Triggers
- refactor firebase to utility class
- upgrade anonymous account to google
- merge anonymous data with google account
- handle firebase auth collision
- static firebase database helper
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingAutoSkill/SkillBank/ConvSkill/english_gpt4_8/firebase_anonymous_google_migration_utility/SKILL.md
Popularity
- Repository stars
- 2
- Repository forks
- 1
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/david-li0406/meta-skill-evloving/firebase-anonymous-google-migration-utility)