Skip to content

Commit c739ff0

Browse files
authored
Merge pull request #452 from TencentCloudBase/feature/skill-boundary-review
docs(skills): ✂️ tighten skill routing boundaries
2 parents a037f0f + 99ccf07 commit c739ff0

17 files changed

Lines changed: 262 additions & 58 deletions

File tree

config/source/skills/auth-nodejs/SKILL.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,39 @@
11
---
22
name: auth-nodejs-cloudbase
3-
description: Complete guide for CloudBase Auth using the CloudBase Node SDK – caller identity, user lookup, custom login tickets, and server-side best practices.
3+
description: CloudBase Node SDK auth guide for server-side identity, user lookup, and custom login tickets. This skill should be used when Node.js code must read caller identity, inspect end users, or bridge an existing user system into CloudBase; not when configuring providers or building client login UI.
44
alwaysApply: false
55
---
66

7+
## Activation Contract
8+
9+
### Use this first when
10+
11+
- Node.js code in cloud functions or backend services must read caller identity, look up users, or issue custom login tickets.
12+
- The backend responsibility is auth / identity, not provider setup or frontend login UI.
13+
14+
### Read before writing code if
15+
16+
- The task mentions `@cloudbase/node-sdk`, server-side auth, custom login tickets, or "who is calling".
17+
- The request mixes frontend login with backend identity logic; split the flow and route client-side work elsewhere.
18+
19+
### Then also read
20+
21+
- Provider setup / publishable key -> `../auth-tool/SKILL.md`
22+
- Web login UI that consumes custom tickets -> `../auth-web/SKILL.md`
23+
- Raw HTTP auth client -> `../http-api/SKILL.md`
24+
25+
### Do NOT use for
26+
27+
- Provider enable/disable or login console configuration.
28+
- Frontend login / sign-up UI.
29+
- Mini program native auth.
30+
31+
### Common mistakes / gotchas
32+
33+
- Using this skill as the entry point for every auth request.
34+
- Mixing provider-management work with Node-side identity code.
35+
- Reaching for raw HTTP examples when Node SDK already covers the job.
36+
737
## When to use this skill
838

939
Use this skill whenever the task involves **server-side authentication or identity** in a CloudBase project, and the code is running in **Node.js**, for example:

config/source/skills/auth-tool/SKILL.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,40 @@
11
---
22
name: auth-tool-cloudbase
3-
description: First-step CloudBase auth provider setup skill for login and registration flows. Use it before auth-web to configure and manage authentication providers for web applications - enable/disable login methods (SMS, Email, WeChat Open Platform, Google, Anonymous, Username/password, OAuth, SAML, CAS, Dingding, etc.) and configure provider settings via MCP tools `callCloudApi`.
3+
description: CloudBase auth provider configuration and login-readiness guide. This skill should be used when users need to inspect, enable, disable, or configure auth providers, publishable-key prerequisites, login methods, SMS/email sender setup, or other provider-side readiness before implementing a client or backend auth flow.
44
alwaysApply: false
55
---
66

77
## Activation Contract
88

99
### Use this first when
1010

11-
- The user mentions login, registration, authentication, provider setup, SMS, email, anonymous login, or third-party login.
12-
- A Web, native App, or backend flow needs CloudBase auth configuration before implementation.
13-
- For any CloudBase Web auth flow, activate this skill before `auth-web`.
11+
- The task is to inspect, enable, disable, or configure CloudBase auth providers, login methods, publishable key prerequisites, SMS/email delivery, or third-party login readiness.
12+
- An auth implementation cannot proceed until provider status and login configuration are confirmed.
13+
- A CloudBase Web auth flow needs provider verification before `auth-web`.
1414

1515
### Read before writing code if
1616

