| name | deploy |
| description | Deployment Checklist & Setup |
| lifecycle | experimental |
/deploy - Deployment Checklist & Setup
Deployment guides for various platforms.
Usage
/deploy # Analyze project, suggest deployment
/deploy systemd # Linux systemd service
/deploy docker # Docker deployment
/deploy cloud # Cloud deployment guide
What This Skill Does
- Analyze Application - Type, dependencies, requirements
- Generate Config - Deployment configuration files
- Create Checklist - Pre-deployment verification
- Document Process - Step-by-step deployment guide
- Add Monitoring - Health checks, logging
Systemd Service Deployment
Service File
[Unit]
Description=My Application
After=network.target
[Service]
Type=simple
User=myapp
Group=myapp
WorkingDirectory=/opt/myapp
Environment="PATH=/opt/myapp/.venv/bin"
ExecStart=/opt/myapp/.venv/bin/python -m myapp serve
Restart=always
RestartSec=5
NoNewPrivileges=yes
PrivateTmp=yes
ProtectSystem=strict
ProtectHome=yes
ReadWritePaths=/opt/myapp/data
[Install]
WantedBy=multi-user.target
Deployment Script
#!/bin/bash
set -e
APP_DIR=/opt/myapp
SERVICE=myapp
echo "Deploying myapp..."
sudo systemctl stop $SERVICE || true
cd $APP_DIR
git pull origin main
.venv/bin/pip install -e .
sudo systemctl start $SERVICE
sudo systemctl status $SERVICE
echo "Deployment complete!"
Docker Deployment
docker-compose.yml
version: "3.8"
services:
app:
build: .
ports:
- "8000:8000"
environment:
- DATABASE_URL=${DATABASE_URL}
- SECRET_KEY=${SECRET_KEY}
volumes:
- app-data:/app/data
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3
db:
image: postgres:15
environment:
- POSTGRES_DB=myapp
- POSTGRES_USER=myapp
- POSTGRES_PASSWORD=${DB_PASSWORD}
volumes:
- db-data:/var/lib/postgresql/data
restart: unless-stopped
volumes:
app-data:
db-data:
Deployment Commands
docker compose build
docker compose up -d
docker compose logs -f app
docker compose pull
docker compose up -d --build
docker compose down
docker compose up -d --no-build
Deployment Checklist
# Deployment Checklist: [App Name]
## Pre-Deployment
- [ ] All tests passing
- [ ] Version bumped
- [ ] CHANGELOG updated
- [ ] Environment variables documented
- [ ] Database migrations ready
- [ ] Backup taken (if applicable)
## Configuration
- [ ] Production .env file ready
- [ ] Secrets rotated (if needed)
- [ ] SSL certificates valid
- [ ] Domain DNS configured
## Deployment
- [ ] Code deployed
- [ ] Dependencies installed
- [ ] Migrations run
- [ ] Static assets built/deployed
- [ ] Service restarted
## Post-Deployment
- [ ] Health check passing
- [ ] Smoke tests passing
- [ ] Logs checked for errors
- [ ] Monitoring alerts configured
- [ ] Rollback plan tested
## Rollback Plan
1. Stop service: `sudo systemctl stop myapp`
2. Checkout previous version: `git checkout v1.2.3`
3. Reinstall deps: `pip install -e .`
4. Start service: `sudo systemctl start myapp`
Health Check Endpoint
@app.get("/health")
async def health_check():
"""Health check endpoint for monitoring."""
checks = {
"status": "healthy",
"version": __version__,
"checks": {}
}
try:
await db.execute("SELECT 1")
checks["checks"]["database"] = "ok"
except Exception as e:
checks["status"] = "unhealthy"
checks["checks"]["database"] = str(e)
try:
await cache.ping()
checks["checks"]["cache"] = "ok"
except Exception as e:
checks["checks"]["cache"] = str(e)
status_code = 200 if checks["status"] == "healthy" else 503
return JSONResponse(checks, status_code=status_code)
Instructions for Claude
When /deploy is invoked:
- Analyze application - Type, dependencies, requirements
- Determine target - Systemd, Docker, cloud, etc.
- Generate configs - Service files, docker-compose, etc.
- Create deploy script - Automated deployment
- Add health checks - Monitoring endpoint
- Write checklist - Pre/post deployment steps
- Document rollback - How to revert if needed
- Consider security - Least privilege, secrets management