Skip to content

Add iOS guides for skills (Re-opened with updates)#58

Open
peterfriese wants to merge 58 commits intonextfrom
feature/ios-guides
Open

Add iOS guides for skills (Re-opened with updates)#58
peterfriese wants to merge 58 commits intonextfrom
feature/ios-guides

Conversation

@peterfriese
Copy link
Copy Markdown
Contributor

This PR introduces iOS guides for several skills. It replaces PR #25 and incorporates the modern Swift practices and fixes merged from #55.

joehan and others added 30 commits February 11, 2026 14:57
* Add firebase-data-connect-basics skill (#7)

* Add firebase-data-connect-basics skill

* Add firebase dataconnect basic skills

---------

Co-authored-by: Muhammad Talha <muhammadtalhar@google.com>

* [Dataconnect] Restructure SKILL.md into a development workflow guide

---------

Co-authored-by: Muhammad Talha <muhammadtalhar@google.com>
Co-authored-by: Muhammad Talha <126821605+mtr002@users.noreply.github.com>
* Add Cursor plugin configuration

* Add logo to cursor plugin config

* Move logo to assets directory

* Restructure Cursor plugin to multi-plugin format

* Clean up language

* Use a symlink instead
Change all `firebase` shell command mentioned in the skills to use
`npx -y firebase-tools@latest` instead to ensure freshness and reduce
frictions to the agents.
- Move all one-time-only local environment setup from `firebase-basic` to `firebase-local-env-setup` skill
- Add description about how to install skills and MCP server.
Co-authored-by: ssbushi <66321939+ssbushi@users.noreply.github.com>
* Add agent skills for firestore enterprise with native mode

* Amend SKILL.md

* Format SKILL

* Address comments and rename standard edition

* Remove files & update frontmatter

* Updated to use "npx firebase-tools@latest"

---------

Co-authored-by: Sichen Liu <sichenliu@google.com>
Co-authored-by: Joe Hanley <joehanley@google.com>
Updated the installation reference guides for all supported agents (Antigravity, Claude Code, Cursor, Gemini CLI, GitHub Copilot, and others) in the `firebase-local-env-setup` skill.
- Added detailed steps to locate, verify, and safely merge MCP configurations (`mcp.json`, `claude_desktop_config.json`, etc.) without overwriting existing entries.
- Added explicit instructions to check for existing skill installations using `npx skills list` before installing.
- Enforced "stop and wait" instructions for user restarts to ensure the agent correctly verifies the MCP server connection securely.
* Update `firebase-basics` skills

- Optimize description so that it is more likely to be loaded
- Clearly state the prerequisites, how to validate them and how to meet them.
- Add principles about how to optimize agent ability to help with Firebase related task
- Indexing other knowledges for progressive disclosure.

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
)

- Update their description so that firebase-basics can be picked up more consistently
- Update instructions about how to refresh skills for Antigravity and other agents.
* docs: improve local installation instructions

* docs: address reviewer feedback on local installation instructions
#52)

* adjusting cursor plugin to reflect skills and mcp setup path correctly

* Apply suggestion from @gemini-code-assist[bot]

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* update mcp path to ensure it can find it

* correct the path

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
- standardize AI model names to gemini-flash-latest
- restore context in AI Logic chat examples
- remove non-existent android_setup.md reference
- clarify automatic vs manual index management in Firestore guides"
Refine iOS and Firestore Skills with Proactive Indexing and Modern SwiftUI Standards
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces comprehensive iOS (Swift) setup guides and best practices across multiple Firebase skills, including AI Logic, Auth, and Firestore. It emphasizes automated provisioning via the Firebase CLI, modern SwiftUI state management using the Observation framework, and critical initialization order to prevent crashes. Additionally, a new xcode-project-setup skill is added to automate Xcode project dependency management using a native Swift script. Feedback was provided regarding a dangerous force unwrap and incorrect string formatting in the iOS Auth setup guide.

@peterfriese
Copy link
Copy Markdown
Contributor Author

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces comprehensive iOS (Swift) support across several Firebase skills, including AI Logic, Auth, and Firestore. It adds a new xcode-project-setup skill that provides a native Swift script to automate SPM dependency management and project configuration, strictly avoiding Ruby-based tools. Key documentation updates include critical rules for SwiftUI initialization order, the transition from FirebaseFirestoreSwift to the main Firestore module, and a mandate for CLI-based service provisioning. A review comment suggests refining the Firestore realtime listener documentation to better reflect how Swift's .task handles cancellation, specifically recommending AsyncSequence or explicit task cancellation handling.

Copy link
Copy Markdown
Contributor Author

@peterfriese peterfriese left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/gemini review

