From my-skills
Deploy the CivilBot chatbot-api backend locally with Docker or to Google Cloud Run. Use when the user says "deploy", "deploy backend", "deploy to cloud run", "deploy for mr", "redeploy", or mentions deploying civilbot, chatbot-api, or the FastAPI backend.
How this skill is triggered — by the user, by Claude, or both
Slash command
/my-skills:civilbot-deployThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Deploys the CivilBot FastAPI backend (`chatbot-api`) either locally via Docker Compose or to Google Cloud Run (project `civilbot-90b36`, region `us-west1`).
Deploys the CivilBot FastAPI backend (chatbot-api) either locally via Docker Compose or to Google Cloud Run (project civilbot-90b36, region us-west1).
Two services are deployed together:
--allow-unauthenticated)--no-allow-unauthenticated)gcloud CLI authenticated (gcloud auth login)civilbot-90b36portkey-api-key in Secret Manager# From repo root
export PATH="/Applications/Docker.app/Contents/Resources/bin:$PATH"
export PORTKEY_API_KEY='your-portkey-api-key'
docker compose up --build
# API at http://localhost:8000
curl http://localhost:8000/health
cd /path/to/civilbot/chatbot-api
./deploy_cloudrun.sh
The script (at chatbot-api/deploy_cloudrun.sh) does everything automatically:
us-west1-docker.pkg.dev)linux/amd64 (required for OpenSeesPy)code-execution-worker (2Gi RAM, 1 CPU, 60s timeout, min 1)chatbot-api (2Gi RAM, 2 CPU, 300s timeout, concurrency 4, min 1, max 20)CLEANUP_AFTER=true KEEP_VERSIONS=5 ./deploy_cloudrun.sh # prune old images after deploy
PORTKEY_API_KEY='...' ./deploy_cloudrun.sh # create secret on first run
# Replace URL with actual output from the script
curl https://chatbot-api-v5ox3dwtwq-uw.a.run.app/health
# Stream logs
gcloud run logs tail chatbot-api --region us-west1
gcloud run logs tail code-execution-worker --region us-west1
| Secret name | Required | Purpose |
|---|---|---|
portkey-api-key | Yes | Portkey LLM routing |
firebase-service-account | Optional | Firebase auth |
wandb-api-key | Optional | W&B Weave LLM tracing |
wandb-project | Optional | W&B project name |
resend-api-key | Optional | Magic link email delivery |
magic-link-base-url | Optional | Frontend URL for magic links |
magic-link-from-email | Optional | Sender address for magic links |
session-secret-key | Optional | Magic link session signing |
Create a missing secret:
echo -n 'VALUE' | gcloud secrets create SECRET_NAME --data-file=-
# Grant Cloud Run access if needed
PROJECT_NUMBER=$(gcloud projects describe civilbot-90b36 --format='value(projectNumber)')
gcloud secrets add-iam-policy-binding SECRET_NAME \
--member="serviceAccount:${PROJECT_NUMBER}[email protected]" \
--role="roles/secretmanager.secretAccessor"
| Key | Value |
|---|---|
| Project ID | civilbot-90b36 |
| Region | us-west1 |
| Artifact Registry | us-west1-docker.pkg.dev/civilbot-90b36/civilbot-repo |
| Main service | chatbot-api |
| Worker service | code-execution-worker |
| Error | Fix |
|---|---|
| Docker not running | open -a Docker and wait for whale icon |
| Docker not in PATH | export PATH="/Applications/Docker.app/Contents/Resources/bin:$PATH" |
| Secret not found | See "Create a missing secret" above |
| Push fails (auth) | gcloud auth configure-docker us-west1-docker.pkg.dev |
| 401/403 on worker | Check IAM binding: main API SA needs roles/run.invoker on worker |
chatbot-api/QUICKSTART.mdchatbot-api/deploy_cloudrun.shCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub liuyinglao/my-claude-skills --plugin my-skills