Skip to content

Commit 36f1dc1

Browse files
authored
Merge pull request #598 from TencentCloudBase/ai-fix/issue-591
fix: 🤖 attempt fix for issue #591
2 parents 41e21fe + 05d13c3 commit 36f1dc1

2 files changed

Lines changed: 10 additions & 11 deletions

File tree

mcp/CODEBUDDY.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ When you see "Read `{auth-web}` rule file" in this document:
6060

6161
### When Developing a Web Project:
6262
1. **Environment Check**: Call `envQuery` tool first (applies to all interactions)
63-
2. **⚠️ Template Download (MANDATORY for New Projects)**: **MUST call `downloadTemplate` tool FIRST when starting a new project** - Do NOT create files manually. Use `downloadTemplate` with `template="react"` or `template="vue"` to get the complete project structure. Only proceed with manual file creation if template download fails or user explicitly requests it.
63+
2. **Template Download**: Call `downloadTemplate` tool when the user requests to create a new project using a CloudBase template. Use `downloadTemplate` with `template="react"` or `template="vue"` to get the complete project structure. Only proceed with manual file creation if template download fails or user explicitly requests it.
6464
3. **⚠️ UI Design (CRITICAL)**: **MUST read `rules/ui-design/rule.md` FIRST before generating any page, interface, component, or style** - This is NOT optional. You MUST explicitly read this file and output the design specification before writing any UI code.
6565
4. **Core Capabilities**: Read Core Capabilities section below (especially UI Design and Database + Authentication for Web)
6666
5. **⚠️ Authentication Configuration Check (MANDATORY)**: **When user mentions ANY login/authentication requirement, MUST FIRST read `{auth-tool}` rule file (using path resolution strategy) and check/configure authentication providers BEFORE implementing frontend code**
@@ -72,7 +72,7 @@ When you see "Read `{auth-web}` rule file" in this document:
7272

7373
### When Developing a Mini Program Project:
7474
1. **Environment Check**: Call `envQuery` tool first (applies to all interactions)
75-
2. **⚠️ Template Download (MANDATORY for New Projects)**: **MUST call `downloadTemplate` tool FIRST when starting a new project** - Do NOT create files manually. Use `downloadTemplate` with `template="miniprogram"` to get the complete project structure. Only proceed with manual file creation if template download fails or user explicitly requests it.
75+
2. **Template Download**: Call `downloadTemplate` tool when the user requests to create a new Mini Program project using a CloudBase template. Use `downloadTemplate` with `template="miniprogram"` to get the complete project structure. Only proceed with manual file creation if template download fails or user explicitly requests it.
7676
3. **⚠️ UI Design (CRITICAL)**: **MUST read `rules/ui-design/rule.md` FIRST before generating any page, interface, component, or style** - This is NOT optional. You MUST explicitly read this file and output the design specification before writing any UI code.
7777
4. **Core Capabilities**: Read Core Capabilities section below (especially UI Design and Database + Authentication for Mini Program)
7878
5. **Platform Rules**: Read `rules/miniprogram-development/rule.md` for platform-specific rules (project structure, WeChat Developer Tools, wx.cloud usage)
@@ -254,7 +254,7 @@ Before starting work, suggest confirming with user:
254254

255255
## Core Behavior Rules
256256
1. **Tool Priority**: For Tencent CloudBase operations, must prioritize using CloudBase tools
257-
2. **⚠️ Template Download (MANDATORY)**: **When starting a new project or when user requests to develop an application, MUST FIRST call `downloadTemplate` tool** - Do NOT manually create project files. Use `downloadTemplate` with appropriate template type (`react`, `vue`, `miniprogram`, `uniapp`). Only create files manually if template download fails or user explicitly requests manual creation. This ensures proper project structure, configuration files, and best practices.
257+
2. **Template Download**: When the user requests to create a new project using a CloudBase template, call `downloadTemplate` tool. Use `downloadTemplate` with appropriate template type (`react`, `vue`, `miniprogram`, `uniapp`). Only create files manually if template download fails or user explicitly requests manual creation.
258258
3. **Project Understanding**: First read current project's README.md, follow project instructions for development
259259
4. **Directory Standards**: Before outputting project code in current directory, first check current directory files
260260
5. **Development Order**: When developing, prioritize frontend first, then backend, ensuring frontend interface and interaction logic are completed first, then implement backend business logic
@@ -283,12 +283,12 @@ Before starting work, suggest confirming with user:
283283