17-
- The request includes any auth UI or auth API work. Provider status must be checked first.
18-
- When the task is a Web auth flow, read `auth-web` after this skill and before writing frontend code.
17+
- The request mentions provider setup, auth console configuration, publishable key retrieval, login method availability, SMS/email sender setup, or third-party provider credentials.
18+
- The task mixes provider configuration with Web, mini program, Node, or raw HTTP auth implementation.
1919

2020
### Then also read
2121

2222
- Web auth UI -> `../auth-web/SKILL.md`
23-
- Mini program auth -> `../auth-wechat/SKILL.md`
24-
- Native App / raw HTTP -> `../http-api/SKILL.md`
23+
- Mini program native auth -> `../auth-wechat/SKILL.md`
24+
- Node server-side identity / custom ticket -> `../auth-nodejs/SKILL.md`
25+
- Native App / raw HTTP auth client -> `../http-api/SKILL.md`
2526

2627
### Do NOT use this as
2728

28-
- A replacement for platform implementation rules. This skill configures providers; it does not define the full frontend or client integration path.
29+
- The default implementation guide for every login or registration request.
30+
- A replacement for mini program native auth behavior when no provider change is involved.
31+
- A replacement for Node-side caller identity, user lookup, or custom login ticket flows.
32+
- A replacement for frontend integration, session handling, or client UX implementation.
2933

3034
### Common mistakes / gotchas
3135

3236
- Writing login UI before enabling the required provider.
37+
- Treating any mention of "auth" as a provider-management task.
3338
- Implementing Web login in cloud functions.
3439
- Routing native App auth to Web SDK flows.
3540

config/source/skills/auth-wechat/SKILL.md

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,45 @@
11
---
22
name: auth-wechat-miniprogram
3-
description: Complete guide for WeChat Mini Program authentication with CloudBase - native login, user identity, and cloud function integration.
3+
description: CloudBase WeChat Mini Program native authentication guide. This skill should be used when users need mini program identity handling, OPENID/UNIONID access, or `wx.cloud` auth behavior in projects where login is native and automatic.
44
alwaysApply: false
55
---
66

7+
## Activation Contract
8+
9+
### Use this first when
10+
11+
- The task is about WeChat Mini Program auth behavior, `wx.cloud` identity, `OPENID` / `UNIONID`, or how a mini program caller is identified in CloudBase.
12+
- The project is a CloudBase mini program and the auth question is about native mini program identity rather than provider configuration.
13+
14+
### Read before writing code if
15+
16+
- The request mentions mini program login, user identity in cloud functions, or `wx.cloud` auth assumptions.
17+
- The user expects a Web-style login page or explicit token exchange in a mini program; route them back to native mini program auth behavior.
18+
19+
### Then also read
20+
21+
- Mini program project implementation -> `../miniprogram-development/SKILL.md`
22+
- Cloud function implementation -> `../cloud-functions/SKILL.md`
23+
24+
### Do NOT use for
25+
26+
- Web-based WeChat login or Web auth UI.
27+
- Provider enable/disable or auth console setup.
28+
- Generic Node-side auth flows outside mini program identity handling.
29+
30+
### Common mistakes / gotchas
31+
32+
- Generating a Web-style login page for a `wx.cloud` mini program.
33+
- Treating mini program auth as a provider-configuration problem.
34+
- Forgetting that caller identity is injected in cloud functions automatically.
35+
736
## When to use this skill
837

938
Use this skill for **WeChat Mini Program (小程序) authentication** in a CloudBase project.
1039

1140
Use it when you need to:
1241

13-
- Implement WeChat Mini Program login with CloudBase
42+
- Implement identity-aware WeChat Mini Program flows with CloudBase
1443
- Access user identity (openid, unionid) in cloud functions
1544
- Understand how WeChat authentication integrates with CloudBase
1645
- Build Mini Program features that require user identification

