-
Notifications
You must be signed in to change notification settings - Fork 57
319 lines (278 loc) ยท 13 KB
/
Copy pathclaude-code-review.yml
File metadata and controls
319 lines (278 loc) ยท 13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
name: Claude PR Review
on:
issue_comment:
types: [created]
jobs:
claude-code-action:
if: |
github.event.issue.pull_request &&
startsWith(github.event.comment.body, '/claude-review') &&
contains(fromJson('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.comment.author_association)
runs-on: ubuntu-latest
timeout-minutes: 60
permissions:
contents: read
pull-requests: write
id-token: write
steps:
- name: Get PR details
id: pr
uses: actions/github-script@v9
with:
script: |
const pr = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number
});
core.setOutput('number', pr.data.number);
core.setOutput('ref', pr.data.head.ref);
core.setOutput('sha', pr.data.head.sha);
core.setOutput('base_ref', pr.data.base.ref);
- name: Checkout PR branch
uses: actions/checkout@v6
with:
ref: ${{ steps.pr.outputs.sha }}
fetch-depth: 0
- name: Add reaction
uses: actions/github-script@v9
with:
script: |
github.rest.reactions.createForIssueComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: context.payload.comment.id,
content: 'eyes'
});
- name: Run Claude PR Action
uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ secrets.ORG_ANTHROPIC_API_KEY }}
track_progress: true
use_sticky_comment: true
# the following line is excluded from the prompt because the comments are given as a global context
# see: https://github.com/anthropics/claude-code-action/blob/108e9829000952e342fefd85a76436e7a1dd1058/src/create-prompt/index.ts#L520
# `To see more details about the PR, you can use `gh pr view` but should *without* `--comments` to avoid redundant information.`
prompt: |
REPO: ${{ github.repository }}
PR NUMBER: ${{ steps.pr.outputs.number }}
ultrathink: ์ฌ์ฌ์๊ณ ํด์ ๋ฆฌ๋ทฐ๋ฅผ ์งํํ์ธ์.
Please review this pull request, **in Korean (ํ๊ตญ์ด)**, with a focus on:
- Code quality and best practices
- Potential bugs or issues
- Performance considerations
<thoughtful-pr-review>
์ด Pull Request๋ฅผ ์์น ๊ธฐ๋ฐ์ผ๋ก ์ฌ์ฌ์๊ณ ํ์ฌ ๋ฆฌ๋ทฐํด์ฃผ์ธ์.
<pr-info>
- GITHUB OWNER: ${{ github.repository_owner }}
- PR_NUMBER: ${{ steps.pr.outputs.number }}
- TARGET_REF: ${{ steps.pr.outputs.base_ref }}
</pr-info>
<review-philosophy>
๋น์ ์ ์ด ํ๋ก์ ํธ๋ฅผ ํจ๊ป ๋ง๋ค์ด๊ฐ๋ ๋๋ฃ์
๋๋ค.
๋นํ๊ฐ๊ฐ ์๋ ํ๋ ฅ์๋ก์, ์ฌ์ฉ์์ ์๋๋ฅผ ์กด์คํ๋ฉฐ
์ ๋ง ํ์ํ ํผ๋๋ฐฑ๋ง ์ ๊ณตํฉ๋๋ค.
</review-philosophy>
<step-1-deep-understanding>
๋จผ์ ๋ค์์ ํตํด ์์ ํ ์ดํดํ์ธ์:
1. AGENTS.md ์ ์ฒด ์ฝ๊ธฐ - ํนํ "PR Review Guidelines" ์น์
์์ง
2. PR ์ ๋ชฉ๊ณผ ์ค๋ช
- ์ฌ์ฉ์์ ์๋์ ๋ชฉ์ ํ์
3. ๋ณ๊ฒฝ ํ์ผ๋ค์ ์ ์ฒด ๊ทธ๋ฆผ - ๋ฌด์์ ํ๋ ค๋์ง ์ดํด
4. git log --oneline -10 - ์ต๊ทผ ๊ฐ๋ฐ ๋ฐฉํฅ๊ณผ ํจํด ํ์ธ
5. ์ด์ PR ์ฝ๋ฉํธ ํ์ธ (`gh pr view ${{ steps.pr.outputs.number }} --comments`)
- ์ด๋ฏธ ๋
ผ์๋ ๋ด์ฉ ํ์
- ๋ฌด์๋ ์ ์์ ๋ค์ ์ ์ํ์ง ์๊ธฐ
- ์ฌ์ฉ์์ ์ ํธ ํจํด ํ์ต
</step-1-deep-understanding>
<step-2-contextual-analysis>
PR์ ์ค์ ๋ด์ฉ์ ๊น์ด ๋ถ์ํ์ฌ ์ ํ ํ์
:
<pr-type-detection>
๋ค์์ ์ข
ํฉ์ ์ผ๋ก ๋ถ์ํ์ฌ PR ์ ํ์ ํ์
ํ์ธ์:
- ๋ณ๊ฒฝ ํ์ผ๋ค์ ์ฑ๊ฒฉ: ์ด๋ค ์ข
๋ฅ์ ํ์ผ๋ค์ด ์์ ๋์๋๊ฐ?
- ์ฝ๋ ๋ณ๊ฒฝ ํจํด: ์ถ๊ฐ/์ญ์ /์์ ์ ๋น์จ๊ณผ ๋ฒ์
- PR ์ค๋ช
๊ณผ ์ฐ๊ฒฐ๋ ์ด์: ์ด๋ค ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ๋ ค๋๊ฐ?
- ์ปค๋ฐ ๋ฉ์์ง๋ค: ์์
์ ์งํ ๊ณผ์ ๊ณผ ์๋
</pr-type-detection>
<review-strategy-by-type>
- ๊ธด๊ธ ๋ฒ๊ทธ ์์ : ๋ฌธ์ ํด๊ฒฐ์ ์ง์ค, ์ต์ํ์ ์ง์ ๋ง
- ์ผ๋ฐ ๋ฒ๊ทธ ์์ : ๊ทผ๋ณธ ์์ธ ํด๊ฒฐ ํ์ธ, ์ฌ๋ฐ ๋ฐฉ์ง ์ฒดํฌ
- ์ ๊ธฐ๋ฅ ์ถ๊ฐ: ๊ธฐ๋ฅ ์์ฑ๋, ์ฃ์ง์ผ์ด์ค, ์ฌ์ฉ์ฑ
- ๋ฆฌํฉํ ๋ง: ๋์ ๋ณ๊ฒฝ ์์ ํ์ธ, ์ผ๊ด์ฑ ๊ฐ์ ๊ฒ์ฆ
- ๊ตฌ์กฐ ๋ณ๊ฒฝ: ์ํฅ ๋ฒ์ ํ์
, ํ์ ํธํ์ฑ ์ฒดํฌ
- ํ์ PR: ์ด์ PR๊ณผ์ ์ฐ๊ฒฐ์ฑ, ์ ์ฒด ๊ทธ๋ฆผ์์์ ์์น
- ์ฑ๋ฅ ๊ฐ์ : ์ค์ ๊ฐ์ ๊ฒ์ฆ, ๋ถ์์ฉ ํ์ธ
- ๋ฌธ์/์ค์ ๋ณ๊ฒฝ: ์ ํ์ฑ๊ณผ ์์ ์ฑ๋ง ์ฒดํฌ
</review-strategy-by-type>
</step-2-contextual-analysis>
<step-3-thoughtful-judgment>
๊ฐ ๋ฐ๊ฒฌ์ฌํญ์ ๋ํด ์๋ฌธ:
- "์ด๊ฒ์ด PR์ ์ฑ๊ณต์ ๋ง๋๊ฐ?"
- "์ฌ์ฉ์๊ฐ ์ด๋ฏธ ์๊ณ ์์ ๊ฐ๋ฅ์ฑ์ด ์๋๊ฐ?"
- "์ง๊ธ ๋น์ฅ ์์ ์ด ํ์ํ๊ฐ?"
- "๋ด ์ ์์ด PR ๋ฒ์๋ฅผ ๋ฒ์ด๋๋๊ฐ?"
- "์ด์ ์ ์ ์ฌํ ์ ์์ด ๊ฑฐ์ ๋ ์ ์ด ์๋๊ฐ?"
</step-3-thoughtful-judgment>
<step-4-inline-comments>
<developer-intent-based-comments>
์ธ๋ผ์ธ ์ฝ๋ฉํธ๋ ๊ฐ๋ฐ์์ ์๋์ PR ๋ชฉ์ ์ ์ถฉ์คํด์ผ ํฉ๋๋ค:
<pr-type-comment-focus>
- ๋ฒ๊ทธ ์์ PR โ ๋ฒ๊ทธ ํด๊ฒฐ๊ณผ ์ง์ ๊ด๋ จ๋ ์ด์๋ง
- ๊ธฐ๋ฅ ์ถ๊ฐ PR โ ์ ๊ธฐ๋ฅ์ ์์ฑ๋์ ์์ ์ฑ
- ๋ฆฌํฉํ ๋ง PR โ ์ฝ๋ ํ์ง๊ณผ ์ผ๊ด์ฑ ๊ฐ์
- ์ฑ๋ฅ ๊ฐ์ PR โ ์ฑ๋ฅ ์ต์ ํ์ ๊ด๋ จ๋ ๋ถ๋ถ
- ๋ฌธ์/์ค์ PR โ ์ ํ์ฑ๊ณผ ๋ช
ํ์ฑ
</pr-type-comment-focus>
<when-to-comment>
๋ค์ ๊ฒฝ์ฐ์๋ง ์ธ๋ผ์ธ ์ฝ๋ฉํธ:
โ PR์์ ์์ ํ ๋ถ๋ถ๊ณผ ์ง์ ๊ด๋ จ
โ PR ๋ชฉ์ ์ ๋ถํฉํ๋ ํผ๋๋ฐฑ
โ ๊ฐ๋จํ๊ฒ ์์ ๊ฐ๋ฅํ ๋ฒ์
โ ๊ตฌ์ฒด์ ์ธ ํด๊ฒฐ์ฑ
์ ์ ๊ฐ๋ฅ
โ ๊ฐ๋ฐ์๊ฐ ๋์ณค์ ๊ฐ๋ฅ์ฑ์ด ์๋ ๊ฒ
</when-to-comment>
<comment-tone-and-format>
- ๋๋ฃ์ ๊ด์ : "์ด ๋ถ๋ถ์ ~ํ๋ฉด ์ด๋จ๊น์?"
- ๊ตฌ์ฒด์ ์ ์: ๊ฐ๋ฅํ๋ฉด ์ฝ๋ ์์ ํฌํจ
- ์ด์ ์ค๋ช
: ์ ์ค์ํ์ง ๊ฐ๋จํ
- ์ ์ฐ์ฑ ๋ถ์ฌ: "๊ณ ๋ คํด๋ณด์๋ฉด ์ข์ ๊ฒ ๊ฐ์์"
</comment-tone-and-format>
<focus-breakers-to-avoid>
โ ๋ฒ๊ทธ ์์ PR์ ๊ตฌ์กฐ ๋ณ๊ฒฝ ์ ์
โ ๊ธฐ๋ฅ ๊ฐ์ PR์ ๋๊ท๋ชจ ๋ฆฌํฉํ ๋ง ์ ์
โ ๊ธด๊ธ ์์ ์ ์ฅ๊ธฐ์ ๊ฐ์ ์ ์
โ PR ๋ฒ์๋ฅผ ๋ฒ์ด๋ "๊น์" ์ ์
โ ์ด๋ฏธ ์๋ํ๋ ์ฝ๋์ ์ ํธ๋ ์ฐจ์ด
</focus-breakers-to-avoid>
</step-4-inline-comments>
<step-5-summary-feedback>
<github.qkg1.topment-update>
๋ค์ ๊ตฌ์กฐ๋ก ์
๋ฐ์ดํธ:
```markdown
๐ค **Claude Code Review ์๋ฃ**
## ๐ PR ์ดํด
[PR ๋ชฉ์ ๊ณผ ์๋๋ฅผ ํ ๋ฌธ์ฅ์ผ๋ก ์์ฝ]
## โ
๋ฆฌ๋ทฐ ๊ฒฐ๊ณผ
### ๐ด ํ์ ์์ ์ฌํญ (๋ฐฐํฌ ์ ๋ฐ๋์)
[์ ๋ง ํฌ๋ฆฌํฐ์ปฌํ ์ด์๋ง. ์์ผ๋ฉด "์์" ํ์]
### ๐ก ๊ถ์ฅ ๊ฐ์ ์ฌํญ (์ ํ์ )
[์์ผ๋ฉด ์ข์ ๊ฐ์ ์ ๋ค]
### ๐ ์ํ ์
[๊ธ์ ์ ์ธ ํฌ์ธํธ๊ฐ ์๋ค๋ฉด]
## ๐ฏ ๊ฒฐ๋ก
[approve/request-changes ๊ฒฐ์ ๊ณผ ์ด์ ]
```
</github.qkg1.topment-update>
</step-5-summary-feedback>
<absolute-dont-do>
<no-repetition>
- ์ด์ PR์์ ๊ฑฐ์ /๋ฌด์๋ ์ ์ ๋ฐ๋ณต
- ์ฌ์ฉ์๊ฐ ์๋์ ์ผ๋ก ์ ํํ ํจํด ๋นํ
- AGENTS.md์ ๋ช
์๋ "์๋ ค์ง ๊ธฐ์ ๋ถ์ฑ" ์ธ๊ธ
</no-repetition>
<stay-in-scope>
- PR ๋ชฉ์ ๊ณผ ๊ด๊ณ์๋ "๊น์" ์ ์
- 3๊ฐ ์ด์ ํ์ผ ์์ ํ์ํ ๋๊ท๋ชจ ๋ณ๊ฒฝ
- ์ํคํ
์ฒ ๋ ๋ฒจ ๋ฆฌํฉํ ๋ง ์ ์
</stay-in-scope>
<watch-your-tone>
- ๊ฐ๋ฅด์น๋ ค๋ ํ๋ ("์ด๋ ๊ฒ ํ๋ ๊ฒ ๋ง์์")
- ์๋ฒฝ์ฃผ์์ ์๊ตฌ ("๋ชจ๋ ๊ณณ์ ์ ์ฉํด์ผ...")
- ๋นํ์ค์ ์ ์ ("์ ์ฒด๋ฅผ ๋ค์ ์์ฑํ๋ฉด...")
</watch-your-tone>
</absolute-dont-do>
<project-specific-context>
AGENTS.md์ "ํ๋ก์ ํธ๋ณ ํน์ ์ปจํ
์คํธ" ์น์
์ ๋ฐ๋์ ์ฐธ์กฐํ์ฌ
ํ๋ก์ ํธ๋ณ ํน์์ฌํญ๊ณผ ์๋ ค์ง ๊ธฐ์ ๋ถ์ฑ๋ฅผ ์ดํดํ๊ณ ๋ฆฌ๋ทฐํ์ธ์.
</project-specific-context>
๊ฑด์ค์ ์ด๊ณ ์ค์ฉ์ ์ธ ๋ฆฌ๋ทฐ๋ก ํ๋ก์ ํธ ๋ฐ์ ์ ๊ธฐ์ฌํด์ฃผ์ธ์.
</thoughtful-pr-review>
To see the diff that needs to be reviewed, you must run this exact command. Note that the PR branch is already checked out in the current working directory.
git diff $(git merge-base ${{ steps.pr.outputs.base_ref }} HEAD) -- . \
':(exclude)**/package.json' \
':(exclude)**/archive/**/*' \
':(exclude)**/.next/**/*' \
':(exclude)**/__testfixtures__/**/*' \
':(exclude)**/__generated__/**/*' \
':(exclude)**/__registry__/**/*' \
':(exclude)**/public/**/*' \
':(exclude)packages/css/**/*' \
':(exclude)**/schema.json' \
':(exclude)packages/qvism-preset/src/vars/**/*' \
':(exclude)packages/qvism-preset/src/token.css' \
':(exclude)packages/qvism-preset/src/tokens.ts' \
':(exclude)packages/tailwind3-plugin/src/index.ts' \
':(exclude)packages/tailwind4-theme/src/index.css'
Use `gh pr comment` for *concise* top-level feedback.
Use `mcp__github_inline_comment__create_inline_comment` to highlight specific code issues.
Only post GitHub comments - don't submit review text as messages.
claude_args: |
--model claude-sonnet-4-5-20250929
--allowedTools "
Bash(cat *),
Bash(find *),
Bash(gh pr:*),
Bash(git blame *),
Bash(git diff *),
Bash(git log *),
Bash(git show *),
Bash(git status),
Bash(grep:*),
Bash(head *),
Bash(ls *),
Bash(npm run *),
Bash(python -c *),
Bash(python -m pytest *),
Bash(python -m ruff *),
Bash(tail *),
Bash(tree *),
Bash(uv *),
Edit,
Glob,
Grep,
mcp__github__add_comment_to_pending_review,
mcp__github__create_and_submit_pull_request_review,
mcp__github__create_pending_pull_request_review,
mcp__github__create_pull_request_review,
mcp__github__create_review_comment,
mcp__github__delete_pending_pull_request_review,
mcp__github__get_file_contents,
mcp__github__get_issue_comments,
mcp__github__get_me,
mcp__github__get_pull_request_comments,
mcp__github__get_pull_request_diff,
mcp__github__get_pull_request_files,
mcp__github__get_pull_request_reviews,
mcp__github__get_pull_request,
mcp__github__get_repository,
mcp__github__list_pull_requests,
mcp__github__submit_pending_pull_request_review,
mcp__github_ci__download_job_log,
mcp__github_ci__get_ci_status,
mcp__github_ci__get_workflow_run_details,
mcp__github.qkg1.topment__update_claude_comment,
mcp__github_inline_comment__create_inline_comment,
Read,
Write
"
- name: Add success reaction
if: success()
uses: actions/github-script@v9
with:
script: |
github.rest.reactions.createForIssueComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: context.payload.comment.id,
content: 'hooray'
});
- name: Add failure reaction
if: failure()
uses: actions/github-script@v9
with:
script: |
github.rest.reactions.createForIssueComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: context.payload.comment.id,
content: '-1'
});