Skip to content
Development
Skill

/cloudrun-development

CloudBase Run backend development rules (Function mode/Container mode). Use this skill when deploying backend services that require long connections, multi-language support, custom environments, AI agent development, or migrating existing/GitHub apps that need VPC access to

From plugin
cloudbase-ai-toolkit
1.1k49 skills6 agents7 commands2 MCP
Install
$ npx -y skills add TencentCloudBase/CloudBase-AI-Toolkit --skill cloudrun-development --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/cloudrun-development

Context preview

The summary Claude sees to decide when to auto-load this skill.

CloudBase Run backend development rules (Function mode/Container mode). Use this skill when deploying backend services that require long connections, multi-language support, custom environments, AI agent development, or migrating existing/GitHub apps that need VPC access to

SKILL.md

cloudrun-development.SKILL.md
name: cloudrun-development
description: CloudBase Run backend development rules (Function mode/Container mode). Use this skill when deploying backend services that require long connections, multi-language support, custom environments, AI agent development, or migrating existing/GitHub apps that need VPC access to MySQL/PostgreSQL/Redis. Also use when diagnosing CloudRun container deploy failures (deploy_failed, readiness/probe failed, image won't start, docker.io pull loops). For stateless HTTP services, prefer HTTP cloud functions.
version: 2.34.3
alwaysApply: false

Sibling skills (local only)

Sibling CloudBase skills ship beside this skill. Use local relative paths such as `../auth-tool-cloudbase/SKILL.md`.

If a referenced sibling skill file is missing from this environment, ask the user to install the full CloudBase plugin (or the missing skill). Do **not** HTTP-fetch remote skill or protocol markdown into the agent context.

**Cross-cutting protocols** (required before writing HTTP handlers or deploying images):

  • Sensitive Runtime Data Protection: `../cloudbase-platform/references/protocols/sensitive-runtime-data-protection.md`
  • Deployment Gate: `../cloudbase-platform/references/protocols/deployment-gate.md`

CloudBase Run Development

Activation Contract

Use this first when

  • The task is to initialize, run, deploy, inspect, or debug a CloudBase Run service.
  • The request needs a long-lived HTTP service, SSE, WebSocket, custom system dependencies, or container-style deployment.
  • The task is to create or run an Agent service on CloudBase Run.
  • The task migrates an **existing / GitHub / third-party** backend that uses classic `DATABASE_URL` / TCP database clients.
  • The service requires a **stable independent process** (long connections, custom runtime, VPC database access) — see the 「云托管 vs HTTP 云函数」 decision section below. A Dockerfile alone is **not** a strong trigger.

Read before writing code if

  • You still need to choose between Function mode and Container mode.
  • The prompt mentions `queryCloudRun`, `manageCloudRun`, Dockerfile, service domains, or public/private access.
  • The app depends on MySQL, PostgreSQL, Redis, or other VPC-private resources over TCP → **先做数据库访问方式决策(SDK/网关优先,见下方「数据库访问方式决策门」)**;确认必须 TCP 直连后 → also read `references/vpc-and-database.md`.
  • You are choosing between CloudRun and HTTP cloud functions for a stateless HTTP service.
  • Container deploy fails (`deploy_failed`, Pod not ready, readiness/probe failed, third-party `imageUrl` won't stay up) → also read `references/image-deploy-troubleshooting.md` and follow the **Container deploy failure SOP** below. Do not start by raising `InitialDelaySeconds`.

Then also read

  • Cloud functions instead of CloudRun -> `../cloud-functions/SKILL.md`
  • Agent SDK and AG-UI specifics -> `../cloudbase-agent/SKILL.md`
  • Web authentication for browser callers -> `../auth-web-cloudbase/SKILL.md`
  • Existing app + TCP database networking -> `references/vpc-and-database.md`
  • Container image deploy failure / probe / `deploy_failed` -> `references/image-deploy-troubleshooting.md`

Do NOT use for

  • Simple Event Function or HTTP Function workflows that fit the function model better.
  • Frontend-only projects with no backend service.
  • Database-schema design tasks.

Common mistakes / gotchas

  • Choosing CloudRun when the request only needs a normal cloud function.
  • Forgetting to listen on the platform-provided `PORT`.
  • Treating CloudRun as stateful app hosting and storing important state on local disk.
  • Assuming local run is available for Container mode.
  • Opening public access by default when the scenario only needs private or mini-program internal access.
  • **Deploying an existing app with `DATABASE_URL` / MySQL / PostgreSQL / Redis but omitting `serverConfig.VpcConf`** — deploy appears to succeed, then runtime DB connections fail.
  • **新应用部署默认选 TCP 直连数据库** — 能用 SDK/网关访问的数据(PG `app.rdb()`、NoSQL、storage)不需要 `VpcConf` 也不需要数据库账号密码;仅迁移类应用(经典驱动/ORM 无法替换)才走 TCP 直连 + `VpcConf`。见「数据库访问方式决策门」。
  • Confusing `OpenAccessTypes` (how users reach the service) with `VpcConf` (how the service reaches VPC databases).
  • **Deploying to an environment that has not initialized CloudRun** — `CreateCloudRunServer` on an environment with no 大租户 record silently lands in the legacy 小租户 path, creating wrong small-tenant services/versions. Always ensure the environment is initialized first (`manageCloudRun(action="initEnv")`, tcbr) before the first deploy. `manageCloudRun(action="deploy")` now blocks new-service creation on uninitialized environments with guidance.
  • **Using the legacy `tcb` CloudRun API** (`CreateCloudBaseRunResource` / `DescribeCloudBaseRunResource` / `DeleteCloudBaseRunResource`) — these are deprecated 小租户 open APIs and are blocked in `callCloudApi`. CloudRun always goes through `tcbr` (`CreateCloudRunEnv` / `CreateCloudRunServer`). Query a single environment's base info / whether CloudRun is enabled with `DescribeEnvBaseInfo` (`EnvId` required) — use `manageCloudRun(action="initEnv")` to open and `queryCloudRun(action="envStatus")` to poll status; query the environment list / resource info with `DescribeCloudRunEnvs` (`EnvId` optional filter).
  • **Deploying `httpbin` / request-echo images or returning `req.headers` / `process.env`** — CloudBase may inject `x-cloudbase-context` (base64 temporary credentials). Echoing it leaks account cloud access. Follow `../cloudbase-platform/references/protocols/sensitive-runtime-data-protection.md`.
  • **Seeing readiness probe failed / `deploy_failed` and immediately raising `InitialDelaySeconds`** — the probe window is already ~N+150s; crash loops and loopback binds are not slow-start. Follow the Container deploy failure SOP.
  • **Deploying a third-party image without reading its run docs** — missing `Cmd`, bind-address env, or `VolumesConf` looks identical to a probe failure.
  • **Calling `getDeployLog` for `imageUrl` deploys** — that is CODING build log; use `
Read more
Ships withcloudbase-ai-toolkit

AI writes the code. CloudBase runs the backend. The CloudBase integration layer for AI coding tools: Plugin installs the stack, Skills steer how code is written, MCP operates databases, functions, storage, and deploys from chat.

Get the whole plugin

Other skills on cloudbase-ai-toolkit.