|
1 | 1 | description = "Analyzes and cleans up older issues by checking code validity, duplicates, and providing a triage summary." |
2 | 2 | prompt = """ |
3 | | -You are an automated triage bot for the `!{echo $REPOSITORY}` repository. Your job is to process Issue #!{echo $ISSUE_NUMBER} as efficiently as possible. |
| 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. |
4 | 4 |
|
5 | | -## Critical Constraints |
6 | | -1. **NO META-ANALYSIS**: DO NOT read local files in the repository you are running in (like `package.json`, `README.md`, or `.github/`). Only read files within the `target-repo/` folder you clone in Step 1. |
7 | | -2. **EFFICIENCY**: If the issue is too vague or inactive, close/comment immediately and stop. Do not investigate code. |
8 | | -
|
9 | | -## Task Lifecycle |
10 | | -
|
11 | | -### Step 1: Setup & Comment Analysis |
| 5 | +### Step 1: Fetch Context (DO THIS IMMEDIATELY) |
12 | 6 | - Run `git clone https://github.com/!{echo $REPOSITORY}.git target-repo` |
13 | 7 | - Run `gh issue view !{echo $ISSUE_NUMBER} --repo !{echo $REPOSITORY} --json title,body,author,comments,labels,assignees` |
14 | 8 |
|
15 | | -**Resolution Check (Priority 1):** |
| 9 | +### Step 2: Resolution Check |
16 | 10 | - Read the comments. Does the latest comment indicate that the issue has been fixed, resolved, or is functioning properly? |
17 | 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}` |
18 | 12 | - **STOP EXECUTION IMMEDIATELY**. |
19 | 13 |
|
20 | | -**Inactivity Check (Priority 2):** |
| 14 | +### Step 3: Inactivity Check |
21 | 15 | - Is `!{echo $INACTIVE_OVER_30_DAYS}` equal to `true`? |
22 | 16 | - If YES (and it was not resolved above): Execute the following bash script exactly as written to handle the inactivity. |
23 | 17 | ```bash |
|
58 | 52 | ``` |
59 | 53 | - **STOP EXECUTION IMMEDIATELY**. |
60 | 54 |
|
61 | | -**Vagueness Check (Priority 3):** |
| 55 | +### Step 4: Vagueness Check |
62 | 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? |
63 | 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}` |
64 | 58 | - **STOP EXECUTION IMMEDIATELY**. |
65 | | -- If the issue is clear, proceed to Step 2. |
| 59 | +- If the issue is clear, proceed to Step 5. |
66 | 60 |
|
67 | | -### Step 2: Reproduction & Code Validity Check |
| 61 | +### Step 5: Reproduction & Code Validity Check |
68 | 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. |
69 | 63 | - Alternatively, search `target-repo/` to manually trace the logic and see if the feature is already implemented or fixed. |
70 | 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): |
71 | 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}` |
72 | 66 | - **STOP EXECUTION IMMEDIATELY**. |
73 | 67 |
|
74 | | -### Step 3: Duplicate Check |
| 68 | +### Step 6: Duplicate Check |
75 | 69 | - Search for duplicates using `gh issue list --search "<keywords>" --repo !{echo $REPOSITORY} --state all` |
76 | 70 | - If a clear duplicate is found: |
77 | 71 | - Close it: `gh issue close !{echo $ISSUE_NUMBER} --reason "not planned" --comment "Closing as duplicate of #<duplicate_number>." --repo !{echo $REPOSITORY}` |
78 | 72 | - **STOP EXECUTION IMMEDIATELY**. |
79 | 73 |
|
80 | | -### Step 4: Triage Summary |
| 74 | +### Step 7: Triage Summary |
81 | 75 | - If unique and valid, provide a summary comment using these instructions: |
82 | 76 | ``` |
83 | 77 | !{echo $CUSTOM_INSTRUCTIONS} |
|
0 commit comments