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: skills/cloudbase/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
@@ -71,7 +71,7 @@ Follow relative `references/...` paths from the current skill. If MCP is unavail
71
71
72
72
- After 2–3 failed attempts on the same path, stop and reroute (platform skill, runtime, auth domain, permission model, SDK boundary).
73
73
- Always specify `EnvId` explicitly; do not rely on CLI-selected or implicit env state.
74
-
- When the environment identifier is an alias, nickname, or other short form, **do not pass it directly** to `auth.set_env`, SDK init, console URLs, or generated config. 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.
74
+
- When the environment identifier is an alias, nickname, or other short form, **do not pass it directly** to `auth.set_env`, SDK init, console URLs, or generated config. First resolve it to the canonical full `EnvId` with `queryEnv(action=list, alias=..., aliasExact=true)`. If multiple environments match or no exact alias exists, stop and clarify with the user.
75
75
- When writing MCP/tool results to a file, pass serialized text (`JSON.stringify(result, null, 2)`), not raw objects. If a write tool says `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.
76
76
- Keep scenario-specific pitfalls in child skills — do not expand this entry file.
77
77
-**First frontend deploy must use `manageApps(action="createApp", ...)`.**`manageHosting` is only for incremental updates of projects originally deployed via hosting.
@@ -97,6 +97,7 @@ These rules override convenience. Full rationale lives in `web-development`.
97
97
| WeChat mini program + CloudBase |`miniprogram-development`|`auth-wechat-miniprogram`, `cloudbase-document-database-in-wechat-miniprogram`|`auth-web-cloudbase`, `web-development`| Whether the project really uses CloudBase / `wx.cloud`|
| Web projects + NoSQL Database |`web-development`|`cloudbase-document-database-web-sdk`, `auth-web-cloudbase`|`relational-database-mcp-cloudbase`, `http-api-cloudbase`| Login state and database access permission model |
100
+
| CloudBase PostgreSQL Best Practices |`postgresql-best-practices-cloudbase`|`postgresql-development-cloudbase`|`cloudbase-document-database-web-sdk`| Access paths, index decisions, row authorization, and launch capacity |
Copy file name to clipboardExpand all lines: skills/cloudbase/references/ai-model-nodejs/SKILL.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -75,7 +75,7 @@ Before calling any AI API on the server, **run the two-step preflight**: ① eli
75
75
76
76
### Step 0: obtain the environment ID
77
77
78
-
Call the MCP tool `envQuery` with `action=info` and read `EnvId` from the response.
78
+
Call the MCP tool `queryEnv` with `action=info` and read `EnvId` from the response.
79
79
80
80
---
81
81
@@ -254,7 +254,7 @@ For full `generateText` / `streamText` / `generateImage` code examples, the erro
254
254
255
255
## Best Practices
256
256
257
-
1.**Run the two-step preflight before writing business code** — ① eligibility: `envQuery` → `callCloudApi(tcb, DescribeEnvPostpayPackage)` to confirm the Token Credits resource pack (text + image share the same pack); ② group readiness: `DescribeAIModels` for the `cloudbase` group and its `Models[]`, `DescribeManagedAIModelList` for the authoritative supported-model catalog, `UpdateAIModel` with a full-replacement `Models[]` + `Status: 1` when the target model is missing. If the pack is missing, return the purchase link `https://buy.cloud.tencent.com/lowcode?buyType=resPack&envId={envId}&resourceType=token` instead of emitting SDK code and letting the user debug runtime errors.
257
+
1.**Run the two-step preflight before writing business code** — ① eligibility: `queryEnv` → `callCloudApi(tcb, DescribeEnvPostpayPackage)` to confirm the Token Credits resource pack (text + image share the same pack); ② group readiness: `DescribeAIModels` for the `cloudbase` group and its `Models[]`, `DescribeManagedAIModelList` for the authoritative supported-model catalog, `UpdateAIModel` with a full-replacement `Models[]` + `Status: 1` when the target model is missing. If the pack is missing, return the purchase link `https://buy.cloud.tencent.com/lowcode?buyType=resPack&envId={envId}&resourceType=token` instead of emitting SDK code and letting the user debug runtime errors.
258
258
2.**Never assume any model is already enabled** — not `deepseek-v4-flash`, not `hunyuan-image`, not anything. Always verify with `DescribeAIModels` first; if the target is missing, look up the exact `Model` string in `DescribeManagedAIModelList` (do **not** guess the spelling) and then `UpdateAIModel` to enable it.
259
259
3.**`createModel` accepts exactly three kinds of values** — `"cloudbase"` (the main managed group), `"hunyuan-exp"` (legacy builtin), or a user-defined GroupName registered via `CreateAIModel` (**MUST start with `custom-`**, e.g. `custom-kimi`, `custom-openai-compat`). **Never** guess with `createModel("deepseek")` / `createModel("kimi")` / `createModel("custom")` — the first two are vendor/model names, the last is a placeholder. `createImageModel("hunyuan-image")` is a separate image API — keep it as-is.
260
260
4.**Do not invent SDK method names or parameters.** This skill (SKILL.md + `references/api-reference.md`) is the authoritative reference for `@cloudbase/node-sdk`'s AI surface — look up the method signature there before writing code. If a method or field is not documented there, stop and ask, or check the live contract via the MCP tools. No guessing.
Copy file name to clipboardExpand all lines: skills/cloudbase/references/ai-model-wechat/SKILL.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -87,7 +87,7 @@ You MUST NOT jump straight into `wx.cloud.extend.AI.createModel(...)`. Before wr
87
87
88
88
The Mini Program side has two billing paths: **小程序成长计划** (checked first; if enrolled, use `hunyuan-exp`) and **Token Credits 资源包** (generic fallback; if available, use the `cloudbase` main managed group).
89
89
90
-
1. Fetch `envId` via the MCP tool `envQuery action=info`.
90
+
1. Fetch `envId` via the MCP tool `queryEnv action=info`.
Copy file name to clipboardExpand all lines: skills/cloudbase/references/auth-web-cloudbase/SKILL.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -87,7 +87,7 @@ Use npm installation for modern Web projects. In React, Vue, Vite, and other bun
87
87
### Parameter map
88
88
89
89
- 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.
90
-
- 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 })`.
90
+
- If the conversation only provides an environment alias, nickname, or other shorthand, resolve it with `queryEnv(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 })`.
91
91
- Treat CloudBase Web Auth as **Supabase-like**, not “every `supabase-js` auth example is valid unchanged”
92
92
- When `queryAppAuth` / `manageAppAuth` returns `sdkStyle: "supabase-like"` and `sdkHints`, follow those method and parameter hints first
93
93
-`auth.signInWithOtp({ phone })` and `auth.signUp({ phone })` use the phone number in a `phone` field, not `phone_number`
-- Optional: allow users to update/delete their own files
153
153
CREATE POLICY "users_manage_own"ONstorage.objects
@@ -216,7 +216,7 @@ const result = await app.uploadFile({
216
216
- Validate file type and size before upload.
217
217
- Show upload progress for larger files when UX matters.
218
218
- On local dev origins, confirm the exact frontend origin already exists in environment security domains before assuming the upload path is usable.
219
-
- Match against the whitelist entry format returned by `envQuery(action="domains")`, which is typically `host:port` instead of a full `http://...` URL.
219
+
- Match against the whitelist entry format returned by `queryEnv(action="domains")`, which is typically `host:port` instead of a full `http://...` URL.
220
220
- If the environment has no storage bucket or the SDK returns `STORAGE_NOT_EXIST` / `STORAGE_BUCKET_NOT_FOUND`, use CloudBase management/MCP storage tools to create or choose a bucket before retrying. Do not treat this as a successful optional upload.
221
221
- After `app.uploadFile()` succeeds, do **not** fabricate a public-looking URL by concatenating `envId`, bucket domain, or `cloudPath`. Use the returned `fileID` with `app.getTempFileURL()` and store or display the SDK-resolved URL instead.
222
222
@@ -291,7 +291,7 @@ Use this for browser-initiated downloads. For programmatic rendering or preview,
291
291
To avoid CORS problems, add your frontend domain in CloudBase security domains. In MCP-enabled workflows, prefer checking and updating this through tools before coding browser uploads.
292
292
293
293
```json
294
-
{ "tool":"envQuery", "action":"domains" }
294
+
{ "tool":"queryEnv", "action":"domains" }
295
295
```
296
296
297
297
Use the actual browser origin when deciding what to add. If the page is running on a custom domain or a local dev port, add that exact `host:port` value instead of guessing from a hard-coded list.
@@ -304,7 +304,7 @@ Use the actual browser origin when deciding what to add. If the page is running
304
304
}
305
305
```
306
306
307
-
Match the real browser origin to the whitelist entry format returned by `envQuery(action="domains")`. For local Vite and preview servers, the port can vary between runs, so avoid assuming any fixed default port is sufficient.
307
+
Match the real browser origin to the whitelist entry format returned by `queryEnv(action="domains")`. For local Vite and preview servers, the port can vary between runs, so avoid assuming any fixed default port is sufficient.
Copy file name to clipboardExpand all lines: skills/cloudbase/references/cloudbase-code-review/references/rules/postgresql/PG-CR005.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@
21
21
22
22
1. 项目是否运行在 CloudBase PG / pgstore 环境?
23
23
2. 如果是,存储桶创建后是否配置了 `storage.objects` 表的 RLS 策略?
24
-
3. 存储 RLS 策略是否至少允许认证用户上传(`FOR INSERT TO authenticated WITH CHECK (auth.role() = 'authenticated')`)和读取(`FOR SELECT TO authenticated USING (auth.role() = 'authenticated')`)?
24
+
3. 存储 RLS 策略是否至少允许认证用户上传(`FOR INSERT TO authenticated WITH CHECK (true)`)和读取(`FOR SELECT TO authenticated USING (true)`)?`TO authenticated` 已经是角色门,不需要重复调用 `auth.role()`。
0 commit comments