name: setup-deploy version: 1.0.0 description: | Configure deployment settings for /land-and-deploy. Detects your deploy platform (Fly.io, Render, Vercel, Netlify, Heroku, custom), production URL, health check endpoints, and deploy status commands. Writes the configuration to CLAUDE.md so all future deploys are automatic. Use when: "setup deploy", "configure deployment", "set up land-and-deploy", "how do I deploy with ostack", "add deploy config". allowed-tools:
- Bash
- Read
- Write
- Edit
- Glob
- Grep
- AskUserQuestion
{{PREAMBLE}}
/setup-deploy — Configure Deployment for ostack
You are helping the user configure their deployment so /land-and-deploy works
automatically. Your job is to detect the deploy platform, production URL, health
checks, and deploy status commands — then persist everything to CLAUDE.md.
After this runs once, /land-and-deploy reads CLAUDE.md and skips detection entirely.
User-invocable
When the user types /setup-deploy, run this skill.
Instructions
Step 1: Check existing configuration
grep -A 20 "## Deploy Configuration" CLAUDE.md 2>/dev/null || echo "NO_CONFIG"
If configuration already exists, show it and ask:
- Context: Deploy configuration already exists in CLAUDE.md.
- RECOMMENDATION: Choose A to update if your setup changed.
- A) Reconfigure from scratch (overwrite existing)
- B) Edit specific fields (show current config, let me change one thing)
- C) Done — configuration looks correct
If the user picks C, stop.
Step 2: Detect platform
Run the platform detection from the deploy bootstrap:
# Platform config files
[ -f fly.toml ] && echo "PLATFORM:fly" && cat fly.toml
[ -f render.yaml ] && echo "PLATFORM:render" && cat render.yaml
[ -f vercel.json ] || [ -d .vercel ] && echo "PLATFORM:vercel"
[ -f netlify.toml ] && echo "PLATFORM:netlify" && cat netlify.toml
[ -f Procfile ] && echo "PLATFORM:heroku"
[ -f railway.json ] || [ -f railway.toml ] && echo "PLATFORM:railway"
# Project type
[ -f package.json ] && grep -q '"bin"' package.json 2>/dev/null && echo "PROJECT_TYPE:cli"
ls *.gemspec 2>/dev/null && echo "PROJECT_TYPE:library"
Step 3: Platform-specific setup
Based on what was detected, guide the user through platform-specific configuration.
Fly.io
If fly.toml detected:
- Extract app name:
grep -m1 "^app" fly.toml | sed 's/app = "\(.*\)"/\1/' - Check if
flyCLI is installed:which fly 2>/dev/null - If installed, verify:
fly status --app {app} 2>/dev/null - Infer URL:
https://{app}.fly.dev - Set deploy status command:
fly status --app {app} - Set health check:
https://{app}.fly.dev(or/healthif the app has one)
Ask the user to confirm the production URL. Some Fly apps use custom domains.
Render
If render.yaml detected:
- Extract service name and type from render.yaml
- Check for Render API key:
echo $RENDER_API_KEY | head -c 4(don't expose the full key) - Infer URL:
https://{service-name}.onrender.com - Render deploys automatically on push to the connected branch — no deploy workflow needed
- Set health check: the inferred URL
Ask the user to confirm. Render uses auto-deploy from the connected git branch — after merge to main, Render picks it up automatically. The "deploy wait" in /land-and-deploy should poll the Render URL until it responds with the new version.
Vercel
If vercel.json or .vercel detected:
- Check for
vercelCLI:which vercel 2>/dev/null - If installed:
vercel ls --prod 2>/dev/null | head -3 - Vercel deploys automatically on push — preview on PR, production on merge to main
- Set health check: the production URL from vercel project settings
Netlify
If netlify.toml detected:
- Extract site info from netlify.toml
- Netlify deploys automatically on push
- Set health check: the production URL
Custom / Manual
If nothing detected:
Use AskUserQuestion to gather the information:
-
How are deploys triggered?
- A) Automatically on push to main (Fly, Render, Vercel, Netlify, etc.)
- B) Via a deploy script or CLI command (describe it)
- C) Manually (SSH, dashboard, etc.)
- D) This project doesn't deploy (library, CLI, tool)
-
What's the production URL? (Free text — the URL where the app runs)
-
How can ostack check if a deploy succeeded?
- A) HTTP health check at a specific URL (e.g., /health, /api/status)
- B) CLI command (e.g.,
fly status,kubectl rollout status) - C) No automated way — just check the URL loads
-
Any pre-merge or post-merge hooks?
- Commands to run before merging (e.g.,
bun run build) - Commands to run after merge but before deploy verification
- Commands to run before merging (e.g.,
Step 4: Write configuration
Read CLAUDE.md (or create it). Find and replace the ## Deploy Configuration section
if it exists, or append it at the end.
## Deploy Configuration (configured by /setup-deploy)
- Platform: {platform}
- Production URL: {url}
- Deploy trigger: {automatic on push / deploy command / manual}
- Deploy status command: {command or "HTTP health check"}
- Merge method: {squash/merge/rebase}
- Project type: {web app / API / CLI / library}
- Post-deploy health check: {health check URL or command}
### Custom deploy hooks
- Pre-merge: {command or "none"}
- Deploy trigger: {command or "automatic on push to main"}
- Deploy status: {command or "poll production URL"}
- Health check: {URL or command}
Step 5: Verify
After writing, verify the configuration works:
- If a health check URL was configured, try it:
curl -sf "{health-check-url}" -o /dev/null -w "%{http_code}" 2>/dev/null || echo "UNREACHABLE"
- If a deploy status command was configured, try it:
{deploy-status-command} 2>/dev/null | head -5 || echo "COMMAND_FAILED"
Report results. If anything failed, note it but don't block — the config is still useful even if the health check is temporarily unreachable.
Step 6: Summary
DEPLOY CONFIGURATION — COMPLETE
════════════════════════════════
Platform: {platform}
URL: {url}
Health check: {health check}
Status cmd: {status command}
Merge method: {merge method}
Saved to CLAUDE.md. /land-and-deploy will use these settings automatically.
Next steps:
- Run /land-and-deploy to merge and deploy your current PR
- Edit the "## Deploy Configuration" section in CLAUDE.md to change settings
- Run /setup-deploy again to reconfigure
Important Rules
- Never expose secrets. Don't print full API keys, tokens, or passwords.
- Confirm with the user. Always show the detected config and ask for confirmation before writing.
- CLAUDE.md is the source of truth. All configuration lives there — not in a separate config file.
- Idempotent. Running /setup-deploy multiple times overwrites the previous config cleanly.
- Platform CLIs are optional. If
flyorvercelCLI isn't installed, fall back to URL-based health checks.
Architecte Docker Compose
DevOps
Concoit des configurations Docker Compose optimisees.
Rapport de Post-Mortem
DevOps
Rédige des rapports post-mortem d'incidents structurés et blameless.
Créateur de Runbooks
DevOps
Crée des runbooks opérationnels clairs pour les procédures DevOps courantes.