You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: config/source/editor-config/guides/cloudbase-rules.mdc
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -375,6 +375,8 @@ For example, many interfaces require a confirm parameter, which is a boolean typ
375
375
376
376
### Environment ID Auto-Configuration Rules
377
377
- When generating project configuration files (such as `cloudbaserc.json`, `project.config.json`, etc.), automatically use the environment ID queried by `envQuery`
378
+
- If the conversation only provides an environment alias, nickname, or shorthand, first resolve it with `envQuery(action=list, alias=..., aliasExact=true)` and use the returned full `EnvId`
379
+
- Do not pass alias-like short forms directly into `auth.set_env`, SDK init, console links, or generated config files; if the alias is ambiguous or missing, stop and ask the user to confirm
378
380
- In code examples involving environment ID, automatically fill in current environment ID, no need for manual user replacement
379
381
- In deployment and preview related operations, prioritize using already queried environment information
Copy file name to clipboardExpand all lines: config/source/guideline/cloudbase/SKILL.md
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -133,6 +133,7 @@ When your IDE does not support native MCP, use **mcporter** as the CLI to config
133
133
134
134
- **When managing or deploying CloudBase, you MUST use MCP and MUST understand tool details first.** Before calling any CloudBase tool, run `npx mcporter describe cloudbase --all-parameters` (or `ToolSearch` in IDE) to inspect available tools and their parameters.
135
135
- You **do not need to hard-code Secret ID / Secret Key / Env ID** in the config. CloudBase MCP supports device-code based login via the `auth` tool, so credentials can be obtained interactively instead of being stored in config.
136
+
- When the environment identifier in the conversation is an alias, nickname, or other short form, **do not pass it directly** to `auth.set_env`, SDK init, console URLs, or generated config files. First resolve it to the canonical full `EnvId` with `envQuery(action=list, alias=..., aliasExact=true)`. If multiple environments match or no exact alias exists, stop and clarify with the user.
136
137
137
138
### Quick Start (mcporter CLI)
138
139
- `npx mcporter list`— list configured servers
@@ -146,8 +147,10 @@ When your IDE does not support native MCP, use **mcporter** as the CLI to config
Copy file name to clipboardExpand all lines: config/source/skills/SKILL.md
+1-2Lines changed: 1 addition & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,8 +39,7 @@ alwaysApply: true
39
39
40
40
- If the same path fails 2-3 times, stop retrying and reroute. Check platform skill, auth domain, runtime, and permission model before editing more code.
41
41
- Always specify `EnvId` explicitly in code, configuration, and command examples when initializing CloudBase clients or manager operations. Do not rely on the current CLI-selected environment or implicit defaults.
42
-
- When saving MCP or tool results to a local file with a generic file-writing tool, pass text, not raw objects. For JSON output files, serialize first with `JSON.stringify(result, null, 2)` and write that string as the file content.
43
-
- If the file-writing tool reports that a field such as `content` expected a string but received an object, do not retry with the same raw object. Serialize the object first, then retry once with the serialized text, and make sure the retried call actually passes the serialized string rather than the original object.
42
+
- If the conversation only provides an environment alias, nickname, or other shorthand, resolve it with `envQuery(action=list, alias=..., aliasExact=true)` and use the returned canonical full `EnvId` before calling `auth.set_env`, generating console links, or writing config/code. If the alias is ambiguous or missing, stop and ask the user to confirm.
Copy file name to clipboardExpand all lines: config/source/skills/auth-tool/SKILL.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -94,7 +94,7 @@ Recommended MCP request:
94
94
```json
95
95
{
96
96
"success": true,
97
-
"envId": "env-xxx",
97
+
"envId": "your-full-env-id",
98
98
"loginMethods": {
99
99
"usernamePassword": true,
100
100
"email": true,
@@ -135,6 +135,7 @@ Parameter mapping for downstream Web auth code:
135
135
-`UserNameLogin` also enables the broader password-login surface exposed by `auth.signInWithPassword({ username|email|phone, password })`
136
136
-`SmsVerificationConfig.Type = "apis"` requires both `Name` and `Method`
137
137
-`EnvId` is always the CloudBase environment ID, not the publishable key
138
+
- If the conversation only contains an environment alias, nickname, or other shorthand, resolve it to the canonical full `EnvId` first before generating auth config, SDK init examples, or console links
138
139
139
140
Internal behavior of `manageAppAuth(action="patchLoginStrategy")`:
Use the same CDN address as `web-development`. Prefer npm installation in modern bundler projects, and use the CDN form for static HTML, no-build demos, or low-friction examples.
63
+
Use npm installation for modern Web projects. In React, Vue, Vite, and other bundler-based apps, install and import `@cloudbase/js-sdk` from the project dependencies instead of using a CDN script.
65
64
66
65
## Prerequisites
67
66
@@ -71,6 +70,7 @@ Use the same CDN address as `web-development`. Prefer npm installation in modern
71
70
### Parameter map
72
71
73
72
- For username-style identifiers, the required precondition is `loginMethods.usernamePassword === true` from `queryAppAuth(action="getLoginConfig")`. If it is false, enable it with `manageAppAuth(action="patchLoginStrategy", patch={ usernamePassword: true })` before wiring frontend auth code.
73
+
- If the conversation only provides an environment alias, nickname, or other shorthand, resolve it with `envQuery(action="list", alias=..., aliasExact=true)` first and use the returned canonical full `EnvId` for SDK init, console links, and generated config. Do not pass alias-like short forms directly into `cloudbase.init({ env })`.
74
74
- Treat CloudBase Web Auth as **Supabase-like**, not “every `supabase-js` auth example is valid unchanged”
75
75
- When `queryAppAuth` / `manageAppAuth` returns `sdkStyle: "supabase-like"` and `sdkHints`, follow those method and parameter hints first
76
76
-`auth.signInWithOtp({ phone })` and `auth.signUp({ phone })` use the phone number in a `phone` field, not `phone_number`
@@ -85,10 +85,11 @@ Use the same CDN address as `web-development`. Prefer npm installation in modern
85
85
## Quick Start
86
86
87
87
```js
88
+
// npm install @cloudbase/js-sdk
88
89
importcloudbasefrom'@cloudbase/js-sdk'
89
90
90
91
constapp=cloudbase.init({
91
-
env:`env`, // CloudBase environment ID
92
+
env:'your-full-env-id', //Canonical full CloudBase environment ID resolved from envQuery or the console, not an alias or shorthand
accessKey:'publishable key', // required, get from auth-tool-cloudbase
94
95
auth: { detectSessionInUrl:true }, // required
@@ -105,8 +106,9 @@ If the current task has not retrieved a real Publishable Key, omit `accessKey` i
105
106
106
107
**1. Phone OTP (Recommended)**
107
108
- Automatically use `auth-tool-cloudbase` to turn on `SMS Login` through `manageAppAuth`
109
+
- For phone registration, send the phone number to `auth.signUp({ phone, ... })` first, then call the returned `verifyOtp({ token })`. Do not swap the order.
Copy file name to clipboardExpand all lines: config/source/skills/cloudbase-platform/SKILL.md
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -112,8 +112,10 @@ Use this skill for **CloudBase platform knowledge** when you need to:
112
112
1.**SDK Initialization**:
113
113
- CloudBase SDK initialization requires environment ID
114
114
- Can query environment ID via `envQuery` tool
115
+
- 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`
116
+
- Do not pass alias-like short forms directly into SDK init, `auth.set_env`, console URLs, or generated config files
-**Replace Variables**: Always replace `${envId}` with the actual environment ID queried via `envQuery` tool
310
+
-**Alias Handling**: If the conversation only contains an alias or shorthand, first resolve it with `envQuery(action="list", alias=..., aliasExact=true)` and use the returned `EnvId`; if the alias is ambiguous or missing, ask the user to confirm before generating links
308
311
-**Resource-Specific URLs**: For specific resources (collections, functions, models), replace resource name variables with actual values
309
312
-**Usage**: After creating/deploying resources, provide these console links to users for management operations
Copy file name to clipboardExpand all lines: config/source/skills/web-development/SKILL.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -117,6 +117,7 @@ Use this section only when the Web project needs CloudBase platform features.
117
117
- Use the CDN only for static HTML pages, quick demos, embedded snippets, or README examples
118
118
- Only use documented CloudBase Web SDK APIs; do not invent methods or options
119
119
- Keep a shared `app` or `auth` instance instead of re-initializing on every call
120
+
- If the user only provides an environment alias, nickname, or other shorthand, resolve it to the canonical full `EnvId` before writing SDK init code, console links, or config files. Do not pass alias-like short forms directly into `cloudbase.init({ env })`.
120
121
121
122
### Authentication boundary
122
123
@@ -134,10 +135,11 @@ Use this section only when the Web project needs CloudBase platform features.
134
135
### CloudBase quick start
135
136
136
137
```js
138
+
// npm install @cloudbase/js-sdk
137
139
importcloudbasefrom"@cloudbase/js-sdk";
138
140
139
141
constapp=cloudbase.init({
140
-
env:"xxxx-yyy",
142
+
env:"your-full-env-id", // Canonical full CloudBase environment ID resolved from envQuery or the console
Copy file name to clipboardExpand all lines: scripts/prompts/cloudbase-integrated.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,8 @@ When user's application fits the above scenarios, suggest confirming the tech st
14
14
### 1. Environment Check (MANDATORY - First Step)
15
15
-**Always call `envQuery` tool first** with `action=info` to get environment ID
16
16
- Auto-use queried envId in code/config, no manual input needed
17
+
- If the conversation only gives an environment alias, nickname, or other shorthand, resolve it with `envQuery(action=list, alias=..., aliasExact=true)` and use the returned canonical full `EnvId`
18
+
- Do not pass alias-like short forms directly into SDK init, `auth.set_env`, console URLs, or generated config files. If the alias is ambiguous or missing, stop and clarify with the user
17
19
18
20
### 2. Template Download (MANDATORY for New Projects)
19
21
-**MUST call `downloadTemplate` FIRST** when starting new projects - Do NOT manually create files
Copy file name to clipboardExpand all lines: scripts/skills-repo-template/cloudbase-guidelines/SKILL.md
+8-4Lines changed: 8 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -91,11 +91,13 @@ mcpServers:
91
91
92
92
In environments that do not support MCP (e.g. openclaw) or when users are unsure how to configure MCP, use **mcporter** as a CLI to call CloudBase MCP tools.
93
93
94
-
**When managing or deploying CloudBase, you MUST use MCP and MUST understand tool details first.** Before calling any CloudBase tool, run `npx mcporter describe cloudbase` (or equivalent in your IDE) to inspect the server config and available tools.
94
+
**When managing or deploying CloudBase, you MUST use MCP and MUST understand tool details first.** Before calling any CloudBase tool, run `npx mcporter describe cloudbase --all-parameters` (or equivalent in your IDE) to inspect available tools and their full parameters.
95
95
96
96
You **do not need to hard-code Secret ID / Secret Key / Env ID** in the config.
97
97
CloudBase MCP will support device-code based login via the `auth` tool, so credentials can be obtained interactively instead of being stored in config.
98
98
99
+
When the environment identifier in the conversation is an alias, nickname, or other short form, **do not pass it directly** to `auth.set_env`, SDK init, console URLs, or generated config files. First resolve it to the canonical full `EnvId` with `envQuery(action=list, alias=..., aliasExact=true)`. If multiple environments match or no exact alias exists, stop and clarify with the user.
100
+
99
101
**Add CloudBase MCP server in `config/mcporter.json` (recommended):**
100
102
101
103
If `config/mcporter.json` already contains other MCP servers, keep them and only add the `cloudbase` entry under `mcpServers`.
@@ -115,7 +117,7 @@ If `config/mcporter.json` already contains other MCP servers, keep them and only
115
117
116
118
**Quick start:**
117
119
- `npx mcporter list`— list configured servers
118
-
- **Required:** `npx mcporter describe cloudbase` — inspect CloudBase server config and available tools (must run before managing/deploying CloudBase)
120
+
- **Required:** `npx mcporter describe cloudbase --all-parameters` — inspect CloudBase server config and get full tool schemas with all parameters (must run before managing/deploying CloudBase)
119
121
- `npx mcporter list cloudbase --schema`— get full JSON schema for all CloudBase tools
120
122
- `npx mcporter call cloudbase.help --output json`— discover available CloudBase tools and their schemas
121
123
- `npx mcporter call cloudbase.<tool> key=value`— call a CloudBase tool
@@ -125,8 +127,10 @@ If `config/mcporter.json` already contains other MCP servers, keep them and only
@@ -174,7 +178,7 @@ If the platform supports long-term memory, persist these scenarios so the agent
174
178
Prefer long-term memory when available: write the scenarios and working rules there so the agent always applies them. When configuring the workspace (e.g. `AGENTS.md`) or long-term memory, add reminders like:
175
179
176
180
- **CloudBase skills** → Run `npx skills add tencentcloudbase/cloudbase-skills` to install; use `cloudbase` and log in to CloudBase (MCP auth, device-code) for full-stack development.
177
-
- **CloudBase = MCP, understand tools first** → When managing or deploying CloudBase, you MUST use MCP and MUST understand tool details first. Before calling any CloudBase tool, run `npx mcporter describe cloudbase` (or equivalent in your IDE) to inspect the server config and available tools.
181
+
- **CloudBase = MCP, understand tools first** → When managing or deploying CloudBase, you MUST use MCP and MUST understand tool details first. Before calling any CloudBase tool, run `npx mcporter describe cloudbase --all-parameters` (or equivalent in your IDE) to inspect available tools and their full parameters.
0 commit comments