|
1 | | -# AGENTS.md |
| 1 | +# CLAUDE.md |
2 | 2 |
|
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 |
4 | 50 |
|
5 | 51 | ## Project Overview |
6 | 52 |
|
|
0 commit comments