Skip to content

Commit d7a1825

Browse files
committed
fix: some fixes
1 parent 1bd94ca commit d7a1825

File tree

2 files changed

+90
-50
lines changed

2 files changed

+90
-50
lines changed

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

Lines changed: 57 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,28 @@ on:
44
pull_request:
55
types: [opened, synchronize]
66
# Optional: Only run on specific file changes
7-
# paths:
8-
# - "src/**/*.ts"
9-
# - "src/**/*.tsx"
10-
# - "src/**/*.js"
11-
# - "src/**/*.jsx"
7+
paths:
8+
- 'src/**/*.ts'
9+
- 'src/**/*.tsx'
10+
- 'src/**/*.js'
11+
- 'src/**/*.jsx'
12+
- 'package.json'
13+
- 'package-lock.json'
1214

1315
jobs:
1416
claude-review:
15-
# Optional: Filter by PR author
16-
# if: |
17-
# github.event.pull_request.user.login == 'external-contributor' ||
18-
# github.event.pull_request.user.login == 'new-developer' ||
19-
# github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'
20-
17+
# Optional: Skip review for specific conditions
18+
if: |
19+
!contains(github.event.pull_request.title, '[skip-review]') &&
20+
!contains(github.event.pull_request.title, '[WIP]')
21+
2122
runs-on: ubuntu-latest
2223
permissions:
2324
contents: read
2425
pull-requests: read
2526
issues: read
2627
id-token: write
27-
28+
2829
steps:
2930
- name: Checkout repository
3031
uses: actions/checkout@v4
@@ -37,42 +38,64 @@ jobs:
3738
with:
3839
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
3940

40-
# Optional: Specify model (defaults to Claude Sonnet 4, uncomment for Claude Opus 4)
41-
# model: "claude-opus-4-20250514"
42-
41+
# Specify model for consistency with main workflow
42+
model: 'claude-opus-4-20250514'
43+
4344
# Direct prompt for automated review (no @claude mention needed)
4445
direct_prompt: |
45-
Please review this pull request and provide feedback on:
46-
- Code quality and best practices
47-
- Potential bugs or issues
48-
- Performance considerations
49-
- Security concerns
50-
- Test coverage
51-
52-
Be constructive and helpful in your feedback.
53-
54-
# Optional: Use sticky comments to make Claude reuse the same comment on subsequent pushes to the same PR
55-
# use_sticky_comment: true
56-
46+
Review this YDB Embedded UI pull request focusing on:
47+
48+
1. **Code Standards**:
49+
- TypeScript type safety and proper interface usage (prefixed with 'T')
50+
- React best practices and Gravity UI component usage
51+
- Redux Toolkit patterns with RTK Query
52+
- BEM naming convention with cn() utility
53+
54+
2. **Critical Requirements**:
55+
- All user-facing text must use i18n (no hardcoded strings)
56+
- API calls must go through window.api, never direct calls
57+
- No state mutations in RTK Query
58+
- Route params validation (React Router v5)
59+
60+
3. **Performance & Security**:
61+
- Virtual scrolling for large tables (PaginatedTable)
62+
- React.memo for expensive renders
63+
- No exposed secrets or keys
64+
- Proper error handling and loading states
65+
66+
4. **Testing**:
67+
- Unit tests in __test__ directories
68+
- E2E tests follow page object pattern
69+
70+
Be constructive and reference specific files with file_path:line_number format.
71+
72+
# Use sticky comments to make Claude reuse the same comment on subsequent pushes to the same PR
73+
use_sticky_comment: true
74+
5775
# Optional: Customize review based on file types
5876
# direct_prompt: |
5977
# Review this PR focusing on:
6078
# - For TypeScript files: Type safety and proper interface usage
6179
# - For API endpoints: Security, input validation, and error handling
6280
# - For React components: Performance, accessibility, and best practices
6381
# - For tests: Coverage, edge cases, and test quality
64-
82+
6583
# Optional: Different prompts for different authors
6684
# direct_prompt: |
67-
# ${{ github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR' &&
85+
# ${{ github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR' &&
6886
# 'Welcome! Please review this PR from a first-time contributor. Be encouraging and provide detailed explanations for any suggestions.' ||
6987
# 'Please provide a thorough code review focusing on our coding standards and best practices.' }}
70-
71-
# Optional: Add specific tools for running tests or linting
72-
# allowed_tools: "Bash(npm run test),Bash(npm run lint),Bash(npm run typecheck)"
73-
88+
89+
# Add specific tools for running tests or linting
90+
allowed_tools: |
91+
Bash(npm run lint)
92+
Bash(npm run typecheck)
93+
Bash(npm test -- --no-watch)
94+
Bash(npm run unused)
95+
Bash(git diff)
96+
Bash(git log)
97+
7498
# Optional: Skip review for certain conditions
7599
# if: |
76100
# !contains(github.event.pull_request.title, '[skip-review]') &&
77101
# !contains(github.event.pull_request.title, '[WIP]')
78-

.github/workflows/claude.yml

Lines changed: 33 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -39,26 +39,43 @@ jobs:
3939
# This is an optional setting that allows Claude to read CI results on PRs
4040
additional_permissions: |
4141
actions: read
42-
42+
4343
# Optional: Specify model (defaults to Claude Sonnet 4, uncomment for Claude Opus 4)
44-
# model: "claude-opus-4-20250514"
45-
44+
model: 'claude-opus-4-20250514'
45+
4646
# Optional: Customize the trigger phrase (default: @claude)
4747
# trigger_phrase: "/claude"
48-
48+
4949
# Optional: Trigger when specific user is assigned to an issue
50-
# assignee_trigger: "claude-bot"
51-
50+
assignee_trigger: 'claude-bot'
51+
5252
# Optional: Allow Claude to run specific commands
53-
# allowed_tools: "Bash(npm install),Bash(npm run build),Bash(npm run test:*),Bash(npm run lint:*)"
54-
53+
allowed_tools: |
54+
Bash(npm ci)
55+
Bash(npm run dev)
56+
Bash(npm run build:*)
57+
Bash(npm run lint)
58+
Bash(npm run typecheck)
59+
Bash(npm run unused)
60+
Bash(npm test)
61+
Bash(npm run test:*)
62+
Bash(docker run*)
63+
Bash(git log*)
64+
Bash(git diff*)
65+
Bash(git status)
66+
5567
# Optional: Add custom instructions for Claude to customize its behavior for your project
56-
# custom_instructions: |
57-
# Follow our coding standards
58-
# Ensure all new code has tests
59-
# Use TypeScript for new files
60-
61-
# Optional: Custom environment variables for Claude
62-
# claude_env: |
63-
# NODE_ENV: test
68+
custom_instructions: |
69+
Follow the CLAUDE.md guidelines in the repository
70+
Use Gravity UI components for any UI changes
71+
Always use i18n for user-facing strings following i18n-naming-ruleset.md
72+
Run npm run lint and npm run typecheck before committing
73+
Use RTK Query for API calls, never call APIs directly
74+
Follow BEM naming convention with cn() utility
75+
Use PaginatedTable for large datasets
76+
TypeScript types should be prefixed with 'T' (e.g., TTenantInfo)
6477
78+
# Optional: Custom environment variables for Claude
79+
claude_env: |
80+
NODE_VERSION: 18
81+
REACT_APP_BACKEND: http://localhost:8765

0 commit comments

Comments
 (0)