Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
b10427e
feat(plugin): add ocf plugin and marketplace manifests
sourcehawk Aug 1, 2026
3fb1452
feat(plugin): sync framework docs into skill references via make sync…
sourcehawk Aug 1, 2026
0e3dff6
feat(plugin): building-components skill
sourcehawk Aug 1, 2026
d4b4342
docs(component): state deletion ordering and required builder inputs
sourcehawk Aug 1, 2026
f4a57bb
feat(plugin): using-primitives skill
sourcehawk Aug 1, 2026
96e84c5
fix(plugin): remove em dashes from using-primitives skill
sourcehawk Aug 1, 2026
5c2a3d5
feat(plugin): custom-resource-wrappers skill
sourcehawk Aug 1, 2026
c7e310f
fix(plugin): scope unstructured primitive claim to the wrapper reference
sourcehawk Aug 1, 2026
14d0579
feat(plugin): structuring-operators skill
sourcehawk Aug 1, 2026
778f6e1
feat(plugin): testing-operators skill
sourcehawk Aug 1, 2026
2473263
fix(plugin): drop unbacked integration-helpers claim from testing-ope…
sourcehawk Aug 1, 2026
bc1b287
feat(plugin): /ocf:docs documentation lookup command
sourcehawk Aug 1, 2026
97fed0d
feat(plugin): /ocf:new-component scaffolding command
sourcehawk Aug 1, 2026
e9216cc
feat(plugin): /ocf:new-wrapper custom resource wrapper command
sourcehawk Aug 1, 2026
5921538
feat(plugin): guidelines reviewer agent and /ocf:review command
sourcehawk Aug 1, 2026
d5e33c5
ci: validate Claude plugin and check reference sync drift
sourcehawk Aug 1, 2026
9e3200c
docs: maintainer rules and install instructions for the ocf Claude pl…
sourcehawk Aug 1, 2026
5a69d04
ci: fail plugin sync check on untracked reference drift
sourcehawk Aug 1, 2026
43a9ce4
fix(plugin): add marketplace description and drop stray checklist anchor
sourcehawk Aug 1, 2026
c5049c5
ci(plugin): pin nodejs via asdf in the plugin validation job
sourcehawk Aug 1, 2026
4ac5d42
Merge remote-tracking branch 'origin/main' into worktree-ocf-claude-p…
sourcehawk Aug 2, 2026
bc54510
feat(plugin): reconcile skills with declared data extraction API
sourcehawk Aug 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 20 additions & 9 deletions .ai/base.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,18 +92,29 @@ semantics. GoDoc is part of the public API surface.

Update documentation in the **same response** as the code change — never leave them out of sync.

| Code area changed | Documentation to update |
| ------------------------------------------------- | ------------------------- |
| Component builder, reconciliation, status model | `docs/component.md` |
| Primitives, field application, editors, selectors | `docs/primitives.md` |
| Primitive implementations | `docs/primitives/*.md` |
| Generic building blocks, custom resource wrappers | `docs/custom-resource.md` |
| Operator structuring patterns, best practices | `docs/guidelines.md` |
| Any `pkg/` export visible in the quick start | `README.md` |
| Examples | `examples/*/README.md` |
| Code area changed | Documentation to update |
| ------------------------------------------------- | ------------------------------------------ |
| Component builder, reconciliation, status model | `docs/component.md` |
| Primitives, field application, editors, selectors | `docs/primitives.md` |
| Primitive implementations | `docs/primitives/*.md` |
| Generic building blocks, custom resource wrappers | `docs/custom-resource.md` |
| Operator structuring patterns, best practices | `docs/guidelines.md` |
| Any `pkg/` export visible in the quick start | `README.md` |
| Examples | `examples/*/README.md` |
| Any file under `docs/` synced into the plugin | Run `make sync-plugin` (CI fails on drift) |

When updating documentation in markdown files, make sure to run `make fmt-md` for consistent formatting.

### Claude Code plugin

The repository ships a Claude Code plugin for framework consumers in `plugin/` (marketplace manifest at
`.claude-plugin/marketplace.json`). Two rules keep it accurate:

- Files under `plugin/skills/*/references/` are generated copies of `docs/` files. Never edit them by hand; edit the
source under `docs/` and run `make sync-plugin`.
- When changing public API behaviour, check whether the distilled guidance in the affected `plugin/skills/*/SKILL.md` is
stale and update it in the same response.

### Examples

If you change a method signature, type name, or behaviour in `pkg/`, search `examples/` for usages and update them.
Expand Down
16 changes: 16 additions & 0 deletions .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "operator-component-framework",
"description": "Claude Code plugin marketplace for the operator-component-framework.",
"owner": {
"name": "sourcehawk",
"url": "https://github.com/sourcehawk"
},
"plugins": [
{
"name": "ocf",
"source": "./plugin",
"description": "Skills, scaffolding commands, and a guidelines reviewer for building Kubernetes operators with the operator-component-framework.",
"category": "development"
}
]
}
29 changes: 20 additions & 9 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,18 +92,29 @@ semantics. GoDoc is part of the public API surface.

Update documentation in the **same response** as the code change — never leave them out of sync.

| Code area changed | Documentation to update |
| ------------------------------------------------- | ------------------------- |
| Component builder, reconciliation, status model | `docs/component.md` |
| Primitives, field application, editors, selectors | `docs/primitives.md` |
| Primitive implementations | `docs/primitives/*.md` |
| Generic building blocks, custom resource wrappers | `docs/custom-resource.md` |
| Operator structuring patterns, best practices | `docs/guidelines.md` |
| Any `pkg/` export visible in the quick start | `README.md` |
| Examples | `examples/*/README.md` |
| Code area changed | Documentation to update |
| ------------------------------------------------- | ------------------------------------------ |
| Component builder, reconciliation, status model | `docs/component.md` |
| Primitives, field application, editors, selectors | `docs/primitives.md` |
| Primitive implementations | `docs/primitives/*.md` |
| Generic building blocks, custom resource wrappers | `docs/custom-resource.md` |
| Operator structuring patterns, best practices | `docs/guidelines.md` |
| Any `pkg/` export visible in the quick start | `README.md` |
| Examples | `examples/*/README.md` |
| Any file under `docs/` synced into the plugin | Run `make sync-plugin` (CI fails on drift) |

When updating documentation in markdown files, make sure to run `make fmt-md` for consistent formatting.

### Claude Code plugin

The repository ships a Claude Code plugin for framework consumers in `plugin/` (marketplace manifest at
`.claude-plugin/marketplace.json`). Two rules keep it accurate:

- Files under `plugin/skills/*/references/` are generated copies of `docs/` files. Never edit them by hand; edit the
source under `docs/` and run `make sync-plugin`.
- When changing public API behaviour, check whether the distilled guidance in the affected `plugin/skills/*/SKILL.md` is
stale and update it in the same response.

### Examples

If you change a method signature, type name, or behaviour in `pkg/`, search `examples/` for usages and update them.
Expand Down
27 changes: 26 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,29 @@ jobs:
nodejs

- name: Run linter
run: make lint
run: make lint

plugin:
name: Validate Claude plugin
runs-on: ubuntu-latest
steps:
- name: Clone the code
uses: actions/checkout@v6

- name: Install tools with asdf
uses: asdf-vm/actions/install@v4
with:
only: nodejs

- name: Check plugin references are in sync with docs
run: |
make sync-plugin
git add -A plugin
git status --porcelain plugin
git diff --cached --exit-code -- plugin

- name: Install Claude Code
run: npm install -g @anthropic-ai/claude-code

- name: Validate plugin and marketplace
run: claude plugin validate .
22 changes: 22 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,28 @@ fmt-go: ## Format Go source files.
fmt-md: prettier ## Format Markdown files.
$(PRETTIER) --write '**/*.md' --ignore-path .gitignore

