Skip to content

Commit 52f2a2b

Browse files
author
CodeBuddy Attribution Bot
committed
fix(attribution): Skill 未引导正确处理环境ID的简写与完整形式 (issue_mnovxo2g_pc6qna)
1 parent a91bee7 commit 52f2a2b

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ Use this skill for **CloudBase platform knowledge** when you need to:
112112
1. **SDK Initialization**:
113113
- CloudBase SDK initialization requires environment ID
114114
- 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
115117
- For Web, always initialize synchronously:
116118
- `import cloudbase from "@cloudbase/js-sdk"; const app = cloudbase.init({ env: "xxxx-yyy" });`
117119
- Do **not** use dynamic imports like `import("@cloudbase/js-sdk")` or async wrappers such as `initCloudBase()` with internal `initPromise`
@@ -305,6 +307,7 @@ The CloudBase console is updated frequently. If a live, logged-in console shows
305307

306308
- **Base URL Pattern**: `https://tcb.cloud.tencent.com/dev?envId=${envId}#/{path}`
307309
- **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
308311
- **Resource-Specific URLs**: For specific resources (collections, functions, models), replace resource name variables with actual values
309312
- **Usage**: After creating/deploying resources, provide these console links to users for management operations
310313

config/source/skills/SKILL.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ alwaysApply: true
3939

4040
- 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.
4141
- 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+
- 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.
4243

4344
### Do NOT use this as
4445

0 commit comments

Comments
 (0)