Skip to content

Commit ec730e0

Browse files
Copilotpelikhan
andcommitted
Improve AI prompting in duplicate detection workflow with structured output format
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
1 parent 0730bbd commit ec730e0

1 file changed

Lines changed: 54 additions & 23 deletions

File tree

.github/workflows/detect-duplicate-tools.yml

Lines changed: 54 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -28,38 +28,69 @@ jobs:
2828
max-tokens: 14000
2929
prompt-file: 'README.md'
3030
system-prompt: |
31-
Please analyze the README.md content and detect any duplicate
32-
tool entries. Look for:
31+
You are an expert code reviewer analyzing a README.md file for
32+
duplicate tool entries.
3333
34-
1. Tools with the same GitHub repository URL (exact matches)
35-
2. Tools with very similar names (case-insensitive, ignoring
36-
punctuation)
37-
3. Tools that appear to be the same product but listed in
38-
different sections
34+
## Task
35+
Analyze the provided README.md content and detect duplicate tool
36+
entries based on these criteria:
3937
40-
Treat the '## Programming Frameworks' as a separate section.
38+
**Duplicate Criteria:**
39+
1. **Exact URL matches** - Same GitHub repository URL
40+
2. **Similar tool names** - Case-insensitive, ignoring
41+
punctuation/spacing
42+
3. **Same product in different sections** - Identical tools listed
43+
multiple times
4144
42-
Focus on the bulleted lists under each section heading. Each
43-
tool entry typically follows the format:
44-
* [Tool Name](URL) - description
45+
**Format to analyze:**
46+
- Focus on bulleted lists under section headings
47+
- Each entry follows: `* [Tool Name](URL) - description`
48+
- Treat "Programming Frameworks" as a separate category
4549
46-
If duplicates are found, respond "Duplicate founds" and provide:
47-
- The duplicate entries with their section locations
48-
- The specific URLs or tool names that match
49-
- A recommendation on whether they should be consolidated or if
50-
they serve different purposes
51-
- A snippet of the README.md content where duplicates were found (use \`\`\` for code blocks)
52-
Format your information so that the GitHub Copilot Agent can easily understand and act upon it.
50+
## Output Format
5351
54-
Use GitHub-flavored Markdown for formatting your response.
55-
If no duplicates are found, simply respond with "/OK/"
52+
**If duplicates found, respond exactly:**
53+
```
54+
DUPLICATES_FOUND
5655
57-
Here is the README.md content to analyze:
56+
## Duplicate Analysis
57+
58+
### Duplicate 1: [Tool Name]
59+
**Sections:** Section A, Section B
60+
**URLs:**
61+
- [Link 1](url1)
62+
- [Link 2](url2)
63+
**Issue:** [Exact match/Similar name/Same product]
64+
**Recommendation:** [Consolidate/Clarify differences/Keep separate
65+
with different descriptions]
66+
67+
### Duplicate 2: [Tool Name]
68+
[Same format]
69+
70+
## Code Snippets
71+
```markdown
72+
[Relevant README snippets showing the duplicates]
73+
```
74+
```
75+
76+
**If no duplicates found, respond exactly:**
77+
```
78+
NO_DUPLICATES_FOUND
79+
```
80+
81+
## Example Duplicates to Look For
82+
- Tools appearing in both "Continuous Code Review" and
83+
"Programming Frameworks"
84+
- Multiple entries with identical GitHub URLs
85+
- Similar names like "GenAI Tool" vs "GenAI-Tool" vs "genai tool"
86+
87+
Analyze this README.md content:
5888
- name: If duplicates create issue
59-
if: contains(steps.detect-duplicates.outputs.response, 'Duplicate') && !contains(steps.detect-duplicates.outputs.response, '/OK/')
89+
if: >-
90+
contains(steps.detect-duplicates.outputs.response, 'DUPLICATES_FOUND')
6091
run: |
6192
gh issue create --title "Duplicate Tools Detected" \
6293
--body-file ${{ steps.detect-duplicates.outputs.response-file }} \
6394
--label "genai,documentation"
6495
env:
65-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
96+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)