Deploy
Deploy a web app from the trunk to staging or production with gates, verification and a rollback path.
Contract
Inputs:
- Repository root
- Target environment: preview, staging, or production
- Optional branch, PR number, deployment provider, and health-check URL
Outputs:
- Pre-deploy gate results
- Deployment route and provider
- Verification status
- Rollback or follow-up instructions when needed
Creates/Modifies:
- Local changes only when fixing failed gates before deployment
- Release PRs or tags only through the
releaseskill
External Side Effects:
- May trigger provider deployments
- May create or update GitHub PRs through delegated release skills
- May read logs and monitoring systems
Confirmation Required:
- Before production deploys
- Before merging release PRs
- Before rollback commands
- Before force-pushes or history rewriting
Delegates To:
- Run a delegate by reading its playbook under the installed skills directory and following it
(
/<router> <action>:<router>/references/<action>.md;/<name>:<name>/SKILL.md); skills here are user-invoked only, so the Skill tool cannot load them. releasefor gating the trunk SHA and cutting the release/git cifor failed GitHub Actions checks
Local quality gates (mandatory)
Before every deployment, run the repository's own format, lint and type-check scripts (plus tests and build when configured). Resolve the real script names from package.json; never guess or chain package managers (use the repo's own, Bun by default). Fix failures before pushing or deploying. Prefer CI-driven deploys over running provider CLIs locally.
Process
Staging
- Ensure trunk CI is green.
- Trigger the staging deploy from the trunk (no staging branch).
- Wait for CI and staging health checks to pass.
Production
- Ensure staging is healthy.
- Require explicit confirmation. Production is critical.
- Deploy to production from the trunk.
- Monitor the deployment; watch health endpoints and error tracking for 15 minutes.
Hotfix
Branch hotfix/xxx off the trunk (default branch), fix, PR to trunk, merge, deploy to production.
Post-deploy verification
- Check health endpoints.
- Check error tracking (Sentry or similar).
- Verify critical user flows.
- Check deployment logs.
Rollback
If the deployment fails, revert the merge commit and redeploy.
References
references/workflow.md has platform-specific deployment details, AWS patterns, CI/CD integration and rollback procedures. Its command examples are generic placeholders; substitute the repo's own package manager and scripts.