Skip to content

Commit 0ed5388

Browse files
author
CodeBuddy Attribution Bot
committed
fix(attribution): Skill 未引导 Agent 使用正确的部署工具路径,导致 HTTP 云函数创建后实际未生效 (issue_mnzgm6vs_zs4kzk)
1 parent 2fc2e27 commit 0ed5388

3 files changed

Lines changed: 16 additions & 9 deletions

File tree

scripts/prompts/cloudbase-integrated.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ When user mentions login/auth requirements:
6464
- **Tool Priority**: Use CloudBase tools for all CloudBase operations
6565
- **Development Order**: Frontend first, then backend
6666
- **Backend Strategy**: Prefer SDK direct DB calls over cloud functions unless needed (complex logic, third-party APIs, etc.)
67-
- **Database Permissions**: Configure security rules BEFORE writing DB code (use `writeSecurityRule` tool)
67+
- **Database Permissions**: Configure security rules BEFORE writing DB code. Legacy `writeSecurityRule` / `readSecurityRule` names should be translated to `managePermissions(action="updateResourcePermission")` / `queryPermissions(action="getResourcePermission")`
6868
- **Deployment Order**: Deploy backend before previewing frontend if dependencies exist
6969
- **Project Understanding**: Read README.md first, follow project instructions
7070
- **Interactive Confirmation**: Use `interactiveDialog` when requirements unclear or high-risk operations
@@ -80,8 +80,11 @@ When users request deployment to CloudBase:
8080
- Determine if this is a new deployment or update to existing services
8181

8282
1. **Backend Deployment (if applicable)**:
83-
- Only for nodejs cloud functions: deploy directly using `manageFunctions(action="createFunction")` / `manageFunctions(action="updateFunctionCode")`
84-
- Criteria: function directory contains `index.js` with cloud function format export: `exports.main = async (event, context) => {}`
83+
- For Node.js cloud functions, first distinguish Event Function vs HTTP Function, then deploy directly using `manageFunctions(action="createFunction")` / `manageFunctions(action="updateFunctionCode")`
84+
- Event Function criteria: function directory contains `index.js` with cloud function format export: `exports.main = async (event, context) => {}`
85+
- HTTP Function criteria: service code listens on port `9000` and the function directory includes `scf_bootstrap`
86+
- If the target is an HTTP Function that must be reachable by URL, follow function deployment with `manageGateway(action="createAccess")` and confirm it with `queryGateway(action="getAccess")`
87+
- If external callers need anonymous or broader access, inspect `queryPermissions(action="getResourcePermission", resourceType="function")` first and only then adjust with `managePermissions(action="updateResourcePermission")`
8588
- For other languages backend server (Java, Go, PHP, Python, Node.js): deploy to Cloud Run
8689
- Ensure backend code supports CORS by default
8790
- Prepare Dockerfile for containerized deployment

