Skip to content

Commit 2edf915

Browse files
maxprilutskiyclaude
andcommitted
feat: upgrade claude issue autolabeler to extreme 12/10 level
- Rewrite agent prompt with mandatory execution protocol - Add deep codebase exploration using find/grep commands - Implement code ownership detection via CODEOWNERS analysis - Add breaking change detection and API impact analysis - Create structured comment strategy with 7 distinct types - Force technical guidance with specific file/function references - Add Discord community integration in all greetings - Implement maintainer tagging for complex issues - Remove emojis for professional tone - Add autolabeled tracking for easy re-processing The bot now behaves like a senior engineer doing thorough issue triage with deep technical analysis and exceptional developer experience. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 069c1fd commit 2edf915

2 files changed

Lines changed: 79 additions & 21 deletions

File tree

.github/workflows/claude-issue-autolabel.yml

Lines changed: 73 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,15 @@ jobs:
3434
run: |
3535
if [[ "${{ github.event_name }}" == "workflow_dispatch" && -n "${{ github.event.inputs.issue_number }}" ]]; then
3636
echo "issue_number=${{ github.event.inputs.issue_number }}" >> $GITHUB_OUTPUT
37-
issue_data=$(gh issue view ${{ github.event.inputs.issue_number }} --json title,body)
37+
issue_data=$(gh issue view ${{ github.event.inputs.issue_number }} --json title,body,author)
3838
echo "issue_title=$(echo "$issue_data" | jq -r '.title')" >> $GITHUB_OUTPUT
3939
echo "issue_body=$(echo "$issue_data" | jq -r '.body')" >> $GITHUB_OUTPUT
40+
echo "issue_author=$(echo "$issue_data" | jq -r '.author.login')" >> $GITHUB_OUTPUT
4041
else
4142
echo "issue_number=${{ github.event.issue.number }}" >> $GITHUB_OUTPUT
4243
echo "issue_title=${{ github.event.issue.title }}" >> $GITHUB_OUTPUT
4344
echo "issue_body=${{ github.event.issue.body }}" >> $GITHUB_OUTPUT
45+
echo "issue_author=${{ github.event.issue.user.login }}" >> $GITHUB_OUTPUT
4446
fi
4547
env:
4648
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -53,24 +55,80 @@ jobs:
5355
timeout_minutes: "5"
5456
allowed_tools: "Bash"
5557
direct_prompt: |
56-
Analyze this newly created issue and apply appropriate labels using the gh CLI.
58+
You are a senior engineer doing issue triage for lingo.dev. Your job is to provide exceptional developer experience through deep technical analysis and helpful guidance.
5759
58-
Available repository labels: ${{ steps.labels.outputs.available_labels }}
60+
REPOSITORY CONTEXT:
61+
- Available labels: ${{ steps.labels.outputs.available_labels }}
62+
- Issue: #${{ steps.target_issue.outputs.issue_number }}
63+
- Author: ${{ steps.target_issue.outputs.issue_author }}
64+
- Title: ${{ steps.target_issue.outputs.issue_title }}
65+
- Body: ${{ steps.target_issue.outputs.issue_body }}
5966
60-
Tasks:
61-
1. Analyze the issue content
62-
2. Use `gh issue edit ${{ steps.target_issue.outputs.issue_number }} --add-label "label-name"` to apply each relevant label
63-
3. Add a comment explaining your labeling decisions
67+
EXECUTION PROTOCOL - FOLLOW EVERY STEP:
6468
65-
Requirements:
66-
- Apply ALL relevant labels that match the issue content
67-
- If no labels are truly relevant, apply NO labels at all
68-
- Be thorough but precise - don't force labels that don't fit
69-
- Use the Bash tool to run gh commands WITHOUT asking for confirmation
70-
- The GITHUB_TOKEN is already set in the environment for gh authentication
69+
1. CONTRIBUTOR ANALYSIS (MANDATORY):
70+
Execute: `gh search issues --repo ${{ github.repository }} --author ${{ steps.target_issue.outputs.issue_author }} --json number | jq 'length'`
71+
Determine if first-time or returning contributor.
7172
72-
Issue Title: ${{ steps.target_issue.outputs.issue_title }}
73-
Issue Body: ${{ steps.target_issue.outputs.issue_body }}
73+
2. CODEBASE EXPLORATION (MANDATORY):
74+
Execute these commands in sequence:
75+
- `find . -name "*.ts" -o -name "*.js" -o -name "*.json" | grep -E "(src|packages|lib)" | head -20`
76+
- `grep -r "keyword1\|keyword2" src/ packages/ --include="*.ts" --include="*.js" | head -10`
77+
- `cat CODEOWNERS` (if exists)
78+
- `find . -name "package.json" | head -5 | xargs cat`
79+
- `git log --oneline -5 --grep="relevant_keyword"`
80+
81+
3. ISSUE INTELLIGENCE (MANDATORY):
82+
Execute these searches:
83+
- `gh issue list --state open --search "relevant keywords" --json number,title,state | head -3`
84+
- `gh issue list --state all --search "similar terms" --json number,title,state | head -3`
85+
- `gh pr list --state open --search "related keywords" --json number,title,state | head -3`
86+
87+
4. LABELING (MANDATORY):
88+
Apply labels using: `gh issue edit ${{ steps.target_issue.outputs.issue_number }} --add-label "label-name"`
89+
Must apply:
90+
- Content labels: bug, enhancement, documentation, question, cli, compiler, etc.
91+
- State labels: duplicate (if found), wip (if related PR exists)
92+
- Difficulty labels: "good first issue" (simple, well-defined), "help wanted" (complex/community)
93+
94+
5. COMMENT GENERATION (MANDATORY):
95+
Post separate comments using: `gh issue comment ${{ steps.target_issue.outputs.issue_number }} --body "text"`
96+
97+
COMMENT TYPES TO POST (only if applicable):
98+
99+
A. GREETING (always post):
100+
First-time: "Hey there! Thanks for opening your first issue with lingo.dev. Feel free to join our Discord if you want to chat about this with the team."
101+
Returning: "Hey [username]! Good to see you back. If you want to discuss this in real-time, we're always on Discord."
102+
103+
B. TECHNICAL ANALYSIS (post if you found relevant code):
104+
"Based on the codebase, this would likely affect [specific files]. You'll want to look at [specific function/class] in [file path] around line [number if found]."
105+
106+
C. IMPLEMENTATION GUIDANCE (post for enhancement requests):
107+
"The cleanest approach would be to [specific technical suggestion]. This would involve modifying [specific components]."
108+
109+
D. INFORMATION REQUEST (post if issue lacks clarity):
110+
"I need exact steps to reproduce this. Can you create a minimal reproduction repo or provide detailed steps?"
111+
112+
E. DOCUMENTATION REFERENCE (post relevant links):
113+
"For [type] issues like this, check out our docs: [lingo.dev/cli, lingo.dev/compiler, or lingo.dev/ci]"
114+
115+
F. SIMILAR WORK REFERENCE (post if found):
116+
"This is similar to #[number] - check that for context" OR "There's already work on this in PR #[number]"
117+
118+
G. MAINTAINER ASSESSMENT (post for complex/breaking changes):
119+
"Maintainer assessment: [technical analysis]. Suggested approach: [specific steps]. Concerns: [any issues]. Next steps: [actionable items]. Tagging [relevant maintainer if found in CODEOWNERS]."
120+
121+
6. FINAL STEP (MANDATORY):
122+
Execute: `gh issue edit ${{ steps.target_issue.outputs.issue_number }} --add-label "autolabeled"`
123+
124+
ABSOLUTE REQUIREMENTS:
125+
- NEVER use emojis in any comments
126+
- ALWAYS run codebase exploration commands before commenting
127+
- ALWAYS provide specific file paths, function names, line numbers when found
128+
- ALWAYS include Discord mention in greeting
129+
- ALWAYS post separate comments for different purposes
130+
- NEVER ask for permission - execute all bash commands immediately
131+
- ALWAYS be matter-of-fact and use simple, casual language
74132
env:
75133
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
76134

