| name | deploy |
|---|---|
| description | Run tests, build, and deploy to the specified environment (staging or production). Includes safety checks. |
| argument-hint | <staging|production> |
| allowed-tools | Bash, Read |
Deploy to: $ARGUMENTS
Follow these steps carefully. Stop and report if any step fails.
-
Confirm the target environment is valid. Accepted values:
staging,production. If the value is anything else, stop with an error. -
Run
git statusto confirm the working tree is clean (no uncommitted changes). If there are uncommitted changes, stop and ask the user to commit or stash them first. -
Run
git log origin/main..HEAD --oneline. If on a non-main branch deploying toproduction, warn the user and ask for explicit confirmation before proceeding. -
For
productiondeployments, confirm with the user by printing: "You are about to deploy to PRODUCTION. Type 'yes' to continue." Wait for the user's response before proceeding.
-
Run the full test suite. If any tests fail, stop. Do not deploy broken code.
-
Run the build command for this project:
npm run build/yarn build/pnpm buildfor Node projects.python -m buildor equivalent for Python packages.make buildif a Makefile target exists.- If no build step is detected, note this and skip.
- Run the deploy command for the target environment.
Look for deploy scripts in these locations (in order of preference):
package.jsonscripts nameddeploy:$ARGUMENTSordeploy.Makefiletargets nameddeploy-$ARGUMENTSordeploy.- Shell scripts in
scripts/orbin/matchingdeploy*.sh. - A
Dockerfile/docker-compose.ymlwith a deploy workflow. If no deploy script is found, report what was checked and ask the user to specify the deploy command.
-
Run a smoke check if one exists (e.g., a health check URL or
make smoke-test). -
Print a summary: environment, branch, commit SHA, timestamp, and whether smoke checks passed.