Jeremiah Lowin commited on
Commit
ba340db
·
unverified ·
1 Parent(s): 46b2a97

Inline dedupe prompt (#1512)

Browse files
.claude/commands/dedupe.md DELETED
@@ -1,39 +0,0 @@
1
- ---
2
- allowed-tools: Bash(gh issue view:*), Bash(gh search:*), Bash(gh issue list:*), Bash(gh api:*), Bash(gh issue comment:*), Task
3
- description: Find duplicate GitHub issues
4
- ---
5
-
6
- Find up to 3 likely duplicate issues for a given GitHub issue.
7
-
8
- To do this, follow these steps precisely:
9
-
10
- 1. Use an agent to check if the Github issue (a) is closed, (b) does not need to be deduped (eg. because it is broad product feedback without a specific solution, or positive feedback), or (c) already has a duplicates comment that you made earlier. If so, do not proceed.
11
-
12
- 2. Use an agent to view a Github issue, and ask the agent to return a summary of the issue
13
-
14
- 3. Then, launch 3 parallel agents to search Github for duplicates of this issue, using diverse keywords and search approaches, using the summary from #1
15
-
16
- 4. Next, feed the results from #1 and #2 into another agent, so that it can filter out false positives, that are likely not actually duplicates of the original issue. If there are no duplicates remaining, do not proceed.
17
-
18
- 5. Finally, comment back on the issue with a list of up to three duplicate issues (or zero, if there are no likely duplicates)
19
-
20
- Notes (be sure to tell this to your agents, too):
21
-
22
- - Use `gh` to interact with Github, rather than web fetch
23
- - Do not use other tools, beyond `gh` (eg. don't use other MCP servers, file edit, etc.)
24
- - Make a todo list first
25
- - For your comment, follow the following format precisely (assuming for this example that you found 3 suspected duplicates):
26
-
27
- ---
28
- Found 3 possible duplicate issues:
29
-
30
- 1. #123: Issue title here
31
- 2. #456: Another issue title
32
- 3. #789: Third issue title
33
-
34
- This issue will be automatically closed as a duplicate in 3 days.
35
-
36
- - If your issue is a duplicate, please close it and 👍 the existing issue instead
37
- - To prevent auto-closure, add a comment or 👎 this comment
38
-
39
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
.github/workflows/marvin-dedupe-issues.yml CHANGED
@@ -29,10 +29,51 @@ jobs:
29
  app-id: ${{ secrets.MARVIN_APP_ID }}
30
  private-key: ${{ secrets.MARVIN_APP_PRIVATE_KEY }}
31
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  - name: Run Marvin dedupe command
33
  uses: anthropics/claude-code-base-action@beta
34
  with:
35
- prompt: "/dedupe ${{ github.repository }}/issues/${{ github.event.issue.number || inputs.issue_number }}"
 
36
  anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
37
  claude_env: |
38
  GH_TOKEN: ${{ steps.marvin-token.outputs.token }}
 
29
  app-id: ${{ secrets.MARVIN_APP_ID }}
30
  private-key: ${{ secrets.MARVIN_APP_PRIVATE_KEY }}
31
 
32
+ - name: Create dedupe prompt
33
+ run: |
34
+ mkdir -p /tmp/claude-prompts
35
+ cat > /tmp/claude-prompts/dedupe-prompt.txt << 'EOF'
36
+ Find up to 3 likely duplicate issues for GitHub issue ${{ github.repository }}/issues/${{ github.event.issue.number || inputs.issue_number }}.
37
+
38
+ Follow these steps precisely:
39
+
40
+ 1. Use the Task tool to check if the GitHub issue (a) is closed, (b) does not need to be deduped (eg. because it is broad product feedback without a specific solution, or positive feedback), or (c) already has a duplicates comment that you made earlier. If so, do not proceed.
41
+
42
+ 2. Use the Task tool to view the GitHub issue, and ask the agent to return a summary of the issue
43
+
44
+ 3. Then, launch 3 parallel agents using the Task tool to search GitHub for duplicates of this issue, using diverse keywords and search approaches, using the summary from step 2
45
+
46
+ 4. Next, feed the results from steps 2 and 3 into another agent using the Task tool, so that it can filter out false positives that are likely not actually duplicates of the original issue. If there are no duplicates remaining, do not proceed.
47
+
48
+ 5. Finally, comment back on the issue with a list of up to three duplicate issues (or zero, if there are no likely duplicates)
49
+
50
+ Notes for your agents:
51
+ - Use `gh` to interact with GitHub, rather than web fetch
52
+ - Do not use other tools, beyond `gh` and Task (eg. don't use other MCP servers, file edit, etc.)
53
+ - Make a todo list first
54
+
55
+ For your comment, follow this format precisely (example with 3 suspected duplicates):
56
+
57
+ ---
58
+ Found 3 possible duplicate issues:
59
+
60
+ 1. #123: Issue title here
61
+ 2. #456: Another issue title
62
+ 3. #789: Third issue title
63
+
64
+ This issue will be automatically closed as a duplicate in 3 days.
65
+
66
+ - If your issue is a duplicate, please close it and 👍 the existing issue instead
67
+ - To prevent auto-closure, add a comment or 👎 this comment
68
+
69
+ ---
70
+ EOF
71
+
72
  - name: Run Marvin dedupe command
73
  uses: anthropics/claude-code-base-action@beta
74
  with:
75
+ prompt_file: /tmp/claude-prompts/dedupe-prompt.txt
76
+ allowed_tools: "Bash(gh issue view:*),Bash(gh search:*),Bash(gh issue list:*),Bash(gh api:*),Bash(gh issue comment:*),Task"
77
  anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
78
  claude_env: |
79
  GH_TOKEN: ${{ steps.marvin-token.outputs.token }}
.github/workflows/marvin-label-triage.yml CHANGED
@@ -12,6 +12,10 @@ on:
12
  required: true
13
  type: string
14
 
 
 
 
 
15
  jobs:
16
  triage-issue:
17
  runs-on: ubuntu-latest
@@ -136,7 +140,7 @@ jobs:
136
  uses: anthropics/claude-code-base-action@beta
137
  with:
138
  prompt_file: /tmp/claude-prompts/triage-prompt.txt
139
- allowed_tools: "Bash(gh label list),mcp__github__get_issue,mcp__github__get_issue_comments,mcp__github__update_issue"
140
  timeout_minutes: "5"
141
  anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
142
  mcp_config: /tmp/mcp-config/mcp-servers.json
 
12
  required: true
13
  type: string
14
 
15
+ concurrency:
16
+ group: triage-${{ github.event.issue.number || github.event.pull_request.number || inputs.issue_number }}
17
+ cancel-in-progress: false
18
+
19
  jobs:
20
  triage-issue:
21
  runs-on: ubuntu-latest
 
140
  uses: anthropics/claude-code-base-action@beta
141
  with:
142
  prompt_file: /tmp/claude-prompts/triage-prompt.txt
143
+ allowed_tools: "Bash(gh label list),mcp__github__get_issue,mcp__github__get_issue_comments,mcp__github__update_issue,mcp__github__get_pull_request_files"
144
  timeout_minutes: "5"
145
  anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
146
  mcp_config: /tmp/mcp-config/mcp-servers.json