$npx -y skills add firebase/agent-skills --skill firebase-basicsProvides foundational setup, authentication, and project management workflows for Firebase using the Firebase CLI. Use when checking Firebase CLI version (must use 'npx -y firebase-tools@latest --version'), initializing a Firebase environment, authenticating, setting active proje
| 1 | # Prerequisites |
| 2 | |
| 3 | Complete these setup steps before proceeding: |
| 4 | |
| 5 | 1. **Local Environment Setup:** Verify the environment is properly set up so we |
| 6 | can use Firebase tools: |
| 7 | |
| 8 | - Run `npx -y firebase-tools@latest --version` to check if the Firebase CLI |
| 9 | is installed. |
| 10 | - Verify if the Firebase MCP server is installed using your existing tools. |
| 11 | - **CRITICAL**: Before configuring any extensions or agent environments |
| 12 | below, you MUST read |
| 13 | [references/local-env-setup.md](references/local-env-setup.md). |
| 14 | - **DO NOT SKIP** this step: if 'firebase-basics' is the only Firebase skill |
| 15 | available to you, you must follow the reference for your agent environment |
| 16 | to set up the full suite of Firebase skills: |
| 17 | - **Gemini CLI**: Review |
| 18 | [references/setup/gemini_cli.md](references/setup/gemini_cli.md) |
| 19 | - **Antigravity**: Review |
| 20 | [references/setup/antigravity.md](references/setup/antigravity.md) |
| 21 | - **Android Studio**: Review |
| 22 | [references/setup/android_studio.md](references/setup/android_studio.md) |
| 23 | - **Claude Code**: Review |
| 24 | [references/setup/claude_code.md](references/setup/claude_code.md) |
| 25 | - **Cursor**: Review |
| 26 | [references/setup/cursor.md](references/setup/cursor.md) |
| 27 | - **GitHub Copilot**: Review |
| 28 | [references/setup/github_copilot.md](references/setup/github_copilot.md) |
| 29 | - **Other Agents**: Review |
| 30 | [references/setup/other_agents.md](references/setup/other_agents.md) |
| 31 | |
| 32 | 1. **Authentication:** Ensure you are logged in to Firebase so that commands |
| 33 | have the correct permissions. Run `npx -y firebase-tools@latest login`. For |
| 34 | environments without a browser (e.g., remote shells), use |
| 35 | `npx -y firebase-tools@latest login --no-localhost`. |
| 36 | |
| 37 | - The command should output the current user. |
| 38 | - If you are not logged in, follow the interactive instructions from this |
| 39 | command to authenticate. |
| 40 | |
| 41 | 1. **Active Project:** Most Firebase tasks require an active project context. |
| 42 | |
| 43 | > [!IMPORTANT] **For Agents:** Before proceeding with project configuration, |
| 44 | > you MUST pause and ask the developer if they prefer to: |
| 45 | > |
| 46 | > 1. **Provide an existing Firebase Project ID**, or |
| 47 | > 1. **Create a new Firebase project**. |
| 48 | |
| 49 | - **If using an existing Project ID:** |
| 50 | |
| 51 | 1. Check the current project by running `npx -y firebase-tools@latest use`. |
| 52 | 1. If the command outputs `Active Project: <project-id>`, confirm with the |
| 53 | user if this is the intended project. |
| 54 | 1. If not, or if no project is active, set the project provided by the |
| 55 | user: |
| 56 | ```bash |
| 57 | npx -y firebase-tools@latest use <PROJECT_ID> |
| 58 | ``` |
| 59 | |
| 60 | - **If creating a new project:** Run the following command to create it: |
| 61 | |
| 62 | ```bash |
| 63 | npx -y firebase-tools@latest projects:create <project-id> --display-name "<display-name>" |
| 64 | ``` |
| 65 | |
| 66 | *Note: The `<project-id>` must be 6-30 characters, lowercase, and can |
| 67 | contain digits and hyphens. It must be globally unique.* |
| 68 | |
| 69 | # Firebase Usage Principles |
| 70 | |
| 71 | Adhere to these principles: |
| 72 | |
| 73 | 1. **Use npx for CLI commands:** To ensure you always use the latest version of |
| 74 | the Firebase CLI, always prepend commands with `npx -y firebase-tools@latest` |
| 75 | instead of just `firebase`. For example, use |
| 76 | `npx -y firebase-tools@latest --version`. NEVER suggest the naked `firebase` |
| 77 | command as an alternative. |
| 78 | 1. **Prioritize official knowledge:** For any Firebase-related knowledge, |
| 79 | consult the `developerknowledge_search_documents` MCP tool before falling |
| 80 | back to Google Search or your internal knowledge base. Including "Firebase" |
| 81 | in your search query significantly improves relevance. |
| 82 | 1. **Follow Agent Skills for implementation guidance:** Skills provide |
| 83 | opinionated workflows (CUJs), security rules, and best practices. Always |
| 84 | consult them to understand *how* to implement Firebase features correctly |
| 85 | instead of relying on general knowledge. |
| 86 | 1. **Use Firebase MCP Server tools instead of direct API calls:** Whenever you |
| 87 | need to interact with remote Firebase APIs (such as fetching Crashlytics logs |
| 88 | or executing Data Connect queries), use the tools provided by the Firebase |
| 89 | MCP Server instead of attempting manual API calls. |
| 90 | 1. **Keep Plugin / Agent Skills updated:** Since Firebase best practices evolve |
| 91 | quickly, regularly check for and install updates to their Firebase plugin or |
| 92 | Agent Skills. Similarly, if you encounter issues with outdated tools or |
| 93 | commands, follow the steps below based on your agent environment: |
| 94 | - **Antigravity**: Follow |
| 95 | [references/refresh/antigravity.md](refer |