K8S Crd From Typed Schema
Use when generating Kubernetes CustomResourceDefinitions from a typed schema source (zod / TypeBox / Valibot / json-schema). Covers the Structural Schema dialect's restrictions, the /status subresource trap, the metadata-prohibition rule, and plural inflection — the four pitfalls that bite on first attempt.
Install
npx skills add mizchi/skills --skill k8s-crd-from-typed-schemagit clone --depth 1 https://github.com/mizchi/skills.git /tmp/skills
mkdir -p ~/.claude/skills
cp -r /tmp/skills/k8s-crd-from-typed-schema ~/.claude/skills/k8s-crd-from-typed-schemaPersonal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.
From the SKILL.md
# k8s CRDs from a typed schema
Generating CRDs from typed schemas (zod / TypeBox / Valibot / hand-written JSON Schema) looks straightforward — convert to OpenAPI v3, embed as `openAPIV3Schema`, done. It isn't. CRDs use a **subset of OpenAPI v3 plus k8s-specific extensions** ("Structural Schema"), and several common JSON-Schema features are silently incompatible. Plus there are two non-schema gotchas (`status` subresource, `metadata` prohibition) that don't show up until you try to use the CRD.
This skill is the punch list of what to fix before `kubectl apply -f crd.yaml` succeeds and the operator actually works.
## When to use
- Building an operator / controller and writing your own CRDs.
- Generating CRDs from a typed source rather than hand-authoring YAML.
- Hitting `kubectl` errors like `unknown field "$schema"` / `must not have "oneOf"` / `must not specify anything other than name and generateName` / `cannot have both "additionalProperties" and "properties"`.
- Operator works once but then reconciles forever in a loop after the first status write.
## Workflow
### 1. Convert typed schema → JSON Schema (OpenAPI v3 dialect)
For zod:
```ts
import { zodToJsonSchema } from 'zod-to-json-schema';
const json = zodToJsonSchema(specSchema, {
target: 'openApi3',
$refStrategy: 'none', // CRDs forbid $refs across the document
});
```
`$refStrategy: 'none'` is mandatory — k8s' Structural Schema does not resolve cross-document `$ref`. Inline everything.Details
- Skill name
k8s-crd-from-typed-schema- Repository
- mizchi/skills
- Path
k8s-crd-from-typed-schema/SKILL.md- Repo updated
- 18 November 2026
FAQ
What does the K8S Crd From Typed Schema skill do?
Use when generating Kubernetes CustomResourceDefinitions from a typed schema source (zod / TypeBox / Valibot / json-schema). Covers the Structural Schema dialect's restrictions, the /status subresource trap, the metadata-prohibition rule, and plural inflection — the four pitfalls that bite on first attempt.
How do I install the K8S Crd From Typed Schema skill?
skills CLI (Claude Code, Cursor, Codex and more): npx skills add mizchi/skills --skill k8s-crd-from-typed-schema. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.
Is K8S Crd From Typed Schema popular?
It lives in mizchi/skills, which has 423 GitHub stars and 6 forks.
Related skills
Actions CI Tuning
423mizchi/skills
Use when auditing or improving GitHub Actions workflows for a project. Covers cache setup (npm/pnpm/yarn), job parallelism, shard-based test splitting, artifact handling pitfalls, and Playwright-specific patterns. Trigger on: slow CI, cache miss, flaky shard jobs, merge-reports failures, or an explicit 'tune CI' request.
AI Index
423mizchi/skills
Method and tooling for measuring how AI-generated a piece of prose reads, in Japanese or English. Two layers — a deterministic lint for removable surface tells (scripts/slopscore.py, no API) and a judgment layer of typed probabilistic questions (Jev noul/score) for the tells that survive editing. Includes measured human/AI baselines, a gap-first calibration procedure, and labeled fixtures. Use when building or calibrating an AI-likeness score, or when a draft needs a defensible number rather than a vibe. For writing guidance use natural-writing-ja / natural-writing-en instead.
Apm Usage
423mizchi/skills
Reference for APM manifests, installation, targeted updates, deployment paths and lockfiles. Invoke when the user explicitly asks about APM or apm.yml, or an unfamiliar APM command/error needs exact CLI details. Do not automatically invoke for every project that happens to have installed skills.
Mcloud Deployments
237medusajs/medusa-agent-skills
Execute mcloud deployments commands to list deployments, retrieve deployment details, and fetch build logs. Use when listing deployments, checking deployment status, or reading build output for debugging build failures.
Cloudflare Workers Otel Utels
423mizchi/skills
Cloudflare Worker telemetry at the fetch boundary — OTLP traces / metrics / logs + utels error tracking + D1 Proxy that emits slow-query warnings. Use when adding observability to a Worker without touching handler code.
Mcloud Logs
237medusajs/medusa-agent-skills
Execute mcloud logs to fetch and stream runtime logs for Cloud environments. Use when reading backend or storefront logs, filtering by time range, searching for errors, or scoping logs to a specific deployment.
Browse the most popular Claude skills, all devops & cloud skills, or write your own with the skills generator.