.claude/skills/cloud-run/SKILL.md
Google Cloud Run deployment, service management, traffic splitting, and log inspection. Use when deploying containerized apps to Cloud Run, managing services, or inspecting Cloud Run logs.
npx skillsauth add oimiragieo/agent-studio cloud-runInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Deploy and manage containerized applications on Google Cloud Run. Covers service deployment, revision management, traffic splitting, and log inspection.
gcloud) installed and authenticated# Deploy from source (Cloud Build auto-builds)
gcloud run deploy SERVICE_NAME \
--source . \
--region us-central1 \
--allow-unauthenticated
# Deploy from container image
gcloud run deploy SERVICE_NAME \
--image gcr.io/PROJECT_ID/IMAGE:TAG \
--region us-central1 \
--memory 512Mi \
--cpu 1 \
--min-instances 0 \
--max-instances 10
gcloud run services list --region us-central1 --format json
gcloud run services describe SERVICE_NAME \
--region us-central1 \
--format json
gcloud run services logs read SERVICE_NAME \
--region us-central1 \
--limit 100
# Tail logs in real-time
gcloud run services logs tail SERVICE_NAME \
--region us-central1
# Route 50% to latest, 50% to previous revision
gcloud run services update-traffic SERVICE_NAME \
--region us-central1 \
--to-revisions LATEST=50,REVISION_NAME=50
# Route all traffic to latest
gcloud run services update-traffic SERVICE_NAME \
--region us-central1 \
--to-latest
# Set env vars
gcloud run services update SERVICE_NAME \
--region us-central1 \
--set-env-vars KEY1=VALUE1,KEY2=VALUE2
# Mount secret as env var
gcloud run services update SERVICE_NAME \
--region us-central1 \
--set-secrets ENV_NAME=SECRET_NAME:latest
gcloud run services delete SERVICE_NAME \
--region us-central1 \
--quiet
Either use a Dockerfile or let Cloud Build auto-detect:
# Option A: Build and push manually
docker build -t gcr.io/PROJECT_ID/SERVICE_NAME:latest .
docker push gcr.io/PROJECT_ID/SERVICE_NAME:latest
# Option B: Deploy from source (Cloud Build handles it)
gcloud run deploy SERVICE_NAME --source .
gcloud run deploy SERVICE_NAME \
--image gcr.io/PROJECT_ID/SERVICE_NAME:latest \
--region us-central1 \
--port 8080 \
--memory 512Mi \
--cpu 1
# Get service URL
gcloud run services describe SERVICE_NAME \
--region us-central1 \
--format "value(status.url)"
# Test the endpoint
curl $(gcloud run services describe SERVICE_NAME \
--region us-central1 \
--format "value(status.url)")
gcloud run services logs read SERVICE_NAME --region us-central1 --limit 20
gcloud run commands — omitting region causes interactive prompts that break automation.--set-secrets flag.| Anti-Pattern | Why It Fails | Correct Approach | | ------------------------------------- | --------------------------------- | ------------------------------------------------------ | | Missing --region flag | Interactive prompt breaks CI/CD | Always specify region explicitly | | Public endpoints for internal APIs | Security exposure | Use IAM auth + Cloud Run invoker role | | Hardcoded secrets in env vars | Secrets visible in service config | Use Secret Manager integration | | No min-instances for latency-critical | Cold start adds 2-10s latency | Set --min-instances 1+ for critical paths | | Single revision (no traffic split) | No rollback path | Always keep previous revision, split traffic gradually |
When the cloud-run-mcp MCP server is configured, these tools are available:
| Tool | Description | Key Params |
| ---------------------- | -------------------------------------- | ---------------------------------- |
| deploy-file-contents | Deploy code directly from file content | service_name, region, source_files |
| list-services | List all Cloud Run services | project_id, region |
| get-service | Get service details + URL | service_name, project_id, region |
| get-service-log | Fetch recent logs | service_name, project_id, limit |
| deploy-local-folder | Deploy from local directory | folder_path, service_name, region |
| list-projects | List GCP projects | — |
| create-project | Create new GCP project | project_id, project_name |
MCP setup: npx @google-cloud/cloud-run-mcp or configure in Claude Desktop settings.json
Auth: Application Default Credentials (gcloud auth application-default login)
When to use MCP vs CLI: Use MCP tools when user asks "deploy this code" or "what services are running"; use gcloud CLI for advanced operations (IAM, VPC, secrets).
Before starting:
Read .claude/context/memory/learnings.md
After completing:
.claude/context/memory/learnings.md.claude/context/memory/issues.md.claude/context/memory/decisions.mdASSUME INTERRUPTION: If it's not in memory, it didn't happen.
tools
Comprehensive biosignal processing toolkit for analyzing physiological data including ECG, EEG, EDA, RSP, PPG, EMG, and EOG signals. Use this skill when processing cardiovascular signals, brain activity, electrodermal responses, respiratory patterns, muscle activity, or eye movements. Applicable for heart rate variability analysis, event-related potentials, complexity measures, autonomic nervous system assessment, psychophysiology research, and multi-modal physiological signal integration.
tools
Comprehensive toolkit for creating, analyzing, and visualizing complex networks and graphs in Python. Use when working with network/graph data structures, analyzing relationships between entities, computing graph algorithms (shortest paths, centrality, clustering), detecting communities, generating synthetic networks, or visualizing network topologies. Applicable to social networks, biological networks, transportation systems, citation networks, and any domain involving pairwise relationships.
data-ai
Molecular featurization for ML (100+ featurizers). ECFP, MACCS, descriptors, pretrained models (ChemBERTa), convert SMILES to features, for QSAR and molecular ML.
development
Run Python code in the cloud with serverless containers, GPUs, and autoscaling. Use when deploying ML models, running batch processing jobs, scheduling compute-intensive tasks, or serving APIs that require GPU acceleration or dynamic scaling.