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/skills/auth-web/SKILL.md
+4-3Lines changed: 4 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -107,10 +107,11 @@ If the current task has not retrieved a real Publishable Key, omit `accessKey` i
107
107
108
108
**1. Phone OTP (Recommended)**
109
109
- Automatically use `auth-tool-cloudbase` to turn on `SMS Login` through `manageAppAuth`
110
-
- For phone registration, send the phone number to `auth.signUp({ phone, ... })` first, then call the returned `verifyOtp({ token })`. Do not swap the order.
110
+
- Send the phone number to `auth.signInWithOtp({ phone, ... })`, then call the returned `verifyOtp({ token })`.
111
+
-`signInWithOtp` can automatically create a new user if the user does not exist; control this via `shouldCreateUser` parameter (default `true`).
Copy file name to clipboardExpand all lines: doc/prompts/cloudbase-platform.mdx
+105Lines changed: 105 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -86,6 +86,9 @@ Keep local `references/...` paths for files that ship with the current skill dir
86
86
- Staying here after the correct implementation skill is already clear.
87
87
- Mixing platform overview with platform-specific API shapes or SDK details.
88
88
- Using this overview skill as a detour in an existing application where the active auth, storage, and data files are already obvious.
89
+
-**Confusing security domains with custom domains**: These are two completely different tools for different purposes:
90
+
-`envDomainManagement` (action: create/delete) = Security domains (安全域名) for CORS/request source validation - used for browser upload whitelisting. Does NOT accept certificateId.
91
+
-`manageGateway(action="bindCustomDomain")` = Custom domains (自定义域名) for public HTTPS access with SSL certificates - requires domain and certificateId parameters.
89
92
90
93
## When to use this skill
91
94
@@ -131,6 +134,45 @@ Use this skill for **CloudBase platform knowledge** when you need to:
131
134
132
135
# CloudBase Platform Knowledge
133
136
137
+
### Domain Management Tools: Clear Distinction
138
+
139
+
When working with domain-related tasks, use the correct tool based on the requirement:
140
+
141
+
| Requirement | Tool | Parameters | Purpose |
142
+
|-------------|------|------------|---------|
143
+
|**Security Domain (安全域名)**|`envDomainManagement`|`action`, `domains` (array of host:port strings) | CORS/request source validation for browser uploads. No certificate involved. |
144
+
|**Custom Domain (自定义域名)**|`manageGateway(action="bindCustomDomain")`|`domain` (string), `certificateId` (string) | Public HTTPS access with SSL certificate. Requires certId from SSL console. |
{"action": "bindDomain", "success": false, "message": "Certificate not found"}
167
+
],
168
+
"summary": {
169
+
"totalAttempted": 2,
170
+
"succeeded": 1,
171
+
"failed": 1
172
+
}
173
+
}
174
+
```
175
+
134
176
## Storage and Hosting
135
177
136
178
1.**Static Hosting vs Cloud Storage**:
@@ -229,6 +271,69 @@ Compatibility note:
229
271
5.**Cross-Collection Operations**:
230
272
- If user has no special requirements, operations involving cross-database collections must be implemented via cloud functions
231
273
274
+
## Role Management (MCP)
275
+
276
+
CloudBase MCP provides role management capabilities through the `queryPermissions` and `managePermissions` tools. These are equivalent to the CLI `tcb role` commands.
277
+
278
+
**⚠️ CRITICAL: Role policies and resource permissions are two independent systems with NO automatic synchronization.**
279
+
280
+
- Resource permissions (security rules) control access to specific resources (tables, collections, functions, storage)
281
+
- Roles (identity dimension) control policy bundles and member assignments
282
+
283
+
### Available Actions
284
+
285
+
**Query Operations** (via `queryPermissions`):
286
+
| Action | Description |
287
+
|--------|-------------|
288
+
|`listRoles`| List all roles (system and custom) |
289
+
|`getRole`| Get detailed role information by roleId/roleIdentity/roleName |
Copy file name to clipboardExpand all lines: doc/prompts/no-sql-web-sdk.mdx
+15Lines changed: 15 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -77,6 +77,21 @@ Keep local `references/...` paths for files that ship with the current skill dir
77
77
- SQL / MySQL database operations.
78
78
- Pure resource-permission administration with no browser SDK code.
79
79
80
+
### SDK Code vs MCP Tools
81
+
82
+
**When to write SDK code (use this skill):**
83
+
- The task explicitly asks to "modify code" or "use SDK"
84
+
- The task asks to implement app/frontend logic
85
+
- The task mentions specific SDK methods like `db.collection().add()`, `.get()`, `.update()`
86
+
- The context shows an existing Web project with SDK initialization (e.g., `index.js` already has `cloudbase.init()`)
87
+
88
+
**When to use MCP tools instead:**
89
+
- The task asks to manage CloudBase resources (create collection, set permissions, etc.)
90
+
- The task involves admin/management operations without writing app code
91
+
- The task mentions tools like `writeNoSqlDatabaseContent`, `managePermissions`, etc.
92
+
93
+
**Key distinction:** If the user says "使用 JS SDK 执行 XX 操作" (use JS SDK to perform XX operation) or "修改代码" (modify code), write SDK code in the project files. Do not use MCP database write tools for app-level data operations.
94
+
80
95
### Common mistakes / gotchas
81
96
82
97
- Querying before the user is signed in when the collection rules require identity.
0 commit comments