Local Deploy Script
Generate and maintain a scripts/deploy.sh script that deploys the project locally and health-checks each service. Designed to be called repeatedly — each invocation re-audits the project and adds, removes, or updates stages to match what's currently deployed.
Workflow
Phase 1: Discover project state
Build a project profile by detecting:
- Language & runtime — Check file extensions and config files (
pyproject.toml, package.json, go.mod, Cargo.toml, etc.). Note the minimum required version (e.g., requires-python = ">=3.11").
- Package manager — pip/uv/poetry, npm/yarn/pnpm, cargo, go modules, etc.
- CLI entry point —
main.py, src/index.ts, cmd/main.go, Cargo.toml [[bin]], etc.
- CLI commands — Parse argument parsers or command definitions to find subcommands.
- Key modules — Identify services, servers, and infrastructure components (databases, chain nodes, etc.).
- Existing scripts/deploy.sh — If present, read it to understand current stages and compare with detected state.
Phase 2: Design stages
Map discovered state to stages. Only include stages for services and infrastructure that are implemented.
Standard stage ordering:
- Environment — Required tools and runtimes are available (version checks, binary existence)
- Build — Compile/build steps needed before services can start (e.g.,
forge build, pnpm build, cargo build)
- Start services — Start infrastructure (database, chain node, message queue) and application services (backend, frontend, indexer). Use a cleanup trap (
trap cleanup EXIT) to tear down all started services on both success and failure.
- Health-check — Verify each service responds correctly (HTTP endpoints return 200, RPC nodes answer queries, databases accept connections, pages load)
If an existing scripts/deploy.sh exists, produce a diff:
- Stages to add (new services or infrastructure detected since last run)
- Stages to remove (services removed)
- Stages to update (ports, commands, or endpoints changed)
- Stages unchanged
Phase 3: Execute
- Write or update
scripts/deploy.sh (create the scripts/ directory if needed)
- Script structure:
#!/usr/bin/env bash
set -euo pipefail
- Each stage is a function:
stage_N_name()
- Each stage prints
--- Stage N: <name> --- before running
- On success: prints
PASS: <check>
- On failure: prints
FAIL: <check> and exits immediately
- Final line on success:
echo "DEPLOY OK"
- The
set -e flag handles fail-fast automatically
- Run
chmod +x scripts/deploy.sh
Phase 4: Verify
- Run
./scripts/deploy.sh
- Confirm it exits 0 with
DEPLOY OK
- If it fails, diagnose and fix the script (not the project code — the script should reflect reality)
- Report result to user
Guidelines
- Deploy only — No static analysis, linting, typechecking, or tests. CI handles verification.
- Idempotent — Safe to run repeatedly. No side effects beyond temporary files (cleaned up).
- Only deploy what's implemented — Never include services that aren't wired up yet.
- Fast — Prefer offline stages, but if the feature being tested requires network (e.g., fetching exchange data), include it. Guard network stages with a credentials check — if credentials aren't configured, prompt the user interactively (via
read -p) and continue. Never persist credentials or silently skip functional stages.
- Language-agnostic — Detect Python/Node/Go/Rust/etc. patterns from config files. Don't hardcode for any language.
- Portable — Use POSIX-compatible bash. Avoid platform-specific commands where possible.
- Minimal output on success — Each stage prints its name and PASS/FAIL. No verbose logs unless a stage fails.
- No project code changes — The skill only creates/updates
scripts/deploy.sh. It never modifies source code, tests, or configuration.
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: smoke-test-43description: Generate and maintain a local deploy script (scripts/deploy.sh). Discovers project services, deploys them locally, and health-checks each one. Use when the user asks to "smoke test", "deploy locally", "test local deploy", "update deploy script", "run deploy", or "run smoke test". Use when this capability is needed.4---56# Local Deploy Script78Generate and maintain a `scripts/deploy.sh` script that deploys the project locally and health-checks each service. Designed to be called repeatedly — each invocation re-audits the project and adds, removes, or updates stages to match what's currently deployed.910## Workflow1112### Phase 1: Discover project state1314Build a project profile by detecting:15161. **Language & runtime** — Check file extensions and config files (`pyproject.toml`, `package.json`, `go.mod`, `Cargo.toml`, etc.). Note the minimum required version (e.g., `requires-python = ">=3.11"`).172. **Package manager** — pip/uv/poetry, npm/yarn/pnpm, cargo, go modules, etc.183. **CLI entry point** — `main.py`, `src/index.ts`, `cmd/main.go`, `Cargo.toml [[bin]]`, etc.194. **CLI commands** — Parse argument parsers or command definitions to find subcommands.205. **Key modules** — Identify services, servers, and infrastructure components (databases, chain nodes, etc.).216. **Existing scripts/deploy.sh** — If present, read it to understand current stages and compare with detected state.2223### Phase 2: Design stages2425Map discovered state to stages. **Only include stages for services and infrastructure that are implemented.**2627Standard stage ordering:28291. **Environment** — Required tools and runtimes are available (version checks, binary existence)302. **Build** — Compile/build steps needed before services can start (e.g., `forge build`, `pnpm build`, `cargo build`)313. **Start services** — Start infrastructure (database, chain node, message queue) and application services (backend, frontend, indexer). Use a cleanup trap (`trap cleanup EXIT`) to tear down all started services on both success and failure.324. **Health-check** — Verify each service responds correctly (HTTP endpoints return 200, RPC nodes answer queries, databases accept connections, pages load)3334If an existing `scripts/deploy.sh` exists, produce a diff:35- Stages to **add** (new services or infrastructure detected since last run)36- Stages to **remove** (services removed)37- Stages to **update** (ports, commands, or endpoints changed)38- Stages **unchanged**3940### Phase 3: Execute41421. Write or update `scripts/deploy.sh` (create the `scripts/` directory if needed)432. Script structure:44 - `#!/usr/bin/env bash`45 - `set -euo pipefail`46 - Each stage is a function: `stage_N_name()`47 - Each stage prints `--- Stage N: <name> ---` before running48 - On success: prints ` PASS: <check>`49 - On failure: prints ` FAIL: <check>` and exits immediately50 - Final line on success: `echo "DEPLOY OK"`51 - The `set -e` flag handles fail-fast automatically523. Run `chmod +x scripts/deploy.sh`5354### Phase 4: Verify55561. Run `./scripts/deploy.sh`572. Confirm it exits 0 with `DEPLOY OK`583. If it fails, diagnose and fix the script (not the project code — the script should reflect reality)594. Report result to user6061## Guidelines6263- **Deploy only** — No static analysis, linting, typechecking, or tests. CI handles verification.64- **Idempotent** — Safe to run repeatedly. No side effects beyond temporary files (cleaned up).65- **Only deploy what's implemented** — Never include services that aren't wired up yet.66- **Fast** — Prefer offline stages, but if the feature being tested requires network (e.g., fetching exchange data), include it. Guard network stages with a credentials check — if credentials aren't configured, prompt the user interactively (via `read -p`) and continue. Never persist credentials or silently skip functional stages.67- **Language-agnostic** — Detect Python/Node/Go/Rust/etc. patterns from config files. Don't hardcode for any language.68- **Portable** — Use POSIX-compatible bash. Avoid platform-specific commands where possible.69- **Minimal output on success** — Each stage prints its name and PASS/FAIL. No verbose logs unless a stage fails.70- **No project code changes** — The skill only creates/updates `scripts/deploy.sh`. It never modifies source code, tests, or configuration.7172---73> Converted and distributed by [TomeVault](https://tomevault.io/claim/cryptofish7) — claim your Tome and manage your conversions.74<!-- tomevault:4.0:skill_md:2026-04-13 -->