From sealos
Converts Docker Compose files and installation docs into Sealos/Kubernetes templates with role-specific resource sizing. Useful when migrating from Docker Compose to Sealos or needing a Kubernetes template.
How this skill is triggered — by the user, by Claude, or both
Slash command
/sealos:docker-to-sealosThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Convert Docker Compose files or installation docs into production-grade Sealos templates.
references/conversion-mappings.mdreferences/database-templates.mdreferences/example-guide.mdreferences/frappe-bench.mdreferences/must-rules-map.yamlreferences/rules-registry.yamlreferences/runtime-log-hygiene.mdreferences/sealos-specs.mdscripts/check_consistency.pyscripts/check_consistency_context.pyscripts/check_consistency_engine.pyscripts/check_consistency_helpers_storage.pyscripts/check_consistency_helpers_violations.pyscripts/check_consistency_helpers_workload.pyscripts/check_consistency_line_locator.pyscripts/check_consistency_models.pyscripts/check_consistency_parser.pyscripts/check_consistency_registry.pyscripts/check_consistency_rule_helpers.pyscripts/check_consistency_rule_registry.pyConvert Docker Compose files or installation docs into production-grade Sealos templates. Execute end-to-end automatically (analysis, conversion, validation, output) without asking users for missing fields.
Use the following precedence to prevent rule drift:
SKILL.md MUST rules (this file)references/sealos-specs.md and references/database-templates.mdreferences/conversion-mappings.md and references/example-guide.mdIf lower-priority references conflict with higher-priority MUST rules, update the lower-priority files. Do not keep conflicting examples.
Extract from Docker Compose/docs:
Infer and normalize:
Generate resources in this order:
Apply field-level mappings from references/conversion-mappings.md, including:
scripts/path_converter.py)*_DATABASE_URL, *_DB_URL), when Kubeblocks endpoint is host:port, inject host/port/username/password via approved secretKeyRef envs and compose the final URL with $(VAR) expansion/etc/nginx/ssl, /etc/ssl, /certs) unless official Kubernetes docs explicitly require HTTPS backend-to-service trafficws://, wss://, CDP/Chrome DevTools, a game socket, or a WebSocket-named port/service, expose it with WebSocket nginx ingress annotationsspec.serviceName and keep the workload, Service, root Ingress, and manager identity aligned; preserve documented HA/headless governing Services and expose them through a separate public application Servicescripts/compose_to_template.py --kompose-mode always as deterministic conversion entrypoint (require kompose for reproducible workload shaping)deploy.replicas values as the topology baselineCluster resources. Do not convert PostgreSQL/MySQL/MongoDB/Redis/Kafka Compose database services into raw Kubernetes Deployment or StatefulSet workloads.references/database-templates.md.postgres), the init Job must wait for PostgreSQL readiness before execution and create the target database idempotently.initContainers and init/migration/bootstrap Jobs for readiness and bootstrap gates.NOAUTH or Authentication required when credentials are not needed for readiness.DO $$ blocks in inline shell commands when a guard query can express the same logic.psql -c "..." for :'var' variable interpolation. Use psql -v name=value <<'SQL' ... :'name' ... SQL or pass already-safe literal SQL.Always produce:
template/<app-name>/index.yamltemplate/<app-name>/logo.<ext> when official icon is resolvable, prioritizing square/circular icon-first artwork and avoiding rectangular wordmark/text logosNever create:
template/<app-name>/README.mdtemplate/<app-name>/README_zh.mdREADME authoring is out of scope for this skill. If the Template CR requires README URLs, populate URL fields in index.yaml only and leave file creation to a dedicated README skill.
Run validator and self-tests before delivering template output. If validation fails, fix template/rules/examples first. For web applications, live validation must include runtime log hygiene: inspect init and main container logs after first readiness, after login or setup, and after one random missing-path HTTP request. Recurring traceback-style warnings are template failures even when pods are Ready. For login-gated web applications, live validation must prove the real credential/session flow with one authenticated API or page before resource tuning or cleanup. For managed or private object storage, live validation must upload known bytes through the authenticated application flow, read or download the object, compare its SHA-256 digest, confirm delivery through the application proxy or a time-bounded presigned URL, and verify the raw anonymous object request remains restricted. Optional object storage must validate the local-storage and managed-bucket branches independently.
metadata.name must be hardcoded lowercase; do not use ${{ defaults.app_name }}.metadata.name.title, url, gitRepo, author, description, icon, templateType, locale, i18n, categories).spec.readme must point to https://raw.githubusercontent.com/labring-actions/templates/kb-0.9/template/<app-name>/README.md.spec.i18n.zh.readme must point to https://raw.githubusercontent.com/labring-actions/templates/kb-0.9/template/<app-name>/README_zh.md.index.yaml only; this skill must not create or update the referenced README files.icon URL must point to template repo raw path for this app on kb-0.9 branch.template/<app-name>/logo.<ext> must use square/circular icon-first artwork (for example app icon/favicon/avatar), and must not use rectangular wordmark/text logos.i18n.zh.description must be written in Simplified Chinese.i18n.zh.title when it is identical to title.categories must only use predefined values (tool, ai, game, database, low-code, monitor, dev-ops, blog, storage, frontend, backend).spec.data.url.spec.displayType must be normal.spec.type must be link.spec.data.url must be the browser entry URL that succeeds from a fresh Sealos launch. For apps with safe-path, setup-path, or entrance-path behavior, verify the configured path and root path, then choose the URL that supports login or first-run setup without hidden prior navigation.Application error, server-side exception, Internal Server Error, or Unhandled Runtime Error text as a failed entry path even if the HTTP status is 2xx/3xx.spec.template in App resource.cloud.sealos.io/app-deploy-manager label value must equal resource metadata.name.metadata.labels.app label value must equal resource metadata.name for managed app workloads.metadata.name for managed app workloads; sidecar/helper containers may use distinct descriptive names.Service resources must define metadata.labels.app and metadata.labels.cloud.sealos.io/app-deploy-manager, and both labels must match spec.selector.app.ConfigMap resources must define metadata.labels.app and metadata.labels.cloud.sealos.io/app-deploy-manager, and both labels must match metadata.name; bootstrap-only ConfigMaps used only by init containers to copy initial config into persistent storage must not define either label.Service resources must use the same component name across metadata.name, metadata.labels.app, metadata.labels.cloud.sealos.io/app-deploy-manager, and spec.selector.app.Ingress resources (pathType: Prefix, path: /) must use the same component name across metadata.name, metadata.labels.cloud.sealos.io/app-deploy-manager, and backend service.name; non-root or non-Prefix Ingress rules may route to a different backend service.Ingress resources (pathType: Prefix, path: /) must use backend.service.port.number, and the number must match a declared spec.ports[*].port on the referenced application Service.spec.ports[*].name must be explicitly set (required for multi-port services).kubernetes.io/ingress.class, nginx.ingress.kubernetes.io/proxy-body-size, nginx.ingress.kubernetes.io/server-snippet, nginx.ingress.kubernetes.io/ssl-redirect, nginx.ingress.kubernetes.io/backend-protocol, nginx.ingress.kubernetes.io/client-body-buffer-size, nginx.ingress.kubernetes.io/proxy-buffer-size, nginx.ingress.kubernetes.io/proxy-send-timeout, nginx.ingress.kubernetes.io/proxy-read-timeout, nginx.ingress.kubernetes.io/configuration-snippet) with expected defaults.kubernetes.io/ingress.class, nginx.ingress.kubernetes.io/proxy-body-size, nginx.ingress.kubernetes.io/proxy-read-timeout, nginx.ingress.kubernetes.io/proxy-send-timeout, nginx.ingress.kubernetes.io/backend-protocol, nginx.ingress.kubernetes.io/ssl-redirect) with backend-protocol: WS and 3600 read/send timeouts.cloud.sealos.io/cronjob, cronjob-launchpad-name, and cronjob-type; cloud.sealos.io/cronjob must equal metadata.name, cronjob-launchpad-name must be "", and cronjob-type must be image.livenessProbe, readinessProbe, and (for slow bootstrap apps) startupProbe, aligned with official endpoints/commands.runAsNonRoot, runAsUser, runAsGroup, fsGroup, seccompProfile: RuntimeDefault, allowPrivilegeEscalation: false, capabilities.drop: [ALL]) unless the image requires root or extra capabilities.deploy.replicas values..sealos/topology-evidence/<app-name>.yaml as validator-only TopologyEvidence; final Sealos Template artifacts must stay free of topology validator metadata.RuntimeBundleEvidence YAML file during validation, while final Sealos Template artifacts stay free of runtime-bundle validator metadata.:latest.crane: prefer an explicit version tag (for example v2.2.0), and fallback to digest pin only when a deterministic version tag is unavailable.:v2, :2.1, :stable); use an explicit version tag or digest.${VAR}, ${VAR:-default}); resolve to explicit tag or digest before emitting template artifacts.originImageName must match container image.template.spec.imagePullSecrets; when a registry-authenticated workload needs a pull Secret, it may reference only the app-scoped Secret ${{ defaults.app_name }}.sealos-deploy using local gh CLI credentials for private GHCR images; do not expose raw registry credential inputs in generated templates.imagePullPolicy: IfNotPresent.emptyDir.volumeClaimTemplates) where storage is needed.volumeClaimTemplates must keep standard workload labels such as app and cloud.sealos.io/app-deploy-manager, and omit only cloud.sealos.io/deploy-on-sealos from both StatefulSet metadata.labels and volumeClaimTemplates[].metadata.labels.volumeClaimTemplates[].metadata must include a path-derived name, annotations.path, and annotations.value: '1', and each claim must match a container volumeMount with the same name and path.<= 1Gi unless source spec explicitly requires less.scripts/path_converter.py), including /, -, ., and other special characters.metadata.name == workload.metadata.name.<workload-name>-cm, and every ConfigMap data key must be mounted as its own volumeMount with subPath exactly equal to that key.defaultMode unless the application explicitly needs a non-default mode. ConfigMap scripts invoked through /bin/sh /path/script do not need executable bits.command/args; place initialization/start scripts in ConfigMap files and invoke them with a short command.ObjectStorageBucket or S3 input for that feature.ObjectStorageBucket resources for the documented bucket topology and inject Sealos object-storage secrets.ObjectStorageBucket must use it as the sole object-store data plane and omit bundled MinIO server workloads, Services, Ingresses, PVCs, and local object-storage credentials.ObjectStorageBucket with bundled minio/minio, bitnami/minio, or bitnamilegacy/minio server images.metadata.annotations.docker-to-sealos.object-storage-compatibility-proxy-source as a credential-free HTTPS source URL or user-request:<reference>, remain stateless, and omit persistent volumes.metadata.annotations.docker-to-sealos.external-object-storage-source as a credential-free HTTPS source URL or user-request:<reference>, and must not coexist with ObjectStorageBucket.env[].value.${{ random(n) }} is invalid for hex- or encoding-constrained values.endpoint, host, port, username, password) from approved Kubeblocks database secrets via env[].valueFrom.secretKeyRef; exception: Redis host/port may use Sealos Redis Service FQDN and 6379 when the Redis secret only exposes credentials, and MongoDB host/port or connection URLs may use the Sealos MongoDB Service FQDN plus 27017 when the MongoDB secret exposes credentials only.Secret references except approved Kubeblocks database secrets and object storage secrets.template.spec.imagePullSecrets; public images must not add pull secrets.Secret resources.https://${{ defaults.<host> }}.${{ SEALOS_CLOUD_DOMAIN }}; backend-to-backend variables use http://<service>.$(SEALOS_NAMESPACE).svc.cluster.local:<port> or the fully rendered Service FQDN.config/default.json, PHP config files), create a ConfigMap containing the config file with the public URL set to https://${{ defaults.app_host }}.${{ SEALOS_CLOUD_DOMAIN }}, and mount it to the application's config directory. The ConfigMap must follow standard naming and label conventions.postgres), include ${{ defaults.app_name }}-pg-init Job and implement startup-safe/idempotent creation logic (readiness wait + existence check before create).command/args must stay close to the image's official entrypoint. Keep only official startup commands, Compose-native args, or a short exec wrapper; move file preparation, permission repair, database bootstrap, and compatibility self-healing into initContainers, Jobs, or ConfigMap scripts.exec the final process so signal handling remains correct.DO $$ blocks.psql -c must not contain :'var' psql variable syntax; use heredocs for SQL that needs -v interpolation.Cluster resources, not application Deployment or StatefulSet workloads. StatefulSet is allowed for stateful application components only, never for PostgreSQL/MySQL/MongoDB/Redis/Kafka database services.initContainers and init/migration/bootstrap Jobs for readiness and bootstrap gates.postgresql-16.4.0.apps.kubeblocks.io/v1alpha1.${{ defaults.app_name }}-pg.app.kubernetes.io/instance and app.kubernetes.io/managed-by labels.Cluster must include kb.io/database, sealos-db-provider-cr, and clusterdefinition.kubeblocks.io/name labels; sealos-db-provider-cr must equal metadata.name so dbprovider can list and classify the database. Related Pods, Services, and OpsRequests should carry app.kubernetes.io/instance=<database name> for detail views.kb.io/database: postgresql-16.4.0, clusterdefinition.kubeblocks.io/name: postgresql, clusterversion.kubeblocks.io/name: postgresql-16.4.0, clusterVersionRef: postgresql-16.4.0, disableExporter: true, enabledLogs: [running], switchPolicy.type: Noop, serviceAccountName).componentDef: mongodb, serviceVersion: 8.0.4, labels kb.io/database and app.kubernetes.io/instance).kb.io/database: ac-mysql-8.0.30-1, clusterDefinitionRef: apecloud-mysql, clusterVersionRef: ac-mysql-8.0.30-1, tolerations: []).componentDef: redis-7, componentDef: redis-sentinel-7, serviceVersion: 7.2.7, main data PVC 1Gi, topology replication).limits(cpu=500m,memory=512Mi) and requests(cpu=50m,memory=51Mi) unless source docs explicitly require otherwise.limits.cpu only 100m/200m/500m/1/2/3/4/8, limits.memory only 128Mi/256Mi/512Mi/1024Mi/2048Mi/4096Mi/8192Mi/16384Mi, and requests must be derived from limits by dropping the last numeric digit (500m→50m, 512Mi→51Mi, 1→100m, 1024Mi→102Mi, 4096Mi→409Mi). Do not invent non-ladder values, and never use 2G/4G/8G/16G because Sealos Template API quota preview can parse bare G memory as 0.ephemeral-storage resource fields during existing-template updates unless runtime evidence identifies ephemeral storage pressure; preserve the original requests/limits values while tuning CPU and memory.${{ defaults.app_name }}-mongo-mongodb-account-root (or ${{ defaults.app_name }}-mongodb-mongodb-account-root when the MongoDB cluster name uses -mongodb)${{ defaults.app_name }}-redis-redis-account-default (legacy ${{ defaults.app_name }}-redis-account-default may be accepted for backward compatibility)${{ defaults.app_name }}-broker-account-adminUnless source docs explicitly require otherwise, use this lightweight app ladder entry as the initial personal low-load candidate:
cpu=200m, memory=256Micpu=20m, memory=25MirevisionHistoryLimit: 1automountServiceAccountToken: false by default; set it to true only when the application has explicit Kubernetes API/service account token requirements, evidenced by Kubernetes integration settings, serviceAccountName, or a sealos.io/service-account-token-reason workload annotation.Static generation cannot prove the final resource tier. Complete live resource validation before treating the candidate as the final template value.
Apply the resource ladder independently to every application main container, sidecar, initContainer, and Job:
OOMKilled terminations, restarts, readiness flaps, or resource-related timeouts.limits(cpu=200m,memory=1024Mi) with derived requests(cpu=20m,memory=102Mi), then test adjacent ladder tiers under the same acceptance contract.defaults for generated values (app_name, app_host, random passwords/keys).inputs only for truly user-provided operational values (email/SMTP/external API keys, etc.).spec.inputs as required inputs with no default field, pass them as direct env values, and apply them through the application's documented bootstrap or initialization path. Keep database credentials on KubeBlocks secrets.${{ inputs.<name> }} reference in a template artifact must have a matching spec.inputs.<name> declaration in the same Template CR.spec.defaults.<name>.value and every present spec.inputs.<name>.default in a Template CR must deserialize as a YAML string, regardless of the declared input type; quote numeric-, boolean-, and null-like scalars, while omitting default remains valid for required inputs.inputs.description must be in English.inputs[*].default values must satisfy the application's documented startup validation. For admin/bootstrap passwords with complexity rules, do not use '', weak examples, or bare ${{ random(n) }} because generated characters may not include required classes; include deterministic required classes around the random segment, for example "AppName@${{ random(16) }}!1".enable_s3_storage) and test with inputs.<name> === 'true'. Resolve provider/backend/type/mode/driver selection during conversion and keep those selectors out of spec.inputs.Run all checks before final response:
python scripts/path_converter.py --self-testpython scripts/test_check_consistency.pypython scripts/test_compose_to_template.pypython scripts/test_check_must_coverage.pypython scripts/check_consistency.py --skill SKILL.md --references references --rules-file references/rules-registry.yamlpython scripts/check_consistency.py --skill SKILL.md --references references --rules-file references/rules-registry.yaml --artifacts template/<app-name>/index.yaml,.sealos/topology-evidence/<app-name>.yaml for existing-template updates and other topology-sensitive conversionspython scripts/check_must_coverage.py --skill SKILL.md --mapping references/must-rules-map.yaml --rules-file references/rules-registry.yamlpython scripts/quality_gate.py --artifacts /abs/path/template/<app-name>/index.yaml or DOCKER_TO_SEALOS_ARTIFACTS=/abs/path/template/<app-name>/index.yaml python scripts/quality_gate.py (without explicit artifacts, it scans template/*/index.yaml; set DOCKER_TO_SEALOS_ALLOW_EMPTY_ARTIFACTS=1 only for dev/debug without artifacts)sealos-deploy creates the app, verify the actual App URL, login/setup flow for web apps, recent logs, a random missing-path 404 without noisy traceback logs, expected database objects, and full resource footprint before reporting success.check_consistency.py is registry-driven. Keep references/rules-registry.yaml in sync with implemented rules.
Registry rule entries support severity and optional scope.include_paths metadata.
When conversion is complete, provide:
template/<app-name>/index.yaml)Do not create or output README content in this skill. README generation is delegated to another skill.
Load only needed references for current task:
references/sealos-specs.md
references/conversion-mappings.md
references/database-templates.md
references/frappe-bench.md
references/runtime-log-hygiene.md
references/example-guide.md
references/rules-registry.yaml
references/must-rules-map.yaml
rule or manual) for drift controlscripts/path_converter.py
scripts/compose_to_template.py
--kompose-mode auto|always|never (always is default) to reuse kompose convert workload shapestemplate/<app-name>/index.yamlscripts/test_compose_to_template.py
scripts/check_consistency.py
scripts/test_check_consistency.py
scripts/check_must_coverage.py
scripts/test_check_must_coverage.py
spec.data.url format; never use spec.template.spec.displayType: normal and spec.type: link; do not infer alternative enum values.ws://, wss://, CDP/Chrome DevTools, game socket, and WebSocket-named ports/services; use backend-protocol: WS with 3600 read/send timeouts.template/<app-name>/README.md or template/<app-name>/README_zh.md; only keep README URL references inside index.yaml when required by the template schema.bench, load references/frappe-bench.md before generating app workloads.npx claudepluginhub labring/sealos-skills --plugin sealosDeploys server, static-web, worker, scheduled-job, or remote-desktop workloads to Sealos Cloud from GitHub or local source. Invoked via /sealos-deploy.
Creates, edits, validates, and troubleshoots Zeabur template YAML files. Converts docker-compose to Zeabur template format. Builds and publishes Docker images for template use.
Provides production-ready Docker Compose templates with security hardening, resource limits, health checks, logging, monitoring, and high-availability for scalable deployments.