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
Reviewer was hitting turn limits by exploring the codebase.
New prompt forces a strict workflow:
- Turn 1: git diff --stat + npm test
- Turn 2-3: quick analysis
- Turn 3: output COMPLETION_JSON immediately
Reduced max-turns from 10 to 5. If verdict not output by then,
fallback NEEDS_CHANGES is used.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: src/agent-templates.ts
+17-12Lines changed: 17 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -227,25 +227,30 @@ COMPLETION_JSON:{"review_comment":"<your strategic analysis and recommendations>
227
227
post_actions: [],
228
228
prompt: {
229
229
mode_header: "## REVIEW MODE — Analyze code changes, run tests, report verdict. Do NOT modify any files.",
230
-
completion: `You are reviewing code changes for a task. Your job:
230
+
completion: `You are reviewing code changes for a task. You have LIMITED TURNS — be fast and direct.
231
231
232
-
1. Run: git diff {{diffRef}} to see the changes
233
-
2. Read relevant source files for context
234
-
3. Run: npm test (check if tests pass)
235
-
4. Evaluate against the criteria below
232
+
## Step 1 (Turn 1): Run these two commands immediately
233
+
- git diff {{diffRef}} --stat
234
+
- npm test 2>&1 | tail -20
235
+
236
+
## Step 2 (Turn 2-3): Quick analysis
237
+
- If tests failed → verdict is NEEDS_CHANGES, skip to Step 3
238
+
- If diff is empty or metadata-only → verdict is NEEDS_CHANGES, skip to Step 3
239
+
- Glance at changed files — do they match the task description?
240
+
241
+
## Step 3: Output verdict IMMEDIATELY
242
+
Output COMPLETION_JSON right now. Do NOT do more analysis. Do NOT read additional files.
236
243
237
244
## Review Criteria
238
245
{{reviewCriteria}}
239
246
240
-
## Project Review Rules
241
247
{{customReviewRules}}
242
248
243
-
IMPORTANT:
244
-
- Do NOT modify any files. Do NOT commit. Do NOT push. Only analyze and report.
245
-
- Be efficient: run git diff and npm test first, then output your verdict. Do not explore the entire codebase.
246
-
- You MUST output COMPLETION_JSON before running out of turns.
249
+
CRITICAL RULES:
250
+
- Do NOT modify any files. Do NOT commit. Do NOT push.
251
+
- Do NOT explore the codebase beyond the diff. Do NOT read unrelated files.
252
+
- Output COMPLETION_JSON within your FIRST 3 TURNS. Every turn without COMPLETION_JSON is wasted.
247
253
248
-
When done, output your verdict on a new line in this exact format:
249
254
COMPLETION_JSON:{"verdict":"APPROVE or NEEDS_CHANGES","requirement_match":"met/partial/not — explain","files_changed":"file: summary","code_quality":"issues or clean","test_coverage":"tested or not","risks":"risks or none"}`,
250
255
rules: [
251
256
"You MUST NOT create, edit, write, or delete any files.",
@@ -625,7 +630,7 @@ export async function executeActions(
0 commit comments