AI-driven OpenShift operator development tools, following OpenShift and Kubernetes API conventions.
Clones an allowed OpenShift operator repository by short name into the current directory so that subsequent /oape:* commands can operate immediately.
Usage:
/oape:init cert-manager-operatorWhat it does:
- Prechecks -- Validates the short name argument, required tools (
git,gh), and GitHub authentication. - Repository Resolution -- Matches the short name against the allowlist (case-insensitive, with partial match disambiguation).
- Clone -- Runs
git clone --filter=blob:noneinto the current working directory. If the directory already exists with the correct remote, reuses it. - Verify -- Changes into the cloned directory and reports the Go module and detected framework.
Reads an OpenShift enhancement proposal PR, extracts the required API changes, and generates compliant Go type definitions in the correct paths of the current OpenShift operator repository.
Usage:
/oape:api-generate https://github.com/openshift/enhancements/pull/1234What it does:
- Prechecks -- Validates the PR URL, required tools (
gh,go,git), GitHub authentication, repository type (must be an OpenShift operator repo withopenshift/apidependency), and PR accessibility. Fails immediately if any precheck fails. - Knowledge Refresh -- Fetches and internalizes the latest OpenShift and Kubernetes API conventions before generating any code.
- Enhancement Analysis -- Reads the enhancement proposal to extract API group, version, kinds, fields, validation requirements, feature gate info, and whether it is a configuration or workload API.
- Code Generation -- Generates or modifies Go type definitions following conventions derived from the authoritative documents and patterns from the existing codebase.
- FeatureGate Registration -- Adds FeatureGate to
features.gowhen applicable.
Generates .testsuite.yaml integration test files for OpenShift API type definitions. Reads Go types, CRD manifests, and validation markers to produce comprehensive test suites.
Usage:
/oape:api-generate-tests api/v1alpha1/myresource_types.goWhat it does:
- Prechecks -- Verifies the repository, identifies target API types, and checks for CRD manifests.
- Type Analysis -- Reads Go types to extract fields, validation markers, enums, unions, immutability rules, and feature gates.
- Test Generation -- Generates test cases covering: minimal valid create, valid/invalid field values, update scenarios, immutable fields, singleton name validation, discriminated unions, feature-gated fields, and status subresource tests.
- File Output -- Writes
.testsuite.yamlfiles following the repo's existing naming and directory conventions.
Reads an OpenShift enhancement proposal PR, extracts the required implementation logic, and generates complete controller/reconciler code following controller-runtime and operator-sdk conventions.
Usage:
/oape:api-implement https://github.com/openshift/enhancements/pull/1234What it does:
- Prechecks -- Validates the PR URL, required tools (
gh,go,git,make), GitHub authentication, repository type (controller-runtime or library-go), and PR accessibility. - Knowledge Refresh -- Fetches and internalizes the latest controller-runtime patterns and operator best practices.
- Enhancement Analysis -- Reads the enhancement proposal to extract business logic requirements, reconciliation workflow, conditions, events, and error handling.
- Pattern Detection -- Identifies the controller layout pattern used in the repository.
- Code Generation -- Generates complete Reconcile() logic, SetupWithManager, finalizer handling, status updates, and event recording.
- Controller Registration -- Adds the new controller to the manager.
Typical Workflow:
# Clone the operator repository (if not already cloned)
/oape:init cert-manager-operator
# Generate the API types
/oape:api-generate https://github.com/openshift/enhancements/pull/1234
# Generate integration tests for the new types
/oape:api-generate-tests api/v1alpha1/myresource_types.go
# Generate the controller implementation
/oape:api-implement https://github.com/openshift/enhancements/pull/1234Performs a "Principal Engineer" level code review that verifies code changes against Jira requirements.
Usage:
/oape:review OCPBUGS-12345
/oape:review OCPBUGS-12345 origin/release-4.15What it does:
- Fetches Jira Issue -- Retrieves the ticket details and acceptance criteria
- Analyzes Git Diff -- Gets changes between base ref and HEAD
- Reviews Code -- Applies four review modules:
- Golang Logic & Safety: Intent matching, execution traces, edge cases, context usage, concurrency, error handling
- Bash Scripts: Safety patterns, variable quoting, temp file handling
- Operator Metadata (OLM): RBAC updates, finalizer handling
- Build Consistency: Generation drift detection
- Generates Report -- Returns structured JSON with verdict, issues, and fix prompts
- Applies Fixes Automatically -- When issues are found, invokes
implement-review-fixes.mdto apply the suggested code changes in severity order (CRITICAL first), then verifies the build still passes
Generates e2e test artifacts for any OpenShift operator repository by discovering the repo structure and analyzing the git diff from a base branch.
Usage:
# Generate e2e tests for changes since main
/oape:e2e-generate main
# Use a specific base branch and custom output directory
/oape:e2e-generate origin/release-4.18 --output .workWhat it does:
- Prechecks -- Validates the base branch argument, required tools (
git,go), repository type (must be an OpenShift operator repo with controller-runtime or library-go), and verifies a non-empty git diff. - Discovery -- Detects framework (controller-runtime vs library-go), API types, CRDs, existing e2e test patterns, install mechanism (OLM or manual), operator namespace, and sample CRs.
- Diff Analysis -- Categorizes changed files (API types, controllers, CRDs, RBAC, samples) and reads diff hunks to understand specific changes.
- Generation -- Produces four files in
output/e2e_<repo-name>/:test-cases.md-- Test scenarios with context, prerequisites, install, CR deployment, diff-specific tests, verification, cleanupexecution-steps.md-- Step-by-stepoccommandse2e_test.goore2e_test.sh-- Go (Ginkgo) or bash test code matching the repo's existing e2e patterne2e-suggestions.md-- Coverage recommendations
Supports:
- controller-runtime operators (Ginkgo e2e) -- e.g., cert-manager-operator, external-secrets-operator
- library-go operators (bash e2e) -- e.g., secrets-store-csi-driver-operator
- Operators with in-repo API types or external types from openshift/api
See e2e-test-generator/ for fixture templates and pattern documentation.
- go -- Go toolchain
- git -- Git
- gh (GitHub CLI) -- installed and authenticated (for api-generate, api-implement, review)
- make -- Make (for api-implement)
- curl -- For fetching Jira issues (for review)
- oc -- OpenShift CLI (recommended, for running generated execution steps)
- Must be run from within an OpenShift operator repository