Skip to content

Add operator-api-standards Claude Code skill#4942

Open
Brian-McM wants to merge 1 commit into
tigera:masterfrom
Brian-McM:add-operator-api-standards-skill
Open

Add operator-api-standards Claude Code skill#4942
Brian-McM wants to merge 1 commit into
tigera:masterfrom
Brian-McM:add-operator-api-standards-skill

Conversation

@Brian-McM

Copy link
Copy Markdown
Contributor

Description

Adds a project-scoped Claude Code skill that guides contributors on conventions and dos/don'ts when adding or changing CRD types under api/v1/.

The skill distills the rationale already captured in docs/principles.md ("API Design", "Respect User Input", "Resource Ownership") and docs/dev_guidelines.md ("API code") into concrete, checkable rules, and pairs them with the repo's actual kubebuilder/Go coding conventions observed across the existing *_types.go files:

  • Design rules: minimal API surface, declarative convergence, kubebuilder-over-reconcile-loop defaulting/validation, every-container-needs-overrides, backward compatibility.
  • Respect user input: never overwrite/delete user fields or resources, error don't guess, no OwnerRefs on user-provided resources.
  • Coding conventions: pointer + omitempty + +optional for optional fields, the Enabled/Disabled enum idiom over *bool, CEL MaxLength/MaxItems bounds and the single-quote gotcha, the top-level Kind marker block + List + init() registration, copyright header, shared-type reuse.
  • Deployment/container override pattern modeled on whisker_deployment_types.go.
  • Required post-change workflow: make gen-files, cluster-scope check, convert package, pkg/common/validation, make dirty-check.
  • A copy-paste checklist for adding a new field.

It auto-triggers whenever a contributor (using Claude Code) edits files under api/v1/, so the guidance surfaces at the moment it's relevant.

For PR author

  • Added or updated tests for any new code (n/a — docs/tooling only)
  • If changing programmatic behavior of the operator, my commit message explains what behavior changed (n/a)

For PR reviewers

This is purely additive (a new .claude/skills/ markdown file); no operator behavior changes. Feedback welcome on the conventions themselves — whether anything is inaccurate, missing, or too prescriptive.

🤖 Generated with Claude Code

Adds a project-scoped skill that guides contributors on conventions and
dos/don'ts when adding or changing CRD types under api/v1. Distills the
rationale in docs/principles.md and docs/dev_guidelines.md into concrete,
checkable rules plus the repo's kubebuilder/Go coding conventions, and
documents the required post-change workflow (gen-files, convert, dirty-check).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants