1- # Claude Code Review Prompt
1+ # Claude Code Review Prompt (GitHub Actions)
22
33## Context Variables
44- ** REPO** : Repository name (injected by workflow)
55- ** PR NUMBER** : Pull request number (injected by workflow)
66- ** COMMIT SHA** : Commit SHA being reviewed (injected by workflow)
77
8- ## Reference Documentation
8+ ## Review Standards
9+
10+ ** Apply the shared review guidelines from:**
11+ ` .github/workflows/code-review-guidelines.md `
12+
13+ Follow all core rules, review sections, common mistakes, and analysis checklist defined in that file.
14+
15+ ## CI-Specific Reference Documentation
916
1017### Valid GitHub Actions Runners
1118https://github.com/actions/runner-images/tree/main/images/macos
@@ -16,44 +23,6 @@ https://github.com/actions/runner-images/tree/main/images/macos
1623
1724** VALIDATION RULE** : When reviewing xcode-version in workflows, verify it matches the runs-on runner version using the mapping above.
1825
19- ## Review Instructions
20-
21- Review this PR using CLAUDE.md for project conventions. Be LEAN and ACTIONABLE - only provide value, avoid noise.
22-
23- ### Core Rules
24- - ONLY include sections when there are ACTUAL issues to report
25- - NO "Strengths" or praise sections
26- - NO "no concerns" statements (skip the section entirely)
27- - NO design/UI/spacing suggestions (padding, margins, colors, etc.) - you cannot see the visual design
28- - Reference specific file: line locations for issues
29- - ** If no issues found** :
30- - Comment ONLY: "✅ ** Approved** - No issues found"
31- - DO NOT describe what the PR does
32- - DO NOT list changes made
33- - DO NOT provide any summary or explanation
34- - Zero noise, zero fluff - just the approval statement
35-
36- ### Review Sections
37- Include ONLY if issues exist:
38-
39- #### Bugs/Issues
40- Logic errors, potential bugs that need fixing
41-
42- #### Best Practices
43- Violations of Swift/SwiftUI conventions or CLAUDE.md guidelines (code quality only, not design)
44-
45- #### Performance
46- Actual performance problems (not theoretical)
47-
48- #### Security
49- Real security vulnerabilities
50-
51- ### Summary Format
52- End with ONE sentence only with status emoji:
53- - ✅ ** Approved** - [ brief reason]
54- - ⚠️ ** Minor Issues** - [ what needs fixing]
55- - 🚨 ** Major Issues** - [ critical problems]
56-
5726## Review Comment Strategy
5827
5928### 1. Small, Localized Issues (Preferred)
@@ -138,88 +107,6 @@ The \`attentionDotView\` overlay positioning is incorrect...
138107** Important** :
139108- Use single quotes to wrap multi-line review text if needed
140109- Escape special characters appropriately for bash
141- - Always include the status emoji summary at the end
110+ - Always include the status emoji summary at the end (as defined in shared guidelines)
142111- The workflow provides ${PR_NUMBER} and ${REPO} variables
143112
144- ## Common Analysis Mistakes to Avoid
145-
146- ### Mistake: Assuming Unused Code After UI Element Removal
147-
148- ** Scenario** : A PR removes a visible UI element (e.g., a menu button) but leaves related parameters in the API.
149-
150- ** Wrong Analysis** :
151- - ❌ "Parameter is unused, should be removed"
152- - ❌ "Remove all related infrastructure"
153- - ❌ Not checking where else the parameter is used
154-
155- ** Correct Approach** :
156- 1 . ** Trace all usages** of parameters/closures before declaring them unused
157- 2 . ** Understand dual UX patterns** : iOS commonly uses button + long-press for same actions
158- 3 . ** Check for multiple consumers** : A closure/parameter may serve multiple UI patterns
159-
160- ** Example - Menu Button + Context Menu Pattern** :
161- ``` swift
162- // Component accepts menu closure
163- struct Widget <MenuContent : View > {
164- let menu: () -> MenuContent
165-
166- var body: some View {
167- content
168- .toolbar {
169- // Visible menu button
170- Menu { menu () } label : { Image (... ) }
171- }
172- .contextMenu {
173- // Long-press menu (same content!)
174- menu ()
175- }
176- }
177- }
178- ```
179-
180- ** Analysis** :
181- - Removing the toolbar menu button does NOT make ` menu ` parameter unused
182- - The ` menu() ` closure is still actively used by ` .contextMenu `
183- - Both are valid access patterns for the same functionality
184-
185- ** Key Questions to Ask** :
186- - Where else is this parameter/closure called in the file?
187- - Is this a dual-access pattern (button + long-press)?
188- - Was the removal intentional (UX change) or accidental?
189- - Are there separate flags controlling each access method?
190-
191- ### Mistake: Not Understanding Conditional Rendering Flags
192-
193- ** Scenario** : A component has multiple boolean flags like ` allowMenuContent ` and ` allowContextMenuItems ` .
194-
195- ** Wrong Analysis** :
196- - ❌ "These flags serve the same purpose, consolidate them"
197- - ❌ Not recognizing they control different UI elements
198-
199- ** Correct Approach** :
200- 1 . Each flag controls a specific UI element/pattern
201- 2 . ` allowMenuContent ` : Controls visible button
202- 3 . ` allowContextMenuItems ` : Controls long-press menu
203- 4 . They can be independently enabled/disabled
204-
205- ** Example** :
206- ``` swift
207- // Widget with independent menu controls
208- LinkWidgetViewContainer (
209- allowMenuContent : false , // No visible button
210- allowContextMenuItems : true , // Long-press still works
211- menu : { MenuItem () } // Used by context menu only
212- )
213- ```
214-
215- ### Analysis Checklist
216-
217- Before suggesting removal of "unused" code:
218- - [ ] Searched ALL usages in the file
219- - [ ] Checked for dual UX patterns (button + context menu)
220- - [ ] Understood purpose of each boolean flag
221- - [ ] Verified it's not used by multiple consumers
222- - [ ] Asked clarifying questions about design intent
223-
224- If unsure, ask:
225- > "Was removing [ UI element] intentional? The [ parameter] is still used by [ other pattern] . Should we keep both access methods or restore the [ UI element] ?"
0 commit comments