Skip to content

Commit 64634fa

Browse files
feat(ci): inline code review comments + scope docs skill to merged PRs (#361)
* feat(ci): switch PR review to inline comments with code-review plugin Use the anthropics code-review plugin with inline comment MCP tool instead of summary-only comments. Retains custom prompt to read project conventions from CLAUDE.md/agent_docs before reviewing. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix(ci): pin GitHub Actions to commit SHAs for supply chain security Resolves CodeQL alert for unpinned 3rd party actions. Pins actions/checkout and anthropics/claude-code-action to their current commit hashes while preserving version comments. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: scope enhance-claude-docs to only merged PRs Only fetch PRs merged in the date range instead of all updated PRs. Open/closed-without-merge PRs will be picked up in future runs when they merge, avoiding duplicate analysis. Also removes redundant State column from PR body template. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent c456e40 commit 64634fa

2 files changed

Lines changed: 21 additions & 22 deletions

File tree

.claude/skills/enhance-claude-docs/SKILL.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
22
name: enhance-claude-docs
3-
description: Analyze recent PR review comments and update Claude documentation files with new insights. Fetches merged, open, and closed PRs from the last N days, extracts reviewer feedback, and proposes documentation improvements. Triggers on "update claude docs", "enhance docs from PRs", "analyze PR comments".
3+
description: Analyze recent PR review comments and update Claude documentation files with new insights. Fetches PRs merged in the last N days, extracts reviewer feedback, and proposes documentation improvements. Triggers on "update claude docs", "enhance docs from PRs", "analyze PR comments".
44
---
55

66
# Enhance Claude Docs
77

8-
Analyzes PR review comments from `UiPath/uipath-typescript` and updates Claude documentation files (`CLAUDE.md`, `Agents.md`, `agent_docs/`) with documentation-worthy insights not already captured.
8+
Analyzes review comments from PRs merged in `UiPath/uipath-typescript` and updates Claude documentation files (`CLAUDE.md`, `Agents.md`, `agent_docs/`) with documentation-worthy insights not already captured.
99

1010
---
1111

@@ -34,16 +34,16 @@ Store `START_DATE` and `END_DATE` for use in the PR body later.
3434

3535
---
3636

37-
## Step 2: Fetch PRs
37+
## Step 2: Fetch Merged PRs
3838

39-
Fetch all PRs updated in the date range:
39+
Fetch only PRs that were **merged** in the date range. PRs that are still open or were closed without merging are skipped — they'll be picked up in a future run when (and if) they merge.
4040

4141
```bash
42-
gh api "repos/UiPath/uipath-typescript/pulls?state=all&sort=updated&direction=desc&per_page=100" \
43-
--jq "[.[] | select(.updated_at >= \"${START_DATE}\") | {number, title, state, user: .user.login, updated_at}]"
42+
gh api "repos/UiPath/uipath-typescript/pulls?state=closed&sort=updated&direction=desc&per_page=100" \
43+
--jq "[.[] | select(.merged_at != null and .merged_at >= \"${START_DATE}\") | {number, title, state: \"merged\", user: .user.login, merged_at}]"
4444
```
4545

46-
If no PRs found, report "No PRs found in the last N days" and stop.
46+
If no merged PRs found, report "No merged PRs found in the last N days" and stop.
4747

4848
---
4949

@@ -233,9 +233,9 @@ Analyzed {X} PRs with {Y} comments. Found {Z} actionable insights.
233233
- {files not modified} -- no relevant insights found
234234
235235
## PRs Analyzed
236-
| PR | Title | State | Comments |
237-
|----|-------|-------|----------|
238-
| #{N} | {title} | {state} | {count} |
236+
| PR | Title | Comments |
237+
|----|-------|----------|
238+
| #{N} | {title} | {count} |
239239
EOF
240240
)"
241241
```
@@ -244,8 +244,7 @@ EOF
244244
- Replace all `{placeholders}` with actual values.
245245
- The **Changes** section must list every file modified with the specific change, source PR, reviewer, and original comment quote.
246246
- The **No changes** section must list files that were read but had no relevant insights.
247-
- The **PRs Analyzed** table must list every PR that was fetched, regardless of whether it yielded insights.
248-
- State values: `merged`, `open`, `closed`.
247+
- The **PRs Analyzed** table must list every merged PR that was fetched, regardless of whether it yielded insights.
249248

250249
---
251250

.github/workflows/claude-code-review.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,26 +22,26 @@ jobs:
2222
permissions:
2323
contents: read
2424
pull-requests: write
25-
issues: read
25+
issues: write
2626
id-token: write
27-
actions: read
2827

2928
steps:
3029
- name: Checkout repository
3130
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
3231
with:
33-
fetch-depth: 0
32+
fetch-depth: 1
3433

35-
- name: Review PR with Claude
34+
- name: Run Claude Code Review
3635
id: claude-review
37-
uses: anthropics/claude-code-action@094bd24d575e7b30ac1576024817bf1a97c81262 # v1
36+
uses: anthropics/claude-code-action@26ddc358fe3befff50c5ec2f80304c90c763f6f8 # v1
3837
with:
3938
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
40-
additional_permissions: |
41-
actions: read
39+
plugin_marketplaces: 'https://github.com/anthropics/claude-code.git'
40+
plugins: 'code-review@claude-code-plugins'
4241
prompt: |
43-
Review PR #${{ github.event.pull_request.number }}.
4442
Read CLAUDE.md at the repo root first — it references Agents.md and agent_docs/ which contain all project conventions, architecture, and rules. Follow every convention defined there during your review.
45-
Use `gh pr diff ${{ github.event.pull_request.number }}` to get the full diff.
46-
Use `gh pr view ${{ github.event.pull_request.number }}` to get the PR description.
43+
/code-review:code-review ${{ github.repository }}/pull/${{ github.event.pull_request.number }} --comment
44+
use_sticky_comment: true
45+
claude_args: |
46+
--allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*)"
4747

0 commit comments

Comments
 (0)