Cloudbase Sites Runtime 标志

Cloudbase Sites Runtime

组织热门
TencentCloudBase
cloudbase-sites-runtime

Use when the user wants to develop, run, preview, save, deploy, or roll back a CloudBase Web app in this conversation as a Lovable/Codex-Sites-like vibe- coding session — i.e. any request that maps to "spin up a React+Vite project, see it live in the browser, iterate, save versions, deploy". Activate ONLY for browser-rendered Web projects based on the CloudBase official React (or Vue) + Vite template. Do NOT activate for: WeChat/Alipay mini-program, React Native / Flutter / Electron, pure cloud functions / CloudRun backends, or Next.js / Nuxt / Astro / Remix / SvelteKit (those frameworks are explicitly out of scope).

概览

发布者TencentCloudBase
代码仓库CloudBase-AI-Toolkit
技能名称cloudbase-sites-runtime
星标数
1.1K
复刻数
141
附带文件
仅含指令
许可协议MIT
链接
  • Markdown 格式的指令

    模型按需加载的 SKILL.md 文件,因此只有在请求确实匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 指令自成一体

    模型所需的一切都包含在指令中,无需同步额外文件。

  • 开源

    由 TencentCloudBase 发布于 GitHub。请在安装前查看源内容。

安装

在 TypingMind 中安装 Cloudbase Sites Runtime AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/TencentCloudBase/CloudBase-AI-Toolkit/tree/main/plugin/cloudbase-sites/skills/cloudbase-sites-runtime
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/TencentCloudBase/CloudBase-AI-Toolkit.git /tmp/CloudBase-AI-Toolkit
mkdir -p .claude/skills
cp -r /tmp/CloudBase-AI-Toolkit/plugin/cloudbase-sites/skills/cloudbase-sites-runtime .claude/skills/cloudbase-sites-runtime
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Cloudbase Sites Runtime,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Cloudbase Sites Runtime。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Cloudbase Sites Runtime 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会获取指令,因此未使用的技能不会产生额外费用。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

CloudBase Sites Runtime

This skill orchestrates a single working directory = single project flow for CloudBase Web apps. The cwd itself is the workspace; we do not manage cross-cwd state or session IDs at the skill level.

This runtime is shared by the Codex, Claude Code, and CodeBuddy plugin surfaces. The CLI and CloudBase MCP workflows are the source of truth. Some hosts also run bundled lifecycle hooks that start previews or inject compact rules at session start; if hooks are unavailable, disabled, or not yet trusted, use the explicit CLI commands in this skill.

Activation contract

Use this skill when

  • The user says "build me a website / app", "I want to make a landing page", "create a React app and let me preview", "deploy this to CloudBase", "save this version", "roll back to v1", or similar.
  • The current cwd looks like a CloudBase + Vite project (has package.json with vite + react or vue).
  • The user is running this conversation inside Codex, Claude Code, CodeBuddy, or a compatible host with the cloudbase-sites plugin enabled — cloudbase-mcp is registered and the cloudbase-sites binary is either on PATH or available from the plugin root's bin/cloudbase-sites.

Do NOT use this skill when

  • It's a mini-program project — route to mini-program guidance instead.
  • It's a native app project — route to http-api guidance.
  • It's a backend-only project — route to cloud-functions / cloudrun guidance.
  • The framework is Next/Nuxt/Astro/Remix — politely tell the user this skill only covers Vite-based React/Vue apps and stop. Do NOT try to adapt the scripts to those frameworks.

What this skill orchestrates — three layers

