You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Moving crashlytics prompt into guides
- Consolidating the report tools into a single get_report tool
- Fixing bug where additional prompt said report result was empty
- Including request filters in report tool response
- Improving error handling and leveraging guides
- Ignore gemini environment dotfile
**The user is logged into Firebase as ${accountEmail||""}.
17
+
`.trim();
18
+
19
+
constnotLoggedInInstruction=`
20
+
**Instruct the User to Log In**
21
+
The user is not logged in to Firebase. None of the Crashlytics tools will be able to authenticate until the user has logged in. Instruct the user to run \`${firebaseCliCommand} login\` before continuing, then use the \`firebase_get_environment\` tool to verify that the user is logged in.
22
+
`.trim();
23
+
14
24
return[
15
25
{
16
26
role: "user"asconst,
17
27
content: {
18
28
type: "text",
19
29
text: `
20
-
You are going to help a developer prioritize and fix issues in their
21
-
mobile application by accessing their Firebase Crashlytics data.
22
-
23
-
Active user: ${accountEmail||"<NONE>"}
24
-
25
-
General rules:
26
-
**ASK THE USER WHAT THEY WOULD LIKE TO DO BEFORE TAKING ACTION**
27
-
**ASK ONLY ONE QUESTION OF THE USER AT A TIME**
28
-
**MAKE SURE TO FOLLOW THE INSTRUCTIONS, ESPECIALLY WHERE THEY ASK YOU TO CHECK IN WITH THE USER**
29
-
**ADHERE TO SUGGESTED FORMATTING**
30
-
31
-
## Required first steps! Absolutely required! Incredibly important!
32
-
33
-
1. **Make sure the user is logged in. No Crashlytics tools will work if the user is not logged in.**
34
-
a. Use the \`firebase_get_environment\` tool to verify that the user is logged in.
35
-
b. If the Firebase 'Active user' is set to <NONE>, instruct the user to run \`${firebaseCliCommand} login\`
36
-
before continuing. Ignore other fields that are set to <NONE>. We are just making sure the
37
-
user is logged in.
38
-
39
-
2. **Get the app ID for the Firebase application.**
40
-
a. **PRIORITIZE REMEMBERED APP ID ENTRIES** If an entry for this directory exists in the remembered app ids, use the remembered app id
41
-
for this directory without presenting any additional options.
42
-
i. If there are multiple remembered app ids for this directory, ask the user to choose one by providing
43
-
a numbered list of all the package names. Tell them that these values came from memories and how they can modify those values.
44
-
b. **IF THERE IS NO REMEMBERED ENTRY FOR THIS DIRECTORY** Use the app IDs from the \`firebase_get_environment\` tool.
45
-
i. If you've already called this tool, use the previous response from context.
46
-
ii. If the 'Detected App IDs' is set to <NONE>, ask the user for the value they want to use.
47
-
iii. If there are multiple 'Detected App IDs', ask the user to choose one by providing
48
-
a numbered list of all the package names and app ids.
49
-
c. **IF THERE IS A REMEMBERED VALUE BUT IT DOES NOT MATCH ANY DETECTED APP IDS** Ask if the user would like to replace the value with one of
50
-
the detected values.
51
-
i. **Description:** A valid app ID to remember contains four colon (":") delimited parts: a version
52
-
number (typically "1"), a project number, a platform type ("android", "ios", or "web"),
53
-
and a sequence of hexadecimal characters.
54
-
ii. Replace the value for this directory with this valid app id, the android package name or ios bundle identifier, and the project directory.
55
-
c. **IF THERE IS NO REMEMBERED ENTRY FOR THIS DIRECTORY** Ask if the user would like to remember the app id selection
56
-
i. **Description:** A valid app ID to remember contains four colon (":") delimited parts: a version
57
-
number (typically "1"), a project number, a platform type ("android", "ios", or "web"),
58
-
and a sequence of hexadecimal characters.
59
-
ii. Store the valid app id value, the android package name or ios bundle identifier, and the project directory.
60
-
61
-
## Next steps
62
-
63
-
Once you have confirmed that the user is logged in to Firebase, confirmed the
64
-
id for the application that they want to access, and asked if they want to remember the app id for this directory,
65
-
ask the user what actions they would like to perform.
66
-
67
-
Use the following format to ask the user what actions they would like to perform:
68
-
69
-
1. Prioritize the most impactful stability issues
70
-
2. Diagnose and propose a fix for a crash
71
-
72
-
Wait for their response before taking action.
73
-
74
-
## Instructions for Using Crashlytics Data
75
-
76
-
### How to prioritize issues
77
-
78
-
Follow these steps to fetch issues and prioritize them.
79
-
80
-
1. Use the 'crashlytics_get_top_issues' tool to fetch up to 20 issues.
81
-
1a. Analyze the user's query and apply the appropriate filters.
82
-
1b. If the user asks for crashes, then set the issueErrorType filter to *FATAL*.
83
-
1c. If the user asks about a particular time range, then set both the intervalStartTime and intervalEndTime.
84
-
2. Use the 'crashlytics_get_top_versions' tool to fetch the top versions for this app.
85
-
3. If the user instructions include statements about prioritization, use those instructions.
86
-
4. If the user instructions do not include statements about prioritization,
87
-
then prioritize the returned issues using the following criteria:
88
-
4a. The app versions for the issue include the most recent version of the app.
89
-
4b. The number of users experiencing the issue across variants
90
-
4c. The volume of crashes
91
-
5. Return the top 5 issues, with a brief description each in a numerical list with the following format:
92
-
1. Issue <issue id>
93
-
* <the issue title>
94
-
* <the issue subtitle>
95
-
* **Description:** <a discription of the issue based on information from the tool response>
96
-
* **Rationale:** <the reason this issue was prioritized in the way it was>
97
-
6. Ask the user if they would like to diagnose and fix any of the issues presented
98
-
99
-
### How to diagnose and fix issues
100
-
101
-
Follow these steps to diagnose and fix issues.
30
+
You will assist developers in investigating and resolving mobile application issues by leveraging Firebase Crashlytics data.
102
31
103
-
1. Make sure you have a good understanding of the code structure and where different functionality exists
104
-
2. Use the 'crashlytics_get_issue' tool to get more context on the issue.
105
-
3. Use the 'crashlytics_batch_get_events' tool to get an example crash for this issue. Use the event names in the sampleEvent fields.
106
-
3a. If you need to read more events, use the 'crashlytics_list_events' tool.
107
-
3b. Apply the same filtering criteria that you used to find the issue, so that you find a appropriate events.
108
-
4. Read the files that exist in the stack trace of the issue to understand the crash deeply.
109
-
5. Determine possible root causes for the crash - no more than 5 potential root causes.
110
-
6. Critique your own determination, analyzing how plausible each scenario is given the crash details.
111
-
7. Choose the most likely root cause given your analysis.
112
-
8. Write out a plan for the most likely root cause using the following criteria:
113
-
8a. Write out a description of the issue and including
114
-
* A brief description of the cause of the issue
115
-
* A determination of your level of confidence in the cause of the issue using your analysis.
116
-
* A determination of which library is at fault, this codebase or a dependent library
117
-
* A determination for how complex the fix will be
118
-
8b. The plan should include relevant files to change
119
-
8c. The plan should include a test plan for how the user might verify the fix
120
-
8d. Use the following format for the plan:
32
+
### Required First Steps
121
33
122
-
## Cause
123
-
<A description of the root cause leading to the issue>
124
-
- **Fault**: <a determination of whether this code base is at fault or a dependent library is at fault>
125
-
- **Complexity**: <one of "simple", "moderately simple", "moderately hard", "hard", "oof, I don't know where to start">
126
-
127
-
## Fix
128
-
<A description of the fix for this issue and a break down of the changes.>
The Firebase App ID is used to identify a mobile or web client application to Firebase back end services such as Crashlytics or Remote Config. Use the information below to find the developer's App ID.
6
+
7
+
1. **PRIORITIZE REMEMBERED APP ID ENTRIES** If an entry for this directory exists in the remembered app ids, use the remembered app id
8
+
for this directory without presenting any additional options.
9
+
i. If there are multiple remembered app ids for this directory, ask the user to choose one by providing
10
+
a numbered list of all the package names. Tell them that these values came from memories and how they can modify those values.
11
+
2. **IF THERE IS NO REMEMBERED ENTRY FOR THIS DIRECTORY** Use the app IDs from the \`firebase_get_environment\` tool.
12
+
i. If you've already called this tool, use the previous response from context.
13
+
ii. If the 'Detected App IDs' is set to <NONE>, ask the user for the value they want to use.
14
+
iii. If there are multiple 'Detected App IDs', ask the user to choose one by providing
15
+
a numbered list of all the package names and app ids.
16
+
3. **IF THERE IS A REMEMBERED VALUE BUT IT DOES NOT MATCH ANY DETECTED APP IDS** Ask if the user would like to replace the value with one of
17
+
the detected values.
18
+
i. **Description:** A valid app ID to remember contains four colon (":") delimited parts: a version
19
+
number (typically "1"), a project number, a platform type ("android", "ios", or "web"),
20
+
and a sequence of hexadecimal characters.
21
+
ii. Replace the value for this directory with this valid app id, the android package name or ios bundle identifier, and the project directory.
22
+
4. **IF THERE IS NO REMEMBERED ENTRY FOR THIS DIRECTORY** Ask if the user would like to remember the app id selection
23
+
i. **Description:** A valid app ID to remember contains four colon (":") delimited parts: a version
24
+
number (typically "1"), a project number, a platform type ("android", "ios", or "web"),
25
+
and a sequence of hexadecimal characters.
26
+
ii. Store the valid app id value, the android package name or ios bundle identifier, and the project directory.
27
+
`.trim();
28
+
29
+
exportconstapp_id=resource(
30
+
{
31
+
uri: "firebase://guides/app_id",
32
+
name: "app_id_guide",
33
+
title: "Firebase App Id Guide",
34
+
description:
35
+
"guides the coding agent through choosing a Firebase App ID in the current project",
### Instructions for Working with Firebase Crashlytics Tools
5
+
6
+
Only ask the user one question at a time. Do not proceed without user instructions. Upon receiving user instructions, refer to the relevant resources for guidance.
7
+
8
+
Use the \`firebase_read_resources\` tool to access the following guides.
9
+
10
+
1. [Firebase App Id Guide](firebase://guides/app_id)
11
+
This guide provides crucial instructions for obtaining the application's App Id which is required for all API calls.
This guide details how to work with issues within Crashlytics. The agent should read this guide before prioritizing issues or presenting issue data to the user.
This guide provides instructions on investigating the root causes of crashes and exceptions reported in Crashlytics issues.
21
+
22
+
### Check That You Are Connected
23
+
24
+
Verify that you can read the app's Crashlytics data by getting the topVersions report. This report will tell you which app versions have the most events.
25
+
a. Call the \`firebase_get_environment\` tool if you need to find the app_id.
26
+
b. Call the \`crashlytics_get_report\` tool to read the \`topVersions\` report.
27
+
c. If you haven't read the reports guide, then the tool will include it in the response. This is OK. Simply call the tool again.
28
+
d. Help the user resolve any issues that arise when trying to connect.
29
+
30
+
After confirming you can access Crashlytics, inquire about the desired actions. Your capabilities include:
31
+
32
+
- Reading Crashlytics reports.
33
+
- Investigating bug reports using Crashlytics event data.
34
+
- Proposing code changes to resolve identified bugs.
35
+
`.trim();
36
+
37
+
exportconstcrashlytics_connect=resource(
38
+
{
39
+
uri: "firebase://guides/crashlytics/connect",
40
+
name: "crashlytics_connect_guide",
41
+
title: "Firebase Crashlytics Connect Guide",
42
+
description: "Guides the coding agent to connect to Firebase Crashlytics.",
0 commit comments