firebaseextended/firebase-video-samples/firebase-swift-best-practices
Claude Code and agent skill by firebaseextended/firebase-video-samples
Trust tier 3
- community
Source check pending
Checking that the SKILL.md file is still in the repository.
Expert patterns for Firebase (Auth, Firestore, Cloud Functions) using modern Swift Concurrency (Actors, Async/Await) and Observation (@Observable).
Install
npx vskill@latest install firebaseextended/firebase-video-samples/firebase-swift-best-practicesSKILL.md
Firebase Swift Best Practices Skill
Overview
Use this skill to implement robust, thread-safe, and performant Firebase integrations in modern Swift applications. This skill focuses on the intersection of Firebase SDKs and modern Swift features like @Observable, async/await, and Actor isolation.
Workflow Decision Tree
1) Implementing a New Repository
- Use the Surgical Actor Isolation pattern to prevent
deinitconflicts (seereferences/concurrency.md) - Use
@Observablefor the repository class (seereferences/concurrency.md) - Implement real-time listeners with proper lifecycle management (see
references/firestore.md)
2) Handling Authentication
- Bridge Firebase Auth state to SwiftUI using
@Observable(seereferences/auth.md) - Use
async/awaitfor sign-in and sign-out operations (seereferences/auth.md)
3) Data Operations
- Use
Codablesupport in Firestore for type-safe data handling (seereferences/firestore.md) - Use native
async/awaitfor all single-result operations likegetDocuments,addDocument, andsetData(seereferences/concurrency.md) - For continuous data streams, bridge listeners to
AsyncStream(seereferences/concurrency.md)
Core Guidelines
Concurrency & Isolation
- Prefer surgical isolation: While class-level
@MainActoris generally recommended for simplicity, we prefer surgical isolation for Firebase repositories to allow non-isolated cleanup indeinit. On Swift 6.2+ (SE-0371), you can alternatively use class-level@MainActorwith anisolated deinit. - Always clean up: Always remove
AuthStateListenerandListenerRegistrationindeinit. - Bridge to MainActor: When receiving results from Firebase background closures, use
Task { @MainActor in ... }to update@Observableproperties.
Firestore
- Use
@DocumentIDfor mapping Firestore document IDs to model properties. - Use
@ServerTimestampfor managing creation/update dates. - Order queries explicitly when using real-time listeners to maintain UI stability.
Authentication
- Check for
currentUserbefore triggering anonymous sign-in to avoid redundant sessions. - Use
weak selfin Auth state listeners to prevent retain cycles.
References
references/concurrency.md: Surgical actor isolation and async bridging.references/firestore.md: Real-time listeners, CRUD, and Codable patterns.references/auth.md: Authentication state management and async flows.
External References
- Firebase Documentation
- Swift Evolution SE-0371
- Matt Massicotte's Blog (Swift Concurrency Expert)
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 repositoryCheckingccdr/makeitso/iOS/.agents/skills/firebase-swift-best-practices/SKILL.md
Popularity
- Repository stars
- 172
- Repository forks
- 128
- 7-day trend score
- 26
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 31 Mar 2026, 8 months ago.
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/firebaseextended/firebase-video-samples/firebase-swift-best-practices)