@peterfriese
Copy link
Copy Markdown
Contributor Author

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces comprehensive iOS support across multiple Firebase skills, including AI Logic, Auth, and Firestore. A significant addition is the xcode-project-setup skill, which provides a native Swift-based automation tool for managing SPM dependencies and project configuration without relying on Ruby. The updates establish critical development patterns for iOS, such as prioritizing the Observation framework, enforcing strict initialization orders to prevent crashes, and migrating away from the deprecated FirebaseFirestoreSwift module. Feedback is provided regarding a technical error in the Firestore iOS setup guide where a synchronous listener is incorrectly shown being awaited within a SwiftUI task block.

In response to swift-concurrency and swiftui-expert-skill guidelines:
- Applied @mainactor to ViewModels to ensure thread-safe UI updates and fix Swift 6 strict concurrency data races.
- Applied 'final' to ViewModels.
- Used 'isolated deinit' in DataManager for safe actor-isolated cleanup of ListenerRegistrations (Swift 6.2+ pattern).
- Replaced deprecated .foregroundColor with modern .foregroundStyle.
}
```

## 5. Legacy Options (Completion Handlers)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we be including this? Will devs be commonly using Agent Skills with older codebases? I'm worried about confusing the model.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will remove it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 - I think ti makes sense to cut this unless its addressing a specific confusion that we've seen agents have. In general, I find that agents are pretty good at handling conversions like this on their own (at least in other languages)

- **Firebase Project**: Created via `npx -y firebase-tools@latest projects:create` (see `firebase-basics`).
- **Firebase CLI**: Installed and logged in (see `firebase-basics`).

## 🤖 Core Automation Mandate
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should all the changes in this file be in a separate PR? Except the changes in line 92, they don't seem to be specific to iOS Agent Skills, are they?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, but not bocking. These seem like good changes to get in for all users.

2. Enter a **display name**.

## 2. Register Platform-Specific Apps
A Firebase Project is just a container. To actually use Firebase in code, you must register a platform-specific "App" (iOS, Android, or Web) within the project and download its configuration file.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
A Firebase Project is just a container. To actually use Firebase in code, you must register a platform-specific "App" (iOS, Android, or Web) within the project and download its configuration file.
A Firebase Project is just a container. To actually use Firebase in code, you must register a platform-specific "App" (iOS, Android, or Web) within the Firebase project and download its configuration file so that it can be added to the codebase.

1. Create the project: `npx -y firebase-tools@latest projects:create`
2. Register the iOS app: `npx -y firebase-tools@latest apps:create IOS <bundle-id>`
3. Fetch the config: `npx -y firebase-tools@latest apps:sdkconfig IOS <App-ID>`
4. Save the output as `GoogleService-Info.plist` in your Xcode project folder. Ensure you remove any non-XML CLI output headers.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will they need to add the config file to all targets?

npm install firebase
```

> **💡 TIP: ALWAYS USE THE LATEST SDK VERSION**
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be in a separate PR? It's not specific to the iOS Agent Skills.

