all-deploy
git clone https://github.com/Hainrixz/all-deploy
git clone --depth=1 https://github.com/Hainrixz/all-deploy ~/.claude/skills/hainrixz-all-deploy-all-deploy
SKILL.mdall-deploy
Detects, audits, and deploys projects to the right host with a confirmed preview → prod flow. The unique value is detect → audit → route to the right CLI, not wrapping the CLI.
Configuration (edit these lines to change default behavior)
CONFIRMATION_MODE: ask_at_start # ask_at_start (default): the skill asks at the start of each cloud deploy # whether to run full-auto or step-by-step. # full_auto: skip the question. Audit → preview → prod with a # 5-second ESC window before prod. # always_ask: skip the question. Require explicit "yes" before prod. VISUAL_VERIFY: false # true → screenshot preview via chrome-bridge-automation (frontend only) ALLOW_DIRTY_TREE: false # true → skip the "HEAD is clean" audit check
The default
ask_at_start works for both solo authors and community users — the mode choice moves to runtime. Pinning to full_auto or always_ask is only useful when wrapping the skill in automation that can't answer the question interactively.
Hard Rules (never violate — these are the safety contract)
- Never bypass or soften the audit. The audit is the only gate between the user's intent and live infra in
mode. If a check cannot run, that itself is a block, not a reason to skip.full_auto - Never deploy to prod before a successful preview with a 2xx/3xx health check. Preview → summary → prod. No prod without a green preview in the same session.
- Never commit, print, or log secrets. If a secret is found in tracked files, halt and guide removal + history rewrite as a separate user-approved step. Secret values never appear in summaries, logs, or commit messages.
- Never auto-install or auto-authenticate third-party CLIs. Hand the user the command with the
prefix (e.g.,!
,! vercel login
).! railway login - Never wrap a target CLI in a custom script that hides flags. Reference files document real commands the user can read and verify.
- Never modify code to make audit pass without showing the diff first.
,.gitignore
, Dockerfile scaffolding, port-binding fixes — all shown and approved before applying..env.example - Never deploy from a dirty working tree unless
is set. Uncommitted changes complicate rollback.ALLOW_DIRTY_TREE: true - Respect "wait." Between preview and prod, any user utterance resembling hesitation (wait/hold/stop/not yet/abort) aborts the prod step cleanly.
Two Modes
Decide up front from the user's phrasing:
- Cloud deploy (default) — Phases 0 through 6 below. Triggers: "deploy", "ship", "push to prod", "get it online", "/all-deploy".
- Run locally — Phases 0, 1, 2, then a local-run step. Triggers: "run it locally", "corre esto localmente", "/all-deploy local", "just run it", or
.--local
In run locally mode, run a scoped audit — only secrets-in-tracked-files, start-command-exists, and sane port binding. Skip: git-remote, clean HEAD,
npm audit/pip-audit, .env.example completeness, and env-var delivery (no remote to deliver to). Then execute the detected start command (npm run dev / uvicorn main:app --reload --host 0.0.0.0 --port $PORT / docker compose up etc.) in the foreground, streaming output via Monitor. If the user asks to also expose the local server, chain into references/targets/cloudflared-tunnel.md. Everything else in this file concerns cloud deploy.
Cloud Deploy Workflow
Mode selection (runs before Phase 0 in ask_at_start
mode)
ask_at_startResolve the effective
CONFIRMATION_MODE for this run:
-
If the user's invocation contains an explicit mode marker, adopt it and skip the question:
triggers: "auto", "full auto", "auto deploy", "deploy auto", "/all-deploy auto", "yolo".full_auto
triggers: "step", "step by step", "one at a time", "confirm each step", "paso a paso", "/all-deploy step".always_ask
-
Else if
is pinned toCONFIRMATION_MODE
orfull_auto
in the config block above, use that and skip the question.always_ask -
Otherwise (
, default), ask the user once, before Phase 0 runs:ask_at_start"Before we start — how should I run the deploy?
1. Full auto — I run audit → preview → prod promotion in sequence. Prod fires after a 5-second ESC window. 2. Step by step — I stop for your OK between audit, preview, and prod.
Reply 'auto' or 'step'."
The chosen mode scopes to this run only — a future invocation asks again (unless the user explicitly opts in via trigger phrase or the config block is pinned).
"Wait" / "stop" / "hold" at any point still aborts the prod step in both modes (Hard Rule 8). The difference is whether you get a 5-second ESC window (full_auto) or an explicit "yes"-required pause (always_ask) before the prod command runs.
Phase 0 — Prerequisites (target-independent)
Check in order. Each failure halts with a
! command for the user.
- Git repo. Run
. If not a repo, halt unless mode isgit rev-parse --is-inside-work-tree
(which doesn't require git).run locally - Git remote (cloud deploy only). Run
. If no remote is configured, halt unless the target will begit remote -v
(deployable without a remote). This second clause is re-evaluated after Phase 3.docker-vps - Language boundary. v1 fingerprints Node and Python. If the primary language is Go, Rust, Ruby, Elixir, Bun, or Deno, exit with: "v1 detects Node/Python ecosystems only. Run the target CLI directly (
,vercel
,railway
,flyctl
). Support for this language is planned in v2."docker
Target-CLI authentication is checked in Phase 3.5 (below), after the target is chosen.
Phase 0.5 — Permission-prompt seeding (first run only)
Tell the user: "Run the
skill once on this project to seed fewer-permission-prompts
with a deploy allowlist — otherwise every step will prompt." Pointer only. Never edit the user's settings here..claude/settings.json
Phase 1 — Detect
Read
references/project-types.md (skill-relative path — Claude resolves it against the installed skill directory) for the full fingerprint table. Inspect:
- Package managers & manifests:
,package.json
,pnpm-lock.yaml
,yarn.lock
,package-lock.json
,bun.lockb
,pyproject.toml
,requirements.txt
,poetry.lock
,uv.lock
.Pipfile - Framework signals:
,next.config.*
,vite.config.*
,astro.config.*
,remix.config.*
,nuxt.config.*
,svelte.config.*
vsapp/
,pages/
withmain.py
,FastAPI()
,Flask()
,app = FastAPI()
,server.py
at root.index.html - Runtime version:
,.nvmrc
,.node-version
inengines
,package.json
,.python-version
inpython_version
. If a long-running target is chosen and no runtime is pinned, audit blocks.pyproject.toml - DB / stateful deps: imports of
,sqlalchemy
,psycopg
,prisma
,mongoose
,redis
,ioredis
. If found, surface "this service needs a database — provision one before prod" with the Railway add-on command from the Railway reference.sqlmodel - Port + start command:
,uvicorn
,gunicorn
,next start
,node server.js
. Check forpython -m ...
binding and0.0.0.0
usage. Localhost-only binding blocks for long-running targets.$PORT - Monorepo:
,pnpm-workspace.yaml
,turbo.json
,nx.json
, orlerna.json
in root"workspaces"
→ enumerate packages and ask which one to deploy. Do not guess.package.json - Library / CLI (not a web deploy): Node signal —
field present inbin:
OR (package.json
array present AND nofiles:
AND no HTTP framework imports likescripts.start
,express
,fastify
,hono
,next
). Python signal —koa
/[project.scripts]
inconsole_scripts
AND nopyproject.toml
/uvicorn
/gunicorn
/flask
in declared scripts or imports. Do not usefastapi
alone as a library signal — almost every Node web app also setsmain:
. Exit cleanly: "This looks like a package —main:
targets web services, not npm/PyPI publishes."/all-deploy - Existing deploy config:
,vercel.json
,railway.toml
,fly.toml
,Dockerfile
— respect, audit, do not regenerate without explicit ask.render.yaml - Existing project linkage:
→ reuse that Vercel project ID..vercel/project.json
withrailway.toml
field → reuse. Re-deploy is the common case; fresh projects require an explicit "start fresh."project
Output: a classification block and a ranked list of candidate targets with one-line rationale each. See
references/project-types.md for the full target-ranking rubric.
Phase 2 — Audit (strict, blocking)
Run the audit script bundled with this skill (
scripts/audit.py) against the current project directory. Claude resolves the skill path at load time — the invocation looks like:
python3 <SKILL_DIR>/scripts/audit.py <project-path>
Where
<SKILL_DIR> is wherever the skill is installed (typically ~/.claude/skills/all-deploy/) and <project-path> is usually .. The script checks every item in references/audit-checklist.md: secrets in tracked files, .gitignore coverage, lockfile sanity, .env.example completeness (via scripts/env_extract.py), build/start script existence, port binding, clean HEAD, git-remote match, npm audit --production --audit-level=high or pip-audit.
Any failure halts. For each issue, show the fix as a diff (if applicable) and wait for the user's OK before applying. Auto-mode does not bypass audit.
Git-history secret scan is user-run, not automatic. In the audit output, surface:
trufflehog git file://. or git log -p -S 'sk_' -S 'AKIA' -S 'ghp_' as a separate step. The skill never rewrites git history.
Phase 3 — Target selection
Present the ranked candidates from Phase 1 with one-line rationales. User picks or accepts the top pick with "ok". Only now load the target reference:
— Next, Vite, Astro, Remix, Nuxt, SvelteKit, staticreferences/targets/vercel.md
— FastAPI, Flask, Express, Python workers, MCP HTTP, Claude Agent SDKreferences/targets/railway.md
— any Dockerfile, stateful workloads, self-hostedreferences/targets/docker-vps.md
— expose local dev, quick demoreferences/targets/cloudflared-tunnel.md
For agent-shaped projects, also load
references/agents.md for per-agent-type adjustments (FastAPI/Flask HTTP, MCP stdio vs HTTP, Claude Agent SDK script, generic Python worker).
Phase 3.5 — Target CLI installed + authenticated
With the target chosen, verify its CLI is installed and authenticated. Do not auto-install or auto-login — hand the user the command with a
! prefix.
- Vercel:
(install:vercel whoami
; login:npm i -g vercel
).! vercel login - Railway:
(install:railway whoami
ornpm i -g @railway/cli
; login:brew install railway
).! railway login - Docker + SSH:
(requires pre-configured SSH key);ssh -o BatchMode=yes <host> true
locally.docker --version - cloudflared:
(install:cloudflared tunnel list
; login:brew install cloudflared
).! cloudflared tunnel login
If the check fails, stop and surface the install/login command. Resume from Phase 3.5 after the user reports done.
Phase 4 — Execute (preview first, always) + env-var delivery
Follow the target reference's preview playbook. First pass is always preview/staging — never
--prod on this phase.
Long-running command handling. Deploy commands take 3–10 min; the default 2-min Bash timeout will kill them.
- Default: run the deploy command via the Bash tool with
. You'll receive a completion notification when the CLI exits;run_in_background: true
the Bash output file at that point to parse the URL and detect errors. Do not chainRead
loops.sleep - When you need an early line (e.g., Railway prints the preview URL mid-run, cloudflared prints the tunnel URL before settling): use the
tool against the same output file with a regex that matches the URL pattern plus known error signatures (Monitor
,Traceback
,FAILED
). Monitor emits each match as a notification; the first URL match is what Phase 4.5 probes.error:
Env-var delivery (before preview runs). Source of truth is the user's local
.env (never committed). Push required keys to the target:
- Vercel:
thenvercel env add <KEY> preview
(paste the value, or pipe it in —vercel env add <KEY> production
). Verify withecho -n "$value" | vercel env add <KEY> <env>
.vercel env ls - Railway:
— one call per key. There's no bulk-import flag; loop in shell over your localrailway variables --set "KEY=value"
(see.env
).references/targets/railway.md - Docker+SSH:
or thescp .env.production user@host:/app/.env
block inenvironment:
.docker-compose.yml - cloudflared: inherits local environment; no remote vars needed.
Never print values. Confirm keys only.
Phase 4.5 — Preview health check (BLOCKING)
Capture the preview URL from the deploy CLI's stdout. Each target reference documents the exact parsing step; examples:
- Vercel: the preview URL is printed on the last non-empty stdout line, formatted like
.https://<project>-<hash>-<scope>.vercel.app - Railway: look for
in theDeployment live at <url>
output.railway up - Docker+SSH: the URL is the user-configured
— the skill must ask or derive fromhttp://<host>[:port]
port mappings.docker-compose.yml - cloudflared: the URL is printed as
or the configured hostname.https://<random>.trycloudflare.com
Assign the captured URL to
$PREVIEW_URL, then probe:
curl -sSL -o /dev/null -w "%{http_code}" "$PREVIEW_URL"
(No
-f — that would suppress the %{http_code} output on HTTP errors. -sSL keeps curl silent on success but still surfaces transport errors and follows redirects.)
A 2xx or 3xx status promotes to Phase 5. 4xx/5xx, empty output (connection refused, DNS failure), or a curl non-zero exit → stop. Report the failing endpoint with the target's log command (
vercel logs, railway logs, ssh ... 'docker compose logs'). Do not promote.
Optional visual verify. If
VISUAL_VERIFY: true and the project is a frontend, use chrome-bridge-automation to screenshot the preview and confirm the page renders (not blank, not error page). Curl 2xx/3xx is still the gate; screenshot is a bonus.
Phase 5 — Prod promotion
In
full_auto mode, after audit + preview health both pass:
- Print a one-screen summary block: target URL, exact command about to run, DNS impact if any, cost implication. For pricing, prefer a live
lookup of current Vercel/Railway pricing. If unavailable, link the provider's pricing page. Do not hardcode plan prices in this file.deep-research - Print: "Prod promotion in 5 seconds — press ESC to interrupt." Then issue a real
via the Bash tool as its own call. This is not theater — ESC during that sleep actually stops the turn. If the user does interrupt, do not issue the prod command on resume; ask what they want to do instead.sleep 5 - After the sleep returns cleanly, issue the prod command as a separate Bash call with
. Wait for the completion notification, thenrun_in_background: true
the Bash output file to extract the production URL. UseRead
on the same output file only if you need to parse the URL before the CLI exits (Railway, cloudflared).Monitor
In
always_ask mode, skip steps 2–3 and require an explicit "yes" in-turn before running the prod command. No sleep.
Respect interruption after preview. If between preview and prod the user types anything resembling hesitation (wait/hold/stop/not yet/abort), do not proceed to prod — treat the preview as the last green state and wait for explicit direction.
Phase 6 — Post-deploy verify + rollback surfacing
- Curl the production URL; confirm status.
- Confirm env vars are set on the remote (
,vercel env ls
,railway variables
).ssh ... 'docker compose config' - Print the rollback path for this target (the user copies if needed later):
- Vercel:
(interactive picker) orvercel rollback
— verify current CLI syntax.vercel rollback <previous-deployment-url> - Railway: no first-class
command. Redeploy a prior commit:rollback
, or use the dashboard's Deployments → "Redeploy" on a prior build.git checkout <prev-sha> && railway up && git checkout - - Docker+SSH:
after re-tagging the prior image, or re-rsync a prior SHA and rebuild. Seessh <host> 'docker compose up -d --no-deps <service>'
for both flows.references/targets/docker-vps.md
- Vercel:
- Print the log-tail command:
,vercel logs <url> --follow
,railway logs --follow
.ssh <host> 'cd /app && docker compose logs -f'
Target Selection — ranking rubric (quick reference)
| Project signals | Top candidate | Why |
|---|---|---|
, , , SPA, SSG | Vercel | Zero-config, preview URLs, edge network |
| FastAPI / Flask / Express with long-running server | Railway | Simple, fast deploy, DB add-ons available |
Any present, DB/volumes needed, self-host preference | Docker + SSH VPS | Full control, stateful-friendly |
| Local dev running, wants a quick public URL | cloudflared tunnel | No host needed, instant |
| MCP server | Railway (HTTP mode) or Docker+SSH | See |
| Claude Agent SDK script | Railway (worker mode) or cron | See |
If signals conflict, present the top two with rationale and let the user pick.
Bundled Resources
— deterministic pre-deploy audit. Invoked in Phase 2.scripts/audit.py
— scans source for env-var usage, used by audit to verifyscripts/env_extract.py
completeness..env.example
— full framework fingerprint table.references/project-types.md
— every audit rule explained with fix guidance.references/audit-checklist.md
— how env vars move between localreferences/env-mapping.md
and each target..env
— four agent shapes with per-type deploy adjustments.references/agents.md
— one playbook per target, loaded only after Phase 3.references/targets/*.md
— Dockerfile.node, Dockerfile.python, docker-compose.example.yml, .env.example.template.assets/templates/
Platform Notes
- macOS + Linux only in v1. Windows community users should use WSL2 for path and shell compatibility.
- All commands assume bash/zsh. Paths use POSIX conventions.
- Network required for all cloud modes;
mode works offline.run locally