CLAUDE.mdis a symlink toAGENTS.md; they are always identical. EditAGENTS.md.
MeshSync is Meshery's Kubernetes cluster-state synchronization agent: a Go controller (not a Kubebuilder operator) that watches a cluster with dynamic informers, converts every discovered resource into a canonical model, and publishes it to Meshery Server over NATS (or to a file). Meshery Operator deploys one MeshSync instance per managed cluster (see meshery/meshery-operator's MeshSync CRD) and injects BROKER_URL.
make build- compilemain.gotobin/meshsyncmake run- start a local NATS container (make nats-run) then run MeshSync against it withDEBUG=truemake test-lint-runthengo test -failfast --short ./... -racemake lint-run-golangci-lint run ./...make coverage-report- unit tests with an HTML coverage report (cover.html)make integration-tests- full kind + NATS docker-compose cycle (integration-tests-setup->integration-tests-run->integration-tests-cleanup); see testing for sub-targets and single-test forms- Runtime verification against a live cluster (not just tests): use the
verifier-meshsyncskill (.claude/skills/verifier-meshsync/)
- MeshKit structured errors only. Every error is a builder over
github.com/meshery/meshkit/errorswith a unique code constant (^Err[A-Z].+Code$) - neverfmt.Errorf/errors.New("..."). Codes are allocated fromhelpers/component_info.json'snext_error_codeand are unique per packageerror.go(meshsync/error.go,internal/pipeline/error.go,internal/config/error.go)..github/workflows/error-codes-updater.ymlrunsmeshkit/cmd/errorutilon every push tomastertouching**.goand self-commits updated codes/exports - do not hand-allocate a code that utility would reassign. Full convention: errors. - Identifier naming - partial. Unlike
meshery-cloud, MeshSync's wire model (pkg/model.KubernetesResourceand siblings) is a local Go/GORM struct, not sourced fromgithub.com/meshery/schemas, and already mixescamelCaseandsnake_caseJSON tags. New fields follow the ecosystem's camelCase-wire contract; do not silently recase existing fields. Full rule and the migration path if this model is ever moved into schemas: naming conventions. - Deployment coupling. MeshSync's CLI flags, config schema (
internal/config), and theKubernetesResourcemodel are consumed by Meshery Operator (which deploys this binary) and Meshery Server (which consumes the broker stream). Coordinate flag/config/model changes with both repos; do not assume this repo alone defines the contract. - Pipeline stages are rebuilt per run.
internal/pipeline.Newconstructs fresh stages on every discovery and resync; never hoist stages or steps into shared package-level state - see architecture.
- Tests accompany every behavioral change. Run every locally-runnable test before requesting review; never defer runnable coverage to reviewers or follow-up PRs.
- Documentation accompanies every behavioral change, in both forms:
- External, user-facing: docs.meshery.io (source: meshery/meshery docs) - update whenever the change is user-visible.
- Internal, developer-facing: this repo's
docs/- update whenever architecture, workflows, or contracts change.
- Schema-aware changes: MeshSync's wire model is not yet sourced from
meshery/schemas(see naming conventions); if a change migrates or aligns a field with the schemas contract, runcd ../schemas && make validate-schemas && make consumer-auditbefore pushing. - Sign off every commit (
git commit -s). - No AI attribution in commits, PR descriptions, comments, or code.
- Architecture - discovery pipeline, output/dedup, channels, config, deployment topology
- Errors - MeshKit error convention and the errorutil workflow
- Naming conventions - the ecosystem identifier-casing contract and MeshSync's current divergence
- Testing - unit, integration, and runtime-verification commands
.claude/hooks/meshkit-errors.sh blocks net-new ad-hoc errors (fmt.Errorf/errors.New("...")) in any edited .go file - see Critical Rule 1. .claude/hooks/no-ai-attribution.sh blocks AI-attribution content in any tool call. .claude/hooks/session-start.sh provisions ../meshery-operator as a sibling on remote (web) sessions for the cross-repo checks in Critical Rule 3. .claude/skills/verifier-meshsync/ is the runtime-verification skill referenced under Commands.