.github/workflows/label-all-unlabeled-issues.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@ jobs:
1717

1818
- name: Find and Label Unlabeled Issues
1919
run: |
20-
echo "Finding all unlabeled issues..."
20+
echo "Finding all issues without 'autolabeled' label..."
2121
22-
# Get all unlabeled issues
23-
unlabeled_issues=$(gh issue list --limit 1000 --json number,labels --jq '.[] | select(.labels | length == 0) | .number')
22+
# Get all issues without the "autolabeled" label
23+
unlabeled_issues=$(gh issue list --limit 1000 --json number,labels --jq '.[] | select(.labels | map(.name) | contains(["autolabeled"]) | not) | .number')
2424
2525
if [[ -z "$unlabeled_issues" ]]; then
26-
echo "No unlabeled issues found"
26+
echo "No issues found without 'autolabeled' label"
2727
exit 0
2828
fi
2929
30-
echo "Found unlabeled issues:"
30+
echo "Found issues without 'autolabeled' label:"
3131
echo "$unlabeled_issues"
3232
echo ""
3333
@@ -43,7 +43,7 @@ jobs:
4343
sleep 10
4444
done
4545
46-
echo "Triggered labeling workflows for all unlabeled issues"
46+
echo "Triggered labeling workflows for all issues without 'autolabeled' label"
4747
echo "Check workflow runs: gh run list --workflow=claude-issue-autolabel.yml"
4848
env:
4949
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)