config/source/skills/cloud-functions/SKILL.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: cloud-functions
3-
description: Complete guide for CloudBase cloud functions development - supports both Event Functions (Node.js) and HTTP Functions (multi-language Web services). Covers runtime selection, deployment, logging, invocation, scf_bootstrap, SSE, WebSocket, and HTTP access configuration.
3+
description: CloudBase function runtime guide for building, deploying, and debugging your own Event Functions or HTTP Functions. This skill should be used when users need application runtime code on CloudBase, not when they are merely calling CloudBase official platform APIs.
44
alwaysApply: false
55
---
66

@@ -10,24 +10,27 @@ alwaysApply: false
1010

1111
### Use this first when
1212

13-
- The task is to create, update, deploy, inspect, or debug a CloudBase Event Function or HTTP Function.
13+
- The task is to create, update, deploy, inspect, or debug a CloudBase Event Function or HTTP Function that serves application runtime logic.
1414

1515
### Read before writing code if
1616

17-
- The request mentions runtime, HTTP function, `scf_bootstrap`, function logs, or function deployment.
17+
- The request mentions runtime, HTTP function, `scf_bootstrap`, function logs, or function deployment for an application service you are building.
1818

1919
### Then also read
2020

2121
- Auth setup or provider-related backend work -> `../auth-tool/SKILL.md`
2222
- AI in functions -> `../ai-model-nodejs/SKILL.md`
23+
- Calling CloudBase official platform APIs from a client or script -> `../http-api/SKILL.md`
2324

2425
### Do NOT use for
2526

2627
- CloudRun container services or Web authentication UI implementation.
28+
- CloudBase official platform API clients or raw HTTP integrations that only consume platform endpoints.
2729

2830
### Common mistakes / gotchas
2931

