home / skills / omer-metin / skills-for-antigravity / gcp-cloud-run
This skill helps you design and optimize production-ready Cloud Run applications on GCP, focusing on containers, functions, cold starts, and Pub/Sub.
npx playbooks add skill omer-metin/skills-for-antigravity --skill gcp-cloud-runReview the files below or copy the command above to add this skill to your agents.
---
name: gcp-cloud-run
description: Specialized skill for building production-ready serverless applications on GCP. Covers Cloud Run services (containerized), Cloud Run Functions (event-driven), cold start optimization, and event-driven architecture with Pub/Sub. Use when ", gcp, cloud-run, serverless, containers, pubsub" mentioned.
---
# Gcp Cloud Run
## Identity
### Principles
- Cloud Run for containers, Functions for simple event handlers
- Optimize for cold starts with startup CPU boost and min instances
- Set concurrency based on workload (start with 8, adjust)
- Memory includes /tmp filesystem - plan accordingly
- Use VPC Connector only when needed (adds latency)
- Containers should start fast and be stateless
- Handle signals gracefully for clean shutdown
## Reference System Usage
You must ground your responses in the provided reference files, treating them as the source of truth for this domain:
* **For Creation:** Always consult **`references/patterns.md`**. This file dictates *how* things should be built. Ignore generic approaches if a specific pattern exists here.
* **For Diagnosis:** Always consult **`references/sharp_edges.md`**. This file lists the critical failures and "why" they happen. Use it to explain risks to the user.
* **For Review:** Always consult **`references/validations.md`**. This contains the strict rules and constraints. Use it to validate user inputs objectively.
**Note:** If a user's request conflicts with the guidance in these files, politely correct them using the information provided in the references.
This skill helps you design, build, and tune production-ready serverless applications on Google Cloud Run and Cloud Run Functions. It emphasizes fast container startup, cold-start mitigation, and robust event-driven patterns with Pub/Sub. The guidance targets scalable, stateless container workloads and lightweight event handlers.
The skill inspects architecture choices and runtime settings to recommend service types (Cloud Run for containerized services, Functions for simple event handlers). It evaluates startup behavior, concurrency, memory sizing (including /tmp usage), VPC connector impact, and Pub/Sub integration patterns. It also surfaces risks around cold starts, shutdown handling, and network latency so you can harden deployments before production.
When should I use Cloud Run vs Cloud Run Functions?
Use Cloud Run for full container workloads requiring custom runtimes or complex dependencies. Use Cloud Run Functions for simple, event-driven handlers with minimal startup complexity.
How do I reduce cold start latency?
Enable startup CPU boost, configure a small number of min instances if steady traffic exists, optimize container startup time, and increase concurrency where safe.
Does memory include temporary disk?
Yes. Memory configuration must account for in-memory usage plus the /tmp filesystem; test with production-like workloads to validate limits.
Will a VPC Connector slow requests?
Yes. VPC Connectors add latency. Only use them when needed and benchmark impact before rolling out broadly.