Skip to content

Commit 4c9540e

Browse files
committed
claude: take latest OpenShift and Kubernetes API conventions into account
It would be good if claude uses the latest conventions to do the review. On top of that it should check for naming convention issues during the documentation checks. Signed-off-by: Sascha Grunert <[email protected]>
1 parent 8c9acca commit 4c9540e

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

.claude/commands/api-review.md

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,17 @@ You MUST use this EXACT format for ALL review feedback:
2828

2929
I'll run a comprehensive API review for OpenShift API changes. This can review either a specific GitHub PR or local changes against upstream master.
3030

31+
## API Conventions
32+
33+
**CRITICAL**: All API changes MUST comply with both Kubernetes and OpenShift API conventions:
34+
35+
1. **Kubernetes API Conventions**: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md
36+
2. **OpenShift API Conventions**: https://github.com/openshift/enhancements/blob/master/dev-guide/api-conventions.md
37+
38+
**Naming Conventions**: All new fields MUST adhere to OpenShift and Kubernetes naming conventions to avoid conflicts now or in the future. Field names in golang must be PascalCase while their JSON representation has to be camelCase. They have to be descriptive, and align with established patterns in both Kubernetes and OpenShift APIs.
39+
40+
Before starting the review, I will fetch and review the latest API conventions from both sources to ensure all validation checks are aligned with current requirements.
41+
3142
## Step 1: Pre-flight checks and determine review mode
3243

3344
First, I'll check the arguments and determine whether to review a PR or local changes:
@@ -131,13 +142,17 @@ fi
131142
echo "✅ Linting checks passed."
132143
```
133144

134-
## Step 4: Documentation validation
145+
## Step 4: Documentation and API conventions validation
135146

136147
For each changed API file, I'll validate:
137148

138-
1. **Field Documentation**: All struct fields must have documentation comments
139-
2. **Optional Field Behavior**: Optional fields must explain what happens when they are omitted
140-
3. **Validation Documentation**: Validation rules must be documented and match markers
149+
1. **Kubernetes API Conventions**: All changes must comply with https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md
150+
2. **OpenShift API Conventions**: All changes must comply with https://github.com/openshift/enhancements/blob/master/dev-guide/api-conventions.md
151+
3. **Field Naming Conventions**: All new fields must adhere to OpenShift and Kubernetes naming conventions to avoid conflicts now or in the future
152+
4. **Field Documentation**: All struct fields must have documentation comments
153+
5. **Optional Field Behavior**: Optional fields must explain what happens when they are omitted
154+
6. **Validation Documentation**: Validation rules must be documented and match markers
155+
7. **Cross-field Validation**: Documented field relationships must have corresponding XValidation rules
141156

142157
Let me check each changed file for these requirements:
143158

@@ -194,4 +209,4 @@ fi
194209
3. MUST fetch latest changes from the detected openshift/api remote
195210
4. MUST compare against the detected remote's master branch
196211
5. MUST include both committed and staged changes in analysis
197-
6. No branch switching required since we're reviewing local changes
212+
6. No branch switching required since we're reviewing local changes

0 commit comments

Comments
 (0)