Skip to content

Commit a1fa51d

Browse files
authored
Another round of prompt tweaks (#9201)
* Ensure the firestore API is enabled before deploying to it * Autocomplete strikes again * More prompt tuning * one more tweak
1 parent 0b9f783 commit a1fa51d

File tree

4 files changed

+20
-9
lines changed

4 files changed

+20
-9
lines changed

src/mcp/prompts/core/init.ts

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,19 +86,29 @@ IMPORTANT: The backend setup guide is for web apps only. If the user requests ba
8686
- If you run into issues logging the user in, suggest that they run \`npx firebase-tools login --reauth\` in a separate terminal
8787
2. If there is no active Firebase project, ask the user if they would like to create a project, or use an existing one, and ask them for the project ID
8888
- If they would like to create a project, use the firebase_create_project with the project ID
89-
- If they would like to use an existing project, run the shell command \`firebase use <project-id>\`
89+
- If they would like to use an existing project, use the firebase_update_environment tool with the active_project argument.
9090
- If you run into issues creating the firebase project, ask the user to go to the [Firebase Console](http://console.firebase.google.com/) and create a project. Wait for the user to report back before continuing.
9191
3. Ensure there is an active Firebase App for their platform
9292
- Run the \`firebase_list_apps\` tool to list their apps, and find an app that matches their "Workspace platform"
9393
- If there is no app that matches that criteria, use the \`firebase_create_app\` tool to create the app with the appropriate platform
9494
4. Now that we have a working environment, print out 1) Active user 2) Firebase Project and 3) Firebase App & platform they are using for this process.
9595
- Ask the user to confirm this is correct before continuing
96-
5. Initialize the Firebase SDK
96+
5. Set up the web Firebase SDK
9797
- Fetch the configuration for the specified app using the \`firebase_get_sdk_config\` tool.
9898
- Write the Firebase SDK config to a file
99-
- Initialize the Firebase SDK for the appropriate platform
100-
6. Determine which of the services listed below are the best match for the user's needs based on their instructions or by asking them.
101-
7. Read the guide for the appropriate services and follow the instructions. If no guides match the user's need, inform the user.
99+
- Check what the latest version of the SDK is by running the command 'npm view firebase version'
100+
- If the user app has a package.json, install via npm
101+
- Run 'npm i firebase'
102+
- Import it into the app code:
103+
'''
104+
import { initializeApp } from 'firebase/app';
105+
'''
106+
- If the user app does not have a package.json, import via CDN:
107+
'''
108+
import { initializeApp } from 'https://www.gstatic.com/firebasejs/12.3.0/firebase-app.js'
109+
'''
110+
7. Determine which of the services listed below are the best match for the user's needs based on their instructions or by asking them.
111+
8. Read the guide for the appropriate services and follow the instructions. If no guides match the user's need, inform the user.
102112
103113
## Available Services
104114

src/mcp/resources/guides/init_backend.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ The user will likely need to setup Firestore, Authentication, and Hosting. Read
2525
3. [Hosting](firebase://guides/init/hosting): read this if the user would like to deploy to Firebase Hosting
2626
2727
**firebase.json**
28-
The firebase.json file is used to deploy assets with the Firebase CLI. It contains configuration for firestore, hosting, and functions.
28+
The firebase.json file is used to deploy Firebase products with the firebase deploy command.
2929
30-
Here is an example firebase.json file with all 3 services. Note that you do not need entries for services that the user isn't using. Do not remove sections from the user's firebase.json unless the user gives explicit permission. For more information, refer to [firebase.json file documentation](https://firebase.google.com/docs/cli/#the_firebasejson_file)
30+
Here is an example firebase.json file with Firebase Hosting, Firestore, and Cloud Functions. Note that you do not need entries for services that the user isn't using. Do not remove sections from the user's firebase.json unless the user gives explicit permission. For more information, refer to [firebase.json file documentation](https://firebase.google.com/docs/cli/#the_firebasejson_file)
3131
\`\`\`json
3232
{
3333
"hosting": {

src/mcp/resources/guides/init_firestore.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ export const init_firestore = resource(
1515
type: "text",
1616
text: `
1717
### Setup Firestore Database
18-
1918
**Database Setup:**
2019
- Configure Firebase Firestore as the primary database for the application
2120
- Implement client code for basic CRUD operations using the Firestore SDK

src/mcp/resources/guides/init_hosting.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,15 @@ export const init_hosting = resource(
1717
text: `
1818
### Configure Firebase Hosting
1919
20+
**Security Warning:**
21+
- Files included in the public folder of a hosting site are publicly accessible. Do not include sensitive API keys for services other than Firebase in these files.
22+
2023
**When to Deploy:**
2124
- Introduce Firebase Hosting when developers are ready to deploy their application to production
2225
- Alternative: Developers can deploy later using the \`/deploy\` command
2326
2427
**Deployment Process:**
2528
- Request developer permission before implementing Firebase Hosting
26-
- Check security rules before deploying - do not deploy if rules are public without explicit confirmation
2729
- Configure Firebase Hosting and deploy the application to production
2830
`.trim(),
2931
},

0 commit comments

Comments
 (0)