Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/mcp/prompts/core/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
Contents of \`firebase.json\` config file:

\`\`\`json
${config.readProjectFile("firebase.json", { fallback: "<FILE DOES NOT EXIST>" })}

Check warning on line 33 in src/mcp/prompts/core/deploy.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Invalid type "any" of template literal expression
\`\`\`

## User Instructions
Expand All @@ -41,7 +41,7 @@

Follow the steps below taking note of any user instructions provided above.

1. If there is no active user, prompt the user to run \`firebase login\` in an interactive terminal before continuing.
1. If there is no active user, prompt the user to run \`npx firebase@latest login\` in an interactive terminal before continuing.
2. Analyze the source code in the current working directory to determine if this is a web app. If it isn't, end this process and tell the user "The /firebase:deploy command only works with web apps."
3. Analyze the source code in the current working directory to determine if the app requires a server for Server-Side Rendering (SSR). This will determine whether or not to use Firebase App Hosting. Here are instructions to determine if the app needs a server:
Objective: Analyze the provided codebase files to determine if the web application requires a backend for Server-Side Rendering (SSR). Your final output must be a clear "Yes" or "No" followed by a brief justification.
Expand Down Expand Up @@ -79,19 +79,19 @@
Example (No): "No, there are no dependencies or file structures that indicate the use of a server-side rendering framework."
4. If there is no \`firebase.json\` file, manually create one based on whether the app requires SSR:
4a. If the app requires SSR, configure Firebase App Hosting:
Create \`firebase.json\ with an "apphosting" configuration, setting backendId to the app's name in package.json: \`{"apphosting": {"backendId": "<backendId>"}}\
Create \`firebase.json\ with an "apphosting" configuration, setting backendId to the app's name in package.json: \`{"apphosting": {"backendId": "<backendId>"}}\

Check warning on line 82 in src/mcp/prompts/core/deploy.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unnecessary escape character: \ .
4b. If the app does NOT require SSR, configure Firebase Hosting:
Create \`firebase.json\ with a "hosting" configuration. Add a \`{"hosting": {"predeploy": "<build_script>"}}\` config to build before deploying.

Check warning on line 84 in src/mcp/prompts/core/deploy.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unnecessary escape character: \ .
5. Check if there is an active Firebase project for this environment (the \`firebase_get_environment\` tool may be helpful). If there is, provide the active project ID to the user and ask them if they want to proceed using that project. If there is not an active project, give the user two options: Provide an existing project ID or create a new project. Only use the list_projects tool on user request. Wait for their response before proceeding.
5a. If the user chooses to use an existing Firebase project, the \`firebase_list_projects\` tool may be helpful. Set the selected project as the active project (the \`firebase_update_environment\` tool may be helpful).
5b. If the user chooses to create a new project, use the \`firebase_create_project \` tool. Then set the new project as the active project (the \`firebase_update_environment\` tool may be helpful).
6. If firebase.json contains an "apphosting" configuration, check if a backend exists matching the provided backendId (the \`apphosting_list_backends\` tool may be helpful).
If it doesn't exist, create one by running the \`firebase apphosting:backends:create --backend <backendId> --primary-region us-central1 --root-dir .\` shell.
7. Only after making sure Firebase has been initialized, run the \`firebase deploy\` shell command to perform the deploy. This may take a few minutes.
6. If firebase.json contains an "apphosting" configuration, check if a backend exists matching the provided backendId (the \`apphosting_list_backends\` tool may be helpful).
If it doesn't exist, create one by running the \`npx firebase@latest apphosting:backends:create --backend <backendId> --primary-region us-central1 --root-dir .\` shell.
7. Only after making sure Firebase has been initialized, run the \`npx firebase@latest deploy\` shell command to perform the deploy. This may take a few minutes.
7a. If deploying to apphosting, tell the user the deployment will take a few minutes, and they can monitor deployment progress in the Firebase console: \`https://console.firebase.google.com/project/<projectId>/apphosting\`
8. If the deploy has errors, attempt to fix them and ask the user clarifying questions as needed.
9. If the deploy needs \`--force\` to run successfully, ALWAYS prompt the user before running \`firebase deploy --force\`.
10. If only one specific feature is failing, use command \`firebase deploy --only <feature>\` as you debug.
9. If the deploy needs \`--force\` to run successfully, ALWAYS prompt the user before running \`npx firebase@latest deploy --force\`.
10. If only one specific feature is failing, use command \`npx firebase@latest deploy --only <feature>\` as you debug.
11. If the deploy succeeds, your job is finished.
`.trim(),
},
Expand Down
32 changes: 16 additions & 16 deletions src/mcp/prompts/crashlytics/connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,33 +25,33 @@ Active user: ${accountEmail || "<NONE>"}
1. **Make sure the user is logged in. No Crashlytics tools will work if the user is not logged in.**
a. Use the \`firebase_get_environment\` tool to verify that the user is logged in.
b. If the Firebase 'Active user' is set to <NONE>, instruct the user to run \`firebase login\`
b. If the Firebase 'Active user' is set to <NONE>, instruct the user to run \`npx firebase@latest login\`
before continuing. Ignore other fields that are set to <NONE>. We are just making sure the
user is logged in.
user is logged in.
2. **Get the app ID for the Firebase application.**
Use the information below to help you find the developer's app ID. If you cannot find it after 2-3
attempts, just ask the user for the value they want to use, providing the description of what the
2. **Get the app ID for the Firebase application.**
Use the information below to help you find the developer's app ID. If you cannot find it after 2-3
attempts, just ask the user for the value they want to use, providing the description of what the
value looks like.
* **Description:** The app ID we are looking for contains four colon (":") delimited parts: a version
number (typically "1"), a project number, a platform type ("android", "ios", or "web"),
* **Description:** The app ID we are looking for contains four colon (":") delimited parts: a version
number (typically "1"), a project number, a platform type ("android", "ios", or "web"),
and a sequence of hexadecimal characters. This can be found in the project settings in the Firebase Console
or in the appropriate google services file for the application type.
* For Android apps, you will typically find the app ID in a file called google-services.json under the
mobilesdk_app_id key. The file is most often located in the app directory that contains the src directory.
* For iOS apps, you will typically find the app ID in a property list file called GoogleService-Info.plist under the
GOOGLE_APP_ID key. The plist file is most often located in the main project directory.
* Sometimes developers will not check in the google services file because it is a shared or public
repository. If you can't find the file, the files may be included in the .gitignore. Check again for the file
repository. If you can't find the file, the files may be included in the .gitignore. Check again for the file
removing restrictions around looking for tracked files.
* Developers may have multiple google services files that map to different releases. In cases like this,
developers may create different directories to hold each like alpha/google-services.json or alpha/GoogleService-Info.plist.
In other cases, developers may change the suffix of the file to something like google-services-alpha.json or
In other cases, developers may change the suffix of the file to something like google-services-alpha.json or
GoogleService-Alpha.plist. Look for as many google services files as you can find.
* Sometimes developers may include the codebase for both the Android app and the iOS app in the same repository.
* If there are multiple files or multiple app IDs in a single file, ask the user to choose one by providing
* If there are multiple files or multiple app IDs in a single file, ask the user to choose one by providing
a numbered list of all the package names.
* Again, if you have trouble finding the app ID, just ask the user for it.
Expand All @@ -76,12 +76,12 @@ Follow these steps to fetch issues and prioritize them.
1c. If the user asks about a particular time range, then set both the intervalStartTime and intervalEndTime.
2. Use the 'crashlytics_get_top_versions' tool to fetch the top versions for this app.
3. If the user instructions include statements about prioritization, use those instructions.
4. If the user instructions do not include statements about prioritization,
4. If the user instructions do not include statements about prioritization,
then prioritize the returned issues using the following criteria:
4a. The app versions for the issue include the most recent version of the app.
4b. The number of users experiencing the issue across variants
4c. The volume of crashes
5. Return the top 5 issues, with a brief description each in a numerical list with the following format:
5. Return the top 5 issues, with a brief description each in a numerical list with the following format:
1. Issue <issue id>
* <the issue title>
* <the issue subtitle>
Expand Down Expand Up @@ -116,7 +116,7 @@ Follow these steps to diagnose and fix issues.
<A description of the root cause leading to the issue>
- **Fault**: <a determination of whether this code base is at fault or a dependent library is at fault>
- **Complexity**: <one of "simple", "moderately simple", "moderately hard", "hard", "oof, I don't know where to start">
## Fix
<A description of the fix for this issue and a break down of the changes.>
1. <Step 1>
Expand All @@ -130,7 +130,7 @@ Follow these steps to diagnose and fix issues.
## Other potential causes
1. <Another possible root cause>
2. <Another possible root cause>
9. Present the plan to the user and get approval before making the change.
10. Only if they approve the plan, create a fix for the issue.
10a. Be mindful of API contracts and do not add fields to resources without a clear way to populate those fields
Expand Down
Loading