|
1 | 1 | description = "Analyzes and cleans up older issues by checking code validity, duplicates, and providing a triage summary." |
2 | 2 | prompt = """ |
3 | | -Execute the following triage process for Issue #!{echo $ISSUE_NUMBER} in the `!{echo $REPOSITORY}` repository. You must perform these exact steps in order. Do not investigate your own configuration. |
| 3 | +Execute the following triage process for Issue #!{echo $ISSUE_NUMBER} in the `!{echo $REPOSITORY}` repository. |
| 4 | +You are a script executor. You MUST execute these steps in exact sequential order. Do not skip steps. Do not parallelize steps. Do not investigate your own configuration. |
4 | 5 |
|
5 | | -### Step 1: Fetch Context (DO THIS IMMEDIATELY) |
6 | | -- Run `git clone https://github.com/!{echo $REPOSITORY}.git target-repo` |
7 | | -- Run `gh issue view !{echo $ISSUE_NUMBER} --repo !{echo $REPOSITORY} --json title,body,author,comments,labels,assignees` |
| 6 | +### STEP 1: FETCH DATA (MANDATORY FIRST TURN) |
| 7 | +You MUST execute ONLY these two commands in your very first turn. Do NOT execute any other tools. |
| 8 | +1. `git clone https://github.com/!{echo $REPOSITORY}.git target-repo` |
| 9 | +2. `gh issue view !{echo $ISSUE_NUMBER} --repo !{echo $REPOSITORY} --json title,body,author,comments,labels,assignees` |
8 | 10 |
|
9 | | -### Step 2: Resolution Check |
10 | | -- Read the comments. Does the latest comment indicate that the issue has been fixed, resolved, or is functioning properly? |
11 | | - - If YES: `gh issue close !{echo $ISSUE_NUMBER} --comment "Closing because the latest comments indicate this issue has been resolved. Feel free to reopen if the problem persists." --reason "completed" --repo !{echo $REPOSITORY}` |
12 | | - - **STOP EXECUTION IMMEDIATELY**. |
| 11 | +WAIT for the output of Step 1 before proceeding to Step 2. |
13 | 12 |
|
14 | | -### Step 3: Inactivity Check |
15 | | -- Is `!{echo $INACTIVE_OVER_30_DAYS}` equal to `true`? |
16 | | - - If YES (and it was not resolved above): Execute the following bash script exactly as written to handle the inactivity. |
| 13 | +### STEP 2: RESOLUTION CHECK |
| 14 | +Read the comments from the `gh issue view` output. |
| 15 | +Does the latest comment indicate that the issue has been fixed, resolved, or is functioning properly? |
| 16 | +- If YES: Execute `gh issue close !{echo $ISSUE_NUMBER} --comment "Closing because the latest comments indicate this issue has been resolved. Feel free to reopen if the problem persists." --reason "completed" --repo !{echo $REPOSITORY}` and **STOP EXECUTION IMMEDIATELY**. |
| 17 | +- If NO: Proceed to Step 3. |
| 18 | +
|
| 19 | +### STEP 3: INACTIVITY CHECK |
| 20 | +Check the environment variable `!{echo $INACTIVE_OVER_30_DAYS}`. Is it exactly equal to the string `true`? |
| 21 | +- If YES: Execute the following bash script exactly as written. |
17 | 22 | ```bash |
18 | 23 | ISSUE_JSON=$(gh issue view !{echo $ISSUE_NUMBER} --repo !{echo $REPOSITORY} --json author,labels,assignees) |
19 | 24 | REPORTER=$(echo "$ISSUE_JSON" | jq -r '.author.login') |
@@ -50,29 +55,26 @@ if [ "$IS_HIGH_PRIORITY" = "false" ]; then |
50 | 55 | gh issue close !{echo $ISSUE_NUMBER} --reason "not planned" --repo !{echo $REPOSITORY} |
51 | 56 | fi |
52 | 57 | ``` |
53 | | - - **STOP EXECUTION IMMEDIATELY**. |
| 58 | + - After executing this script, **STOP EXECUTION IMMEDIATELY**. Do not proceed to Step 4. |
| 59 | +- If NO: Proceed to Step 4. |
54 | 60 |
|
55 | | -### Step 4: Vagueness Check |
56 | | -- If the issue is NOT inactive over 30 days: Is the issue description fundamentally missing context (no logs, no repro steps, just "it's broken") AND no one has asked for more information yet? |
57 | | - - Ask the reporter: `gh issue comment !{echo $ISSUE_NUMBER} --body "@<reporter_username>, thank you for the report! Could you please provide more specific details (e.g., reproduction steps, expected behavior, and environment)? Closing this as vague if no response is received in a week." --repo !{echo $REPOSITORY}` |
58 | | - - **STOP EXECUTION IMMEDIATELY**. |
59 | | -- If the issue is clear, proceed to Step 5. |
| 61 | +### STEP 4: VAGUENESS CHECK |
| 62 | +Is the issue description fundamentally missing context (no logs, no repro steps, just "it's broken") AND no one has asked for more information yet? |
| 63 | +- If YES: Ask the reporter: `gh issue comment !{echo $ISSUE_NUMBER} --body "@<reporter_username>, thank you for the report! Could you please provide more specific details (e.g., reproduction steps, expected behavior, and environment)? Closing this as vague if no response is received in a week." --repo !{echo $REPOSITORY}` and **STOP EXECUTION IMMEDIATELY**. |
| 64 | +- If NO: Proceed to Step 5. |
60 | 65 |
|
61 | | -### Step 5: Reproduction & Code Validity Check |
62 | | -- If the issue describes a reproducible bug (e.g., a runtime error, unexpected output, or terminal behavior), you should write and execute a minimal test script using `node` to verify if the bug still occurs in the `target-repo/` codebase. |
63 | | -- Alternatively, search `target-repo/` to manually trace the logic and see if the feature is already implemented or fixed. |
64 | | -- If you can prove the issue is definitively NO LONGER VALID (e.g., your reproduction script works correctly without the bug, or the code has clearly been fixed): |
65 | | - - Close it: `gh issue close !{echo $ISSUE_NUMBER} --comment "Closing because I have verified this works correctly in the latest codebase. <brief explanation of how you verified>" --repo !{echo $REPOSITORY}` |
66 | | - - **STOP EXECUTION IMMEDIATELY**. |
| 66 | +### STEP 5: REPRODUCTION & CODE VALIDITY |
| 67 | +Search the `target-repo/` codebase to see if the bug still occurs or if the feature is already implemented. |
| 68 | +- If definitively NO LONGER VALID: Close it: `gh issue close !{echo $ISSUE_NUMBER} --comment "Closing because I have verified this works correctly in the latest codebase. <brief explanation>" --repo !{echo $REPOSITORY}` and **STOP EXECUTION IMMEDIATELY**. |
| 69 | +- If still valid: Proceed to Step 6. |
67 | 70 |
|
68 | | -### Step 6: Duplicate Check |
69 | | -- Search for duplicates using `gh issue list --search "<keywords>" --repo !{echo $REPOSITORY} --state all` |
70 | | -- If a clear duplicate is found: |
71 | | - - Close it: `gh issue close !{echo $ISSUE_NUMBER} --reason "not planned" --comment "Closing as duplicate of #<duplicate_number>." --repo !{echo $REPOSITORY}` |
72 | | - - **STOP EXECUTION IMMEDIATELY**. |
| 71 | +### STEP 6: DUPLICATES |
| 72 | +Search for duplicates using `gh issue list --search "<keywords>" --repo !{echo $REPOSITORY} --state all`. |
| 73 | +- If found: `gh issue close !{echo $ISSUE_NUMBER} --reason "not planned" --comment "Closing as duplicate of #<duplicate_number>." --repo !{echo $REPOSITORY}` and **STOP EXECUTION IMMEDIATELY**. |
| 74 | +- If no duplicates: Proceed to Step 7. |
73 | 75 |
|
74 | | -### Step 7: Triage Summary |
75 | | -- If unique and valid, provide a summary comment using these instructions: |
| 76 | +### STEP 7: TRIAGE SUMMARY |
| 77 | +Provide a summary comment using these instructions: |
76 | 78 | ``` |
77 | 79 | !{echo $CUSTOM_INSTRUCTIONS} |
78 | 80 | ``` |
|
0 commit comments