Skip to content
Back to skills

Deploy

ASecurity

Deliver the app — write a minimal Dockerfile and compose file with a healthcheck when they are missing, register the environment, run `spectoflow deliver` (build, up --wait, health check, smoke test) and fix what fails.

  • 2 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added December 4, 2026
developmentpythongoshellsqlnodedockergitdatabase

Works with

  • cli

Security analysis

A100/100

Scanned December 4, 2026

npx -y skills add georgesmomo/spectoflow --skill deploy --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Deploy?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Deploy
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/georgesmomo-deploy/badge)](https://www.skillsdirectory.com/skills/georgesmomo-deploy)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: deploy
description: Deliver the app — write a minimal Dockerfile and compose file with a healthcheck when they are missing, register the environment, run `spectoflow deliver` (build, up --wait, health check, smoke test) and fix what fails.
capability: operations
inputs: The built and tested project (its stack is on the project card), where to deliver (this machine's Docker, or a VPS the user named), and any Dockerfile / compose file already there.
outputs: A Dockerfile + compose file (only when absent), an environment in `.spectoflow/config.json`, and a delivery result — healthy and smoke-tested, or the failure code with its cause.
standard: Docker build best practices + Compose healthchecks (docs.docker.com), The Twelve-Factor App
---
# Deploy

Get the project from "the code is written" to "it runs, is healthy and answers" — in Docker on this machine, or on
the user's VPS — and prove it with `spectoflow deliver`, never with your own word.

## When to use
When the workflow reaches the **Deliver** step, or the user asks to run the app locally, "put it online", "deploy
it" or "ship it". The target comes from the run's `target` fact (`local` or `vps`) or from the request. Platforms have
their own skills (modules `coolify`, `dokploy`, `vercel` — `spectoflow add vercel`): use that one. Any other platform (Fly, a
cloud): say it is not supported yet and stop.

## Method
1. **Look first.** Read the project card (`.spectoflow/memory.md`, section Project: stack, Run, Build lines), then
   `spectoflow env` (what is configured and the last delivery) and any `Dockerfile`, `compose.y*ml`,
   `docker-compose.y*ml`, `.dockerignore` already in the project. Reuse what exists; change it only to make it
   pass the delivery. If everything is there and `spectoflow env` shows an environment, go to step 5.
2. **Dockerfile, only when absent.** Smallest image that runs the app, chosen from the card's stack (Docker
   build best practices): a pinned official base image of the project's runtime version (`node:22-alpine`,
   `python:3.12-slim`, `golang:1.23-alpine` build stage + `alpine`/`distroless` run stage, `nginx:alpine` for a
   static site); copy the dependency manifest first and install, then copy the source (layer cache); a
   multi-stage build when there is a compile step; run as a non-root user; `EXPOSE` the port; `CMD` in exec
   form; the server listens on `0.0.0.0` and reads its port from `PORT` (Twelve-Factor). Add a `.dockerignore`
   (`.git`, `node_modules`, `.env*`, `.spectoflow`, build output) — a secret or a 500 MB `node_modules` must
   never enter the build context.
3. **A health endpoint.** The app needs a cheap `GET /health` that answers `200` when it can serve (a database
   it needs reachable, nothing heavier). If it has none, add the smallest one and a test for it — this is a code
   change like any other. A static site is healthy on `/`.
4. **Compose file, only when absent.** One `app` service (`build: .`, `ports: ["3000:3000"]`, config in
   `environment:` read from the shell or an `env_file` that is git-ignored — never a secret written into the
   file) **with a `healthcheck`**, because `docker compose up --wait` waits for it. Use a tool the image
   has: `wget -qO- http://127.0.0.1:3000/health` on Alpine, `python -c "import urllib.request as u; u.urlopen('http://127.0.0.1:8000/health')"`
   on a slim Python image, `curl -f` only if the image has curl. Write `127.0.0.1`, not `localhost`: inside an
   Alpine image `localhost` resolves to `::1` first while the server listens on IPv4 only, so the check fails and
   `up --wait` reports the container unhealthy (found in a real delivery). `interval: 5s`, `timeout: 3s`, `retries: 10`,
   `start_period: 10s`. A database or cache is a second service with its own healthcheck and a named volume;
   `app` gets `depends_on: { db: { condition: service_healthy } }`.
   Data the app keeps in a file (SQLite, uploads) lives in a named volume or a mounted folder, never in the container's own layer.
   **It must start from what is in the project.** Every variable has a working default, or the app creates what it needs at
   first start (a generated secret, kept in the data volume). An `env_file` is written `- path: .env` with `required: false`:
   the default policy forbids you to write `.env`, so a stack that only starts with a file nobody created is not delivered
   (found in a real run: the agent deleted its `.env` to obey the policy and the stack could no longer restart). A secret the
   user must choose goes in `.env.example`, and you say how to copy it — the app still starts without it.
