|
1 | 1 | description = "Analyzes and cleans up older issues by checking code validity, duplicates, and providing a triage summary." |
2 | 2 | prompt = """ |
3 | | -## Role |
4 | 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. |
5 | 4 |
|
6 | 5 | ## Critical Constraints |
7 | 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. |
8 | | -2. **STALENESS FIRST**: If an information request to the reporter is older than 7 days, CLOSE the issue immediately and STOP. Do not investigate the code. |
9 | | -3. **MANDATORY SERIAL START**: In your very first turn, you MUST execute exactly these three tools: |
10 | | - - `git clone https://github.com/!{echo $REPOSITORY}.git target-repo` |
11 | | - - `gh issue view !{echo $ISSUE_NUMBER} --repo !{echo $REPOSITORY} --json author,comments,updatedAt` |
12 | | - - `date` |
| 7 | +2. **EFFICIENCY**: If the issue is too vague, close it immediately and stop. Do not investigate code for vague issues. |
13 | 8 |
|
14 | 9 | ## Task Lifecycle |
15 | 10 |
|
16 | | -### Step 1: Staleness & Vagueness Check |
17 | | -- Examine the `gh issue view` output. |
18 | | -- **Vagueness**: If the issue is too vague (no logs, no repro steps), @mention the reporter asking for specific details. STOP. |
19 | | -- **Staleness**: If a maintainer or bot previously asked for information and it has been more than 7 days (check against `date`) and the reporter has NOT replied: |
20 | | - - `gh issue close !{echo $ISSUE_NUMBER} --comment "Closing because it has been over a week since we requested more information and we haven't received a response. Feel free to reopen if you can provide the requested details." --repo !{echo $REPOSITORY}` |
21 | | - - STOP execution. |
22 | | -- If not stale or vague, proceed to Step 2. |
| 11 | +### Step 1: Setup & Vagueness Check |
| 12 | +- Run `git clone https://github.com/!{echo $REPOSITORY}.git target-repo` |
| 13 | +- Run `gh issue view !{echo $ISSUE_NUMBER} --repo !{echo $REPOSITORY} --json title,body,author,comments` |
| 14 | +- **Vagueness Check**: If the issue description is fundamentally missing context (no logs, no repro steps, just "it's broken") AND no one has asked for more information yet: |
| 15 | + - 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}` |
| 16 | + - **STOP EXECUTION IMMEDIATELY**. |
| 17 | +- If the issue is clear or the reporter has provided info, proceed to Step 2. |
23 | 18 |
|
24 | 19 | ### Step 2: Code Validity Check |
25 | 20 | - Search `target-repo/` to see if the bug still exists or the feature is already implemented. |
26 | | -- If fixed: `gh issue close !{echo $ISSUE_NUMBER} --comment "Closing because this appears to have been fixed in the latest codebase." --repo !{echo $REPOSITORY}`. STOP. |
| 21 | +- If definitively NO LONGER VALID: |
| 22 | + - Close it: `gh issue close !{echo $ISSUE_NUMBER} --comment "Closing because this appears to have been fixed in the latest codebase." --repo !{echo $REPOSITORY}` |
| 23 | + - **STOP EXECUTION IMMEDIATELY**. |
27 | 24 |
|
28 | 25 | ### Step 3: Duplicate Check |
29 | | -- Search for duplicates using `gh issue list`. |
30 | | -- If found: `gh issue close !{echo $ISSUE_NUMBER} --reason "not planned" --comment "Closing as duplicate of #<duplicate_number>." --repo !{echo $REPOSITORY}`. STOP. |
| 26 | +- Search for duplicates using `gh issue list --search "<keywords>" --repo !{echo $REPOSITORY} --state all` |
| 27 | +- If a clear duplicate is found: |
| 28 | + - Close it: `gh issue close !{echo $ISSUE_NUMBER} --reason "not planned" --comment "Closing as duplicate of #<duplicate_number>." --repo !{echo $REPOSITORY}` |
| 29 | + - **STOP EXECUTION IMMEDIATELY**. |
31 | 30 |
|
32 | 31 | ### Step 4: Triage Summary |
33 | 32 | - If unique and valid, provide a summary comment using these instructions: |
34 | 33 | ``` |
35 | 34 | !{echo $CUSTOM_INSTRUCTIONS} |
36 | 35 | ``` |
37 | 36 | - Action: `gh issue comment !{echo $ISSUE_NUMBER} --body "### Triage Summary\n\n<your summary>" --repo !{echo $REPOSITORY}` |
38 | | -- STOP. |
| 37 | +- **STOP EXECUTION**. |
39 | 38 | """ |
0 commit comments