Skip to content

Commit 87668f0

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

2 files changed

Lines changed: 11 additions & 6 deletions

File tree

scripts/prompts/cloudbase-integrated.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ When user's application fits the above scenarios, suggest confirming the tech st
1212
- **DO NOT start coding without reading the relevant rules** - Ensures correct implementation and avoids mistakes
1313

1414
### 1. Environment Check (MANDATORY - First Step)
15-
- **Always call `envQuery` tool first** with `action=info` to get environment ID
16-
- Auto-use queried envId in code/config, no manual input needed
15+
- Confirm the target environment before coding or deploying
16+
- 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`
17+
- 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
1718

1819
### 2. Template Download (MANDATORY for New Projects)
1920
- **MUST call `downloadTemplate` FIRST** when starting new projects - Do NOT manually create files

scripts/skills-repo-template/cloudbase-guidelines/SKILL.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,13 @@ mcpServers:
9191
9292
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.
9393
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.
9595

9696
You **do not need to hard-code Secret ID / Secret Key / Env ID** in the config.
9797
CloudBase MCP will support device-code based login via the `auth` tool, so credentials can be obtained interactively instead of being stored in config.
9898

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+
99101
**Add CloudBase MCP server in `config/mcporter.json` (recommended):**
100102

101103
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
115117

116118
**Quick start:**
117119
- `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)
119121
- `npx mcporter list cloudbase --schema` — get full JSON schema for all CloudBase tools
120122
- `npx mcporter call cloudbase.help --output json` — discover available CloudBase tools and their schemas
121123
- `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
125127
`npx mcporter call cloudbase.auth action=status --output json`
126128
- Start device-flow login (future-friendly device-code login; no keys in config):
127129
`npx mcporter call cloudbase.auth action=start_auth authMode=device --output json`
130+
- If the user gives an environment alias / nickname / short form instead of the full `EnvId`, resolve it first:
131+
`npx mcporter call cloudbase.envQuery action=list alias=demo aliasExact=true fields='["EnvId","Alias","Status","IsDefault"]' --output json`
128132
- Bind environment after login (envId from CloudBase console):
129-
`npx mcporter call cloudbase.auth action=set_env envId=env-xxx --output json`
133+
`npx mcporter call cloudbase.auth action=set_env envId=<full-env-id> --output json`
130134

131135
---
132136

@@ -174,7 +178,7 @@ If the platform supports long-term memory, persist these scenarios so the agent
174178
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:
175179

176180
- **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.
178182
- **mcporter call format** → `npx mcporter call cloudbase.<tool> key=value`, e.g. `npx mcporter call cloudbase.auth action=status --output json`.
179183
- **CloudBase development and deployment** → Use MCP to automate (environment, functions, database, hosting, etc.).
180184
- **Development norms** → Read the relevant CloudBase skills (e.g. `cloudbase`, `web-development`, `miniprogram-development`, `cloud-functions`) before writing code.

0 commit comments

Comments
 (0)