3032
- Picking the wrong function type and trying to compensate later.
33+
- Confusing official CloudBase API client work with building your own HTTP function.
3134
- Mixing Event Function code shape (`exports.main(event, context)`) with HTTP Function code shape (`req` / `res` on port 9000).
3235
- Treating HTTP Access as the implementation model for HTTP Functions. HTTP Access is a gateway configuration for Event Functions, not the HTTP Function runtime model.
3336
- Forgetting that runtime cannot be changed after creation.
@@ -461,7 +464,7 @@ wss.on('connection', (ws) => {
461464

462465
**Primary Method:** Use `queryFunctions(action="listFunctionLogs")` and `queryFunctions(action="getFunctionLogDetail")` (see MCP tool documentation).
463466

464-
**Alternative Method (Plan B):** If tools unavailable, use `callCloudApi`:
467+
**Alternative Method (Plan B):** If tools unavailable, use `callCloudApi` only after you first read the matching official CloudBase / Tencent Cloud documentation or knowledge base entry for the target action. Confirm action name, parameter contract, time range rules, and response structure before calling it. If the call fails, go back to the docs instead of trial-and-error parameter guessing.
465468

466469
1. **Get Log List** - Use `GetFunctionLogs` action:
467470
```
@@ -572,7 +575,7 @@ Use CloudBase HTTP API to invoke event functions:
572575

573576
**Primary Method:** Use `manageGateway(action="createAccess")` (see MCP tool documentation).
574577

575-
**Alternative Method (Plan B):** If tool unavailable, use `callCloudApi` with `CreateCloudBaseGWAPI`:
578+
**Alternative Method (Plan B):** If tool unavailable, use `callCloudApi` with `CreateCloudBaseGWAPI` only after you first read the matching official documentation or knowledge base entry and confirm the gateway contract. Do not guess fields such as auth mode, path transmission, or domain routing from memory; if the request fails, return to the docs and re-check the contract.
576579

577580
```
578581
callCloudApi({
@@ -693,13 +696,13 @@ For accessing VPC resources:
693696
**Logging:**
694697
- `queryFunctions(action="listFunctionLogs")` - Get function log list (basic info)
695698
- `queryFunctions(action="getFunctionLogDetail")` - Get detailed log content by RequestId
696-
- `callCloudApi` (Plan B) - Use `GetFunctionLogs` and `GetFunctionLogDetail` actions if direct tools unavailable
699+
- `callCloudApi` (Plan B) - Use `GetFunctionLogs` and `GetFunctionLogDetail` actions only after reading the matching official docs / knowledge base and confirming the contract; do not guess params from memory
697700
- Legacy aliases still seen in historical prompts: `getFunctionLogs`, `getFunctionLogDetail`
698701

699702
**HTTP Access:**
700703
- `queryGateway(action="getAccess")` - Query current function gateway exposure
701704
- `manageGateway(action="createAccess")` - Create HTTP access for function
702-
- `callCloudApi` (Plan B) - Use `CreateCloudBaseGWAPI` action if direct tool unavailable
705+
- `callCloudApi` (Plan B) - Use `CreateCloudBaseGWAPI` only after reading the matching official docs / knowledge base and confirming auth, path, and domain parameters
703706
- Legacy alias still seen in historical prompts: `createFunctionHTTPAccess`
704707

705708
**Triggers:**

config/source/skills/cloudbase-platform/SKILL.md

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,51 @@
11
---
22
name: cloudbase-platform
3-
description: CloudBase platform knowledge and best practices. Use this skill for general CloudBase platform understanding, including storage, hosting, authentication, cloud functions, database permissions, and data models.
3+
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.
44
alwaysApply: false
55
---
66

7+
## Activation Contract
8+
9+
### Use this first when
10+
11+
- 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.
12+
- The task is about console navigation, cross-platform differences, permission models, or platform-level best practices before implementation.
13+
14+
### Read before writing code if
15+
16+
- It is still unclear whether the task belongs to Web, mini program, cloud functions, storage, MySQL / NoSQL, or auth.
17+
- The response needs platform selection, conceptual explanation, or control-plane navigation more than direct implementation steps.
18+
19+
### Then also read
20+
21+
- Web app implementation -> `../web-development/SKILL.md`
22+
- Web auth and provider setup -> `../auth-tool/SKILL.md`, `../auth-web/SKILL.md`
23+
- Mini program development -> `../miniprogram-development/SKILL.md`
24+
- Cloud functions -> `../cloud-functions/SKILL.md`
25+
- Official HTTP API clients -> `../http-api/SKILL.md`
26+
- Document database -> `../no-sql-web-sdk/SKILL.md` or `../no-sql-wx-mp-sdk/SKILL.md`
27+
- Relational database / data modeling -> `../relational-database-tool/SKILL.md` or `../data-model-creation/SKILL.md`
28+
- Cloud storage -> `../cloud-storage-web/SKILL.md`
29+
30+
### Do NOT use for
31+
32+
- Direct implementation of web pages, auth flows, functions, or database operations when a more specific skill already fits.
33+
- Low-level API parameter references or SDK recipes that belong in specialized skills.
34+
35+
### Common mistakes / gotchas
36+
37+
- Treating this general skill as the default entry point for all CloudBase development.
38+
- Staying here after the correct implementation skill is already clear.
39+
- Mixing platform overview with platform-specific API shapes or SDK details.
40+
741
## When to use this skill
842

943
Use this skill for **CloudBase platform knowledge** when you need to:
1044

1145
- Understand CloudBase storage and hosting concepts
12-
- Configure authentication for different platforms (Web vs Mini Program)
13-
- Deploy and manage cloud functions
46+
- Compare platform capabilities before implementation
47+
- Understand cross-platform auth differences (Web vs Mini Program)
1448
- Understand database permissions and access control
15-
- Work with data models (MySQL and NoSQL)
1649
- Access CloudBase console management pages
1750

1851
**This skill provides foundational knowledge** that applies to all CloudBase projects, regardless of whether they are Web, Mini Program, or backend services.

config/source/skills/http-api/SKILL.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,37 @@
11
---
22
name: http-api-cloudbase
3-
description: Use CloudBase HTTP API to access CloudBase platform features (database, authentication, cloud functions, cloud hosting, cloud storage, AI) via HTTP protocol from backends or scripts that are not using SDKs.
3+
description: CloudBase official HTTP API client guide. This skill should be used when backends, scripts, or non-SDK clients must call CloudBase platform APIs over raw HTTP instead of using a platform SDK or MCP management tool.
44
alwaysApply: false
55
---
66

77
## Activation Contract
88

99
### Use this first when
1010

11-
- The request comes from Android, iOS, Flutter, React Native, non-Node backends, or admin scripts that must call CloudBase via raw HTTP.
11+
- The request comes from Android, iOS, Flutter, React Native, non-Node backends, or admin scripts that must call official CloudBase APIs via raw HTTP.
12+
- The task is to consume CloudBase platform endpoints, not to build a new HTTP service on CloudBase.
1213

1314
### Read before writing code if
1415

1516
- The platform does not support a CloudBase SDK, or the user explicitly asks for HTTP API integration.
17+
- The user says "HTTP API" but it is unclear whether they mean official CloudBase endpoints or their own business API.
1618

1719
### Then also read
1820

1921
- Auth configuration -> `../auth-tool/SKILL.md`
2022
- MySQL MCP management -> `../relational-database-tool/SKILL.md`
23+
- Your own HTTP service on CloudBase -> `../cloud-functions/SKILL.md` or `../cloudrun-development/SKILL.md`
2124

2225
### Do NOT use for
2326

2427
- CloudBase Web SDK flows, mini program SDK flows, or MCP-driven management tasks.
28+
- Building your own HTTP service or REST API on CloudBase.
2529

2630
### Common mistakes / gotchas
2731

2832
- Treating Web SDK examples as valid for native Apps.
2933
- Guessing endpoints without reading OpenAPI definitions.
34+
- Confusing official CloudBase HTTP APIs with your own function or CloudRun endpoint.
3035
- Mixing raw HTTP API integration with MCP management logic.
3136

3237
### Minimal checklist

config/source/skills/ui-design/SKILL.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
---
22
name: ui-design
3-
description: Professional UI design and frontend interface guidelines. Use this skill when creating web pages, mini-program interfaces, prototypes, or any frontend UI components that require distinctive, production-grade design with exceptional aesthetic quality.
3+
description: UI design specification and visual direction guide. This skill should be used when users need aesthetic direction, layout decisions, prototypes, or interface design specs before implementation across web or mini program surfaces.
44
alwaysApply: false
55
---
66

77
## Activation Contract
88

99
### Use this first when
1010

11-
- The request involves any page, component, screen, visual prototype, or frontend styling work.
11+
- The request is to decide visual direction, produce a design specification, create a prototype, or make layout, typography, color, and visual hierarchy choices for an interface.
12+
- The implementation should follow a deliberate aesthetic rather than directly coding an already-approved design.
1213

1314
### Read before writing code if
1415

15-
- The response will include UI code, layout structure, typography, color decisions, or visual behavior.
16+
- The response must choose typography, color, spacing, layout strategy, or other visual rules before code exists.
17+
- The user asks for "design", "prototype", "look and feel", or "style" rather than straight implementation.
1618

1719
### Then also read
1820

@@ -22,11 +24,13 @@ alwaysApply: false
2224
### Do NOT use for
2325

2426
- Backend-only tasks, database design, or pure API work without interface output.
27+
- Straight implementation of an already-approved UI without new design decisions.
2528

2629
### Common mistakes / gotchas
2730

2831
- Writing JSX, WXML, or CSS before outputting the design specification.
2932
- Falling back to generic AI layouts instead of an explicit aesthetic direction.
33+
- Jumping into implementation when the design intent is still unclear.
3034
- Ignoring platform constraints after the visual concept is defined.
3135

3236
### Minimal checklist

0 commit comments

Comments
 (0)