feat(plugin): ship the ocf Claude Code plugin for framework consumers - #164
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…-plugin Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…rators description Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ugin Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR adds a Claude Code plugin (“ocf”) to this repository so framework consumers can install version-grounded skills/commands/agents directly from the framework repo, and it wires CI + Makefile automation to keep the plugin’s bundled reference docs mechanically in sync with docs/.
Changes:
- Add a Claude Code plugin under
plugin/(manifest, skills + references, commands, and a reviewer agent) and a marketplace manifest at repo root. - Add
make sync-pluginto regenerate plugin reference docs fromdocs/, plus a CI job that fails on drift and validates the plugin. - Update framework documentation and repo docs to describe the plugin and clarify component builder/deletion semantics.
Reviewed changes
Copilot reviewed 46 out of 46 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Documents plugin purpose, installation, and available /ocf:* commands. |
| docs/component.md | Documents builder validation aggregation (errors.Join) and deletion ordering semantics. |
| Makefile | Adds sync-plugin target to regenerate plugin reference docs from docs/. |
| .github/workflows/lint.yml | Adds a CI job to check plugin/doc sync drift and run claude plugin validate. |
| .github/copilot-instructions.md | Updates contributor guidance to include plugin sync/drift rules. |
| .claude-plugin/marketplace.json | Adds marketplace manifest so the repo can be installed as a plugin source. |
| .ai/base.md | Mirrors contributor guidance updates (including plugin sync/drift rules). |
| plugin/.claude-plugin/plugin.json | Defines the ocf plugin metadata (name/version/homepage/etc). |
| plugin/agents/reviewer.md | Adds a read-only “reviewer” agent with a guidelines checklist. |
| plugin/commands/docs.md | Adds /ocf:docs command for documentation lookup workflow. |
| plugin/commands/new-component.md | Adds /ocf:new-component scaffolding dialogue command. |
| plugin/commands/new-wrapper.md | Adds /ocf:new-wrapper scaffolding dialogue command. |
| plugin/commands/review.md | Adds /ocf:review command that dispatches the bundled reviewer agent. |
| plugin/skills/building-components/SKILL.md | Adds skill guidance for component building/lifecycle/status/guards. |
| plugin/skills/custom-resource-wrappers/SKILL.md | Adds skill guidance for wrapping CRD-backed types via pkg/generic. |
| plugin/skills/structuring-operators/SKILL.md | Adds skill guidance/checklist for operator structuring guidelines. |
| plugin/skills/testing-operators/SKILL.md | Adds skill guidance for mutation tests + golden/goldengen testing patterns. |
| plugin/skills/using-primitives/SKILL.md | Adds skill guidance for primitives, mutations, editors/selectors, SSA, etc. |
| plugin/skills/structuring-operators/references/compatibility.md | Generated copy of compatibility docs for plugin reference bundle. |
| plugin/skills/using-primitives/references/primitives/clusterrole.md | Generated per-primitive reference doc for plugin bundle. |
| plugin/skills/using-primitives/references/primitives/clusterrolebinding.md | Generated per-primitive reference doc for plugin bundle. |
| plugin/skills/using-primitives/references/primitives/configmap.md | Generated per-primitive reference doc for plugin bundle. |
| plugin/skills/using-primitives/references/primitives/cronjob.md | Generated per-primitive reference doc for plugin bundle. |
| plugin/skills/using-primitives/references/primitives/daemonset.md | Generated per-primitive reference doc for plugin bundle. |
| plugin/skills/using-primitives/references/primitives/deployment.md | Generated per-primitive reference doc for plugin bundle. |
| plugin/skills/using-primitives/references/primitives/ingress.md | Generated per-primitive reference doc for plugin bundle. |
| plugin/skills/using-primitives/references/primitives/job.md | Generated per-primitive reference doc for plugin bundle. |
| plugin/skills/using-primitives/references/primitives/networkpolicy.md | Generated per-primitive reference doc for plugin bundle. |
| plugin/skills/using-primitives/references/primitives/pdb.md | Generated per-primitive reference doc for plugin bundle. |
| plugin/skills/using-primitives/references/primitives/pod.md | Generated per-primitive reference doc for plugin bundle. |
| plugin/skills/using-primitives/references/primitives/pv.md | Generated per-primitive reference doc for plugin bundle. |
| plugin/skills/using-primitives/references/primitives/pvc.md | Generated per-primitive reference doc for plugin bundle. |
| plugin/skills/using-primitives/references/primitives/replicaset.md | Generated per-primitive reference doc for plugin bundle. |
| plugin/skills/using-primitives/references/primitives/role.md | Generated per-primitive reference doc for plugin bundle. |
| plugin/skills/using-primitives/references/primitives/rolebinding.md | Generated per-primitive reference doc for plugin bundle. |
| plugin/skills/using-primitives/references/primitives/secret.md | Generated per-primitive reference doc for plugin bundle. |
| plugin/skills/using-primitives/references/primitives/service.md | Generated per-primitive reference doc for plugin bundle. |
| plugin/skills/using-primitives/references/primitives/serviceaccount.md | Generated per-primitive reference doc for plugin bundle. |
| plugin/skills/using-primitives/references/primitives/statefulset.md | Generated per-primitive reference doc for plugin bundle. |
The plugin job installed Claude Code with the runner's default Node toolchain while the sibling lint job pins nodejs from .tool-versions, so the job was exposed to CI-only failures when the ubuntu-latest default drifts. Install nodejs through asdf as the lint job does. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 46 out of 46 changed files in this pull request and generated no new comments.
Suppressed comments (1)
.github/workflows/lint.yml:56
npm install -g @anthropic-ai/claude-codeis unpinned, so CI behavior can change (and start failing) when the upstream CLI publishes a new release. For reproducible CI (and to match the repo's existing pattern of pinning tool versions like Prettier in the Makefile), pin Claude Code to an explicit version and bump it intentionally when needed.
- name: Install Claude Code
run: npm install -g @anthropic-ai/claude-code
- name: Validate plugin and marketplace
run: claude plugin validate .
Update the distilled skill guidance, reviewer agent checklist, and docs command index for the declared data API merged in #165: concepts.Data cells, ExtractInto, WithDataGuard, WithOptionalData, build-time topology validation, DataTopology introspection, reconcile-start cell reset, and the suspension and preview caveats. Regenerate skill references via make sync-plugin. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 46 out of 46 changed files in this pull request and generated no new comments.
Suppressed comments (2)
docs/component.md:264
- Step 7 claims delete-flagged resources are deleted "in the same registration order used for reconciliation", but the implementation deletes
c.deleteResources(and, for feature-gate disable,allManagedResources()iterates managed reconcile resources first, then delete resources). That means deletion order is not necessarily the same as overallWithResourceregistration order when delete entries are interleaved. Please reword to match the actual behavior (deleted in the slice/registration order and not reversed).
7. **Resource deletion.** Resources registered for deletion are removed from the cluster, in the same registration order
used for reconciliation; the framework does not reverse it.
Makefile:110
make sync-plugincopiesdocs/primitives/*.mdintoplugin/skills/using-primitives/references/primitives/, but those files contain relative links like../component.md#declared-data(e.g. the generatedserviceaccount.md). In the plugin layout there is noplugin/skills/using-primitives/references/component.md, so these references are broken after sync. Consider copyingdocs/component.mdinto the using-primitives references as well so existing relative links continue to resolve in the installed plugin tree.
cp docs/component.md $(PLUGIN_SKILLS)/building-components/references/component.md
cp docs/primitives.md $(PLUGIN_SKILLS)/using-primitives/references/primitives.md
cp docs/primitives/*.md $(PLUGIN_SKILLS)/using-primitives/references/primitives/
cp docs/custom-resource.md $(PLUGIN_SKILLS)/custom-resource-wrappers/references/custom-resource.md
Description
Teams building operators with this framework get no assistance from AI coding agents beyond stale model memory, which invents builder methods and misses the structural guidelines. This PR ships a Claude Code plugin, named
ocf, inside the repository: the repo root doubles as a plugin marketplace, so consumers install directly from this repo and Claude picks up accurate, version-grounded knowledge of the framework while they build their operators.Changes
plugin/with the plugin manifest;.claude-plugin/marketplace.jsonat the repo root makes the repo installable via/plugin marketplace add sourcehawk/operator-component-frameworkfollowed by/plugin install ocf.docs/files, and instructs Claude to verify signatures withgo docagainst the consumer's resolved module version./ocf:docs(documentation lookup),/ocf:new-componentand/ocf:new-wrapper(scaffolding dialogues),/ocf:review(dispatches the bundled reviewer agent).docs/guidelines.md.make sync-plugincopies the mapped docs into the skill reference directories; a new CI job fails on any drift (including untracked additions) and runsclaude plugin validate.docs/component.mdnow states two previously undocumented facts, verified againstpkg/componentsource: registered resources are deleted in the same registration order used for reconciliation, andBuild()requiresWithNameandWithConditionTypewith validation failures aggregated viaerrors.Join..ai/base.md(regenerated instruction files included where tracked) and a README section documenting installation.Challenges
Keeping the plugin honest was the core design problem: skill guidance drifts as the framework evolves. Three mechanisms address it: reference files are generated copies of
docs/(never hand-edited, CI-enforced), every skill carries a ground-truth section makinggo docon the consumer's pinned version the final authority, and doc changes now sync in the same PR that makes them.Testing
Each skill passed a retrieval test: a fresh agent without the skill could not answer three framework-specific check questions, while an agent reading only the SKILL.md and its references answered all of them correctly against the docs. The full suite (
make all) passes,claude plugin validate .passes with zero warnings, and the sync drift check was negatively tested (a modified and an added docs file both fail CI, clean tree passes). A full local install cycle was exercised: marketplace add, plugin install, verification that all 33 skill files land in the installed layout, then uninstall.🤖 Generated with Claude Code