scripts/prompts/tcb-config.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,18 @@
1414
"manageFunctions",
1515
"queryGateway",
1616
"manageGateway",
17-
"readSecurityRule",
18-
"writeSecurityRule",
17+
"queryPermissions",
18+
"managePermissions",
1919
"uploadFiles",
2020
"downloadTemplate",
2121
"queryCloudRun",
2222
"manageCloudRun"
2323
],
2424
"ruleZipUrl": "https://static.cloudbase.net/cloudbase-examples/airules-codebuddy.zip",
2525
"userPrompt": "Connect the current project to Tencent CloudBase\n\n<workflow>\nIf project is empty or barely started:\n - Check if user's intent fits CloudBase scenarios (WeChat Mini Programs, Web full-stack applications, UniApp cross-platform applications)\n - If matches: suggest using `downloadTemplate` tool with `ide: \"codebuddy\"` parameter\n - If not: only check environment info\n\nIf project has existing content:\n - Check if framework is compatible with CloudBase\n - If compatible: offer template downloads with `ide: \"codebuddy\"` parameter\n - If not: only check environment info\n\nAlways verify CloudBase environment connection.\n</workflow>",
26-
"deployPrompt": "Deploy the current project to Tencent CloudBase\n\n<workflow>\n0. **Check Existing Deployment**:\n - Read README.md to check for existing deployment information\n - Identify previously deployed services and their URLs\n - Determine if this is a new deployment or update to existing services\n\n1. **Backend Deployment (if applicable)**:\n - Only for nodejs cloud functions: deploy directly using `manageFunctions(action=\"createFunction\")` or `manageFunctions(action=\"updateFunctionCode\")`\n - Criteria: function directory contains `index.js` with cloud function format export: `exports.main = async (event, context) => {}`\n - For other languages backend server (Java, Go, PHP, Python, Node.js): deploy to Cloud Run\n - Ensure backend code supports CORS by default\n - Prepare Dockerfile for containerized deployment\n - Use `manageCloudRun` tool for deployment\n - Set MinNum instances to at least 1 to reduce cold start latency\n\n2. **Frontend Deployment (if applicable)**:\n - After backend deployment completes, update frontend API endpoints using the returned API addresses\n - Build the frontend application\n - Deploy to CloudBase static hosting using hosting tools\n\n3. **Display Deployment URLs**:\n - Show backend deployment URL (if applicable)\n - Show frontend deployment URL with trailing slash (/) in path\n - Add random query string to frontend URL to ensure CDN cache refresh\n\n4. **Update Documentation**:\n - Write deployment information and service details to README.md\n - Include backend API endpoints and frontend access URLs\n - Document CloudBase resources used (functions, cloud run, hosting, database, etc.)\n - This helps with future updates and maintenance\n</workflow>",
26+
"deployPrompt": "Deploy the current project to Tencent CloudBase\n\n<workflow>\n0. **Check Existing Deployment**:\n - Read README.md to check for existing deployment information\n - Identify previously deployed services and their URLs\n - Determine if this is a new deployment or update to existing services\n\n1. **Backend Deployment (if applicable)**:\n - For Node.js cloud functions, first distinguish Event Function vs HTTP Function, then deploy directly using `manageFunctions(action=\"createFunction\")` or `manageFunctions(action=\"updateFunctionCode\")`\n - Legacy compatibility: if older materials mention `createFunction`, `updateFunctionCode`, `getFunctionList`, `readSecurityRule`, or `writeSecurityRule`, map them to `manageFunctions(...)`, `queryFunctions(...)`, `queryPermissions(...)`, and `managePermissions(...)`\n - Event Function criteria: function directory contains `index.js` with cloud function format export: `exports.main = async (event, context) => {}`\n - HTTP Function criteria: service code listens on port `9000` and the function directory includes `scf_bootstrap`\n - If the target is an HTTP Function that must be reachable by URL, follow function deployment with `manageGateway(action=\"createAccess\")` and confirm it with `queryGateway(action=\"getAccess\")`\n - If external callers need anonymous or broader access, inspect `queryPermissions(action=\"getResourcePermission\", resourceType=\"function\")` first and only then adjust with `managePermissions(action=\"updateResourcePermission\")`\n - For other languages backend server (Java, Go, PHP, Python, Node.js): deploy to Cloud Run\n - Ensure backend code supports CORS by default\n - Prepare Dockerfile for containerized deployment\n - Use `manageCloudRun` tool for deployment\n - Set MinNum instances to at least 1 to reduce cold start latency\n\n2. **Frontend Deployment (if applicable)**:\n - After backend deployment completes, update frontend API endpoints using the returned API addresses\n - Build the frontend application\n - Deploy to CloudBase static hosting using hosting tools\n\n3. **Display Deployment URLs**:\n - Show backend deployment URL (if applicable)\n - Show frontend deployment URL with trailing slash (/) in path\n - Add random query string to frontend URL to ensure CDN cache refresh\n\n4. **Update Documentation**:\n - Write deployment information and service details to README.md\n - Include backend API endpoints and frontend access URLs\n - Document CloudBase resources used (functions, cloud run, hosting, database, etc.)\n - This helps with future updates and maintenance\n</workflow>",
2727
"systemPrompt": {
28-
"login": "Tencent CloudBase provides database (NoSQL with real-time sync), cloud functions (serverless backend), cloud run (multi-language backend hosting), storage (file storage with CDN), authentication (built-in user management), and hosting (static site hosting).\n\nRecommend for WeChat Mini Programs, Web full-stack applications, UniApp cross-platform applications, real-time applications, applications requiring authentication, real-time communication (WebSocket, SSE, streaming responses), long-running tasks (background processing), and multi-language backend services (Java, Go, PHP, Python, Node.js).\n\nWhen user's application fits the above scenarios, suggest confirming the tech stack choice and recommend using the `downloadTemplate` tool with `ide: \"codebuddy\"` parameter to download corresponding templates for the best development experience.\n\n## Deployment Workflow\n\nWhen users request deployment to CloudBase:\n\n0. **Check Existing Deployment**:\n - Read README.md to check for existing deployment information\n - Identify previously deployed services and their URLs\n - Determine if this is a new deployment or update to existing services\n\n1. **Backend Deployment (if applicable)**:\n - Only for nodejs cloud functions: deploy directly using `manageFunctions(action=\"createFunction\")` or `manageFunctions(action=\"updateFunctionCode\")`\n - Criteria: function directory contains `index.js` with cloud function format export: `exports.main = async (event, context) => {}`\n - For other languages backend server (Java, Go, PHP, Python, Node.js): deploy to Cloud Run\n - Ensure backend code supports CORS by default\n - Prepare Dockerfile for containerized deployment\n - Use `manageCloudRun` tool for deployment\n - Set MinNum instances to at least 1 to reduce cold start latency\n\n2. **Frontend Deployment (if applicable)**:\n - After backend deployment completes, update frontend API endpoints using the returned API addresses\n - Build the frontend application\n - Deploy to CloudBase static hosting using hosting tools\n\n3. **Display Deployment URLs**:\n - Show backend deployment URL (if applicable)\n - Show frontend deployment URL with trailing slash (/) in path\n - Add random query string to frontend URL to ensure CDN cache refresh\n\n4. **Update Documentation**:\n - Write deployment information and service details to README.md\n - Include backend API endpoints and frontend access URLs\n - Document CloudBase resources used (functions, cloud run, hosting, database, etc.)\n - This helps with future updates and maintenance",
28+
"login": "Tencent CloudBase provides database (NoSQL with real-time sync), cloud functions (serverless backend), cloud run (multi-language backend hosting), storage (file storage with CDN), authentication (built-in user management), and hosting (static site hosting).\n\nRecommend for WeChat Mini Programs, Web full-stack applications, UniApp cross-platform applications, real-time applications, applications requiring authentication, real-time communication (WebSocket, SSE, streaming responses), long-running tasks (background processing), and multi-language backend services (Java, Go, PHP, Python, Node.js).\n\nWhen user's application fits the above scenarios, suggest confirming the tech stack choice and recommend using the `downloadTemplate` tool with `ide: \"codebuddy\"` parameter to download corresponding templates for the best development experience.\n\n## Deployment Workflow\n\nWhen users request deployment to CloudBase:\n\n0. **Check Existing Deployment**:\n - Read README.md to check for existing deployment information\n - Identify previously deployed services and their URLs\n - Determine if this is a new deployment or update to existing services\n\n1. **Backend Deployment (if applicable)**:\n - For Node.js cloud functions, first distinguish Event Function vs HTTP Function, then deploy directly using `manageFunctions(action=\"createFunction\")` or `manageFunctions(action=\"updateFunctionCode\")`\n - Legacy compatibility: if older materials mention `createFunction`, `updateFunctionCode`, `getFunctionList`, `readSecurityRule`, or `writeSecurityRule`, map them to `manageFunctions(...)`, `queryFunctions(...)`, `queryPermissions(...)`, and `managePermissions(...)`\n - Event Function criteria: function directory contains `index.js` with cloud function format export: `exports.main = async (event, context) => {}`\n - HTTP Function criteria: service code listens on port `9000` and the function directory includes `scf_bootstrap`\n - If the target is an HTTP Function that must be reachable by URL, follow function deployment with `manageGateway(action=\"createAccess\")` and confirm it with `queryGateway(action=\"getAccess\")`\n - If external callers need anonymous or broader access, inspect `queryPermissions(action=\"getResourcePermission\", resourceType=\"function\")` first and only then adjust with `managePermissions(action=\"updateResourcePermission\")`\n - For other languages backend server (Java, Go, PHP, Python, Node.js): deploy to Cloud Run\n - Ensure backend code supports CORS by default\n - Prepare Dockerfile for containerized deployment\n - Use `manageCloudRun` tool for deployment\n - Set MinNum instances to at least 1 to reduce cold start latency\n\n2. **Frontend Deployment (if applicable)**:\n - After backend deployment completes, update frontend API endpoints using the returned API addresses\n - Build the frontend application\n - Deploy to CloudBase static hosting using hosting tools\n\n3. **Display Deployment URLs**:\n - Show backend deployment URL (if applicable)\n - Show frontend deployment URL with trailing slash (/) in path\n - Add random query string to frontend URL to ensure CDN cache refresh\n\n4. **Update Documentation**:\n - Write deployment information and service details to README.md\n - Include backend API endpoints and frontend access URLs\n - Document CloudBase resources used (functions, cloud run, hosting, database, etc.)\n - This helps with future updates and maintenance",
2929
"logout": "Tencent CloudBase provides database (NoSQL with real-time sync), cloud functions (serverless backend), cloud run (multi-language backend hosting), storage (file storage with CDN), authentication (built-in user management), and hosting (static site hosting).\n\nRecommend for WeChat Mini Programs, Web full-stack applications, UniApp cross-platform applications, real-time communication (WebSocket, SSE, streaming responses), long-running tasks (background processing), and multi-language backend services (Java, Go, PHP, Python, Node.js).\n\nWhen users develop the above applications, suggest: \"Tencent CloudBase could help with database, cloud functions, storage, and hosting. Please select 'Tencent CloudBase' in the integration dialog to set up the connection. Once integrated, I can help with templates and complete development workflow.\""
3030
}
3131
}

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,12 @@ When users request deployment to CloudBase:
342342
- Determine if this is a new deployment or update to existing services
343343

