Skip to content

Commit b5e9a4f

Browse files
committed
feat(examples): refactor triage prompt to action-first syntax to stop self-investigation
1 parent 7b58e43 commit b5e9a4f

1 file changed

Lines changed: 9 additions & 15 deletions

File tree

examples/workflows/issue-cleanup/gemini-issue-cleanup.toml

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,17 @@
11
description = "Analyzes and cleans up older issues by checking code validity, duplicates, and providing a triage summary."
22
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.
44
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)
126
- Run `git clone https://github.com/!{echo $REPOSITORY}.git target-repo`
137
- Run `gh issue view !{echo $ISSUE_NUMBER} --repo !{echo $REPOSITORY} --json title,body,author,comments,labels,assignees`
148
15-
**Resolution Check (Priority 1):**
9+
### Step 2: Resolution Check
1610
- Read the comments. Does the latest comment indicate that the issue has been fixed, resolved, or is functioning properly?
1711
- 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}`
1812
- **STOP EXECUTION IMMEDIATELY**.
1913
20-
**Inactivity Check (Priority 2):**
14+
### Step 3: Inactivity Check
2115
- Is `!{echo $INACTIVE_OVER_30_DAYS}` equal to `true`?
2216
- If YES (and it was not resolved above): Execute the following bash script exactly as written to handle the inactivity.
2317
```bash
@@ -58,26 +52,26 @@ fi
5852
```
5953
- **STOP EXECUTION IMMEDIATELY**.
6054
61-
**Vagueness Check (Priority 3):**
55+
### Step 4: Vagueness Check
6256
- 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?
6357
- 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}`
6458
- **STOP EXECUTION IMMEDIATELY**.
65-
- If the issue is clear, proceed to Step 2.
59+
- If the issue is clear, proceed to Step 5.
6660
67-
### Step 2: Reproduction & Code Validity Check
61+
### Step 5: Reproduction & Code Validity Check
6862
- 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.
6963
- Alternatively, search `target-repo/` to manually trace the logic and see if the feature is already implemented or fixed.
7064
- 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):
7165
- 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}`
7266
- **STOP EXECUTION IMMEDIATELY**.
7367
74-
### Step 3: Duplicate Check
68+
### Step 6: Duplicate Check
7569
- Search for duplicates using `gh issue list --search "<keywords>" --repo !{echo $REPOSITORY} --state all`
7670
- If a clear duplicate is found:
7771
- Close it: `gh issue close !{echo $ISSUE_NUMBER} --reason "not planned" --comment "Closing as duplicate of #<duplicate_number>." --repo !{echo $REPOSITORY}`
7872
- **STOP EXECUTION IMMEDIATELY**.
7973
80-
### Step 4: Triage Summary
74+
### Step 7: Triage Summary
8175
- If unique and valid, provide a summary comment using these instructions:
8276
```
8377
!{echo $CUSTOM_INSTRUCTIONS}

0 commit comments

Comments
 (0)