5. **Register the environment.** Local: `spectoflow env add local --url=http://localhost:<published port> --health=/health`.
   VPS: only with the host, login and folder **the user gave you** (`spectoflow env add vps --host=… --user=…
   --path=/srv/app --url=https://…`) — never guess them, never put a password or key anywhere (ssh uses the
   user's own agent). The VPS is production: it is behind the policy gate, so say so and wait for the approval.
6. **Deliver.** Run `spectoflow deliver --env=<name>` and read the verdict. Stream nothing else: the command
   builds, brings the stack up with `--wait`, checks health, runs the smoke test (the project's Playwright
   `*smoke*.spec.*` if it has one — offer to write one with the `write-e2e-tests` skill when the app has a real
   user flow — otherwise an HTTP 200 with a body).
7. **On failure, act on the code** (it is in the output; `--json` gives it too):
   - `docker-missing`, `docker-daemon`, `compose-missing`, `ssh-missing`, `rsync-missing`, `ssh-failed`: not
     something to fix in the code. Report it plainly with the one thing the user must do, and stop.
   - `no-compose-file`: write it (step 4) or point the environment at the right file.
   - `build-failed`: read the output tail; fix the Dockerfile or the build script; run again.
   - `up-failed`, `health-failed`: read the container logs that came back; the usual causes are a server bound
     to `127.0.0.1` instead of `0.0.0.0`, a published port that differs from the one the app listens on, a wrong
     health path, a missing environment variable, a database that is not ready. Fix, run again.
   - `smoke-failed`: the app is up but the page is wrong or empty; fix the app, run again.
   At most **three** attempts for the same code; then report `blocked` with the last output instead of looping.
8. **Leave nothing hidden.** The stack stays running so the user can open the url. Do not run
   `docker compose down -v`, `docker system prune` or anything that deletes volumes or images you did not
   create, and do not touch an environment the user did not ask for.

## Output contract
Files: `Dockerfile`, `.dockerignore`, the compose file (only the ones that were absent or had to change),
and `.spectoflow/config.json` → `environments` (through `spectoflow env add`, never by hand). The proof is the last
`spectoflow deliver` run (kept in `runtime.delivery`, shown in the dashboard). Report with the sentinel:

```
::spectoflow role=operations kind=progress msg=<what you are doing: writing the Dockerfile / delivering to local>
::spectoflow role=operations kind=artifact msg=<path of each file you wrote>
::spectoflow role=operations kind=summary msg=<delivered to local at http://localhost:3000, healthy, smoke ok — or the code and the cause>
```

A delivery that did not end healthy is never reported as done: end with `REJECTED: <code> — <one-line cause>`.

## Quality bar
- [ ] `spectoflow deliver` exited 0 in this session (not an earlier one).
- [ ] The compose file has a healthcheck, and the environment has a url and a health path.
- [ ] The stack starts from a fresh clone: no file it needs is missing, no variable has no default (`docker compose up` works after `rm .env`).
- [ ] No secret in the Dockerfile, the compose file, the image or `config.json`; `.env*` is in `.dockerignore`
      and `.gitignore`.
- [ ] Base image pinned to a version, non-root user, exec-form `CMD`, the app listens on `0.0.0.0:$PORT`.
- [ ] Nothing was deleted that the delivery did not create; a VPS was touched only with the user's approval.

## References
- Docker, "Building best practices" — https://docs.docker.com/build/building/best-practices/
- Docker, Compose file reference, `healthcheck` — https://docs.docker.com/reference/compose-file/services/#healthcheck
- Docker, `docker compose up --wait` — https://docs.docker.com/reference/cli/docker/compose/up/
- Adam Wiggins, "The Twelve-Factor App" — https://12factor.net/

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.