Skip to main content

operator-api-standards

Standards, conventions, and dos/don'ts for adding or changing CRD types in the operator API (`operator/api/v1`). Use this skill whenever editing or creating files under `operator/api/v1/` (any *_types.go), adding/removing/renaming a CRD field, introducing a new Kind/CRD, adding kubebuilder validation or defaulting markers, or designing an overrides/configuration field. Trigger even if the user doesn't mention "standards" — any change to operator CRD types should follow these conventions.

来源信息

仓库
projectcalico/calico
最近来源活动
2026年9月3日 01:31
检测到的 SKILL.md 语言
英语
星标
7,394
分支
1,621

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
operator-api-standards
description
Standards, conventions, and dos/don'ts for adding or changing CRD types in the operator API (`operator/api/v1`). Use this skill whenever editing or creating files under `operator/api/v1/` (any *_types.go), adding/removing/renaming a CRD field, introducing a new Kind/CRD, adding kubebuilder validation or defaulting markers, or designing an overrides/configuration field. Trigger even if the user doesn't mention "standards" — any change to operator CRD types should follow these conventions.
# Operator API Standards When adding or changing CRD types under `operator/api/v1/`: 1. **Read [`operator/docs/api_design.md`](../../../operator/docs/api_design.md)** — the API design principles plus the concrete Go/kubebuilder coding conventions (optional vs required fields, the `Enabled`/`Disabled` enum idiom, validation/CEL markers, the top-level Kind marker block, shared-type reuse, the Deployment override pattern) and the end-of-file **checklist**. Apply all of it, and run the checklist before you finish. 2. **Read [`DESIGN.md`](../../../operator/DESIGN.md)** for related rules ("Respect User Input", "Resource Ownership") when a judgement call isn't settled by `api_design.md`. 3. Follow the post-change workflow in `api_design.md` — `make gen-files`, verify scope didn't flip to `Namespaced`, update `convert` if relevant, and `make dirty-check`.
在 GitHub 查看