Skip to content

Commit 093e337

Browse files
paul-fractureclaude
andcommitted
Fix suggest-review mode to allow multi-line suggestions
- Increased context window from 10 to 15 lines for better code understanding - Updated prompt guidelines to allow function-level suggestions when needed - Clarified that GitHub suggestions can handle multi-line changes - Modified instructions to focus on proper implementation vs. line restriction - Added explicit permission to modify multiple lines if necessary in strict mode 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 020764b commit 093e337

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

scripts/suggest-review-mode.sh

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,13 @@ git checkout $PR_HEAD
4242
# Get the specific file content
4343
FILE_CONTENT=$(cat "$FILE_PATH")
4444

45-
# Get a context window around the line in question (10 lines before and after)
46-
LINE_START=$((LINE_NUMBER - 10))
45+
# Get a context window around the line in question (15 lines before and after)
46+
# Using a larger window to allow Claude to see more surrounding context
47+
LINE_START=$((LINE_NUMBER - 15))
4748
if [ $LINE_START -lt 1 ]; then
4849
LINE_START=1
4950
fi
50-
LINE_END=$((LINE_NUMBER + 10))
51+
LINE_END=$((LINE_NUMBER + 15))
5152
CONTEXT_CONTENT=$(sed -n "${LINE_START},${LINE_END}p" "$FILE_PATH")
5253

5354
# Get repo information
@@ -67,7 +68,8 @@ IMPORTANT - STRICT MODE IS ENABLED:
6768
2. Do NOT make any unrelated improvements to the code, even if they would be beneficial
6869
3. If the user asks to "add X", focus exclusively on adding X, not refactoring existing code
6970
4. If you identify other issues in the code, DO NOT address them in your suggestion
70-
5. Stay hyper-focused on the specific request, even if other improvements seem obvious
71+
5. Stay focused on the specific request, even if other improvements seem obvious
72+
6. You MAY modify multiple lines if necessary to properly implement what was requested, but do not add unrelated features
7173
EOF
7274
)
7375
fi
@@ -85,8 +87,10 @@ You MUST format your response as a SINGLE suggestion using the exact GitHub sugg
8587
$STRICT_INSTRUCTIONS
8688
8789
Guidelines:
88-
1. Focus ONLY on line $LINE_NUMBER and immediately surrounding lines
89-
2. Keep the suggestion concise - it should replace just what needs to be changed
90+
1. You should suggest changes to fix the issue at line $LINE_NUMBER
91+
2. GitHub's suggestion format can handle multi-line changes, so you can suggest:
92+
- Changes to just line $LINE_NUMBER if that's sufficient
93+
- Changes to an entire function or block if needed to properly fix the issue
9094
3. Maintain the existing indentation and code style
9195
4. Ensure your suggestion is syntactically correct
9296
5. Start your response with a brief explanation, then provide the suggestion block
@@ -110,7 +114,7 @@ $FILE_CONTENT
110114
User query:
111115
$FEEDBACK
112116
113-
Provide a single, specific suggestion that addresses this query for the code at line $LINE_NUMBER.
117+
Provide a single suggestion that addresses this query. Your suggestion can include multiple lines if needed to properly implement the requested functionality or fix. Include enough context so the suggestion can be applied cleanly.
114118
EOF
115119
)
116120

0 commit comments

Comments
 (0)