kubefleet
Copilot instructions164 starsChanged 6 days agoApache-2.0View on GitHub
KubeFleet is a multi-cluster Kubernetes management system (CNCF sandbox) using a hub-and-spoke model. The hub agent runs on a central cluster; member agents run on each managed cluster. User-created placement flows through a chain of controllers: CRDs starting with Cluster are cluster-scoped; the name without the Cluster prefix is the namespace-scoped counterpart. For example: ClusterResourcePlacement (cluster-scoped) vs ResourcePlacement (namespace-scoped). This affects CRUD operations — namespace-scoped resources require a Namespace field in types.NamespacedName. Pluggable architecture modeled after the Kubernetes scheduler: -…
1 other project uses a version of this.
Adopted by
Most recently taken up by
- Azure/fleetword for word, first seen Feb 7, 2026
Other versions1 project uses a version of this.
Word for word · 1
- Azure/fleet★ 227100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
Where files are headingNew Copilot instructions files have more rules about branches and pull requests, and fewer about code style.
Of the Copilot instructions files we read, the 2,349 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository22 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- .squad/copilot-instructions.mdCopilot instructions
- agent-collaborationSkill
- coordinator-init-modeSkill
- coordinator-response-modeSkill
- coordinator-source-of-truthSkill
- cross-squad-communicationSkill
- cross-squadSkill
- error-recoverySkill
- git-workflowSkill
- iterative-retrievalSkill
- reflectSkill
- reviewer-protocolSkill
- secret-handlingSkill
- session-recoverySkill
- squad-conventionsSkill
- squad-helpSkill
- squadSkill
- squad-version-checkSkill
- test-disciplineSkill
- tiered-memorySkill
- {skill-name}Skill
The file
We split this copilot-instructions.md into the rules it gives an agent
9 rules. About 0 are common, 2 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 76
All policy and resource changes create immutable snapshot CRDs (ResourceSnapshot, SchedulingPolicySnapshot, OverrideSnapshot).
- Distinctive: line 88
Follow the Uber Go Style Guide
- Distinctive: line 91
Always add an empty line at the end of new files
- Very specific: line 92
Run make reviewable before submitting PRs
- Very specific: line 107
Do not use assert libraries.
- Very specific: line 108
Use want / wanted (not expect / expected) for desired state variables
- Very specific: line 109
Test output format: "FuncName(%v) = %v, want %v"
- Very specific: line 112
When adding Ginkgo tests, add to a new Context.
- Very specific: line 122
Use .github/.copilot/specifications/ for feature specs.
≈ “Common” is an estimate: at least 1 in 5 of the 3,779 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
KubeFleet Copilot Instructions
Build, Test, and Lint Commands
make build # Build all binaries
make reviewable # Run all quality checks (fmt, vet, lint, staticcheck, tidy) — required before PRs
make lint # Fast linting
make lint-full # Thorough linting (--fast=false)
make test # Unit + integration tests
make local-unit-test # Unit tests only
make integration-test # Integration tests only (Ginkgo, uses envtest)
make manifests # Regenerate CRDs from API types
make generate # Regenerate deep copy methodsRunning a single test
# Single package
go test -v -race -timeout=30m ./pkg/controllers/rollout/...
# Single test by name
go test -v -race -run TestReconcile ./pkg/controllers/rollout/...
# Single Ginkgo integration test by description
cd test/scheduler && ginkgo -v --focus="should schedule"E2E tests
make setup-clusters # Create 3 Kind clusters
make e2e-tests # Run E2E suite (ginkgo, ~70min timeout)
make clean-e2e-tests # Tear down clustersArchitecture
KubeFleet is a multi-cluster Kubernetes management system (CNCF sandbox) using a hub-and-spoke model. The hub agent runs on a central cluster; member agents run on each managed cluster.
Reconciliation Pipeline
User-created placement flows through a chain of controllers:
ClusterResourcePlacement / ResourcePlacement (user intent)
↓
Placement Controller → creates ResourceSnapshot + SchedulingPolicySnapshot (immutable)
↓
Scheduler → creates ClusterResourceBinding / ResourceBinding (placement decisions)
↓
Rollout Controller → manages staged rollout of bindings
↓
Work Generator → creates Work objects (per-cluster manifests)
↓
Work Applier (member agent) → applies manifests, creates AppliedWork
↓
Status flows back: AppliedWork → Work status → Binding status → Placement statusAPI Naming Convention
CRDs starting with Cluster are cluster-scoped; the name without the Cluster prefix is the namespace-scoped counterpart. For example: ClusterResourcePlacement (cluster-scoped) vs ResourcePlacement (namespace-scoped). This affects CRUD operations — namespace-scoped resources require a Namespace field in types.NamespacedName.
Scheduler Framework
Pluggable architecture modeled after the Kubernetes scheduler:
- Plugin interfaces:
PreFilterPlugin,FilterPlugin,PreScorePlugin,ScorePlugin,PostBatchPlugin - Built-in plugins:
clusteraffinity,tainttoleration,clustereligibility,sameplacementaffinity - Placement strategies: PickAll (all matching), PickN (top N scored), PickFixed (named clusters)
- Plugins share state via
CycleStatePluginReadWriter
Snapshot-Based Versioning
All policy and resource changes create immutable snapshot CRDs (ResourceSnapshot, SchedulingPolicySnapshot, OverrideSnapshot). This enables rollback, change tracking, and consistent scheduling decisions.
Terminology
- Fleet: A collection of clusters managed together
- Hub Cluster: Central control plane cluster
- Member Cluster: A managed cluster in the fleet
- Hub Agent: Controllers on the hub for scheduling and placement
- Member Agent: Controllers on member clusters for applying workloads and reporting status
Code Conventions
- Follow the Uber Go Style Guide
- Favor standard library over third-party libraries
- PR titles must use a prefix:
feat:,fix:,docs:,test:,chore:,ci:,perf:,refactor:,revert:,style:,interface:,util:, or[WIP] - Always add an empty line at the end of new files
- Run
make reviewablebefore submitting PRs
Controller Pattern
All controllers embed client.Client, use a standard Reconcile loop (fetch → check deletion → apply defaults → business logic → requeue), update status via the status subresource, and record events. Error handling uses categorized errors (API Server, User, Expected, Unexpected) for retry semantics. See existing controllers in pkg/controllers/ for reference.
API Interface Pattern
Resources implement Conditioned (for status conditions) and ConditionedObj (combining client.Object + Conditioned). See apis/interface.go.
Testing Conventions
- Unit tests:
<file>_test.goin the same directory; table-driven style - Integration tests:
<file>_integration_test.go; use Ginkgo/Gomega withenvtest - E2E tests:
test/e2e/; Ginkgo/Gomega against Kind clusters - Do not use assert libraries; use
cmp.Diff/cmp.Equalfromgoogle/go-cmpfor comparisons - Use
want/wanted(notexpect/expected) for desired state variables - Test output format:
"FuncName(%v) = %v, want %v" - Compare structs in one shot with
cmp.Diff, not field-by-field - Mock external dependencies with
gomock - When adding Ginkgo tests, add to a new
Context; reuse existing setup
Collaboration Protocol
Domain Knowledge
Refer to .github/.copilot/domain_knowledge/ for entity relationships, workflows, and ubiquitous language. Update these files as understanding grows.
Specifications
Use .github/.copilot/specifications/ for feature specs. Ask which specifications apply if unclear.
Breadcrumb Protocol
For non-trivial tasks, create a breadcrumb file at .github/.copilot/breadcrumbs/yyyy-mm-dd-HHMM-{title}.md to track decisions and progress. Update it before and after code changes, and get plan approval before implementation. See existing breadcrumbs for format examples.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

