You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Record findings for the summary comment. Refer to CLAUDE.md for project conventions.
110
119
</step>
111
120
121
+
<step name="duplicate_detection">
122
+
Check whether this PR introduces code that duplicates logic already present elsewhere in the repository — including across languages. Focus on finding true duplicates, not just similar-looking code.
123
+
124
+
1. Get changed source files (excluding tests and config):
2. For each changed file, read it and identify functions/methods added or substantially modified (longer than 5 lines).
128
+
129
+
3. Search for duplicates using Grep:
130
+
- Same function name defined elsewhere
131
+
- 2-3 distinctive operations from the body (specific API calls, algorithm patterns, string literals)
132
+
133
+
4. Cross-module check: this codebase has parallel modules under `languages/python/`, `languages/javascript/`, and `languages/java/` plus runtimes under `packages/codeflash/runtime/` and `codeflash-java-runtime/`. When a changed file is under one of these areas, search the others for equivalent logic. Only flag cases where the logic is genuinely shared or one module could import from the other.
134
+
135
+
5. When a Grep hit looks promising, read the full function and compare semantics. Flag only:
136
+
- Same function with same/very similar body in another module
137
+
- Same helper logic repeated in sibling files
138
+
- Same logic implemented inline across multiple classes
139
+
- Same algorithm reimplemented across language modules (Python code, not target-language differences)
140
+
141
+
Report at most 5 findings with confidence (HIGH/MEDIUM), locations, what's duplicated, and suggestion.
142
+
143
+
DO NOT report: boilerplate, functions under 5 lines, config/setup, intentional polymorphism, test files, imports, code that must differ due to target-language semantics.
144
+
145
+
If no duplicates found, include "No duplicates detected" in the summary.
146
+
</step>
147
+
112
148
<step name="coverage">
113
149
Analyze test coverage for changed files:
114
150
@@ -120,19 +156,12 @@ jobs:
120
156
</step>
121
157
122
158
<step name="summary_comment">
123
-
Post exactly one summary comment containing all results from previous steps.
124
-
125
-
To ensure one comment: find an existing claude[bot] comment and update it, or create one if none exists.
126
-
Delete any duplicate claude[bot] comments.
127
-
128
-
```
129
-
gh api repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments --jq '.[] | select(.user.login == "claude[bot]") | .id' | head -1
130
-
```
159
+
Post exactly one summary comment containing all results from previous steps using this format:
131
160
132
-
Format:
133
161
## PR Review Summary
134
162
### Prek Checks
135
163
### Code Review
164
+
### Duplicate Detection
136
165
### Test Coverage
137
166
---
138
167
*Last updated: <timestamp>*
@@ -165,12 +194,15 @@ jobs:
165
194
- All findings are in a single summary comment (no inline review comments were created)
166
195
- If fixes were made, they were verified with prek
167
196
</verification>
168
-
claude_args: '--model us.anthropic.claude-opus-4-6-v1 --allowedTools "Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*),Bash(gh pr checks:*),Bash(gh pr merge:*),Bash(gh issue view:*),Bash(gh issue list:*),Bash(gh api:*),Bash(uv run prek *),Bash(uv run mypy *),Bash(uv run coverage *),Bash(uv run pytest *),Bash(git status*),Bash(git add *),Bash(git commit *),Bash(git push*),Bash(git diff *),Bash(git checkout *),Read,Glob,Grep,Edit,Skill"'
197
+
claude_args: '--model us.anthropic.claude-opus-4-6-v1 --max-turns 25 --allowedTools "Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*),Bash(gh pr checks:*),Bash(gh pr merge:*),Bash(gh issue view:*),Bash(gh issue list:*),Bash(gh api:*),Bash(uv run prek *),Bash(uv run mypy *),Bash(uv run coverage *),Bash(uv run pytest *),Bash(git status*),Bash(git add *),Bash(git commit *),Bash(git push*),Bash(git diff *),Bash(git checkout *),Read,Glob,Grep,Edit,Skill"'
169
198
additional_permissions: |
170
199
actions: read
171
200
172
201
# @claude mentions (can edit and push) - restricted to maintainers only
0 commit comments