284284
### Development
285285

286-
1. **⚠️ Download CloudBase Templates (MANDATORY for New Projects)**:
287-
- **MUST call `downloadTemplate` tool FIRST when starting a new project** - Do NOT manually create project files
286+
1. **Download CloudBase Templates**:
287+
- Call `downloadTemplate` tool when the user requests to create a new project using a CloudBase template
288288
- For Web projects: Use `downloadTemplate` with `template="react"` or `template="vue"`
289289
- For Mini Program projects: Use `downloadTemplate` with `template="miniprogram"`
290290
- For UniApp projects: Use `downloadTemplate` with `template="uniapp"`
291-
- **Only proceed with manual file creation if template download fails or user explicitly requests manual creation**
291+
- Only proceed with manual file creation if template download fails or user explicitly requests manual creation
292292
- If unable to download to current directory, can use scripts to copy, note that hidden files also need to be copied
293293

294294
2. **⚠️ UI Design Document Reading (MANDATORY)**:
@@ -382,7 +382,7 @@ To ensure development quality, recommend completing the following checks before
382382

383383
### Recommended Steps
384384
0. **[ ] Environment Check**: Call `envQuery` tool to check CloudBase environment status (applies to all interactions)
385-
1. **[ ] Template Download Check (MANDATORY for New Projects)**: If starting a new project, have you called `downloadTemplate` tool FIRST? Do NOT manually create project files - use templates.
385+
1. **[ ] Template Download Check**: If the user requests to create a new project using a CloudBase template, have you considered calling `downloadTemplate` tool?
386386
2. **[ ] Scenario Identification**: Clearly identify what type of project this is (Web/Mini Program/Database/UI)
387387
3. **[ ] Core Capability Confirmation**: Confirm all four core capabilities have been considered
388388
- UI Design: Have you explicitly read the file `rules/ui-design/rule.md` using file reading tools?
@@ -397,7 +397,7 @@ To ensure development quality, recommend completing the following checks before
397397
6. **[ ] Rule Execution**: Strictly follow core capability requirements and relevant rule files for development
398398

399399
### ⚠️ Common Issues to Avoid
400-
- **DO NOT manually create project files** - Always use `downloadTemplate` tool first for new projects
400+
- **Avoid manually creating project files when the user requests a CloudBase template** - consider using `downloadTemplate` tool to get proper project structure
401401
- **❌ DO NOT skip reading UI design document** - Must explicitly read `rules/ui-design/rule.md` file before generating any UI code
402402
- Avoid skipping core capabilities and starting development directly
403403
- Avoid mixing APIs and authentication methods from different platforms

