Shuttle Scaffolding Instructions for Claude Code¶
Hand-scaffolded — no Kubebuilder, no operator-sdk.
Step 1: go mod init github.com/starform/shuttle
Step 2: Add dependencies:
go get sigs.k8s.io/controller-runtime@latest
go get k8s.io/api@latest k8s.io/apimachinery@latest k8s.io/client-go@latest
go get sigs.k8s.io/gateway-api@latest
Step 3: Create directory structure from §21.
Step 4: Scaffold each file with stubs (TODO bodies):
cmd/agent/main.go— Manager setup, scheme registration (corev1, appsv1, rbacv1, networkingv1, policyv1, gatewayv1), cache label filter, register 3 Runnables, signal handlerinternal/config/config.go— Config struct, LoadConfig() from env varsinternal/types/types.go— Snapshot, SnapshotBatch, CapacityReport, DesiredState, ClusterConfig, ServiceSpec structs with json tagsinternal/client/starbase.go— Client struct with PullDesiredState, PostSnapshots, PostCapacity method signaturesinternal/runner/desiredstate.go— DesiredStateRunnable with 30s ticker loop (TODO body)internal/runner/snapshot.go— SnapshotRunnable with 60s ticker loop (TODO body)internal/runner/capacity.go— CapacityRunnable with 60s ticker loop (TODO body)internal/apply/namespace.go— EnsureNamespace, EnsureServiceAccount, EnsureRBAC, EnsureNetworkPolicy, EnsureResourceQuota, EnsureLimitRange stubsinternal/apply/workload.go— EnsureDeployment, EnsureService, EnsureConfigMap, EnsureSecret, EnsurePodDisruptionBudget stubsinternal/apply/routing.go— EnsureHTTPRoute stubinternal/apply/garbage.go— GarbageCollect stub
Step 5: Add Dockerfile (multi-stage, distroless), Makefile, .gitignore, .dockerignore, README.md
Step 6: Add deploy/ manifests (rbac.yaml, deployment.yaml, servicemonitor.yaml) from
§22 RBAC and §28 resources.
Step 7: Verify: go mod tidy && go build ./... && go vet ./...
Claude Code must NOT: implement business logic, write tests, add CI/CD, use Kubebuilder/operator-sdk, define a Reconciler, add WAL/leader election/mTLS.