5. **Keep Plugin / Agent Skills updated:** Since Firebase best practices evolve quickly, remind the user to regularly check for and install updates to their Firebase plugin or Agent Skills, ensuring you both operate with the latest workflows. Similarly, if you encounter issues with outdated tools or commands, follow the steps below based on your agent environment:
3. **Always use the latest SDK versions:** To ensure access to the latest features and security fixes, always use the most recent version of the Firebase SDKs for your platform.
- For **iOS**, check the latest release version at [https://github.com/firebase/firebase-ios-sdk/releases](https://github.com/firebase/firebase-ios-sdk/releases).
- For **Android**, check the Firebase Android Release Notes for the latest BoM version at [https://github.com/firebase/firebase-android-sdk/releases](https://github.com/firebase/firebase-android-sdk/releases).
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be added with the Android PR? Not the iOS PR.

Comment on lines +38 to +41
- For **Web**, check the latest release version at [https://github.com/firebase/firebase-js-sdk/releases](https://github.com/firebase/firebase-js-sdk/releases).
4. **Follow Agent Skills for implementation guidance:** Skills provide opinionated workflows (CUJs), security rules, and best practices. Always consult them to understand *how* to implement Firebase features correctly instead of relying on general knowledge.
5. **Use Firebase MCP Server tools instead of direct API calls:** Whenever you need to interact with remote Firebase APIs (such as fetching Crashlytics logs or executing Data Connect queries), use the tools provided by the Firebase MCP Server instead of attempting manual API calls.
6. **Keep Plugin / Agent Skills updated:** Since Firebase best practices evolve quickly, remind the user to regularly check for and install updates to their Firebase plugin or Agent Skills, ensuring you both operate with the latest workflows. Similarly, if you encounter issues with outdated tools or commands, follow the steps below based on your agent environment:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't all this be added in a separate PR? This isn't specific to the iOS Agent Skills.

Comment on lines +28 to +29
When writing complex queries using the SDK, **anticipate** the need for composite indexes (e.g., combining `==` on one field with `orderBy` on another) and proactively generate the `firestore.indexes.json` file.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

separate PR?

This commit addresses Rachel's feedback on PR #58 by:
- Reverting out-of-scope changes (Android/Web SDK versioning, Auth/Firestore automation mandates) to be handled in separate PRs.
- Reordering AI Logic sections so Chat Session correctly precedes Function Calling.
- Removing legacy completion handler snippets from the Auth iOS guide to prevent AI confusion.
- Clarifying that a Firebase Project is just a container and requires an App registration.
- Adding explicit instructions for the AI agent to read the Xcode project to find the bundle ID before registering the iOS app.
- Clarifying that the downloaded plist config should be linked to the main application target.
Copy link
Copy Markdown
Contributor Author

@peterfriese peterfriese left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rachelsaunders I've addressed all of your feedback! I removed the out-of-scope files, fixed the AI Logic numbering/ordering, removed the legacy completion handlers from the Auth guide to avoid confusing the model, and clarified the setup instructions regarding the Bundle ID and Xcode target. Let me know if everything looks good now!

@joehan joehan changed the base branch from main to next April 2, 2026 17:04
@joehan
Copy link
Copy Markdown
Member

joehan commented Apr 2, 2026

FYI - just pointed this to next and resolved the merge conflicts.

- **Firebase Project**: Created via `npx -y firebase-tools@latest projects:create` (see `firebase-basics`).
- **Firebase CLI**: Installed and logged in (see `firebase-basics`).

## 🤖 Core Automation Mandate
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, but not bocking. These seem like good changes to get in for all users.

@@ -0,0 +1,87 @@
---
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did this make it in accidentally? Seems a bit beyond the scope of this repo. If it is completely necessary to get reasonable behavior, we can consider leaving it up

@@ -0,0 +1,70 @@
---
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I screwed this up in the move to next - this was removed on main, so we can remove it here too


```bash
# Initialize Data Connect
<<<<<<< HEAD
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, missed this while syncing branches - fixing on next.

## 1. Create a Firebase Project and App (Automated)
Do not use the Firebase Console. Use the CLI to automate setup:

1. Create the project: `npx -y firebase-tools@latest projects:create`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is fine for now - but I imagine we should have something to handle if an existing project exists, ask the user if you want to add the app to project XXXX or create a new project

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, might be good to explicitly state "check if a Firebase project exists".

2. Action: Read the Xcode project (`.pbxproj` or `Info.plist`) to determine the iOS bundle ID.
3. Register the iOS app: `npx -y firebase-tools@latest apps:create IOS <bundle-id>`
4. Fetch the config: `npx -y firebase-tools@latest apps:sdkconfig IOS <App-ID>`
5. Save the output as `GoogleService-Info.plist` in your Xcode project folder. Ensure you remove any non-XML CLI output headers, and ensure the file is linked to the main application target.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe "in the same directory as your Xcode project"? right now I worry an agent would put it in the .xcodeproj directory

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This phrasing has worked well for me, but we should see if anyonen runs into issues, and be more explicit if that happens.

@@ -0,0 +1,145 @@
import Foundation
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: license

func main() {
let args = CommandLine.arguments
guard args.count >= 5 else {
print("Usage: swift run --package-path <path> xcode_spm_setup <Path/To/Project.xcodeproj> <RepoURL> <VersionRequirement> [--plist <Path/To/Plist>] <Product1> [Product2 ...]")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume we don't want to have a big project and use ArgumentParser, right?

@@ -0,0 +1,145 @@
import Foundation
import XcodeProj
import PathKit
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this provide a ton of value?

Copy link
Copy Markdown
Contributor Author

@peterfriese peterfriese Apr 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The purpose of our script is:
a) prevent the agent from using Ruby to write scripts to edit Xcode [rojects
b) wrap XcodeProject (the Swift SDK that Tuist uses to edit Xcode projects).

So - yes, these imports are the entire reason this script exists. I would NOT want use to write a clone of XcodeProj.

name: "xcode_spm_setup",
platforms: [.macOS(.v13)],
dependencies: [
.package(url: "https://github.com/tuist/XcodeProj.git", .upToNextMajor(from: "8.27.7")),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we lock to a specific commit hash to prevent any future issues?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm.... Not a big fan of this, although I see why you're suggesting it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.