mcp/src/tools/setup.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -517,9 +517,8 @@ export function registerSetupTools(server: ExtendedMcpServer) {
517517
"downloadTemplate",
518518
{
519519
title: "下载项目模板",
520-
description: `自动下载并部署CloudBase项目模板。⚠️ **MANDATORY FOR NEW PROJECTS** ⚠️
521-
522-
**CRITICAL**: This tool MUST be called FIRST when starting a new project.\n\n支持的模板:\n- react: React + CloudBase 全栈应用模板\n- vue: Vue + CloudBase 全栈应用模板\n- miniprogram: 微信小程序 + 云开发模板 \n- uniapp: UniApp + CloudBase 跨端应用模板\n- rules: 只包含AI编辑器配置文件(包含Cursor、WindSurf、CodeBuddy等所有主流编辑器配置),适合在已有项目中补充AI编辑器配置\n\n支持的IDE类型:\n- all: 下载所有IDE配置\n- cursor: Cursor AI编辑器\n- 其他IDE类型见下方列表\n\n注意:如果未传入 ide 参数且无法从环境变量检测到 IDE,将提示错误并要求传入 ide 参数\n- windsurf: WindSurf AI编辑器\n- codebuddy: CodeBuddy AI编辑器\n- claude-code: Claude Code AI编辑器\n- cline: Cline AI编辑器\n- gemini-cli: Gemini CLI\n- opencode: OpenCode AI编辑器\n- qwen-code: 通义灵码\n- baidu-comate: 百度Comate\n- openai-codex-cli: OpenAI Codex CLI\n- augment-code: Augment Code\n- github-copilot: GitHub Copilot\n- roocode: RooCode AI编辑器\n- tongyi-lingma: 通义灵码\n- trae: Trae AI编辑器\n- qoder: Qoder AI编辑器\n- antigravity: Google Antigravity AI编辑器\n- vscode: Visual Studio Code\n- kiro: Kiro AI编辑器\n- aider: Aider AI编辑器\n\n特别说明:\n- rules 模板会自动包含当前 mcp 版本号信息(版本号:${typeof __MCP_VERSION__ !== "undefined" ? __MCP_VERSION__ : "unknown"}),便于后续维护和版本追踪\n- 下载 rules 模板时,如果项目中已存在 README.md 文件,系统会自动保护该文件不被覆盖(除非设置 overwrite=true)`,
520+
description: `自动下载并部署CloudBase项目模板。
521+
**Note**: Call this tool when the user requests to create a new project using a CloudBase template.\n\n支持的模板:\n- react: React + CloudBase 全栈应用模板\n- vue: Vue + CloudBase 全栈应用模板\n- miniprogram: 微信小程序 + 云开发模板 \n- uniapp: UniApp + CloudBase 跨端应用模板\n- rules: 只包含AI编辑器配置文件(包含Cursor、WindSurf、CodeBuddy等所有主流编辑器配置),适合在已有项目中补充AI编辑器配置\n\n支持的IDE类型:\n- all: 下载所有IDE配置\n- cursor: Cursor AI编辑器\n- 其他IDE类型见下方列表\n\n注意:如果未传入 ide 参数且无法从环境变量检测到 IDE,将提示错误并要求传入 ide 参数\n- windsurf: WindSurf AI编辑器\n- codebuddy: CodeBuddy AI编辑器\n- claude-code: Claude Code AI编辑器\n- cline: Cline AI编辑器\n- gemini-cli: Gemini CLI\n- opencode: OpenCode AI编辑器\n- qwen-code: 通义灵码\n- baidu-comate: 百度Comate\n- openai-codex-cli: OpenAI Codex CLI\n- augment-code: Augment Code\n- github-copilot: GitHub Copilot\n- roocode: RooCode AI编辑器\n- tongyi-lingma: 通义灵码\n- trae: Trae AI编辑器\n- qoder: Qoder AI编辑器\n- antigravity: Google Antigravity AI编辑器\n- vscode: Visual Studio Code\n- kiro: Kiro AI编辑器\n- aider: Aider AI编辑器\n\n特别说明:\n- rules 模板会自动包含当前 mcp 版本号信息(版本号:${typeof __MCP_VERSION__ !== "undefined" ? __MCP_VERSION__ : "unknown"}),便于后续维护和版本追踪\n- 下载 rules 模板时,如果项目中已存在 README.md 文件,系统会自动保护该文件不被覆盖(除非设置 overwrite=true)`,
523522
inputSchema: {
524523
template: z
525524
.enum(["react", "vue", "miniprogram", "uniapp", "rules"])

0 commit comments

Comments
 (0)