PLUGIN_SKILLS := plugin/skills

.PHONY: sync-plugin
sync-plugin: ## Sync framework docs into the Claude plugin skill references.
rm -rf $(PLUGIN_SKILLS)/building-components/references \
$(PLUGIN_SKILLS)/using-primitives/references \
$(PLUGIN_SKILLS)/custom-resource-wrappers/references \
$(PLUGIN_SKILLS)/structuring-operators/references \
$(PLUGIN_SKILLS)/testing-operators/references
mkdir -p $(PLUGIN_SKILLS)/building-components/references \
$(PLUGIN_SKILLS)/using-primitives/references/primitives \
$(PLUGIN_SKILLS)/custom-resource-wrappers/references \
$(PLUGIN_SKILLS)/structuring-operators/references \
$(PLUGIN_SKILLS)/testing-operators/references
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
cp docs/guidelines.md $(PLUGIN_SKILLS)/structuring-operators/references/guidelines.md
cp docs/compatibility.md $(PLUGIN_SKILLS)/structuring-operators/references/compatibility.md
cp docs/testing.md $(PLUGIN_SKILLS)/testing-operators/references/testing.md

.PHONY: prettier
prettier: $(PRETTIER) ## Download prettier locally if necessary.
$(PRETTIER): $(LOCALBIN)
Expand Down
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,21 @@ Full documentation, including a step-by-step tutorial, is at

The full Go API reference is on [pkg.go.dev](https://pkg.go.dev/github.com/sourcehawk/operator-component-framework).

## Claude Code plugin

The repository ships a [Claude Code](https://code.claude.com) plugin that teaches Claude the framework's concepts and
idioms: skills for components, primitives, custom resource wrappers, operator structure, and testing, plus scaffolding
commands and a guidelines reviewer.

Install it from this repository:

```
/plugin marketplace add sourcehawk/operator-component-framework
/plugin install ocf
```

Then use `/ocf:docs <topic>`, `/ocf:new-component`, `/ocf:new-wrapper`, and `/ocf:review` inside your operator project.

## Contributing

Contributions are welcome. Open an issue to discuss significant changes before submitting a pull request. New code
Expand Down
7 changes: 6 additions & 1 deletion docs/component.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ For operator-structuring advice (one component per condition, thin controllers,
Components are constructed through a builder. The builder collects resource registrations, configuration, and lifecycle
flags, then produces an immutable `Component` ready for reconciliation.

`Build()` requires `WithName` and `WithConditionType`; every other builder method is optional. If either is missing, or
any registered resource fails validation, `Build()` returns a single aggregated error containing every failure, using
`errors.Join`.

```go
comp, err := component.NewComponentBuilder().
WithName("frontend").
Expand Down Expand Up @@ -256,7 +260,8 @@ reconcile can be observed during this one.
6. **Condition update.** A new component condition is derived from the aggregate resource status, the previous
condition, and the configured grace period, then written to the owner **in memory only**. `Reconcile` never calls the
Kubernetes status API; the controller persists with [`FlushStatus`](#persisting-status-with-flushstatus).
7. **Resource deletion.** Resources registered for deletion are removed from the cluster.
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.

```mermaid
flowchart TD
Expand Down
14 changes: 14 additions & 0 deletions plugin/.claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "ocf",
"displayName": "Operator Component Framework",
"version": "0.1.0",
"description": "Skills, scaffolding commands, and a guidelines reviewer for building Kubernetes operators with the operator-component-framework.",
"author": {
"name": "sourcehawk",
"url": "https://github.com/sourcehawk"
},
"homepage": "https://sourcehawk.github.io/operator-component-framework/",
"repository": "https://github.com/sourcehawk/operator-component-framework",
"license": "Apache-2.0",
"keywords": ["kubernetes", "operator", "controller-runtime", "go"]
}
Loading
Loading