From openshift
Review Kubernetes CRDs against Kubernetes and OpenShift API conventions
How this command is triggered — by the user, by Claude, or both
Slash command
/openshift:crd-review [repository-path]The summary Claude sees in its command listing — used to decide when to auto-load this command
## Name openshift:crd-review ## Synopsis ## Description The `openshift:crd-review` command analyzes Go Kubernetes Custom Resource Definitions (CRDs) in a repository against both: - **Kubernetes API Conventions** as defined in the [Kubernetes community guidelines](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md) - **OpenShift API Conventions** as defined in the [OpenShift development guide](https://github.com/openshift/enhancements/blob/master/dev-guide/api-conventions.md) This command checks CRDs for compliance with these conve...
openshift:crd-review
/openshift:crd-review [repository-path]
The openshift:crd-review command analyzes Go Kubernetes Custom Resource Definitions (CRDs) in a repository against both:
This command checks CRDs for compliance with these conventions, covering:
The review covers Go API type definitions, providing actionable feedback to improve API design.
timeoutSeconds)k8s.io/apimachinery/pkg/apis/meta/v1 TypeMeta structk8s.io/apimachinery/pkg/apis/meta/v1 ObjectMeta struct called metadatatype: Clear, human-readable condition typestatus: True, False, or Unknownreason: Machine-readable reason codemessage: Human-readable messagelastTransitionTime: RFC 3339 timestampint32 over int64myapp.example.com)v1, v1beta1)paused: truelifecycle: "Paused" with enum values ["Paused", "Active"]+kubebuilder:validation:*)The command performs the following analysis workflow:
Repository Discovery
api/, pkg/apis/ directories)+kubebuilder comments)Kubernetes Convention Validation
OpenShift Convention Validation
Report Generation
The command generates a structured report with:
Each finding includes:
/crd-review
Analyzes CRDs in the current working directory.
/crd-review /path/to/operator-project
Analyzes CRDs in the specified directory.
The command automatically provides detailed output including:
Issue: Using boolean where enum is better
// ❌ Bad
type MySpec struct {
Enabled bool `json:"enabled"`
}
// ✅ Good
type MySpec struct {
// State defines the operational state
// Valid values are: "Enabled", "Disabled", "Auto"
// +kubebuilder:validation:Enum=Enabled;Disabled;Auto
State string `json:"state"`
}
Issue: Status without conditions array
// ❌ Bad
type MyStatus struct {
Ready bool `json:"ready"`
}
// ✅ Good
type MyStatus struct {
// Conditions represent the latest available observations
// +listType=map
// +listMapKey=type
Conditions []metav1.Condition `json:"conditions,omitempty"`
}
Issue: Ambiguous or abbreviated names
// ❌ Bad
type MySpec struct {
Timeout int `json:"timeout"` // Ambiguous unit
Cnt int `json:"cnt"` // Abbreviation
}
// ✅ Good
type MySpec struct {
// TimeoutSeconds is the timeout in seconds
// +kubebuilder:validation:Minimum=1
TimeoutSeconds int32 `json:"timeoutSeconds"`
// Count is the number of replicas
// +kubebuilder:validation:Minimum=0
Count int32 `json:"count"`
}
Issue: Exported fields without Godoc
// ❌ Bad
type MySpec struct {
Field string `json:"field"`
}
// ✅ Good
type MySpec struct {
// field specifies the configuration field for...
// This value determines how the operator will...
// Valid values include...
Field string `json:"field"`
}
Issue: Fields without kubebuilder validation
// ❌ Bad
type MySpec struct {
Mode string `json:"mode"`
}
// ✅ Good
type MySpec struct {
// mode defines the operational mode
// +kubebuilder:validation:Enum=Standard;Advanced;Debug
// +kubebuilder:validation:Required
Mode string `json:"mode"`
}
npx claudepluginhub cblecker/ai-helpers --plugin openshift10plugins reuse this command
First indexed Jul 11, 2026
Showing the 6 earliest of 10 plugins