From ring-dev-team
Migrates Lerian Go services from static .env/YAML config to lib-systemplane hot-reloadable runtime config client. Orchestrates an 11-gate migration cycle.
How this skill is triggered — by the user, by Claude, or both
Slash command
/ring-dev-team:migrating-to-lib-systemplaneThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
- User requests systemplane integration for a Go service
You orchestrate. Agents implement. NEVER use Edit/Write/Bash on Go source files.
All code changes go through Task(subagent_type="ring:backend-go").
TDD mandatory for all implementation gates (RED → GREEN → REFACTOR).
Three-step lifecycle:
systemplane.NewPostgres / systemplane.NewMongoDB — construct client (pass open *sql.DB or *mongo.Client)client.Register(namespace, key, defaultValue, opts...) — declare every key BEFORE Startclient.Start(ctx) — begin listening; Get* for reads, OnChange for reactionsStandards reference: WebFetch https://raw.githubusercontent.com/LerianStudio/lib-systemplane/main/doc.go
Canonical import paths:
| Alias | Import Path | Purpose |
|---|---|---|
systemplane | github.com/LerianStudio/lib-systemplane | Client, constructors, options, SchemaSQL() / DefaultSeedSQL() provisioning artifacts |
admin | github.com/LerianStudio/lib-systemplane/admin | HTTP admin routes |
systemplanetest | github.com/LerianStudio/lib-systemplane/systemplanetest | Contract test suite |
Legacy paths are DELETED — do not use lib-commons/v4/... or lib-commons/v5/commons/systemplane (extracted to its own module), and do not use Supervisor, BundleFactory, ApplyBehavior.
Provisioning is migration-only. lib-systemplane publishes systemplane.SchemaSQL() + systemplane.DefaultSeedSQL() as public artifacts and consumers MUST fold them into the service's own SQL migration pipeline via the make systemplane-ddl generator pattern (Gate 3.5). Runtime DDL provisioning is FORBIDDEN — least-privilege tenant-manager roles cannot run DDL anyway, and any boot-time runSchema-style hook is a CRITICAL deviation.
Scope: operational knobs only — values that can mutate in-place (log levels, feature flags, rate limits, timeouts, poll intervals). NOT for settings requiring resource teardown: DSNs, TLS material, listen addresses → keep in env vars + restart.
Redaction policies for Register:
| Policy | Admin GET returns | Use for |
|---|---|---|
RedactNone (default) | Raw value | Log levels, feature flags, non-sensitive |
RedactMask | Type-aware mask | Low-sensitivity values |
RedactFull | null/omitted | Secrets, tokens, API keys |
Any key storing credentials MUST use RedactFull.
Admin mount requires custom authorizer (admin.WithAuthorizer) — default is DENY-ALL.
Mandatory agent instruction (include in EVERY dispatch):
WebFetch
https://raw.githubusercontent.com/LerianStudio/lib-systemplane/main/doc.go. Use only canonicalgithub.com/LerianStudio/lib-systemplaneimport paths. v4 packages and the legacylib-commons/v5/commons/systemplanepath no longer exist. systemplane is for operational knobs only — not DSNs, TLS, or listen addresses. Provisioning is migration-only (Gate 3.5). Wirecmd/generate-systemplane-ddl/+make systemplane-ddl+check-systemplane-ddl-drift+migrations/systemplane_ddl_manifest.jsonand a bootstrap seam returning[]SystemplaneSeedEntry. NEVER callSchemaSQL()at boot. NEVER hand-edit generatedmigrations/NNN_systemplane_*.sql. See multi-tenant.md §27 "Cold-tenant resolution" for the canonical reference. TDD: RED → GREEN → REFACTOR for every gate.
MULTI_TENANT_ENABLED=true), the consumer-side pattern (registration shape, no-fallback consumer reads, DI interface, make systemplane-ddl provisioning generator, Manager binding when available in the pinned lib version) is documented in dev-team/docs/standards/golang/multi-tenant.md §27 "Systemplane in MT mode — compliance pattern (MANDATORY)". Load that section — particularly the "Cold-tenant resolution — make systemplane-ddl generator" subsection — in addition to the general systemplane architecture below.| Gate | Name | Condition | Agent |
|---|---|---|---|
| 0 | Stack Detection + Compliance Audit | Always | Orchestrator |
| 1 | Codebase Analysis (config focus) | Always | ring:codebase-explorer |
| 1.5 | Implementation Preview | Always | ring:visualizing |
| 2 | lib-commons v5 Upgrade + v4 Removal | Skip only if v5 in go.mod AND zero v4 imports | ring:backend-go |
| 3 | Client Construction + Key Registration | Always | ring:backend-go |
| 3.5 | DDL Provisioning (make systemplane-ddl) | Always — STANDARD provisioning mechanism | ring:backend-go |
| 4 | OnChange Subscriptions | Always unless zero hot-reloadable keys (justify) | ring:backend-go |
| 5 | Config Bridge | Skip if no Config struct reads need live values | ring:backend-go |
| 6 | Admin HTTP Mount + Authorizer | Skip only if service has no admin surface (justify) | ring:backend-go |
| 7 | Wiring + Lifecycle + Backward Compat | Always — NEVER skippable | ring:backend-go |
| 8 | Tests | Always | ring:backend-go |
| 9 | Code Review | Always | 9 defaults + triggered specialists in parallel |
| 10 | User Validation | Always | User |
| 11 | Activation Guide | Always | Orchestrator |
Gates execute sequentially. Any existing v4 code = NON-COMPLIANT = gates cannot be skipped.
Orchestrator executes directly. Three phases:
Phase 1: Stack Detection
grep "lib-commons\|lib-systemplane" go.mod # check legacy v4/v5 paths vs new module
grep -rn "systemplane" internal/ # existing usage
grep -rn "SYSTEMPLANE_" . # v4 env vars
grep "postgresql\|postgres" go.mod # backend type
grep "mongodb\|mongo" go.mod
# Non-canonical:
grep -rn "fsnotify\|viper.Watch\|Supervisor\|BundleFactory\|ApplyBehavior" internal/
grep -rn "lib-commons/v5/commons/systemplane\|lib-commons/v4" internal/ # legacy paths
# DDL provisioning seam + manifest (Gate 3.5):
ls cmd/generate-systemplane-ddl/ # generator presence
ls migrations/systemplane_ddl_manifest.json # append-only manifest
grep -n "systemplane-ddl\|check-systemplane-ddl-drift" Makefile # make targets
grep -rn "SystemplaneSeedEntries\|buildSystemplaneRegistrations" internal/bootstrap/ # seam
# Runtime DDL anti-pattern (CRITICAL):
grep -rn "runSchema\|SchemaSQL()\|CREATE TABLE.*systemplane_entries" internal/ # MUST be migration-only
Phase 2: Compliance Audit (if systemplane code detected)
lib-commons/v4/..., lib-commons/v5/commons/systemplane)Register called before StartOnChange wired for hot-reloadable keysadmin.Mount with admin.WithAuthorizerclient.Start(ctx) registered with commons.Launchercmd/generate-systemplane-ddl/ generator present AND migrations/systemplane_ddl_manifest.json committedmake systemplane-ddl + check-systemplane-ddl-drift wired in Makefile and called from check-generated-artifactsSystemplaneSeedEntries() ([]SystemplaneSeedEntry, error) derived from the same buildSystemplaneRegistrations (or equivalent) the client uses at bootrunSchema, no SchemaSQL() at boot, no CREATE TABLE ... systemplane_entries outside migrations/Phase 3: Non-Canonical Detection
fsnotify / viper.WatchConfig / envconfig.Watch for runtime config → MUST replacedomain/, ports/, registry/, service/, bootstrap/) → MUST removelib-commons/v5/commons/systemplane imports → MUST migrate to lib-systemplaneSchemaSQL() execution) → MUST replace with the make systemplane-ddl migration pipeline (Gate 3.5)migrations/NNN_systemplane_*.sql files NOT emitted by the generator → MUST be re-emitted via make systemplane-ddl (drift-guarded)| Severity | Criteria |
|---|---|
| CRITICAL | Legacy import (lib-commons/v4/... or lib-commons/v5/commons/systemplane); admin.Mount without authorizer; secret with RedactNone; runtime DDL provisioning (boot-time SchemaSQL() or CREATE TABLE systemplane_entries outside migrations/) |
| HIGH | No Register before Start; no OnChange for live key; SYSTEMPLANE_* env vars in code; missing cmd/generate-systemplane-ddl/ generator or systemplane_ddl_manifest.json; make systemplane-ddl not wired into check-generated-artifacts |
| MEDIUM | Missing WithLogger/WithTelemetry; no validator on numeric range; hand-edited generated migrations/NNN_systemplane_*.sql (would fail the drift guard) |
| LOW | Missing WithDescription; inconsistent namespace naming |
npx claudepluginhub p/lerianstudio-ring-dev-team-dev-teamAudits Go services for hot-reload runtime-config opportunities with lib-systemplane (Postgres LISTEN/NOTIFY or MongoDB change streams). Sweep mode detects DIY patterns; reference mode catalogs client lifecycle.
Guides system migrations and technology transitions using strategies like Strangler Fig, Big Bang, Parallel Run, and Branch by Abstraction, with plans for JS to TS, REST to GraphQL, monolith to microservices, and zero-downtime data migration.
Plans zero-downtime data and system migrations with rollback procedures, validation checks, and execution timeline. Useful for database restructures, provider switches, and infrastructure moves.