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.
Analyzes a Jira Request for Enhancement (RFE) and generates a structured breakdown of Epics, user stories, and their outcomes. Requires JIRA_PERSONAL_TOKEN for Jira API access.
Usage:
/oape:analyze-rfe RFE-7841
/oape:analyze-rfe https://issues.redhat.com/browse/RFE-7841What it does:
- Fetch RFE -- Retrieves the RFE from Jira (REST API).
- Parse -- Extracts nature, description, desired behavior, affected components.
- Workspace context (optional) -- Uses
context.mdfiles (e.g.docs/component-context/context.md) when present to enrich scope and key areas. - Generate EPIC(s) -- Objective, scope, acceptance criteria.
- Generate user stories -- "As a... I want... So that..." with acceptance criteria and outcomes.
- Output -- Markdown report; optionally saved to
.work/jira/analyze-rfe/<rfe-key>/breakdown.md.
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
# Predict potential regressions
/oape:predict-regressions main
# Generate the controller implementation
/oape:api-implement https://github.com/openshift/enhancements/pull/1234Analyzes git diff to predict potential regressions, breaking changes, and backward compatibility issues in newly developed APIs.
Usage:
/oape:predict-regressions main
/oape:predict-regressions origin/release-4.18 --output .reportsWhat it does:
- Prechecks -- Validates base branch exists, verifies repository is a valid OpenShift operator, and confirms non-empty git diff.
- Diff Extraction -- Collects all API type changes, CRD schema changes, controller changes, RBAC changes, and webhook changes.
- Static Analysis -- Applies rule-based detection for common breaking changes: field removals, required field additions, type changes, enum value removals, API version additions without conversion, validation rule tightening, default value changes, and condition type changes.
- LLM Analysis -- Uses Claude to perform deep semantic analysis for subtle regressions: semantic changes, upgrade issues, performance concerns, edge cases, backward compatibility, and controller behavior changes.
- Report Generation -- Creates a comprehensive markdown report (
output/regression-report.md) with severity-ordered findings (Critical/High/Medium/Low), impact analysis, evidence, mitigation recommendations, and suggested test scenarios.
Output:
output/regression-report.md-- Detailed regression risk report with executive summary, findings by severity, recommended actions, and test scenarios.
Key Features:
- Combines static analysis with LLM-powered semantic analysis
- Every finding includes specific mitigation steps and test scenarios
- Prioritizes findings by severity and real-world impact
- Framework-aware (controller-runtime vs library-go)
- Focuses on API versioning, upgrade paths, and backward compatibility
Performs 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, analyze-rfe)
- JIRA_PERSONAL_TOKEN -- For analyze-rfe (Jira REST API)
- oc -- OpenShift CLI (recommended, for running generated execution steps)
- Must be run from within an OpenShift operator repository