1. CloudBase MCP tools (provided by cloudbase-mcp, registered via plugin's .mcp.json)

These are the only tools that produce CloudBase side effects. Highlights:

  • downloadTemplate({ template: "react" | "vue", ide }) — pull official template
  • queryEnv({ action: "info" }) + auth({ action: "set_env", envId }) — bind env
  • manageApps({ action: "deployApp", ... }) — deploy to CloudApp (independent subdomain)
  • envDomainManagement({ action: "create", domains }) — whitelist dev origin for CORS
  • searchKnowledgeBase({ mode: "skill", skillName: "<name>" }) — fetch CloudBase domain skills (see below)

For all CloudBase operations beyond the dev-server lifecycle (auth, db, storage, ai), fetch the corresponding CloudBase domain skill via searchKnowledgeBase(mode="skill", skillName=...). Common ones:

  • ui-design UI design spec (mandatory before new UI work)
  • web-development Web project conventions
  • auth-tool-cloudbase provider config (management-side)
  • auth-web-cloudbase Web SDK auth client code
  • postgresql-development-cloudbase PG mode schema/RLS/app.rdb() (PG envs)
  • cloudbase-document-database-web-sdk document database Web SDK
  • cloud-storage-web cloud storage Web SDK
  • relational-database-web-cloudbase MySQL Web SDK
  • cloudbase-platform platform overview / console links

These are NOT Claude Code native skills and are NOT bundled with this plugin. They live inside cloudbase-mcp and are fetched on demand. When this file (or the injected RULES_BLOCK) says "调 ui-design skill" or "follow the auth-tool skill", that means: call searchKnowledgeBase(mode="skill", skillName="<that-name>") and apply the returned content.

2. The cloudbase-sites CLI (provided by this plugin's bin/ directory)

First resolve the CLI path:

  1. Try command -v cloudbase-sites.
  2. If that fails and the host exposes CODEX_PLUGIN_ROOT, use $CODEX_PLUGIN_ROOT/bin/cloudbase-sites.
  3. If that fails and the host exposes CLAUDE_PLUGIN_ROOT, use $CLAUDE_PLUGIN_ROOT/bin/cloudbase-sites.
  4. If SessionStart injected an absolute CLI path, use that path.

Do not assume Codex has injected the plugin bin/ directory into PATH.

Single binary, multiple subcommands. Use these — and ONLY these — for the dev-server / version / deploy lifecycle:

  • cloudbase-sites init --start — scaffold from empty cwd and start preview when the user explicitly wants a Sites app
  • cloudbase-sites preview — daemonize Vite for an existing Vite project
  • cloudbase-sites preview --status [--quiet] — JSON status / exit code
  • cloudbase-sites preview --restart / --stop [--force]
  • cloudbase-sites save -m "<label>" — create a saved version
  • cloudbase-sites versions — list saved versions + deploy status
  • cloudbase-sites deploy [--version <n>] — deploy a saved version (Phase 1: emit nextAction)
  • cloudbase-sites deploy --post --version <n> --access-url <url> [--build-id <BuildId>] [--version-name <VersionName>] — record deploy
  • cloudbase-sites rollback [--to-version <n>] — revert to a saved version
  • cloudbase-sites supervisor status|list|heal|reload|start|stop

Never invent npm run dev / vite / vite build invocations. The CLI handles host=0.0.0.0 forcing, port allocation (17173..17272), daemonization, base path injection, version metadata, and deploy history.

3. Standard tools (Bash, git, Edit, Write)

Use for editing files. The plugin's PostToolUse hook handles automatic restart on config-file edits — you don't need to manage that.

Lifecycle hooks and fallback

Do NOT invoke cloudbase-sites init or cloudbase-sites preview proactively in your first message just because the plugin is installed. SessionStart is intentionally passive for empty directories so the plugin does not interfere with unrelated sessions. A UserPromptSubmit hook may initialize after the first user message, but only when deterministic Chinese/English intent rules detect an explicit Sites/Web-app creation request. By the time you read the user's first prompt:

  • If the cwd was an existing Vite project: dev server is up (or installing).
  • If the cwd was empty: no files were downloaded by SessionStart. If the first prompt clearly asked to build/create a Sites app, UserPromptSubmit may have started init --start; otherwise initialize only after the user asks.
  • If the cwd is a non-Vite / blacklisted project: hook stayed silent.

Codex supports bundled plugin hooks, but non-managed command hooks may require the user to review and trust them before they run. If Codex hooks have not run, resolve the CLI path as described above, then fall back to <cloudbase-sites-cli> preview --status, <cloudbase-sites-cli> init, and the other explicit commands below instead of assuming automatic startup.

If SessionStart reports that it skipped a non-empty non-Vite cwd, do not assume the runtime is active. If a template is downloaded later through MCP downloadTemplate, run <cloudbase-sites-cli> preview --status and then <cloudbase-sites-cli> preview if no preview is running.

You only invoke a CLI verb when:

  • User asks to create/build a new Sites app in an empty cwd → cloudbase-sites init --start
  • User explicitly says "stop the dev server" → cloudbase-sites preview --stop
  • User asks for the URL or "is it running" → cloudbase-sites preview --status
  • User wants to save a version → cloudbase-sites save -m "<label>"
  • User wants to deploy → cloudbase-sites deploy (then bridge to manageApps)
  • User wants to roll back → cloudbase-sites rollback

When the user just walked into the conversation

  1. Read the SessionStart status first. If it says the cwd is passive/empty, do not assume a project exists. Wait for the user's first concrete Sites app request, then run cloudbase-sites init --start.

  2. For existing Vite projects, check preview state — read <cwd>/.cloudbase-sites/preview.json or run cloudbase-sites preview --status. If no preview is running, start it with cloudbase-sites preview.

  3. Tell the user the URL — surface internalUrl from the JSON. If the file is missing after init/preview, inspect .cloudbase-sites/logs/.

  4. Offer to open the preview. Ask: "要不要我用内置浏览器打开 预览一下?" If yes, use the host Browser / in-app browser tool to open internalUrl. Do not use macOS open, and do not run browser interaction tests unless the user explicitly asks you to test the UI.

  5. DO NOT re-init / re-start. Calling init again will fail with code 10 (cwd no longer empty). Calling preview is idempotent and safe but wastes a turn.

  6. NEVER guess the port. It is NOT 5173/5174/5175 — the plugin uses 17173..17272. Always read the recorded port from preview.json.

Two-stage save → deploy workflow

Inspired by Codex Sites' saved version model:

  • Save: label a git checkpoint. cloudbase-sites save -m "<label>" runs git init when needed, then git add -A && git commit && git tag version/<n> and appends to <cwd>/.cloudbase-sites/app.json.versions[]. No build, no deploy.
  • Deploy: publish a saved version to a CloudApp. cloudbase-sites deploy [--version <n>] (default: latest saved) builds dist/ locally then emits nextAction telling you to call manageApps({ action: "deployApp", serviceName: <stable from app.json>, filePath: cwd, buildPath: "dist", framework: "static", installCmd: "", buildCmd: "" }). The framework=static shape skips remote install/build because we built locally.
  • Record: after manageApps succeeds and gives you the access URL, call cloudbase-sites deploy --post --version <n> --access-url <url> --build-id <BuildId> [--version-name <VersionName>]. This appends to app.json.deployments[], records CloudBase build metadata, tags git deploy/<n>-<ts>, and returns finalUrl with a cache-busting query. If the manageApps result includes BuildId, you MUST pass it to --build-id; otherwise future build status and log queries cannot be traced directly from the saved deployment.
  • Rollback: cloudbase-sites rollback [--to-version <n>] (default: current production deploy). Stashes uncommitted edits, git reset --hard to the version's commit, marks newer versions as rolled-back, and restarts the dev server.

Why CloudApp (manageApps) not static hosting? Each CloudApp has its own subdomain (*.webapps.tcloudbase.com); two vibe sessions on the same env never collide. The stable siteName in app.json ensures re-deploys preserve the URL.

Pre-flight: if manageApps fails with "no envId" / env-related error, call queryEnv({ action: "info" }). If multiple envs exist, ask the user to pick. After binding, retry the deploy.

Proactive prompts (do not act unsolicited)

When you finish a user-requested feature (especially "make me a X app", "build me a Y", "add Z feature"), end your reply by asking:

  1. Save? "要保存这一版吗?(下次能再调出来)" → if yes, run cloudbase-sites save -m "<auto-generated label>".
  2. Deploy? "现在要部署看一下吗?(独立 URL,可分享)" → if yes, run the two-stage deploy described above.
  3. Open preview? "要不要我用内置浏览器打开 预览一下?" — if yes, use the host Browser / in-app browser tool to open internalUrl. Only click through interactions or run browser-driving verification after the user explicitly asks for testing. Do NOT spawn playwright / agent-browser by default.
  4. After successful deploy ask: "要我用 ui-design 能力进一步优化样式和体验吗?" If yes, fetch searchKnowledgeBase(mode="skill", skillName="ui-design") and iterate on the design.
  5. After a verified successful deploy — at most once — ask: "要不要把这次 「一句话做出这个应用」的过程整理成可分享的素材?(脱敏的图文卡片 + 可粘贴文案)" If yes, follow the cloudbase-platform skill's references/protocols/deployment-share.md (trigger boundaries, required information, anonymization red lines, deliverable formats). If that skill is not available in this environment, skip this step — do not improvise a share flow from memory. Never follow up if declined; never publish on the user's behalf.

Skip any of these when:

  • The work was a bug fix or trivial refactor.
  • The user already chose this option earlier in the session.
  • The user explicitly said "don't deploy" / "no tests" / "no design changes".

Hard rules (also injected by SessionStart hook)

  1. Never guess the preview URL. Always read preview.json or run cloudbase-sites preview --status. Default port range is 17173..17272.

  2. "Make me a X app" = X IS the homepage. When the user uses whole-house language, REPLACE the content of src/pages/HomePage.tsx (or App.tsx if no HomePage exists) with the new feature. Do NOT create a new <TodoApp /> component and leave the original template welcome at /. Only add a new route when the user explicitly says "add a X page".

  3. UI work for NEW features requires a design specification first. Before writing any .tsx/.css/.html, fetch searchKnowledgeBase(mode="skill", skillName="ui-design"), output the 4-part spec (Aesthetic / Color / Typography / Layout), THEN write code. The CloudBase template's CLAUDE.md "Existing Implementation First" exemption applies only to bug fixes; new apps still need ui-design.

  4. Never spawn npm run dev / vite / vite build yourself. Lifecycle is owned by hooks + the cloudbase-sites CLI.

  5. BaaS-first data persistence — detect the env type first. Before any data-layer work, call queryEnv({ action: "info" }) and branch on the detected database backend:

    env typeschema / RLSbrowser SDKdomain skill
    PostgreSQL (RuntimeBackends.postgresql === true)managePgDatabase (versioned applyMigration)app.rdb() / app.storage.from()postgresql-development-cloudbase
    NoSQL (document)writeNoSqlDatabaseStructure(action="createCollection")app.database() collectionscloudbase-document-database-web-sdk

    Do NOT load cloudbase-document-database-web-sdk (or NoSQL APIs) for a PG environment, and do NOT guess from the skill catalog — the catalog contains both, only queryEnv tells them apart. Reads/writes go through @cloudbase/js-sdk from React/Vue code either way. Reach for cloud functions only when (a) the logic cannot be expressed as security rules AND (b) it needs server-side secrets or a third-party API AND (c) it's a scheduled / background job. A Todo / Notes / Chat / Kanban app does NOT need cloud functions.

  6. Do not run browser tests by default. Verify reasonably (preview healthy, no compile error in cloudbase-sites preview --status). Offer to open the preview URL in the host Browser / in-app browser; ask again before interaction testing.

  7. Two-stage save → deploy. Don't deploy unsolicited. Don't bypass cloudbase-sites deploy with your own pnpm build + manageApps call — you'd lose version metadata, snapshot, deploy history, and the stable siteName.

  8. Icons come from lucide-react — preinstalled, never hand-installed. cloudbase-sites init injects lucide-react (react) / lucide-vue-next (vue) into the scaffold's package.json before its single install step. Import icons directly (import { Heart } from "lucide-react"). Do NOT run a package-install command just to add icons — sandboxed installs during generation are a known failure point — and do NOT hand-write inline SVG paths when a lucide icon exists.

  9. Fill VITE_PUBLISHABLE_KEY automatically — never ask the user. The template's src/utils/cloudbase.ts reads it from .env.local; new envs have no publishable key by default. After init: call queryAppAuth({ action: "getPublishableKey" }); if empty, call manageAppAuth({ action: "ensurePublishableKey" }); then write VITE_PUBLISHABLE_KEY=<key> into .env.local. This key cannot be skipped — it is the data-plane app credential attached to every browser request, including the login request itself and anonymous reads — but the user should never fill it by hand.

Hard rules — always parse CLI stdout as JSON

The first stdout line of every cloudbase-sites <verb> invocation is a single JSON object. The stderr [cloudbase-sites] ... line is for humans — do not parse it. On error the JSON is { ok: false, code: <int>, message, hint?, logPath? }. When a script reports failure, surface logPath to the user instead of guessing the cause.

Error codes from the CLI

codemeaningrecovery
1generic failurecheck the message and nextActions if present
2not a Vite project (or vite binary missing)pnpm install then retry
3port pool exhausted in 17173..17272cloudbase-sites preview --stop for stale ones, or pass --port
4dev server failed health check in 30sread logPath; usually a build error in user code
5no preview is running (status / stop)start one with cloudbase-sites preview
6stop failed (process refused SIGKILL)inspect the PID manually with ps; very rare
7build failed (cloudbase-sites deploy)inspect build output; fix code, retry
8dist/ missing or empty after buildconfirm scripts.build runs vite build; rerun
9cwd in danger blacklist (init)cd to a real project directory first
10cwd not empty (init)move conflicting files; only .git/.gitignore/README/LICENSE/.cloudbase-sites are tolerated
11template download failedcheck internet; URL is static.cloudbase.net/cloudbase-examples/...
12template extract failedinstall unzip
13dependency install failedcheck terminal output
14version not foundrun cloudbase-sites versions to list
15rollback failedcheck git state

State files

PathPurpose
<cwd>/.cloudbase-sites/preview.jsondev server PID/port/URL/framework
<cwd>/.cloudbase-sites/app.jsonsiteName + versions[] + deployments[] + currentVersion + currentDeploy
<cwd>/.cloudbase-sites/logs/preview-<ts>.logVite stdout/stderr
<cwd>/.cloudbase-sites/logs/hook-session-start.logSessionStart hook trace
<cwd>/.cloudbase-sites/logs/hook-restart.logPostToolUse restart trail
~/.cloudbase-sites/registry.jsonglobal supervisor's view of all cwds
~/.cloudbase-sites/supervisor.jsonglobal supervisor PID + uptime
~/.cloudbase-sites/supervisor.logsupervisor stdout/stderr

What this skill is NOT

  • It is not a session manager. There is no sessionId at the skill level. There is only cwd. (The supervisor's registry.json does track cwds globally, but for self-healing — not as a user-facing concept.)
  • It is not a reverse proxy. If the host is on a public-facing server and the user needs <host>:8080/s/<sid>/ style routing, that's a separate optional component (cloudbase-sites-proxy, future work) — out of scope here.
  • It is not a CloudBase auth/database guide. For those, fetch the corresponding CloudBase domain skill via searchKnowledgeBase(mode="skill", skillName=...).
  • It is not a UI design guide. For visual decisions, fetch searchKnowledgeBase(mode="skill", skillName="ui-design").

常见问题

Cloudbase Sites Runtime AI 技能有什么作用?

Use when the user wants to develop, run, preview, save, deploy, or roll back a CloudBase Web app in this conversation as a Lovable/Codex-Sites-like vibe- coding session — i.e. any request that maps to "spin up a React+Vite project, see it live in the browser, iterate, save versions, deploy". Activate ONLY for browser-rendered Web projects based on the CloudBase official React (or Vue) + Vite template. Do NOT activate for: WeChat/Alipay mini-program, React Native / Flutter / Electron, pure cloud functions / CloudRun backends, or Next.js / Nuxt / Astro / Remix / SvelteKit (those frameworks ar...

为什么在 TypingMind 中使用 Cloudbase Sites Runtime?

因为您只需安装一次,就能搭配任何模型使用。Cloudbase Sites Runtime 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型,甚至可以在聊天中途切换模型,而不会影响技能正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Cloudbase Sites Runtime?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/TencentCloudBase/CloudBase-AI-Toolkit/tree/main/plugin/cloudbase-sites/skills/cloudbase-sites-runtime。TypingMind 会读取其中的 SKILL.md,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Cloudbase Sites Runtime?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Cloudbase Sites Runtime 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以搭配 Cloudbase Sites Runtime 使用,包括 GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等,都可在 TypingMind 中使用您自己的 API 密钥接入。

Cloudbase Sites Runtime AI 技能免费吗?

是的。该技能源自 TencentCloudBase 在 GitHub 上以 MIT 许可证发布的项目。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