Skip to content
Back to skills

Dev Api And Codegen

ASecurity

Adds or modifies Kubernetes Custom Resource Definition (CRD) Go types in api/, Kubebuilder validation markers, RBAC annotations, Kustomize bases, and Helm chart templates, values, and CRD schemas; regenerates manifests, ClusterRoles, and DeepCopy methods via make manifests and make generate; and audits pre-PR repository parity across config/, helm/, VERSION, and docs/examples/ YAMLs. Use when changing WorkloadMixing API struct fields, updating CRD validation or RBAC permissions, editing Helm/...

  • 17 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 14, 2026
testinggobashrailskubernetesgitapi

Works with

  • api

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned November 14, 2026

npx -y skills add GoogleCloudPlatform/k8s-bridge --skill dev-api-and-codegen --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Dev Api And Codegen?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Dev Api And Codegen
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/googlecloudplatform-dev-api-and-codegen/badge)](https://www.skillsdirectory.com/skills/googlecloudplatform-dev-api-and-codegen)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: dev-api-and-codegen
description: >-
  Adds or modifies Kubernetes Custom Resource Definition (CRD) Go types in api/,
  Kubebuilder validation markers, RBAC annotations, Kustomize bases, and Helm
  chart templates, values, and CRD schemas; regenerates manifests, ClusterRoles,
  and DeepCopy methods via make manifests and make generate; and audits pre-PR
  repository parity across config/, helm/, VERSION, and docs/examples/ YAMLs.
  Use when changing WorkloadMixing API struct fields, updating CRD validation or
  RBAC permissions, editing Helm/Kustomize packaging templates, or verifying
  zero codegen and manifest drift before a pull request. Don't use for
  implementing Go controller reconciliation logic (use
  dev-controller-and-translator), Slurm Lua scripts (use dev-slurm-lua), or
  running unit/E2E test suites (use test-unit-and-lint or test-e2e-cluster).
---

# API, Codegen, Packaging, and Parity Audit Workflow (`dev-api-and-codegen`)

## 1. Preconditions & Inputs

Before modifying API schemas, RBAC markers, or chart templates, or running a pre-PR parity audit, read [references/parity-checklist.md](references/parity-checklist.md) for the source-to-derived parity matrix.

---

## 2. Guardrails

- **Do not hand-edit generated files, and sync manually paired artifacts:** Treat all generated outputs in [references/parity-checklist.md](references/parity-checklist.md) (plus `PROJECT`) as read-only outputs of `make manifests generate` and `make version-sync`, and manually sync all non-generated paired files in that table.
- **Preserve API identity, status subresource, and immutable Deployment selector labels:** Do not alter `WorkloadMixing` group/version (`k8s-bridge.x-k8s.io/v1alpha1`), `Namespaced` scope, or `+kubebuilder:subresource:status`, and never add `app.kubernetes.io/component` or `app.kubernetes.io/version` to `.spec.selector.matchLabels` in `helm/templates/deployment.yaml` or `config/manager/manager.yaml`.

---

## 3. Step-by-Step Procedure

### Step 1: Edit `WorkloadMixing` Go Types or Controller `+kubebuilder:rbac` Markers
1. **CRD Schema & Validation:** Edit struct fields and Kubebuilder markers in `api/v1alpha1/workloadmixing_types.go` (keep paired validation and defaults in `internal/controller/slurmjob/translator.go` in sync; see [references/parity-checklist.md](references/parity-checklist.md)).
2. **Controller RBAC Permissions:** If controller permissions changed, update the `+kubebuilder:rbac` annotations above `Reconcile` in `internal/controller/*/*_controller.go`.

### Step 2: Run Code and Manifest Generation
Regenerate CRDs, RBAC roles, `helm/crds/`, and DeepCopy methods:

```bash
make manifests generate
```

### Step 3: Synchronize Paired Artifacts & Audit Pre-PR Repository Parity
Walk through every modified row in [references/parity-checklist.md](references/parity-checklist.md) and synchronize all derived/paired artifacts.

---

## 4. Verification

Verify that version sync, code generation, formatting, static analysis, Kustomize/Helm rendering, and unit/`envtest` suites succeed with zero uncommitted drift:

```bash
make version-sync manifests generate fmt vet lint kustomize
git diff --exit-code
./bin/kustomize build config/default > /dev/null && ./bin/kustomize build config/samples > /dev/null
helm lint ./helm && helm template k8s-bridge ./helm --namespace k8s-bridge-system > /dev/null
make test
```

---

## 5. Handoffs & Related Skills

- **To implement controller reconciliation or `JobSet` translation for new CRD fields:** Read [skills/dev-controller-and-translator/SKILL.md](../dev-controller-and-translator/SKILL.md).
- **To write unit or `envtest` tests for new API fields:** Read [skills/test-unit-and-lint/SKILL.md](../test-unit-and-lint/SKILL.md).
- **To run the full-cluster Kind or GKE GPU E2E suite before merging:** Read [skills/test-e2e-cluster/SKILL.md](../test-e2e-cluster/SKILL.md).

Files in this skill

  • SKILL.md3.8 KB
  • references/parity-checklist.md2.2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in testing →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.