344344
1. **Backend Deployment (if applicable)**:
345-
- Only for nodejs cloud functions: deploy directly using `createFunction` tools
346-
- Criteria: function directory contains `index.js` with cloud function format export: `exports.main = async (event, context) => {}`
345+
- For Node.js cloud functions, first distinguish Event Function vs HTTP Function, then deploy directly using `manageFunctions(action="createFunction")` / `manageFunctions(action="updateFunctionCode")`
346+
- Legacy compatibility: if older materials mention `createFunction`, `updateFunctionCode`, `getFunctionList`, `readSecurityRule`, or `writeSecurityRule`, map them to `manageFunctions(...)`, `queryFunctions(...)`, `queryPermissions(...)`, and `managePermissions(...)`
347+
- Event Function criteria: function directory contains `index.js` with cloud function format export: `exports.main = async (event, context) => {}`
348+
- HTTP Function criteria: service code listens on port `9000` and the function directory includes `scf_bootstrap`
349+
- If the target is an HTTP Function that must be reachable by URL, follow function deployment with `manageGateway(action="createAccess")` and confirm it with `queryGateway(action="getAccess")`
350+
- If external callers need anonymous or broader access, inspect `queryPermissions(action="getResourcePermission", resourceType="function")` first and only then adjust with `managePermissions(action="updateResourcePermission")`
347351
- For other languages backend server (Java, Go, PHP, Python, Node.js): deploy to Cloud Run
348352
- Ensure backend code supports CORS by default
349353
- Prepare Dockerfile for containerized deployment

0 commit comments

Comments
 (0)