Skip to content

Commit c3c3796

Browse files
Copilotastandrik
andcommitted
Document Claude code review workflow fix and architecture
Co-authored-by: astandrik <[email protected]>
1 parent dc3ffea commit c3c3796

File tree

1 file changed

+48
-2
lines changed

1 file changed

+48
-2
lines changed

CLAUDE.md

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,52 @@
1-
# AGENTS.md
1+
# CLAUDE.md
22

3-
This file provides guidance to AI coding assistants when working with this codebase. Designed for OpenAI Codex, GitHub Copilot, Claude, Cursor, and other AI development tools.
3+
This file provides guidance for using Claude AI with this YDB Embedded UI codebase and documents the Claude code review workflow configuration.
4+
5+
## Claude Code Review Workflows
6+
7+
This repository includes two GitHub Actions workflows for Claude AI integration:
8+
9+
### 1. Claude Code Review (`claude-code-review.yml`)
10+
11+
- **Trigger**: Comment `/claude_review` on any PR
12+
- **Purpose**: Automated code review focusing on coding standards and best practices
13+
- **Model**: `claude-opus-4-20250514`
14+
15+
### 2. Claude Code (`claude.yml`)
16+
17+
- **Trigger**: Comment `@claude` on any PR or assign `claude-bot` to an issue
18+
- **Purpose**: Interactive Claude assistance for development tasks
19+
- **Model**: `claude-opus-4-20250514`
20+
21+
### Workflow Architecture
22+
23+
Both workflows use a robust reference resolution system to ensure Claude reviews the latest changes:
24+
25+
1. **PR Reference Resolution**: When triggered by issue comments on PRs, workflows:
26+
27+
- Fetch the current PR details via GitHub API
28+
- Extract the head commit SHA (latest changes)
29+
- Checkout the actual PR head instead of the base branch
30+
31+
2. **Fallback Logic**: For manual workflow dispatches, falls back to the default branch
32+
33+
3. **Full Git History**: Uses `fetch-depth: 0` to provide complete context for reviews
34+
35+
### Recent Fix (Issue #2651)
36+
37+
**Problem**: Claude was reviewing stale data because workflows checked out the base branch instead of PR head.
38+
39+
**Solution**: Added dynamic reference resolution:
40+
41+
```yaml
42+
ref: ${{ github.event_name == 'issue_comment' && steps.pr-details.outputs.pr_head_sha || github.ref }}
43+
```
44+
45+
This ensures Claude always reviews the current state of the PR, including any recent commits.
46+
47+
---
48+
49+
# Project Development Guide
450
551
## Project Overview
652

0 commit comments

Comments
 (0)