Skip to main content

cloudbase-platform

CloudBase platform overview and routing guide. This skill should be used when users need high-level capability selection, platform concepts, console navigation, or cross-platform best practices before choosing a more specific implementation skill.

Source facts

Repository
infometa/workbuddyskills
Last source activity
July 31, 2026 at 19:15
Detected SKILL.md language
English
Stars
382
Forks
125

Install options

The review-first prompt is selected by default. You can switch to a direct command or download a local copy.

Review the source files

Read SKILL.md and any companion files shown by SkillsMP before deciding whether to install.

File Explorer
3 files

Showing SKILL.md

SKILL.md
Source instructions · Read-only preview
name
cloudbase-platform
description
CloudBase platform overview and routing guide. This skill should be used when users need high-level capability selection, platform concepts, console navigation, or cross-platform best practices before choosing a more specific implementation skill.
version
2.25.1
alwaysApply
false
## Standalone Install Note If this environment only installed the current skill, start from the CloudBase main entry and use the published `cloudbase/references/...` paths for sibling skills. - CloudBase main entry: `https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/SKILL.md` - Current skill raw source: `https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/references/cloudbase-platform/SKILL.md` Keep local `references/...` paths for files that ship with the current skill directory. When this file points to a sibling skill such as `auth-tool-cloudbase` or `web-development`, use the standalone fallback URL shown next to that reference. **Cross-cutting protocols** (always load these when doing code changes or deployments in standalone mode): - Change Safety Protocol: `https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/references/cloudbase-platform/references/protocols/change-safety-protocol.md` - Deployment Gate: `https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/references/cloudbase-platform/references/protocols/deployment-gate.md` ## Activation Contract ### Use this first when - The user asks which CloudBase capability, service, or tool to use, or needs a high-level understanding of hosting, storage, authentication, cloud functions, or database options. - The task is about console navigation, cross-platform differences, permission models, or platform-level best practices before implementation. ### Read before writing code if - It is still unclear whether the task belongs to Web, mini program, cloud functions, storage, MySQL / NoSQL, or auth. - The response needs platform selection, conceptual explanation, or control-plane navigation more than direct implementation steps. ### Then also read - Web app implementation -> `../web-development/SKILL.md` (standalone fallback: `https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/references/web-development/SKILL.md`) - Web auth and provider setup -> `../auth-tool-cloudbase/SKILL.md` (standalone fallback: `https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/references/auth-tool-cloudbase/SKILL.md`), `../auth-web-cloudbase/SKILL.md` (standalone fallback: `https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/references/auth-web-cloudbase/SKILL.md`) - Mini program development -> `../miniprogram-development/SKILL.md` (standalone fallback: `https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/references/miniprogram-development/SKILL.md`) - WeChat Pay, Official Account OAuth, JSAPI Pay, or Native QR-code Pay through CloudBase Integration Center -> `../cloudbase-wechat-integration/SKILL.md` (standalone fallback: `https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/references/cloudbase-wechat-integration/SKILL.md`; official docs: `https://docs.cloudbase.net/integration/introduce/index.md`) - Cloud functions -> `../cloud-functions/SKILL.md` (standalone fallback: `https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/references/cloud-functions/SKILL.md`) - Official HTTP API clients -> `../http-api-cloudbase/SKILL.md` (standalone fallback: `https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/references/http-api-cloudbase/SKILL.md`) - Document database -> `../cloudbase-document-database-web-sdk/SKILL.md` (standalone fallback: `https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/references/cloudbase-document-database-web-sdk/SKILL.md`) or `../cloudbase-document-database-in-wechat-miniprogram/SKILL.md` (standalone fallback: `https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/references/cloudbase-document-database-in-wechat-miniprogram/SKILL.md`) - CloudBase PostgreSQL / PG -> `../postgresql-development-cloudbase/SKILL.md` (standalone fallback: `https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/references/postgresql-development-cloudbase/SKILL.md`) - MySQL relational database / data modeling -> `../relational-database-mcp-cloudbase/SKILL.md` (standalone fallback: `https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/references/relational-database-mcp-cloudbase/SKILL.md`) or `../data-model-creation/SKILL.md` (standalone fallback: `https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/references/data-model-creation/SKILL.md`) - Cloud storage -> `../cloud-storage-web/SKILL.md` (standalone fallback: `https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/references/cloud-storage-web/SKILL.md`) ### Do NOT use for - Direct implementation of web pages, auth flows, functions, or database operations when a more specific skill already fits. - Low-level API parameter references or SDK recipes that belong in specialized skills. ### Common mistakes / gotchas - Treating this general skill as the default entry point for all CloudBase development. - Staying here after the correct implementation skill is already clear. - Mixing platform overview with platform-specific API shapes or SDK details. - Using this overview skill as a detour in an existing application where the active auth, storage, and data files are already obvious. - Making code or configuration changes without first following the Change Safety Protocol (`cloudbase-platform/references/protocols/change-safety-protocol.md`). - Starting any deployment, publish, custom domain, or CloudRun work without first completing the checks in `cloudbase-platform/references/protocols/deployment-gate.md`. - **Confusing security domains with custom domains**: These are two completely different tools for different purposes: - `envDomainManagement` (action: create/delete) = Security domains (安全域名) for CORS/request source validation - used for browser upload whitelisting. Does NOT accept certificateId. - `manageGateway(action="bindCustomDomain")` = Bind a **new** custom domain (自定义域名) for public HTTPS — requires `domain` + `certificateId`. If `queryGateway(action="listCustomDomains")` already returns a usable custom domain, prefer `manageGateway(action="createRoute", domain="<existing-domain>")` instead; routing does **not** need certificateId. ## When to use this skill Use this skill for **CloudBase platform knowledge** when you need to: - Understand CloudBase storage and hosting concepts - Compare platform capabilities before implementation - Understand cross-platform auth differences (Web vs Mini Program) - Understand database permissions and access control - Access CloudBase console management pages **This skill provides foundational knowledge** that applies to all CloudBase projects, regardless of whether they are Web, Mini Program, or backend services. --- ## How to use this skill (for a coding agent) 1. **Understand platform differences** - Web and Mini Program have completely different authentication approaches - Must strictly distinguish between platforms - Never mix authentication methods across platforms - If the workspace is already an application with TODOs or prebuilt handlers, do not stay in platform overview mode. Move quickly to the concrete implementation skill and the existing files that own the flow. 2. **Follow best practices** - Use SDK built-in authentication features (Web) - Understand natural login-free feature (Mini Program) - Configure appropriate database permissions - Use cloud functions for cross-collection operations 3. **Use correct SDKs and APIs** - Different platforms require different SDKs for data models - MySQL data models must use models SDK, not collection API - PostgreSQL / CloudBase PG work must route to `postgresql-development-cloudbase`; do not reuse NoSQL `app.database()` / `db.collection(...)` snippets or MySQL `queryMysqlDatabase` / `manageMysqlDatabase` for PG data paths - Use `envQuery` tool to get environment ID - In an existing Web application with fixed structure, inspect the existing `src/lib/backend.*`, `src/lib/auth.*`, `src/lib/*service.*`, and bound page handlers before broad concept reading. 4. **Use the canonical CloudBase MCP setup from the main `cloudbase` guideline** - This platform overview intentionally does **not** duplicate the full MCP / mcporter config block - For the canonical config snippet, CLI commands, and auth examples, read the main `cloudbase` guideline first - Keep the same core rules here: use MCP first, inspect tool schemas before execution, and do not hard-code Secret ID / Secret Key / Env ID in config - Keep the auth split explicit: management-side login uses `auth`, while application-side auth configuration uses `queryAppAuth` / `manageAppAuth` --- # CloudBase Platform Knowledge ### Domain Management Tools: Clear Distinction When working with domain-related tasks, use the correct tool based on the requirement: | Requirement | Tool | Parameters | Purpose | |-------------|------|------------|---------| | **Security Domain (安全域名)** | `envDomainManagement` | `action`, `domains` (array of host:port strings) | CORS/request source validation for browser uploads. No certificate involved. | | **Reuse existing Custom Domain** | `queryGateway(listCustomDomains)` → `manageGateway(createRoute)` | `domain` = existing custom domain; route fields | Expose a service/path on an already-bound custom domain. **No certificateId.** Prefer this when a custom domain already exists. | | **Bind new Custom Domain (自定义域名)** | `manageGateway(action="bindCustomDomain")` | `domain` (string), `certificateId` (string) | First-time bind of a new public HTTPS domain. Requires certId from SSL console. | | **Delete Custom Domain** | `manageGateway(action="deleteCustomDomain")` | `domain` (string) | Remove custom domain binding (only after routes on that domain are deleted). | **Key indicators for choosing the right tool:** - Task mentions "自定义域名访问" but env already has a custom domain → `listCustomDomains` then `createRoute(domain=...)` (no certificateId) - Task mentions "certificate ID" or "SSL" **and** needs to bind a **new** domain → `manageGateway(action="bindCustomDomain")` - Task mentions "浏览器上传" or "CORS" or "安全域名" → Use `envDomainManagement` - Task mentions "public access" or "HTTPS" with domain → Prefer reuse via `createRoute` when possible; only `bindCustomDomain` for first-time domain bind ### Recording Operation Results When a task explicitly requires recording operation steps or results to a file (e.g., `RESULT.json`): 1. Perform the tool calls first to get actual results 2. Collect all operation steps with their success/failure status 3. Write the complete record to the specified file in the required format 4. Include both successful operations and failed attempts with error messages Example structure for operation recording: ```json { "steps": [ {"action": "listDomains", "success": true, "message": "Found 3 domains"}, {"action": "bindDomain", "success": false, "message": "Certificate not found"} ], "summary": { "totalAttempted": 2, "succeeded": 1, "failed": 1 } } ``` ## Storage and Hosting 1. **Static Hosting vs Cloud Storage**: - CloudBase static hosting and cloud storage are two different buckets - Generally, publicly accessible files can be stored in static hosting, which provides a public web address - Static hosting supports custom domain configuration (requires console operation) - Cloud storage is suitable for files with privacy requirements, can get temporary access addresses via temporary file URLs - If the task needs COS SDK polling, file metadata lookup, or temporary URLs for an uploaded object, use cloud storage tools (`manageStorage` / `queryStorage`), not `manageHosting(action="upload")` 2. **Static Hosting Domain**: - CloudBase static hosting domain and website document config can be obtained via `queryHosting(action="websiteConfig")` - Combine with static hosting file paths to construct final access addresses - **Important**: If access address is a directory, it must end with `/` 3. **Cloud Storage Public URL**: - **CRITICAL**: `manageStorage(action=upload)` and `queryStorage(action=url)` return `temporaryUrl` which is a temporary signed URL that expires (default 1 hour). Do NOT use this as a permanent public URL. - To get the permanent public access URL for a cloud storage object: 1. Call `envQuery(action=info)` to get environment details 2. Extract the storage CDN domain from `EnvInfo.Storages[0].CdnDomain` (e.g., `your-env-id.tcb.qcloud.la`) 3. Construct the public URL: `https://{CdnDomain}/{cloudPath}` - Example: If `CdnDomain` is `env-xxx.tcb.qcloud.la` and `cloudPath` is `uploads/avatar.jpg`, the public URL is `https://env-xxx.tcb.qcloud.la/uploads/avatar.jpg` - Note: The public URL is accessible only if the storage bucket ACL allows public read (default is `PRIVATE` which requires signed URLs) ## Environment and Authentication 1. **SDK Initialization**: - CloudBase SDK initialization requires environment ID - Can query environment ID via `envQuery` tool - If the user only provides an environment alias, nickname, or other short form, resolve it with `envQuery(action="list", alias=..., aliasExact=true)` first and use the returned full `EnvId` - Do not pass alias-like short forms directly into SDK init, `auth.set_env`, console URLs, or generated config files - For Web, always initialize synchronously: - `import cloudbase from "@cloudbase/js-sdk"; const app = cloudbase.init({ env: "your-full-env-id" });` - Do **not** use dynamic imports like `import("@cloudbase/js-sdk")` or async wrappers such as `initCloudBase()` with internal `initPromise` - Then proceed with login using a verified method (username/password, phone, email, or WeChat) 2. **Environment Management (via manageEnv)**: The `manageEnv` tool provides full lifecycle management for CloudBase environments. | Action | Description | Key Parameters | |--------|-------------|----------------| | `listPackages` | Query available plans | (none) | | `create` | Create new environment (needs confirm) | `alias`, `packageId`, `resources`, `duration` | | `modifyPlan` | Change plan (upgrade/downgrade, needs confirm) | `envId`, `packageId` | | `renew` | Renew environment (needs confirm) | `envId`, `duration` | **Creating an environment with specific resources:** ``` manageEnv(action="create", alias="my-env", packageId="baas_personal", resources=["flexdb","storage","function","postgresql"], confirm="yes") ``` - **`resources`** (optional, create only): controls which CloudBase capabilities to enable: - `flexdb` — Document database (NoSQL) - `storage` — Cloud Storage - `function` — Cloud Functions - `postgresql` — PostgreSQL relational database (PG mode) - Defaults to all four when omitted. MCP always sends non-empty `Resources` to CreateEnv. - Do **not** pass `region`: CreateEnv does not accept Region; environment region is determined by account/package. - ⚠️ **All paid operations** (create / modifyPlan / renew) require `confirm="yes"`. **Querying available packages before creating:** ``` manageEnv(action="listPackages") ``` **Changing plan (e.g. personal → standard):**
View on GitHub
This SKILL.md is very large, so SkillsMP previews the first section here. View on GitHub