Tgf Server Dev
thkhxm/tgf
基于 tgf v2(github.com/thkhxm/tgf/v2)用确定性的 tgfctl 工作流创建、验证和维护 Go 游戏服务器项目。
CloudBase Run backend development rules (Function mode/Container mode).
$ npx skills add TencentCloudBase/CloudBase-AI-Toolkit --skill cloudrun-development -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install TencentCloudBase/CloudBase-AI-Toolkit cloudrun-development --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/TencentCloudBase/CloudBase-AI-Toolkit.git skills-src && mkdir -p .claude/skills && cp -r skills-src/config/source/skills/cloudrun-development .claude/skills/cloudrun-development && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "cloudrun-development" agent skill from https://github.com/TencentCloudBase/CloudBase-AI-Toolkit/tree/main/config/source/skills/cloudrun-development into .claude/skills/cloudrun-development/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "cloudrun-development", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/TencentCloudBase/CloudBase-AI-Toolkit/tree/main/config/source/skills/cloudrun-developmentType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add TencentCloudBase/CloudBase-AI-Toolkit --skill cloudrun-development -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install TencentCloudBase/CloudBase-AI-Toolkit cloudrun-development --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/TencentCloudBase/CloudBase-AI-Toolkit.git skills-src && mkdir -p .agents/skills && cp -r skills-src/config/source/skills/cloudrun-development .agents/skills/cloudrun-development && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "cloudrun-development" agent skill from https://github.com/TencentCloudBase/CloudBase-AI-Toolkit/tree/main/config/source/skills/cloudrun-development into .agents/skills/cloudrun-development/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "cloudrun-development", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add TencentCloudBase/CloudBase-AI-Toolkit --skill cloudrun-development -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install TencentCloudBase/CloudBase-AI-Toolkit cloudrun-development --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/TencentCloudBase/CloudBase-AI-Toolkit.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/config/source/skills/cloudrun-development .cursor/skills/cloudrun-development && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "cloudrun-development" agent skill from https://github.com/TencentCloudBase/CloudBase-AI-Toolkit/tree/main/config/source/skills/cloudrun-development into .cursor/skills/cloudrun-development/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "cloudrun-development", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/TencentCloudBase/CloudBase-AI-Toolkit.git --path config/source/skills/cloudrun-development--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add TencentCloudBase/CloudBase-AI-Toolkit --skill cloudrun-development -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install TencentCloudBase/CloudBase-AI-Toolkit cloudrun-development --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/TencentCloudBase/CloudBase-AI-Toolkit.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/config/source/skills/cloudrun-development .gemini/skills/cloudrun-development && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "cloudrun-development" agent skill from https://github.com/TencentCloudBase/CloudBase-AI-Toolkit/tree/main/config/source/skills/cloudrun-development into .gemini/skills/cloudrun-development/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "cloudrun-development", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install TencentCloudBase/CloudBase-AI-Toolkit cloudrun-developmentInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add TencentCloudBase/CloudBase-AI-Toolkit --skill cloudrun-development -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/TencentCloudBase/CloudBase-AI-Toolkit.git skills-src && mkdir -p .github/skills && cp -r skills-src/config/source/skills/cloudrun-development .github/skills/cloudrun-development && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "cloudrun-development" agent skill from https://github.com/TencentCloudBase/CloudBase-AI-Toolkit/tree/main/config/source/skills/cloudrun-development into .github/skills/cloudrun-development/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "cloudrun-development", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add TencentCloudBase/CloudBase-AI-Toolkit --skill cloudrun-development -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install TencentCloudBase/CloudBase-AI-Toolkit cloudrun-development --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/TencentCloudBase/CloudBase-AI-Toolkit.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/config/source/skills/cloudrun-development .opencode/skills/cloudrun-development && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "cloudrun-development" agent skill from https://github.com/TencentCloudBase/CloudBase-AI-Toolkit/tree/main/config/source/skills/cloudrun-development into .opencode/skills/cloudrun-development/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "cloudrun-development", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
cloudrun-developmentCloudBase Run backend development rules (Function mode/Container mode).
Cloudrun Development is an agent skill from TencentCloudBase/CloudBase-AI-Toolkit. 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 (deployfailed, readiness/probe failed, image won't start, docker.io pull loops) or a deploy stuck behind a running deploy task. For stateless HTTP services…
Its SKILL.md is about 7.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files, including reference files (for example `references/image-deploy-troubleshooting.md` and `references/vpc-and-database.md`).
It sits in Databases, covering Serverless, Backend development and Containers. It works with Docker, MySQL, PostgreSQL and Redis. The repository describes itself as: Backend for AI coding agents on CloudBase — database, auth, functions via Plugin, Skills & MCP. The licence is MIT.
5 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 21af91c. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
dockerFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md. Its commands use docker, which can reach the network depending on how they are called.
From URLs in SKILL.md, links to its own repository left out.
Names these keys or tokens, usually read from environment variables:
TCB_API_KEYFrom names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Cloudrun Development loads about 7.2k tokens when it runs, and up to ~12k if it reads all its reference files. Until then it costs about 142 tokens; SKILL.md has 2,812 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from TencentCloudBase/CloudBase-AI-Toolkit at commit 21af91c, republished under its MIT licence (© TencentCloudBase). 2,812 words, ~7,230 tokens.
.claude/skills/cloudrun-development/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.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):
../cloudbase-platform/references/protocols/sensitive-runtime-data-protection.md../cloudbase-platform/references/protocols/deployment-gate.mdDATABASE_URL / TCP database clients.queryCloudRun, manageCloudRun, Dockerfile, service domains, or public/private access.references/vpc-and-database.md.app.rdb(), NoSQL, storage, functions) through an SDK → 先过「计算资源访问 CloudBase 的凭证决策门」:凭证谁签发、怎么注入、怎么吊销,都必须在写代码之前定下来。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.../cloud-functions/SKILL.md../cloudbase-agent/SKILL.md../auth-web-cloudbase/SKILL.mdreferences/vpc-and-database.mddeploy_failed -> references/image-deploy-troubleshooting.md../cloud-functions/references/http-function-credentials.mdPORT in Container mode — and its mirror image in Function mode: calling app.listen() there, where the framework already owns the port and the second bind dies with EADDRINUSE.@cloudbase/node-sdk reads CLOUDBASE_APIKEY; an invented name (for example TCB_API_KEY) is silently ignored and only shows up later as "no credentials at runtime".auth.json, .cloudbase/) and injecting it into a deployed service. Issue the key with manageAppAuth(action="createApiKey", keyType="api_key") instead, so it has an owner, a rotation path, and a keyId you can revoke. See ../cloud-functions/references/http-function-credentials.md.DATABASE_URL / MySQL / PostgreSQL / Redis but omitting serverConfig.VpcConf — deploy appears to succeed, then runtime DB connections fail.app.rdb()、NoSQL、storage)不需要 VpcConf 也不需要数据库账号密码;仅迁移类应用(经典驱动/ORM 无法替换)才走 TCP 直连 + VpcConf。见「数据库访问方式决策门」。OpenAccessTypes (how users reach the service) with VpcConf (how the service reaches VPC databases).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.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).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.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.Cmd, bind-address env, or VolumesConf looks identical to a probe failure.getDeployLog for imageUrl deploys — that is CODING build log; use getProcessLog.getProcessLog twice and compare; a repeated boot sequence is a restart loop.CreateCloudRunEnv (tcbr) first; never CreateCloudRunServer on an uninitialized environment (it falls back to the legacy 小租户 path). manageCloudRun(action="deploy") validates this automatically and blocks new services on uninitialized environments. When blocked, first call manageCloudRun(action="initEnv", envId=...) (异步开通) and poll queryCloudRun(action="envStatus") until Status=normal, or reconsider an HTTP cloud function to bypass CloudRun entirely.VpcConf (egress / private network) before deploy — see references/vpc-and-database.md.manageAppAuth(action="createApiKey") and injected via EnvParams, never a key copied out of the local client login state.x-cloudbase-context, full headers, or credential env vars; do not deploy httpbin-style reflectors.Use CloudBase Run when the task needs a deployed backend service rather than a short-lived serverless function.
核心原则:HTTP 云函数优先。只有需求真正需要云托管时才用云托管;有
Dockerfile不等于必须上云托管。
HTTP 云函数更合适(优先):
PORT/9000,只做「请求进来 → 处理 → 响应」的响应式逻辑Dockerfile 但服务本质是无状态 HTTP → 优先 HTTP 云函数(HTTP Function / Custom Image HTTP Function),不必上云托管云托管才需要(只有以下之一才选云托管):
VpcConf 私有网络连通)决策示例: 一个带 Dockerfile 的 Go/Python HTTP API,无长连接、无自定义运行时、不碰 VPC 数据库 → 选 HTTP 云函数而不是云托管;同一份代码若有 WebSocket 长连接 → 才选云托管。
核心原则:能用 CloudBase SDK/网关访问的数据,一律优先 SDK 路径。 TCP 直连会引入 VPC、安全组、数据库账号密码三件套,全是部署后才暴露的问题(
ETIMEDOUT、安全组拦截、密码注入),能不碰就不碰。
优先:SDK / 网关路径(无需 VpcConf、无需数据库账号密码)
app.rdb()(js-sdk v3 / node-sdk,走 PG HTTP 网关;详见 ../postgresql-development-cloudbase/SKILL.md)app.database();对象存储 → app.storage仅当以下情况才走 TCP 直连(须完成 references/vpc-and-database.md 全流程):
决策动作: 扫描到 DATABASE_URL / DB 依赖信号时,先停下来回答「这个数据访问能不能换成 SDK/网关」,再决定是否进入 VPC checklist——不要默认按 TCP 直连方案往下走。
核心原则:SDK 路径免掉的是数据库账号密码,不是 CloudBase 资源访问凭证。 服务代码要调 CloudBase 资源(PG
app.rdb()/ NoSQL / storage / functions)时,先把凭证来源定下来,再写代码、再部署。
三件事必须先答:
manageAppAuth(action="createApiKey", keyType="api_key", keyName="<service>-<env>"),或 CLI tcb env apikey create my-key -e env-xxx。不要从本地客户端登录态(auth.json / .cloudbase/)里取一把来用。serverConfig.EnvParams 注入 CLOUDBASE_APIKEY(@cloudbase/node-sdk 自动读取该变量;显式字段是 accessKey)。变量名以官方为准,不要自造。改环境变量时保留已有键值,不要整份覆盖。keyName 与轮换负责人;下线或轮换时 manageAppAuth(action="deleteApiKey", keyId=...) 并重新部署。轮换后旧实例里残留的副本不会报错,只会静默失效。不要假设云托管容器已自动带上可用的 CloudBase 凭证 —— 部署后用一次真实的 SDK 读取验证(验证两次以上,不要只看进程起没起来)。完整步骤、Manager SDK 的腾讯云密钥对路径、环境变量合并的安全写法见 ../cloud-functions/references/http-function-credentials.md。
api_key 是环境级凭证:可绕过 RLS,单环境签发数量有限。不要给每个服务灌同一把 —— 任一实例失陷即整环境失陷。
| Dimension | Function mode | Container mode |
|---|---|---|
| Best for | Fast start, Node.js service patterns, built-in framework, Agent flows | Existing containers, arbitrary runtimes, custom system dependencies |
| Port model | The function framework binds the platform port itself — your code must not call app.listen() | App must listen on the injected PORT |
| Dockerfile | Not required | Required — but a Dockerfile alone does not mean CloudRun; first check whether the service needs long connections / custom runtime. Stateless HTTP services with a Dockerfile may fit HTTP cloud functions better. |
| Local run through tools | Supported | Not supported |
| Typical use | Streaming APIs, low-latency backend, Agent service | Custom language stack, migrated container app |
Choose mode first
Follow mandatory runtime rules
PORT. Function mode: the framework binds the port for you — never call app.listen()Mem = 2 × CPUUse the correct tools
queryCloudRunmanageCloudRunforce: truetargetPathFollow the deployment sequence
manageCloudRun(action="initEnv", envId=...) (async, idempotent) before the first deploy; manageCloudRun(action="deploy") blocks new services on uninitialized environments and tells you to call initEnvDATABASE_URL, docker-compose DB services, ORM configs)references/vpc-and-database.md before deployVpcConf when neededimageUrl / third-party images, complete the five-item docs checklist in the Container deploy failure SOP before deployreferences/image-deploy-troubleshooting.md) — docs → getProcessLog → config; do not start with InitialDelaySecondsqueryCloudRun(action="list") -> list servicesqueryCloudRun(action="detail") -> inspect one service and its latest deploy status when availablequeryCloudRun(action="templates") -> see available startersqueryCloudRun(action="getDeployLog") -> 构建日志(CODING / DescribeCloudRunBuildLog)。仅云端源码构建有意义;已有镜像部署(imageUrl)没有构建过程,不要用它诊断镜像部署失败。未登录 CODING 的账号会报错(如 User not created or may not qcloud user)queryCloudRun(action="getProcessLog") -> 运行日志(tcbr/DescribeCloudRunProcessLog)。返回部署阶段步骤(如 create_version_check_vpc / create_eks_virtual_service / check_eks_virtual_service)+ 容器启动/运行日志(s6-overlay、应用进程、readiness probe 失败原因)。镜像部署与源码构建均可用,不依赖 CODING。参数:detailServerName/serverName + 可选 runId(不传则取最新部署的 RunId;RunId 也可从 detail / getDeployRecords 的 latestDeploy.RunId 取得)queryCloudRun(action="getDeployRecords") -> list deploy records (newest first; includes BuildId / RunId / FlowRatio / Status) — use to review release history and rollback context before a traffic operationqueryCloudRun(action="envStatus") -> check whether the environment's CloudRun is opened and its provisioning status (Status=creating opening / normal opened) — use after initEnv to poll progress or before deploy to confirm readinessqueryCloudRun(action="getManageTask") -> 发布任务状态(tcbr/DescribeServerManageTask)。返回 taskId / taskStatus 与最新部署记录状态 latestDeployStatus。用于两件事:撞到「已有部署发布任务运行中」时先确认任务是否真在推进;以及部署长时间无进展时,区分「任务仍在推进」和「任务已卡住」。不知道任务状态就不要反复重试 deploy部署失败排查时必须区分两类日志,不要只用 getDeployLog:
targetPath、走 CODING 构建) queryCloudRun(action="getDeployLog", detailServerName=..., buildId=...) 查构建日志(编译/打包失败) queryCloudRun(action="getProcessLog", detailServerName=..., runId=...) 查运行日志(部署步骤 + 容器启动/健康检查)imageUrl、DeployType=image) getDeployLog(无构建过程;且依赖 CODING,未登录会直接失败) queryCloudRun(action="detail") 或 getDeployRecords 取 latestDeploy.RunId,再 getProcessLog 查运行日志{
"action": "getProcessLog",
"detailServerName": "my-svc",
"runId": "<from latestDeploy.RunId>"
}manageCloudRun(action="deploy") 报「已有部署发布任务运行中」/ already has a deploy task running 时,不要盲目重试,也不要反复改 Dockerfile / serverConfig —— 先确认任务真实状态:
queryCloudRun(action="getManageTask", detailServerName=...) → 读 taskId / taskStatus / latestDeployStatusqueryCloudRun(action="getProcessLog") → 隔 20–40 秒对比两次拉取,确认部署阶段步骤是否还在推进| 观察 | 动作 |
|---|---|
taskStatus 仍是运行态,部署步骤有推进 | 继续等,不要重发 deploy |
| 任务已结束(非运行态),而 deploy 仍被拒 | 才考虑重试 |
任务长时间停在非终态,版本也停在 creating 不动 | 记录 taskId / latestDeployStatus / 时间窗作为证据,不要空转重试 |
force=true 不解决这个问题:它只跳过本工具的确认提示,不会取消或覆盖服务端已有的发布任务 —— 把它当「强制覆盖」用只会白撞一次。
日志侧的排查顺序(构建日志 vs 运行日志、先日志后配置)见上面的 Log query SOP 与 Container deploy failure SOP。
manageCloudRun(action="initEnv") -> open (initialize) CloudRun for the environment — async, idempotent (Status=normal → already opened, no re-create). Use on a brand-new environment before the first deploy, or when deploy is blocked with an "尚未初始化云托管" message. Params: envId (defaults to the configured env), packageType (default Trial). Poll queryCloudRun(action="envStatus") until Status=normal.manageCloudRun(action="init") -> create local projectmanageCloudRun(action="download") -> pull remote codemanageCloudRun(action="run") -> local run for Function modemanageCloudRun(action="deploy") -> trigger deploy + lightweight wait for registration (does not hang for full build; pass waitRegistration=false to skip even that wait when you don't need buildId). Returns buildId / runId / taskId + DeployType-aware next_step: source → getDeployLog then getProcessLog; image (imageUrl, BuildId often 0) → skip getDeployLog, use getDeployRecords/detail for RunId then getProcessLog. Follow the returned next_step — do not always poll build logs. Existing services: RMW preserves remote VpcConf / EnvParams keys / OpenAccessTypes; new services automatically validate that the environment's CloudRun is initialized — if not, deploy is blocked with guidance to call initEnv firstmanageCloudRun(action="updateConfig") -> config-only update (no code upload; VPC / EnvParams / scaling / access types)manageCloudRun(action="traffic") -> traffic management / canary release (aligns with tcb cloudrun traffic): trafficOp="set" adjusts the stable/canary traffic ratio (stablePercent + canaryPercent must equal 100, e.g. 90/10); trafficOp="promote" promotes the canary version to full release (100%, closes gray release, irreversible); trafficOp="rollback" rolls back to the previous stable version (stops the releasing canary). Check queryCloudRun(action="getDeployRecords") first to understand current versions and trafficmanageCloudRun(action="delete") -> delete servicemanageCloudRun(action="createAgent") -> create Agent service已有一个现成镜像(本地构建好、或第三方发布)时,不需要本地源码目录,直接
manageCloudRun(action="deploy")传入imageUrl即可,走DeployType="image"(容器型)部署,targetPath可省略。若用户明确提到使用某个镜像或无需重新构建代码,必须传 imageUrl,不要仅因本地有源码目录就回退到源码构建。
决策路径(直填 vs 本地中转):
ccr.ccs.tencentyun.com/...、公开 Docker Hub 镜像)→ 直填 imageUrl:manageCloudRun(action="deploy", serverName=..., imageUrl="ccr.ccs.tencentyun.com/ns/img:v1", serverConfig={...})。CloudBase 会直接拉取该 registry 地址构建部署。若 docker.io / Docker Hub 在节点上反复拉取失败,不要空转重试:改用 Dockerfile FROM <public-image> + targetPath 源码构建(CODING 拉公网镜像,产物进 CCR 内网拉取)。见下方 SOP 第 4 步。ghcr.io、私有 ECR/Harbor 等)→ 本地中转到 CCR:docker pull ghcr.io/example/app:latest
docker tag ghcr.io/example/app:latest ccr.ccs.tencentyun.com/<ns>/app:latest
docker login ccr.ccs.tencentyun.com
docker push ccr.ccs.tencentyun.com/<ns>/app:latestccr.ccs.tencentyun.com/<ns>/app:latest 作为 imageUrl 传入。中转只解决拉取,不能替代镜像文档里的启动命令 / 环境变量 / 数据目录。与 initEnv 联动: 镜像部署同样要求环境已开通云托管。新环境首次部署前先 manageCloudRun(action="initEnv", envId=...),并用 queryCloudRun(action="envStatus") 轮询到 Status=normal;未开通时 deploy 会被拦截并引导先 initEnv。
示例:
{
"action": "deploy",
"serverName": "my-image-svc",
"imageUrl": "ccr.ccs.tencentyun.com/ns/app:latest",
"serverConfig": {
"OpenAccessTypes": ["PUBLIC"],
"Cpu": 0.5,
"Mem": 1,
"MinNum": 1,
"MaxNum": 3,
"Port": 8080,
"Cmd": ["node", "server.js"],
"EnvParams": "{\"PORT\":\"8080\",\"BIND_HOST\":\"0.0.0.0\"}"
}
}Port / Cmd / EnvParams 必须来自镜像官方文档的五要素清单,不要套用 3000 或省略启动命令。第三方镜像的完整对照见 references/image-deploy-troubleshooting.md 附录。
部署后:manageCloudRun(deploy) 对镜像返回的 next_step 默认指向 getProcessLog(或先 getDeployRecords 取 RunId),不要改去调 getDeployLog。也可用 queryCloudRun(action="detail") 查看 imageInfo(镜像地址与部署类型)。镜像部署失败排查走下方 SOP。
顺序:先查镜像官方文档 → 再查运行日志 → 最后才动配置。禁止一看到 probe failed / deploy_failed 就调 InitialDelaySeconds。
详情与案例:references/image-deploy-troubleshooting.md。
不要靠 Docker Hub tag 或「常见默认值」猜。部署前必须确认:
serverConfig.EntryPoint / CmdPORT)→ serverConfig.Port0.0.0.0 而不是 127.0.0.1、功能开关默认关闭等)→ EnvParamsserverConfig.VolumesConf缺任何一项再部署,失败看起来都会像「健康检查失败」。
getProcessLog 定性镜像部署(imageUrl)跳过 getDeployLog(那是云端源码构建的构建日志)。从 detail / getDeployRecords 取 RunId,再 queryCloudRun(action="getProcessLog")。
启动日志存在 ≠ 服务正常运行。 banner、s6/tini 行、sidecar "listening" 都不能证明探针目标已起来。
两次日志对比判活: 隔 20–40 秒再拉一次 getProcessLog。
| 观察 | 定性 |
|---|---|
只有调度/创建步骤(create_eks_*),没有容器 stdout | Pod 调度中 / 镜像拉取 |
| 同一段启动 banner / PID 1 行重复出现(时间戳在走、内容几乎一样) | 容器启动即退出 / 重启循环 |
进程还在,但 listen 在 127.0.0.1 或端口 ≠ serverConfig.Port | 端口 / 绑定地址问题 |
| 两次拉取是同一条启动过程在往后打日志,banner 不重复 | 才可能是启动慢 |
部署步骤完成后:先等 N 秒(InitialDelaySeconds),再大约 每 5 秒 探一次服务端口,连续约 30 次全失败 才判本次部署失败。窗口 ≈ N+150s。不是「N 秒后立即失败」。
docker.io)反复失败 → Dockerfile 源码构建节点直连 Docker Hub 反复失败时,不要空转 imageUrl。写:
FROM docker.io/example/app:latest用 targetPath 走云端源码构建:CODING 构建机拉公网镜像,产物进 CCR,云托管节点内网拉取。这只解决拉取拓扑,不替代第 1 步的 Cmd / 环境变量 / 卷。
PID 1 往往是监督进程,不是 HTTP 应用。用两次日志找子进程重启风暴。若镜像 issue 记录了 PID 1 / pgrep -f 误匹配,按文档 workaround(绝对路径 Cmd、关闭 supervise),不要调探针延迟。示例见 reference 附录。
OpenAccessTypes. You must set serverConfig.VpcConf and use the database private address. Read references/vpc-and-database.md.{ "action": "init", "serverName": "my-svc", "targetPath": "/abs/ws/my-svc" }{ "action": "run", "serverName": "my-svc", "targetPath": "/abs/ws/my-svc", "runOptions": { "port": 3000 } }{
"action": "deploy",
"serverName": "my-svc",
"targetPath": "/abs/ws/my-svc",
"serverConfig": {
"OpenAccessTypes": ["PUBLIC"],
"Cpu": 0.5,
"Mem": 1,
"MinNum": 1,
"MaxNum": 5
}
}{
"action": "deploy",
"serverName": "my-existing-app",
"targetPath": "/abs/ws/my-existing-app",
"serverConfig": {
"OpenAccessTypes": ["PUBLIC"],
"Cpu": 0.5,
"Mem": 1,
"MinNum": 1,
"MaxNum": 5,
"EnvParams": "{\"DATABASE_URL\":\"postgres://user:pass@10.x.x.x:5432/app\"}",
"VpcConf": {
"VpcId": "vpc-xxxxxxxx",
"SubnetId": "subnet-xxxxxxxx"
}
}
}Valid OpenAccessTypes values: OA (办公网访问), PUBLIC (公网访问), MINIAPP (小程序访问), VPC (VPC访问). Use PUBLIC for web applications that need public HTTPS access.
MinNum: 1 is the recommended default when you want to reduce cold-start latency. If the user explicitly prefers lower cost and accepts more cold starts, explain the tradeoff and let them reduce MinNum to 0.
VpcConf in the same VPC/region as the database.manageAppAuth(action="createApiKey"), not from a local client login file.queryCloudRun(action="detail").{ "ok": true } / health payload — never deploy httpbin or any service that reflects request headers.manageCloudRun(action="initEnv", envId=...) (异步开通) and poll queryCloudRun(action="envStatus") until Status=normal; or open the console 环境 → 云托管 → 开通. For stateless HTTP services, consider an HTTP cloud function instead of CloudRun entirely.references/image-deploy-troubleshooting.md): image deploys skip getDeployLog and use getProcessLog only; classify scheduling vs port vs exit-on-start with two log pulls. Do not raise InitialDelaySeconds until logs prove a single slow init. Also inspect Dockerfile (source) and CPU/memory ratio.queryCloudRun(action="getManageTask") first. Do not retry blindly, and do not set force=true expecting an override — it only skips this tool's confirmation prompt. See the Deploy-task SOP above.creating -> queryCloudRun(action="getManageTask") for latestDeployStatus + taskStatus, then getProcessLog for the deploy-phase steps. Only change Dockerfile / serverConfig once the logs actually point at code or config.VpcConf, wrong private host, or security group. Follow references/vpc-and-database.md before rewriting application code.manageAppAuth(action="createApiKey"), inject it as CLOUDBASE_APIKEY through EnvParams, redeploy, then verify a real read. See ../cloud-functions/references/http-function-credentials.md.All packaged reference files (required for skill lint reachability):
© TencentCloudBase, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 2 other files (references) in config/source/skills/cloudrun-development of TencentCloudBase/CloudBase-AI-Toolkit.
Open the folder on GitHubat commit 21af91c
We found 4 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in TencentCloudBase/CloudBase-AI-Toolkit, which our catalogue first saw on October 7, 2026.
Cloudrun Development next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Cloudrun Development this skillTencentCloudBase/CloudBase-AI-Toolkit | 1.1k | 1 repos | ~7.2k | Automated safety check: Pass | MIT | |
| Tgf Server Devthkhxm/tgf | 128 | — | ~1.3k | Automated safety check: Notes | MIT | |
| Use Sealoshashgraph-online/awesome-codex-plugins | 1.2k | — | ~2.2k | Automated safety check: Pass | Apache-2.0 | |
| Create Environmentgodatadriven/whirl | 205 | — | ~1.9k | Automated safety check: Pass | Apache-2.0 | |
| Spring Boot Project Creatorgiuseppe-trisciuoglio/developer-kit | 355 | — | ~3.4k | Automated safety check: Notes | MIT | |
| SQL Database Support for pRESTprest/prest | 4.6k | — | ~1.6k | Automated safety check: Pass | MIT |
thkhxm/tgf
基于 tgf v2(github.com/thkhxm/tgf/v2)用确定性的 tgfctl 工作流创建、验证和维护 Go 游戏服务器项目。
hashgraph-online/awesome-codex-plugins
Deploy and operate apps on Sealos Cloud: sign in to a Sealos account, deploy any project or self-hosted app (from the template store, an official Docker image, or project source code), provision…
godatadriven/whirl
Create a new Whirl environment in the envs/ directory. An agent skill from godatadriven/whirl.
giuseppe-trisciuoglio/developer-kit
Creates and scaffolds a new Spring Boot project (3.x or 4.x) by downloading from Spring Initializr, generating package structure (DDD or Layered architecture), configuring JPA, SpringDoc OpenAPI…
prest/prest
Guides classifying, gap-analyzing and scaffolding support for a new SQL database in pREST, from Postgres-compatible variants to entirely new dialects.
awslabs/agent-plugins
Build with Aurora DSQL — manage schemas, execute queries, handle migrations, diagnose query plans, diagnose cluster performance, load data, and develop applications with a serverless, distributed…
TencentCloudBase/CloudBase-AI-Toolkit
A skill your agent uses for Node.js backend AI via @cloudbase/node-sdk (=3.16.0) — cloud functions, CloudRun, Express/Koa/NestJS, serverless APIs, scheduled jobs, LLM proxies, agent orchestration.
TencentCloudBase/CloudBase-AI-Toolkit
CloudBase official HTTP API client guide. An agent skill from TencentCloudBase/CloudBase-AI-Toolkit.
TencentCloudBase/CloudBase-AI-Toolkit
Author or revise a cloud-api-operations recipe (config/source/skills/cloud-api-operations/references/recipes/).
TencentCloudBase/CloudBase-AI-Toolkit
Analyze, standardize, validate, and sync locally maintained skills into agent skill directories with a skills CLI-aligned workflow.
TencentCloudBase/CloudBase-AI-Toolkit
Build production-ready AI agent backends using the CloudBase Agent Python SDK — create agents with LangGraph/CrewAI/LlamaIndex, serve them via FastAPI with AG-UI protocol streaming +…
TencentCloudBase/CloudBase-AI-Toolkit
A skill your agent uses when you develop, design, build, deploy, debug, migrate, or troubleshoot CloudBase (腾讯云开发, 云开发, TCB, 微信云开发) projects — Web, 微信小程序, 小程序, uni-app, mobile (iOS, Android…
Works with
Categories
CloudBase Run backend development rules (Function mode/Container mode). Cloudrun Development is an agent skill from TencentCloudBase/CloudBase-AI-Toolkit. CloudBase Run backend development rules (Function mode/Container mode).
Cloudrun Development fits situations like: deploying backend services that require long connections; multi-language support; custom environments; AI agent development.
Run `npx skills add TencentCloudBase/CloudBase-AI-Toolkit --skill cloudrun-development -a claude-code`. Or copy the skill folder (config/source/skills/cloudrun-development in TencentCloudBase/CloudBase-AI-Toolkit) into .claude/skills/cloudrun-development in your project. Claude Code loads it when a task matches its description.
Run `npx skills add TencentCloudBase/CloudBase-AI-Toolkit --skill cloudrun-development -a codex`. Or copy the skill folder (config/source/skills/cloudrun-development in TencentCloudBase/CloudBase-AI-Toolkit) into .agents/skills/cloudrun-development in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add TencentCloudBase/CloudBase-AI-Toolkit --skill cloudrun-development -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/cloudrun-development, .gemini/skills/cloudrun-development, .github/skills/cloudrun-development and .opencode/skills/cloudrun-development in your project.
Going by SKILL.md and its folder, Cloudrun Development needs the command-line tools its instructions call (docker) and credentials named TCB_API_KEY. Our summary lists: Python 3; Docker; A credential in TCB_API_KEY.
SKILL.md contains no URLs. Its commands use docker, which can reach the network depending on how they are called. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Cloudrun Development is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 7.2k tokens (SKILL.md is roughly 29k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 4.7k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Cloudrun Development: Tgf Server Dev (thkhxm/tgf, 128 stars), Use Sealos (hashgraph-online/awesome-codex-plugins, 1.2k stars), Create Environment (godatadriven/whirl, 205 stars) and Spring Boot Project Creator (giuseppe-trisciuoglio/developer-kit, 355 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
TencentCloudBase (a GitHub organization) maintains it in TencentCloudBase/CloudBase-AI-Toolkit, which has 1,133 GitHub stars. The repository holds 49 skills in this directory. The repository was last updated on October 7, 2026.
Source: TencentCloudBase/CloudBase-AI-Toolkit on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.