AGENT SKILL

rust-deployable-service

Use when preparing, containerizing, configuring, testing, or reviewing Rust services for deployment, especially Docker multi-stage builds, runtime configuration, environment overrides, secrets, health checks, SQLx offline builds, release profiles, image-size reduction, or production startup validation.

License 许可
MIT
最近更新
2026-06-26
Stars
★ 0
Forks
0

01 前言 Front Matter

name
rust-deployable-service
license
MIT
metadata
{ "tags": "rust,deployment,docker,configuration,sqlx", "version": "0.1.0", "category": "Rust", "displayName": "Rust Deployable Service" }
description
Use when preparing, containerizing, configuring, testing, or reviewing Rust services for deployment, especially Docker multi-stage builds, runtime configuration, environment overrides, secrets, health checks, SQLx offline builds, release profiles, image-size reduction, or production startup validation.
compatibility
Codex, Claude Code, and other Agent Skills-compatible clients.

02 资源文件 4

03 SKILL.md 正文

Rust Deployable Service

Use this skill when a Rust service needs to move from local development to a repeatable container or cloud deployment. Keep runtime configuration explicit, builds reproducible, and health checks boring.

Core Workflow

  1. Inspect Cargo.toml, workspace layout, Dockerfile, .dockerignore, config files, migrations, .sqlx/, CI, and deployment docs.
  2. Identify the binary entrypoint and runtime dependencies: database, Redis, external APIs, TLS roots, static files, templates, migrations, and config.
  3. Separate build-time and runtime configuration. Never bake production secrets into images.
  4. Use hierarchical config with environment overrides for deployment-specific values.
  5. Use a multi-stage Docker build and copy only the runtime binary and needed assets into the final image.
  6. Account for SQLx query checking. Use SQLX_OFFLINE=true with checked-in .sqlx/ metadata or provide a build-time database intentionally.
  7. Add health and readiness checks that match real dependencies.
  8. Run the bundled Docker preflight or the repository's equivalent CI command.

Configuration Rules

Read references/configuration.md when adding config files, environment variables, or secret handling.

  • Keep local defaults convenient and production defaults conservative.
  • Validate config at startup before binding the server when possible.
  • Store secrets in environment variables or the deployment secret manager.
  • Avoid reading environment variables deep inside handlers or repositories.

Docker Rules

Read references/docker-rust.md before changing Docker builds.

  • Use dependency caching deliberately; avoid invalidating the whole build on every source edit when practical.
  • Use --locked for release builds if the repo commits Cargo.lock.
  • Include CA certificates when outbound HTTPS is required.
  • Copy migrations, templates, and static assets only if the binary needs them at runtime.
  • Run as a non-root user when the deployment platform supports it.

Verification

Run from the Rust project root when Docker is part of the delivery path:

path/to/rust-deployable-service/scripts/docker-preflight.sh

The script builds an image. It only runs a smoke command when RUST_DEPLOY_SMOKE_COMMAND is set, because services often need environment and infrastructure to start successfully.

Reference Files

  • references/configuration.md: typed config loading, overrides, validation, and secrets.
  • references/docker-rust.md: multi-stage builds, SQLx offline builds, runtime assets, and image checks.

04 同仓库更多 Skills

ConcertoNotes
ConcertoNotes/codex-plugins

android-emulator-qa

Use when validating Android feature flows in an emulator with adb-driven launch, input, UI-tree inspection, screenshots, and logcat capture.

★ 0
ConcertoNotes
ConcertoNotes/codex-plugins

supabase-postgres-best-practices

Postgres performance optimization and best practices from Supabase. Use this skill when writing, reviewing, or optimizing Postgres queries, schema designs, or database configurations.

★ 0
ConcertoNotes
ConcertoNotes/codex-plugins

sentry

Use when the user asks to inspect Sentry issues or events, summarize recent production errors, or pull basic Sentry health data via the Sentry API; perform read-only queries with the bundled script and require `SENTRY_AUTH_TOKEN`.

★ 0
ConcertoNotes
ConcertoNotes/codex-plugins

render-workflows

Sets up, develops, tests, and deploys Render Workflows. Covers first-time scaffolding (via CLI or manual), SDK installation (Python or TypeScript), task patterns (retries, subtasks, fan-out), local development, Dashboard deployment, and troubleshooting. Use when a user wants to set up Render Workflows for the first time, scaffold a workflow service, add or modify workflow tasks, test workflows locally, or deploy workflows to Render.

★ 0
ConcertoNotes
ConcertoNotes/codex-plugins

render-web-services

Configures Render web services—port binding, TLS, health checks, custom domains, auto-deploy, PR previews, persistent disks, and deploy lifecycle. Use when the user needs to set up a web service, fix health check failures, add a custom domain, configure zero-downtime deploys, or troubleshoot port binding issues.

★ 0
ConcertoNotes
ConcertoNotes/codex-plugins

render-static-sites

Deploys and configures static sites on Render's global CDN—build commands, publish paths, SPA routing, redirects, custom headers, and PR previews. Use when the user needs to deploy a static site, set up a React/Vue/Hugo/Gatsby frontend, configure SPA fallback routing, add redirect rules, customize response headers, or choose between a static site and a web service for their frontend. Trigger terms: static site, CDN, SPA, single-page app, React deploy, Vue deploy, Hugo, Gatsby, Docusaurus, Jekyll, staticPublishPath.

★ 0