1---2name: deploy3description: Set up, validate, or run deployment for the current app on Cloudflare, a VPS, or a mixed architecture. Use when the user asks to deploy an app, configure deployment, set up CI/CD, choose a deployment target, document deployment, or fix deployment readiness.4---56# Deploy78## Input910- An app or service in the current repo, plus a target such as Cloudflare, VPS, or a mix of both.11- Use explicit input first; otherwise infer from context, config, docs, selected files, or branch.12- Safest default: define and document the deploy path before automating it.1314## Workflow15161. **Inspect the app**. Identify runtime, build command, start command, ports, env vars, storage, database, background jobs, and health checks.172. **Detect deploy path**. Read existing deploy docs, CI/CD, Dockerfiles, platform config, infra files, and package scripts.183. **Choose route**. Use Cloudflare, VPS, or mixed deployment based on app needs and user preference.194. **Plan setup if missing**. Confirm target, domain/DNS, environments, secrets, build, runtime, database/migrations, logs, monitoring, backups, rollback, and CI/CD trigger.205. **Apply best practices**. Prefer least-privilege secrets, HTTPS, non-root processes where applicable, firewall or platform access controls, health checks, logs, rollback path, and documented env vars.216. **Configure deployment**. Add or update platform config, CI/CD, Docker/systemd/service files, scripts, and docs using repo conventions.227. **Validate**. Run local checks, build, deploy dry run where available, smoke test, health check, logs check, and rollback notes.238. **Document**. Keep internal developer and operator deployment notes under `docs/development/`, such as `docs/development/deployment.md`, `docs/development/ci.md`, `docs/development/operations.md`, or `docs/development/environment.md`.2425## Output2627- Target and route chosen28- Config changed29- Secrets/env vars required30- CI/CD or manual deploy path31- Validation run32- Rollback and follow-up tasks3334## Examples3536- Cloudflare: Workers, Pages, DNS, routes, bindings, secrets, queues, D1, R2, KV, Durable Objects.37- VPS: SSH target, Docker or systemd, reverse proxy, firewall, TLS, logs, backups, restart policy.38- Mixed: Cloudflare DNS/proxy/access in front of a VPS app, or Workers edge in front of an origin service.3940## Guardrails4142- Do not deploy, mutate production, or change DNS without explicit user approval.43- Do not print or commit secrets.44- Do not assume platform-specific behavior; use official docs or available skills/tools for current platform details.45- For remote commands, resolve targets explicitly, prefer read-only probes first, and treat service restarts, migrations, DNS, firewall, and deletes as high-risk.46- If CI/CD is feasible, prefer repeatable deploys over one-off manual commands.