[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7CQAFBNM79ZAEFGNPR3GAKF":3,"skill-same:01M7CQAFBNM79ZAEFGNPR3GAKF":53},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":6,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M7CQAFBNM79ZAEFGNPR3GAKF","cloud-functions",null,"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.","YYC-Cube\u002FYYC3-Knowledge-Base","YYC-Cube","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F235006543?v=4","01M79J2PH4SWD2X0825X6PN748","yyc3","01M79J2PHVK3F6ZBYT8K2SCZCW",1,"MIT","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-Skills-技能包\u002FYYC3-Skills-技能包-code-skills\u002Fskills\u002Fcloudbase\u002Freferences\u002Fcloud-functions\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: cloud-functions\ndescription: 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.\nalwaysApply: false\n---\n\n# Cloud Functions Development\n\n## Activation Contract\n\n### Use this first when\n\n- The task is to create, update, deploy, inspect, or debug a CloudBase Event Function or HTTP Function.\n\n### Read before writing code if\n\n- The request mentions runtime, HTTP function, `scf_bootstrap`, function logs, or function deployment.\n\n### Then also read\n\n- Auth setup or provider-related backend work -> `..\u002Fauth-tool\u002FSKILL.md`\n- AI in functions -> `..\u002Fai-model-nodejs\u002FSKILL.md`\n\n### Do NOT use for\n\n- CloudRun container services or Web authentication UI implementation.\n\n### Common mistakes \u002F gotchas\n\n- Picking the wrong function type and trying to compensate later.\n- Mixing Event Function code shape (`exports.main(event, context)`) with HTTP Function code shape (`req` \u002F `res` on port 9000).\n- 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.\n- Forgetting that runtime cannot be changed after creation.\n- Using cloud functions as the first solution for Web login.\n- Forgetting that HTTP Functions do NOT auto-install dependencies — always include `node_modules`.\n- Forgetting to add `app.use(express.json())` or equivalent body parsing middleware for POST\u002FPUT requests.\n- Leaving HTTP handlers without sending a response (causes request timeout).\n- Not returning proper HTTP status codes (400, 401, 405) for error cases.\n\n### Minimal checklist\n\n- Read [Cloud Functions Execution Checklist](checklist.md) before deployment or runtime changes.\n\n## Overview\n\nUse this skill when developing, deploying, and managing CloudBase cloud functions. CloudBase supports two types of cloud functions:\n\n- **Event Functions (普通云函数)**: Traditional serverless functions triggered by events (SDK calls, timers)\n- **HTTP Functions (HTTP 云函数)**: Web service functions triggered by HTTP requests, supporting multiple languages\n\n### Writing mode at a glance\n\n- If the request is for a normal CloudBase function triggered by SDK calls, timers, or other events, write an **Event Function** with `exports.main = async (event, context) => {}`.\n- If the request is for an HTTP endpoint, REST API, SSE, or WebSocket service, write an **HTTP Function** that listens on port `9000` and handles `req` \u002F `res`.\n- If the user mentions HTTP access for an existing Event Function, keep the Event Function code shape and add gateway access separately.\n\n## When to use this skill\n\nUse this skill for **cloud function operations** when you need to:\n\n- Create and deploy Event Functions (Node.js)\n- Create and deploy HTTP Functions (Node.js\u002FPython\u002FGo\u002FJava)\n- Understand runtime limitations and selection\n- Query function logs and monitor execution\n- Invoke cloud functions from applications\n- Configure HTTP access for cloud functions\n- Implement SSE (Server-Sent Events) or WebSocket\n\n**Do NOT use for:**\n- CloudRun backend services (use `cloudrun-development` skill)\n- Complex container-based services (use `cloudrun-development` skill)\n- Database operations (use database skills)\n\n## How to use this skill (for a coding agent)\n\n1. **Choose the right function type**\n   - **Event Function**: For SDK calls, scheduled tasks, event-driven scenarios\n   - **HTTP Function**: For Web APIs, REST services, SSE\u002FWebSocket, multi-language support\n   - If the prompt says \"HTTP 云函数\", use the HTTP Function model first; if it says \"触发器云函数\" or omits HTTP, default to the Event Function model.\n\n2. **Understand runtime limitations**\n   - Runtime **CANNOT be changed** after function creation\n   - Must select correct runtime during initial creation\n   - If runtime needs to change, must delete and recreate function\n\n3. **Write code AND deploy — do not stop after writing files**\n   - **CRITICAL**: After writing function code, you MUST also deploy it using `manageFunctions`. Creating files locally without deploying is incomplete.\n   - Use `manageFunctions(action=\"createFunction\")` to create AND deploy in one step\n   - Provide `functionRootPath` as the **parent directory** of the function folder (e.g., `\u002Fproject\u002Fcloudfunctions\u002F` not `\u002Fproject\u002Fcloudfunctions\u002FmyFunction\u002F`)\n   - **Preferred MCP Tools**: Use `queryFunctions` for reads, `manageFunctions(action=\"createFunction\")` for creation, and `manageFunctions(action=\"updateFunctionCode\")` for code updates\n   - **Legacy compatibility**: If older prompts mention `createFunction` \u002F `updateFunctionCode`, map them to the `manageFunctions` actions above\n   - **CLI**: Use `tcb fn deploy` (Event) or `tcb fn deploy --httpFn` (HTTP) only as a fallback when MCP tools are unavailable\n   - In agent \u002F non-interactive runs, never default to CLI login flows for deployment; keep the flow on `manageFunctions`\n   - For HTTP functions, create or update them through `manageFunctions` with `func.type=\"HTTP\"` as the primary path\n   - HTTP Functions require `scf_bootstrap` file in the function directory\n   - Provide correct `functionRootPath` (parent directory of function folder)\n\n4. **Query logs properly**\n   - Use `queryFunctions(action=\"listFunctionLogs\")` for log list (basic info)\n   - Use `queryFunctions(action=\"getFunctionLogDetail\")` with RequestId for detailed logs\n   - **Legacy compatibility**: Treat `getFunctionLogs` \u002F `getFunctionLogDetail` as the two `queryFunctions` actions above\n   - Note time range limitations (max 1 day interval)\n\n5. **Handle legacy tool names safely**\n   - Prefer the converged entrances: `queryFunctions`, `manageFunctions`, `queryGateway`, `manageGateway`\n   - If old names appear in historical docs or prompts, convert them before acting:\n     - `getFunctionList` -> `queryFunctions`\n     - `createFunction` -> `manageFunctions(action=\"createFunction\")`\n     - `updateFunctionCode` -> `manageFunctions(action=\"updateFunctionCode\")`\n     - `updateFunctionConfig` -> `manageFunctions(action=\"updateFunctionConfig\")`\n     - `getFunctionLogs` -> `queryFunctions(action=\"listFunctionLogs\")`\n     - `getFunctionLogDetail` -> `queryFunctions(action=\"getFunctionLogDetail\")`\n     - `manageFunctionTriggers` -> `manageFunctions(action=\"createFunctionTrigger\"|\"deleteFunctionTrigger\")`\n     - `readFunctionLayers` -> `queryFunctions(action=\"listLayers\"|\"listLayerVersions\"|\"getLayerVersionDetail\"|\"listFunctionLayers\")`\n     - `writeFunctionLayers` -> `manageFunctions(action=\"createLayerVersion\"|\"deleteLayerVersion\"|\"attachLayer\"|\"detachLayer\"|\"updateFunctionLayers\")`\n     - `createFunctionHTTPAccess` -> `manageGateway(action=\"createAccess\")`\n\n---\n\n## Function Types Comparison\n\n| Feature | Event Function (普通云函数) | HTTP Function (HTTP 云函数) |\n|---------|---------------------------|----------------------------|\n| Trigger | Event-driven (SDK, timer) | HTTP request |\n| Entry Point | `exports.main = async (event, context) => {}` | Web Server (Express\u002FFlask\u002FGin etc.) |\n| Port | No port required | **Must listen on port 9000** |\n| Bootstrap | Not required | Requires `scf_bootstrap` |\n| Connection | Short connection | Supports long connection |\n| Languages | Node.js only | Node.js, Python, Go, Java |\n| Protocols | N\u002FA | HTTP, SSE, WebSocket |\n| Use Cases | Event processing, scheduled tasks | Web APIs, REST services, real-time streaming |\n\n---\n\n## Core Knowledge - Event Functions\n\n### Runtime Environment\n\n**⚠️ CRITICAL: Runtime cannot be modified after function creation**\n\nOnce a cloud function is created with a specific runtime, the runtime **cannot be changed**. If you need a different runtime:\n\n1. Delete the existing function\n2. Create a new function with the desired runtime\n\n**Supported Node.js Runtimes:**\n\n- `Nodejs18.15` (Default, Recommended)\n- `Nodejs16.13`\n- `Nodejs14.18`\n- `Nodejs12.16`\n- `Nodejs10.15`\n- `Nodejs8.9`\n\n**Runtime Selection Guidelines:**\n\n- **Use `Nodejs18.15`** for new projects (default, most modern)\n- Choose older versions only if dependencies require specific Node.js versions\n- Consider security updates and support lifecycle\n- Test thoroughly with selected runtime before deployment\n\n### Event Function Structure\n\nEvent functions require:\n\n1. **Function Directory**: Contains function code\n   - Must have `index.js` (or specified entry file)\n   - Must export handler: `exports.main = async (event, context) => {}`\n   - Include `package.json` with dependencies\n\n2. **Function Root Path**: Parent directory containing function directories\n   - Example: If function is at `\u002Fproject\u002Fcloudfunctions\u002FmyFunction\u002F`\n   - `functionRootPath` should be `\u002Fproject\u002Fcloudfunctions\u002F`\n   - **Important**: Do NOT include function name in root path\n\n3. **Entry Point**: Default is `index.js` with `exports.main`\n   - Can be customized via `handler` parameter\n\n### Event Function Deployment\n\n**Creating New Functions:**\n\nUse `manageFunctions(action=\"createFunction\")` (see MCP tool documentation for full parameter list):\n- **Important**: Always specify `func.runtime` explicitly (defaults to `Nodejs18.15`)\n- Provide `functionRootPath` as parent directory of function folders (absolute path)\n- Use `force=true` to overwrite existing function\n- **Legacy compatibility**: If an older prompt says `createFunction`, keep the same payload but send it through `manageFunctions`\n\n**Updating Function Code:**\n\nUse `manageFunctions(action=\"updateFunctionCode\")`:\n- **⚠️ Note**: Only updates code, **cannot change runtime**\n- If runtime needs to change, delete and recreate function\n- **Legacy compatibility**: If an older prompt says `updateFunctionCode`, map it to this `manageFunctions` action\n\n**Deployment Best Practices:**\n\n1. **Always specify runtime** explicitly when creating functions\n2. **Use absolute paths** for `functionRootPath`\n3. **Don't upload node_modules** - dependencies installed automatically\n4. **Test locally** before deployment when possible\n5. **Use environment variables** for configuration, not hardcoded values\n\n---\n\n## Core Knowledge - HTTP Functions\n\n### HTTP Function Overview\n\nHTTP Functions are optimized for Web service scenarios, supporting standard HTTP request\u002Fresponse patterns.\n\n**HTTP Function coding model**\n- Use a web-server style handler with `req` \u002F `res`\n- Parse query, headers, and body from the HTTP request directly\n- Return HTTP status codes and response bodies explicitly\n- Do not use `exports.main(event, context)` as the primary HTTP Function shape\n\n**Key Characteristics:**\n- **Must listen on port 9000** (platform requirement)\n- Requires `scf_bootstrap` startup script\n- Supports multiple languages: Node.js, Python, Go, Java\n- Supports HTTP, SSE, WebSocket protocols\n\n### scf_bootstrap Startup Script\n\n**⚠️ CRITICAL: HTTP Functions require `scf_bootstrap` file**\n\n| Requirement | Description |\n|-------------|-------------|\n| File name | Must be exactly `scf_bootstrap` (no extension) |\n| Permission | Must have execute permission (`chmod +x scf_bootstrap`) |\n| Port | Must start server on port **9000** |\n| Line endings | Must use LF (Unix), not CRLF (Windows) |\n\n**Examples:**\n```bash\n# Node.js\n#!\u002Fbin\u002Fbash\nnode index.js\n\n# Python\n#!\u002Fbin\u002Fbash\nexport PYTHONPATH=\".\u002Fthird_party:$PYTHONPATH\"\n\u002Fvar\u002Flang\u002Fpython310\u002Fbin\u002Fpython3.10 app.py\n\n# Go\n#!\u002Fbin\u002Fbash\n.\u002Fmain\n\n# Java\n#!\u002Fbin\u002Fbash\njava -jar *.jar\n```\n\n### HTTP Function Request & Response Handling\n\n**⚠️ CRITICAL: HTTP Functions are standard web servers.** They receive full HTTP requests (method, headers, query string, body) and must return complete HTTP responses (status code, headers, body). Unlike Event Functions, there is no CloudBase-specific request envelope.\n\n**Dependencies:**\n- **HTTP Functions do NOT auto-install dependencies.** You MUST include `node_modules` in the function directory or use layers.\n- Common packages: `express`, `body-parser` (built into Express 4.16+), `cors`, `helmet`\n\n**Handling Different HTTP Methods:**\n\n```javascript\nconst express = require('express');\nconst app = express();\n\n\u002F\u002F IMPORTANT: Must parse JSON body for POST\u002FPUT requests\napp.use(express.json());\n\n\u002F\u002F GET - read query parameters from req.query\napp.get('\u002Fusers', (req, res) => {\n  const { userId, page = 1, pageSize = 10 } = req.query;\n\n  if (!userId) {\n    return res.status(400).json({ error: 'userId is required' });\n  }\n\n  res.json({\n    method: 'GET',\n    params: { userId, page: Number(page), pageSize: Number(pageSize) },\n    message: 'Query parameters processed'\n  });\n});\n\n\u002F\u002F POST - read body from req.body, query from req.query\napp.post('\u002Fusers', (req, res) => {\n  const { action } = req.query;    \u002F\u002F query string: ?action=create\n  const { name, email } = req.body; \u002F\u002F JSON body\n\n  if (!name || !email) {\n    return res.status(400).json({ error: 'name and email are required' });\n  }\n\n  res.json({\n    method: 'POST',\n    action,\n    data: { name, email },\n    message: 'Body and query parameters processed'\n  });\n});\n\n\u002F\u002F PUT - read custom headers from req.headers\napp.put('\u002Fusers\u002F:id', (req, res) => {\n  const userId = req.headers['x-user-id']; \u002F\u002F custom header\n\n  if (!userId) {\n    return res.status(401).json({ error: 'x-user-id header is required' });\n  }\n\n  const { status } = req.body;\n  res.json({\n    method: 'PUT',\n    userId,\n    status,\n    message: 'Headers and body processed'\n  });\n});\n\n\u002F\u002F For unsupported methods, return 405\napp.all('*', (req, res) => {\n  res.status(405).json({ error: 'Method Not Allowed' });\n});\n\napp.listen(9000); \u002F\u002F Must be port 9000\n```\n\n**Key Rules:**\n- `req.query` - URL query string parameters (e.g., `?userId=123&page=1`)\n- `req.body` - Parsed request body (requires `app.use(express.json())` or equivalent middleware)\n- `req.headers` - All HTTP headers (lowercased, e.g., `req.headers['x-user-id']`)\n- `req.params` - URL path parameters (e.g., `\u002Fusers\u002F:id`)\n- Always return proper HTTP status codes: 200 (success), 400 (bad request), 401 (unauthorized), 405 (method not allowed)\n- Always call `res.json()`, `res.send()`, or `res.status().json()` to send a response\n- Never leave a request handler without sending a response\n\n### HTTP Function Structure & Example\n\n```\nmy-http-function\u002F\n├── scf_bootstrap      # Required: startup script\n├── package.json       # Dependencies\n├── node_modules\u002F      # Required for HTTP Functions (no auto-install)\n└── index.js           # Application code\n```\n\n**Minimal Node.js Example (Express):**\n```javascript\nconst express = require('express');\nconst app = express();\napp.use(express.json());\n\napp.get('\u002F', (req, res) => res.json({ message: 'Hello!' }));\napp.listen(9000);  \u002F\u002F Must be port 9000\n```\n\n### HTTP Function Deployment\n\n**MCP Tool:**\n```javascript\nmanageFunctions({\n  action: \"createFunction\",\n  func: {\n    name: \"myHttpFunction\",\n    type: \"HTTP\",           \u002F\u002F Required for HTTP Function\n    protocolType: \"HTTP\",   \u002F\u002F \"HTTP\" (default) or \"WS\" (WebSocket)\n    timeout: 60\n  },\n  functionRootPath: \"\u002Fpath\u002Fto\u002Ffunctions\",\n  force: false\n})\n```\n\n**CLI:**\n```bash\ntcb fn deploy \u003Cname> --httpFn        # HTTP Function\ntcb fn deploy \u003Cname> --httpFn --ws   # With WebSocket\n```\n\n**⚠️ Notes:**\n- Function type **cannot be changed** after creation\n- HTTP Functions do NOT auto-install dependencies; include `node_modules` or use layers\n\n### Invoking HTTP Functions\n\n**Method 1: HTTP API (with Access Token)**\n```bash\ncurl -L 'https:\u002F\u002F{envId}.api.tcloudbasegateway.com\u002Fv1\u002Ffunctions\u002F{name}?webfn=true' \\\n  -H 'Authorization: Bearer \u003CTOKEN>'\n```\n**⚠️ Must include `webfn=true` parameter**\n\n**Method 2: HTTP Access Service (Custom Domain)**\n\nUse `manageGateway(action=\"createAccess\")` to configure HTTP access:\n\n```javascript\nmanageGateway({\n  action: \"createAccess\",\n  targetType: \"function\",\n  targetName: \"myHttpFunction\",\n  type: \"HTTP\",           \u002F\u002F \"HTTP\" for HTTP Function\n  path: \"\u002Fapi\u002Fhello\",     \u002F\u002F Trigger path\n  \u002F\u002F auth: false            \u002F\u002F Optional: only set this when you intentionally need anonymous\u002Fpublic access\n})\n```\n\nNotes:\n- `manageFunctions(action=\"createFunction\")` 只创建 HTTP 云函数本身，不会默认替你创建 HTTP 访问路径。\n- 如果用户明确说“不需要配置 HTTP 访问服务”，不要额外调用 `manageGateway(action=\"createAccess\")`。\n- 评测、浏览器或其他外部调用方可能会以匿名身份访问，而且失败后不一定会把 `EXCEED_AUTHORITY` 再反馈给 AI。只要场景涉及匿名 URL 访问，就要主动确认两件事：访问路径是否已创建，以及函数安全规则是否允许该访问方式。\n- 若外部请求已经报 `EXCEED_AUTHORITY`，先调用 `readSecurityRule(resourceType=\"function\")` 查看当前规则，再根据实际需求决定是否用 `writeSecurityRule(resourceType=\"function\", aclTag=\"CUSTOM\", rule=\"true\")` 或更细粒度规则放开权限。\n\n```bash\n# Access via default domain\ncurl https:\u002F\u002F{envId}.{region}.app.tcloudbase.com\u002F{path}\n\n# Access via custom domain\ncurl https:\u002F\u002Fyour-domain.com\u002F{path}\n```\n\n| Method | Auth Required | Use Case |\n|--------|--------------|----------|\n| HTTP API (`?webfn=true`) | Yes (Bearer Token) | Server-to-server |\n| HTTP Access Service | Optional | Browser, public APIs |\n\n### SSE & WebSocket Support\n\n**SSE (Server-Sent Events):** Enabled by default, for server-to-client streaming (AI chat, progress updates).\n\n```javascript\n\u002F\u002F Server\nres.setHeader('Content-Type', 'text\u002Fevent-stream');\nres.write(`data: ${JSON.stringify({ content: 'Hello' })}\\n\\n`);\n\n\u002F\u002F Client\nconst es = new EventSource('https:\u002F\u002Fyour-domain\u002Fstream');\nes.onmessage = (e) => console.log(JSON.parse(e.data));\n```\n\n**WebSocket:** Enable via `protocolType: \"WS\"` in `manageFunctions(action=\"createFunction\")`. For bidirectional real-time communication.\n\n| Limit | Value |\n|-------|-------|\n| Idle timeout | 10 - 7200 seconds |\n| Max message size | 256KB |\n\n```javascript\nconst wss = new WebSocket.Server({ port: 9000 });\nwss.on('connection', (ws) => {\n  ws.on('message', (msg) => ws.send(`Echo: ${msg}`));\n});\n```\n\n---\n\n### Function Logs\n\n**Querying Logs:**\n\n**Primary Method:** Use `queryFunctions(action=\"listFunctionLogs\")` and `queryFunctions(action=\"getFunctionLogDetail\")` (see MCP tool documentation).\n\n**Alternative Method (Plan B):** If tools unavailable, use `callCloudApi`:\n\n1. **Get Log List** - Use `GetFunctionLogs` action:\n```\ncallCloudApi({\n  service: \"tcb\",\n  action: \"GetFunctionLogs\",\n  params: {\n    EnvId: \"{envId}\",\n    FunctionName: \"functionName\",\n    Offset: 0,\n    Limit: 10,\n    StartTime: \"2024-01-01 00:00:00\",\n    EndTime: \"2024-01-01 23:59:59\",\n    LogRequestId: \"optional-request-id\",\n    Qualifier: \"$LATEST\"\n  }\n})\n```\n\n2. **Get Log Details** - Use `GetFunctionLogDetail` action (requires LogRequestId from step 1):\n```\ncallCloudApi({\n  service: \"tcb\",\n  action: \"GetFunctionLogDetail\",\n  params: {\n    StartTime: \"2024-01-01 00:00:00\",\n    EndTime: \"2024-01-01 23:59:59\",\n    LogRequestId: \"request-id-from-log-list\"\n  }\n})\n```\n\n**Log Query Limitations:**\n\n- `Offset + Limit` cannot exceed 10000\n- `StartTime` and `EndTime` interval cannot exceed 1 day\n- Use pagination for large time ranges\n\n**Log Query Best Practices:**\n\n1. Query logs within 1-day windows\n2. Use RequestId for specific invocation debugging\n3. Combine list and detail queries for comprehensive debugging\n4. Check logs after deployment to verify function behavior\n\n### Invoking Event Functions\n\n**From Web Applications:**\n\n```javascript\nimport cloudbaseSDK from \"@cloudbase\u002Fjs-sdk\";\n\nconst cloudbase = cloudbaseSDK.init({\n  env: 'your-env-id',\n  region: 'ap-shanghai',\n  accessKey: 'your-access-key'\n});\n\n\u002F\u002F Call event function\nconst result = await cloudbase.callFunction({\n  name: \"functionName\",\n  data: { \u002F* function parameters *\u002F }\n});\n```\n\n**From Mini Programs:**\n\n```javascript\nwx.cloud.callFunction({\n  name: \"functionName\",\n  data: { \u002F* function parameters *\u002F }\n}).then(res => {\n  console.log(res.result);\n});\n```\n\n**From Node.js Backend:**\n\n```javascript\nconst cloudbase = require(\"@cloudbase\u002Fnode-sdk\");\n\nconst app = cloudbase.init({\n  env: \"your-env-id\"\n});\n\nconst result = await app.callFunction({\n  name: \"functionName\",\n  data: { \u002F* function parameters *\u002F }\n});\n```\n\n**From HTTP API:**\n\nUse CloudBase HTTP API to invoke event functions:\n- Endpoint: `https:\u002F\u002F{envId}.api.tcloudbasegateway.com\u002Fv1\u002Ffunctions\u002F{functionName}`\n- Requires authentication token (Bearer Token)\n- See `http-api` skill for details\n\n### HTTP Access Configuration (for Event Functions)\n\n**HTTP Access vs HTTP API:**\n\n- **HTTP API**: Uses CloudBase API endpoint with authentication token\n- **HTTP Access**: Creates direct HTTP\u002FHTTPS endpoint for standard REST API access without SDK\n- **Important**: This section applies to Event Functions only. It does not change an HTTP Function into an Event Function or vice versa.\n\n**Creating HTTP Access:**\n\n**Primary Method:** Use `manageGateway(action=\"createAccess\")` (see MCP tool documentation).\n\n**Alternative Method (Plan B):** If tool unavailable, use `callCloudApi` with `CreateCloudBaseGWAPI`:\n\n```\ncallCloudApi({\n  service: \"tcb\",\n  action: \"CreateCloudBaseGWAPI\",\n  params: {\n    EnableUnion: true,\n    Path: \"\u002Fapi\u002Fusers\",\n    ServiceId: \"{envId}\",\n    Type: 6,\n    Name: \"functionName\",\n    AuthSwitch: 2,\n    PathTransmission: 2,\n    EnableRegion: true,\n    Domain: \"*\"  \u002F\u002F Use \"*\" for default domain, or custom domain name\n  }\n})\n```\n\n**Key Parameters:**\n- `Type: 6` - Cloud Function type (required)\n- `AuthSwitch: 2` - No auth (1 = with auth)\n- `Domain: \"*\"` - Default domain, or specify custom domain\n\n**Access URL:** `https:\u002F\u002F{envId}.{region}.app.tcloudbase.com\u002F{path}` or `https:\u002F\u002F{domain}\u002F{path}`\n\n### Function Configuration\n\n**Environment Variables:**\n\nSet via `func.envVariables` when creating\u002Fupdating:\n```javascript\n{\n  envVariables: {\n    \"DATABASE_URL\": \"mysql:\u002F\u002F...\",\n    \"API_KEY\": \"secret-key\"\n  }\n}\n```\n\n**⚠️ CRITICAL: Environment Variable Update Constraint**\n\nWhen updating environment variables for existing functions:\n\n1. **MUST first query current environment variables** using `queryFunctions(action=\"getFunctionDetail\")` to get the function's current configuration\n2. **MUST merge** new environment variables with existing ones\n3. **DO NOT directly overwrite** - this will delete existing environment variables not included in the update\n\n**Correct Update Pattern:**\n\n```javascript\n\u002F\u002F 1. First, get current function details\nconst currentFunction = await queryFunctions({\n  action: \"getFunctionDetail\",\n  functionName: \"functionName\"\n});\n\n\u002F\u002F 2. Merge existing envVariables with new ones\nconst mergedEnvVariables = {\n  ...currentFunction.EnvVariables,  \u002F\u002F Existing variables\n  ...newEnvVariables                 \u002F\u002F New\u002Fupdated variables\n};\n\n\u002F\u002F 3. Update with merged variables\nawait manageFunctions({\n  action: \"updateFunctionConfig\",\n  functionName: \"functionName\",\n  envVariables: mergedEnvVariables\n});\n```\n\n**Why This Matters:**\n\n- Direct overwrite will **delete** all environment variables not included in the update\n- This can break function functionality if critical variables are removed\n- Always preserve existing configuration when making partial updates\n\n**Timeout Configuration:**\n\nSet via `func.timeout` (in seconds):\n- Default timeout varies by runtime\n- Maximum timeout depends on runtime version\n- Consider function execution time when setting\n\n**Timer Triggers:**\n\nConfigure via `func.triggers`:\n- Type: `timer` (only supported type)\n- Config: Cron expression (7 fields: second minute hour day month week year)\n- Examples:\n  - `\"0 0 2 1 * * *\"` - 2:00 AM on 1st of every month\n  - `\"0 30 9 * * * *\"` - 9:30 AM every day\n\n**VPC Configuration:**\n\nFor accessing VPC resources:\n```javascript\n{\n  vpc: {\n    vpcId: \"vpc-xxxxx\",\n    subnetId: \"subnet-xxxxx\"\n  }\n}\n```\n\n## MCP Tools Reference\n\n**Function Management:**\n- `queryFunctions(action=\"listFunctions\"|\"getFunctionDetail\")` - Preferred read entrance for function inventory and detail\n- `manageFunctions(action=\"createFunction\")` - Create cloud function (supports both Event and HTTP types via `func.type`)\n  - `func.type: \"Event\"` - Event Function (default)\n  - `func.type: \"HTTP\"` - HTTP Function\n  - `func.protocolType: \"WS\"` - Enable WebSocket for HTTP Function\n- `manageFunctions(action=\"updateFunctionCode\")` - Update function code (runtime cannot change)\n- `manageFunctions(action=\"updateFunctionConfig\")` - Update function configuration (⚠️ when updating envVariables, must first query and merge with existing values to avoid overwriting)\n- Legacy aliases still seen in historical prompts: `getFunctionList`, `createFunction`, `updateFunctionCode`, `updateFunctionConfig`\n\n**Logging:**\n- `queryFunctions(action=\"listFunctionLogs\")` - Get function log list (basic info)\n- `queryFunctions(action=\"getFunctionLogDetail\")` - Get detailed log content by RequestId\n- `callCloudApi` (Plan B) - Use `GetFunctionLogs` and `GetFunctionLogDetail` actions if direct tools unavailable\n- Legacy aliases still seen in historical prompts: `getFunctionLogs`, `getFunctionLogDetail`\n\n**HTTP Access:**\n- `queryGateway(action=\"getAccess\")` - Query current function gateway exposure\n- `manageGateway(action=\"createAccess\")` - Create HTTP access for function\n- `callCloudApi` (Plan B) - Use `CreateCloudBaseGWAPI` action if direct tool unavailable\n- Legacy alias still seen in historical prompts: `createFunctionHTTPAccess`\n\n**Triggers:**\n- `queryFunctions(action=\"listFunctionTriggers\")` - Inspect triggers\n- `manageFunctions(action=\"createFunctionTrigger\"|\"deleteFunctionTrigger\")` - Create or delete function triggers\n- Legacy alias still seen in historical prompts: `manageFunctionTriggers`\n\n**CLI Commands:**\n- `tcb fn deploy \u003Cname>` - Deploy Event Function\n- `tcb fn deploy \u003Cname> --httpFn` - Deploy HTTP Function\n- `tcb fn deploy \u003Cname> --httpFn --ws` - Deploy HTTP Function with WebSocket\n- `tcb fn deploy --all` - Deploy all functions in config\n\n## Common Patterns\n\n### Error Handling\n\n```javascript\nexports.main = async (event, context) => {\n  try {\n    \u002F\u002F Function logic\n    return {\n      code: 0,\n      message: \"Success\",\n      data: result\n    };\n  } catch (error) {\n    return {\n      code: -1,\n      message: error.message,\n      data: null\n    };\n  }\n};\n```\n\n### Environment Variable Usage\n\n```javascript\nexports.main = async (event, context) => {\n  const apiKey = process.env.API_KEY;\n  const dbUrl = process.env.DATABASE_URL;\n  \n  \u002F\u002F Use environment variables\n};\n```\n\n### Database Operations\n\n```javascript\nconst cloudbase = require(\"@cloudbase\u002Fnode-sdk\");\n\nconst app = cloudbase.init({\n  env: process.env.ENV_ID\n});\n\nexports.main = async (event, context) => {\n  const db = app.database();\n  const result = await db.collection(\"users\").get();\n  return result;\n};\n```\n\n## Best Practices\n\n### General Best Practices\n1. **Runtime Selection**: Always specify runtime explicitly, use `Nodejs18.15` for new projects\n2. **Code Organization**: Keep functions focused and single-purpose\n3. **Error Handling**: Always implement proper error handling\n4. **Environment Variables**: Use env vars for configuration, never hardcode secrets\n5. **Logging**: Add meaningful logs for debugging\n6. **Testing**: Test functions locally when possible before deployment\n7. **Security**: Implement authentication\u002Fauthorization for HTTP access\n8. **Performance**: Optimize cold start time, use connection pooling for databases\n9. **Monitoring**: Regularly check logs and monitor function performance\n10. **Documentation**: Document function parameters and return values\n\n### HTTP Function Specific Best Practices\n1. **Port Configuration**: Always listen on port 9000\n2. **scf_bootstrap**: Ensure correct file permissions and LF line endings\n3. **Health Check**: Add `\u002Fhealth` endpoint for monitoring\n4. **CORS**: Configure CORS headers for browser access\n5. **Graceful Shutdown**: Handle process signals properly\n6. **Dependencies**: Include `node_modules` in package or use layers (no auto-install for HTTP Functions)\n7. **Timeout**: Set appropriate timeout for long-running SSE\u002FWebSocket connections\n8. **Error Responses**: Return proper HTTP status codes and error messages\n\n### Choosing Between Event and HTTP Functions\n\n| Scenario | Recommended Type |\n|----------|-----------------|\n| SDK\u002FMini Program calls | Event Function |\n| Scheduled tasks (cron) | Event Function |\n| REST API \u002F Web services | HTTP Function |\n| SSE streaming (AI chat) | HTTP Function |\n| WebSocket real-time | HTTP Function |\n| File upload\u002Fdownload | HTTP Function |\n| Multi-language support | HTTP Function |\n\n## Related Skills\n\n- `cloudrun-development` - For container-based backend services\n- `http-api` - For HTTP API invocation patterns\n- `cloudbase-platform` - For general CloudBase platform knowledge\n","# Cloud Functions Development\n\n## Activation Contract\n\n### Use this first when\n\n- The task is to create, update, deploy, inspect, or debug a CloudBase Event Function or HTTP Function.\n\n### Read before writing code if\n\n- The request mentions runtime, HTTP function, `scf_bootstrap`, function logs, or function deployment.\n\n### Then also read\n\n- Auth setup or provider-related backend work -> `..\u002Fauth-tool\u002FSKILL.md`\n- AI in functions -> `..\u002Fai-model-nodejs\u002FSKILL.md`\n\n### Do NOT use for\n\n- CloudRun container services or Web authentication UI implementation.\n\n### Common mistakes \u002F gotchas\n\n- Picking the wrong function type and trying to compensate later.\n- Mixing Event Function code shape (`exports.main(event, context)`) with HTTP Function code shape (`req` \u002F `res` on port 9000).\n- 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.\n- Forgetting that runtime cannot be changed after creation.\n- Using cloud functions as the first solution for Web login.\n- Forgetting that HTTP Functions do NOT auto-install dependencies — always include `node_modules`.\n- Forgetting to add `app.use(express.json())` or equivalent body parsing middleware for POST\u002FPUT requests.\n- Leaving HTTP handlers without sending a response (causes request timeout).\n- Not returning proper HTTP status codes (400, 401, 405) for error cases.\n\n### Minimal checklist\n\n- Read [Cloud Functions Execution Checklist](checklist.md) before deployment or runtime changes.\n\n## Overview\n\nUse this skill when developing, deploying, and managing CloudBase cloud functions. CloudBase supports two types of cloud functions:\n\n- **Event Functions (普通云函数)**: Traditional serverless functions triggered by events (SDK calls, timers)\n- **HTTP Functions (HTTP 云函数)**: Web service functions triggered by HTTP requests, supporting multiple languages\n\n### Writing mode at a glance\n\n- If the request is for a normal CloudBase function triggered by SDK calls, timers, or other events, write an **Event Function** with `exports.main = async (event, context) => {}`.\n- If the request is for an HTTP endpoint, REST API, SSE, or WebSocket service, write an **HTTP Function** that listens on port `9000` and handles `req` \u002F `res`.\n- If the user mentions HTTP access for an existing Event Function, keep the Event Function code shape and add gateway access separately.\n\n## When to use this skill\n\nUse this skill for **cloud function operations** when you need to:\n\n- Create and deploy Event Functions (Node.js)\n- Create and deploy HTTP Functions (Node.js\u002FPython\u002FGo\u002FJava)\n- Understand runtime limitations and selection\n- Query function logs and monitor execution\n- Invoke cloud functions from applications\n- Configure HTTP access for cloud functions\n- Implement SSE (Server-Sent Events) or WebSocket\n\n**Do NOT use for:**\n- CloudRun backend services (use `cloudrun-development` skill)\n- Complex container-based services (use `cloudrun-development` skill)\n- Database operations (use database skills)\n\n## How to use this skill (for a coding agent)\n\n1. **Choose the right function type**\n   - **Event Function**: For SDK calls, scheduled tasks, event-driven scenarios\n   - **HTTP Function**: For Web APIs, REST services, SSE\u002FWebSocket, multi-language support\n   - If the prompt says \"HTTP 云函数\", use the HTTP Function model first; if it says \"触发器云函数\" or omits HTTP, default to the Event Function model.\n\n2. **Understand runtime limitations**\n   - Runtime **CANNOT be changed** after function creation\n   - Must select correct runtime during initial creation\n   - If runtime needs to change, must delete and recreate function\n\n3. **Write code AND deploy — do not stop after writing files**\n   - **CRITICAL**: After writing function code, you MUST also deploy it using `manageFunctions`. Creating files locally without deploying is incomplete.\n   - Use `manageFunctions(action=\"createFunction\")` to create AND deploy in one step\n   - Provide `functionRootPath` as the **parent directory** of the function folder (e.g., `\u002Fproject\u002Fcloudfunctions\u002F` not `\u002Fproject\u002Fcloudfunctions\u002FmyFunction\u002F`)\n   - **Preferred MCP Tools**: Use `queryFunctions` for reads, `manageFunctions(action=\"createFunction\")` for creation, and `manageFunctions(action=\"updateFunctionCode\")` for code updates\n   - **Legacy compatibility**: If older prompts mention `createFunction` \u002F `updateFunctionCode`, map them to the `manageFunctions` actions above\n   - **CLI**: Use `tcb fn deploy` (Event) or `tcb fn deploy --httpFn` (HTTP) only as a fallback when MCP tools are unavailable\n   - In agent \u002F non-interactive runs, never default to CLI login flows for deployment; keep the flow on `manageFunctions`\n   - For HTTP functions, create or update them through `manageFunctions` with `func.type=\"HTTP\"` as the primary path\n   - HTTP Functions require `scf_bootstrap` file in the function directory\n   - Provide correct `functionRootPath` (parent directory of function folder)\n\n4. **Query logs properly**\n   - Use `queryFunctions(action=\"listFunctionLogs\")` for log list (basic info)\n   - Use `queryFunctions(action=\"getFunctionLogDetail\")` with RequestId for detailed logs\n   - **Legacy compatibility**: Treat `getFunctionLogs` \u002F `getFunctionLogDetail` as the two `queryFunctions` actions above\n   - Note time range limitations (max 1 day interval)\n\n5. **Handle legacy tool names safely**\n   - Prefer the converged entrances: `queryFunctions`, `manageFunctions`, `queryGateway`, `manageGateway`\n   - If old names appear in historical docs or prompts, convert them before acting:\n     - `getFunctionList` -> `queryFunctions`\n     - `createFunction` -> `manageFunctions(action=\"createFunction\")`\n     - `updateFunctionCode` -> `manageFunctions(action=\"updateFunctionCode\")`\n     - `updateFunctionConfig` -> `manageFunctions(action=\"updateFunctionConfig\")`\n     - `getFunctionLogs` -> `queryFunctions(action=\"listFunctionLogs\")`\n     - `getFunctionLogDetail` -> `queryFunctions(action=\"getFunctionLogDetail\")`\n     - `manageFunctionTriggers` -> `manageFunctions(action=\"createFunctionTrigger\"|\"deleteFunctionTrigger\")`\n     - `readFunctionLayers` -> `queryFunctions(action=\"listLayers\"|\"listLayerVersions\"|\"getLayerVersionDetail\"|\"listFunctionLayers\")`\n     - `writeFunctionLayers` -> `manageFunctions(action=\"createLayerVersion\"|\"deleteLayerVersion\"|\"attachLayer\"|\"detachLayer\"|\"updateFunctionLayers\")`\n     - `createFunctionHTTPAccess` -> `manageGateway(action=\"createAccess\")`\n\n---\n\n## Function Types Comparison\n\n| Feature | Event Function (普通云函数) | HTTP Function (HTTP 云函数) |\n|---------|---------------------------|----------------------------|\n| Trigger | Event-driven (SDK, timer) | HTTP request |\n| Entry Point | `exports.main = async (event, context) => {}` | Web Server (Express\u002FFlask\u002FGin etc.) |\n| Port | No port required | **Must listen on port 9000** |\n| Bootstrap | Not required | Requires `scf_bootstrap` |\n| Connection | Short connection | Supports long connection |\n| Languages | Node.js only | Node.js, Python, Go, Java |\n| Protocols | N\u002FA | HTTP, SSE, WebSocket |\n| Use Cases | Event processing, scheduled tasks | Web APIs, REST services, real-time streaming |\n\n---\n\n## Core Knowledge - Event Functions\n\n### Runtime Environment\n\n**⚠️ CRITICAL: Runtime cannot be modified after function creation**\n\nOnce a cloud function is created with a specific runtime, the runtime **cannot be changed**. If you need a different runtime:\n\n1. Delete the existing function\n2. Create a new function with the desired runtime\n\n**Supported Node.js Runtimes:**\n\n- `Nodejs18.15` (Default, Recommended)\n- `Nodejs16.13`\n- `Nodejs14.18`\n- `Nodejs12.16`\n- `Nodejs10.15`\n- `Nodejs8.9`\n\n**Runtime Selection Guidelines:**\n\n- **Use `Nodejs18.15`** for new projects (default, most modern)\n- Choose older versions only if dependencies require specific Node.js versions\n- Consider security updates and support lifecycle\n- Test thoroughly with selected runtime before deployment\n\n### Event Function Structure\n\nEvent functions require:\n\n1. **Function Directory**: Contains function code\n   - Must have `index.js` (or specified entry file)\n   - Must export handler: `exports.main = async (event, context) => {}`\n   - Include `package.json` with dependencies\n\n2. **Function Root Path**: Parent directory containing function directories\n   - Example: If function is at `\u002Fproject\u002Fcloudfunctions\u002FmyFunction\u002F`\n   - `functionRootPath` should be `\u002Fproject\u002Fcloudfunctions\u002F`\n   - **Important**: Do NOT include function name in root path\n\n3. **Entry Point**: Default is `index.js` with `exports.main`\n   - Can be customized via `handler` parameter\n\n### Event Function Deployment\n\n**Creating New Functions:**\n\nUse `manageFunctions(action=\"createFunction\")` (see MCP tool documentation for full parameter list):\n- **Important**: Always specify `func.runtime` explicitly (defaults to `Nodejs18.15`)\n- Provide `functionRootPath` as parent directory of function folders (absolute path)\n- Use `force=true` to overwrite existing function\n- **Legacy compatibility**: If an older prompt says `createFunction`, keep the same payload but send it through `manageFunctions`\n\n**Updating Function Code:**\n\nUse `manageFunctions(action=\"updateFunctionCode\")`:\n- **⚠️ Note**: Only updates code, **cannot change runtime**\n- If runtime needs to change, delete and recreate function\n- **Legacy compatibility**: If an older prompt says `updateFunctionCode`, map it to this `manageFunctions` action\n\n**Deployment Best Practices:**\n\n1. **Always specify runtime** explicitly when creating functions\n2. **Use absolute paths** for `functionRootPath`\n3. **Don't upload node_modules** - dependencies installed automatically\n4. **Test locally** before deployment when possible\n5. **Use environment variables** for configuration, not hardcoded values\n\n---\n\n## Core Knowledge - HTTP Functions\n\n### HTTP Function Overview\n\nHTTP Functions are optimized for Web service scenarios, supporting standard HTTP request\u002Fresponse patterns.\n\n**HTTP Function coding model**\n- Use a web-server style handler with `req` \u002F `res`\n- Parse query, headers, and body from the HTTP request directly\n- Return HTTP status codes and response bodies explicitly\n- Do not use `exports.main(event, context)` as the primary HTTP Function shape\n\n**Key Characteristics:**\n- **Must listen on port 9000** (platform requirement)\n- Requires `scf_bootstrap` startup script\n- Supports multiple languages: Node.js, Python, Go, Java\n- Supports HTTP, SSE, WebSocket protocols\n\n### scf_bootstrap Startup Script\n\n**⚠️ CRITICAL: HTTP Functions require `scf_bootstrap` file**\n\n| Requirement | Description |\n|-------------|-------------|\n| File name | Must be exactly `scf_bootstrap` (no extension) |\n| Permission | Must have execute permission (`chmod +x scf_bootstrap`) |\n| Port | Must start server on port **9000** |\n| Line endings | Must use LF (Unix), not CRLF (Windows) |\n\n**Examples:**\n```bash\n# Node.js\n#!\u002Fbin\u002Fbash\nnode index.js\n\n# Python\n#!\u002Fbin\u002Fbash\nexport PYTHONPATH=\".\u002Fthird_party:$PYTHONPATH\"\n\u002Fvar\u002Flang\u002Fpython310\u002Fbin\u002Fpython3.10 app.py\n\n# Go\n#!\u002Fbin\u002Fbash\n.\u002Fmain\n\n# Java\n#!\u002Fbin\u002Fbash\njava -jar *.jar\n```\n\n### HTTP Function Request & Response Handling\n\n**⚠️ CRITICAL: HTTP Functions are standard web servers.** They receive full HTTP requests (method, headers, query string, body) and must return complete HTTP responses (status code, headers, body). Unlike Event Functions, there is no CloudBase-specific request envelope.\n\n**Dependencies:**\n- **HTTP Functions do NOT auto-install dependencies.** You MUST include `node_modules` in the function directory or use layers.\n- Common packages: `express`, `body-parser` (built into Express 4.16+), `cors`, `helmet`\n\n**Handling Different HTTP Methods:**\n\n```javascript\nconst express = require('express');\nconst app = express();\n\n\u002F\u002F IMPORTANT: Must parse JSON body for POST\u002FPUT requests\napp.use(express.json());\n\n\u002F\u002F GET - read query parameters from req.query\napp.get('\u002Fusers', (req, res) => {\n  const { userId, page = 1, pageSize = 10 } = req.query;\n\n  if (!userId) {\n    return res.status(400).json({ error: 'userId is required' });\n  }\n\n  res.json({\n    method: 'GET',\n    params: { userId, page: Number(page), pageSize: Number(pageSize) },\n    message: 'Query parameters processed'\n  });\n});\n\n\u002F\u002F POST - read body from req.body, query from req.query\napp.post('\u002Fusers', (req, res) => {\n  const { action } = req.query;    \u002F\u002F query string: ?action=create\n  const { name, email } = req.body; \u002F\u002F JSON body\n\n  if (!name || !email) {\n    return res.status(400).json({ error: 'name and email are required' });\n  }\n\n  res.json({\n    method: 'POST',\n    action,\n    data: { name, email },\n    message: 'Body and query parameters processed'\n  });\n});\n\n\u002F\u002F PUT - read custom headers from req.headers\napp.put('\u002Fusers\u002F:id', (req, res) => {\n  const userId = req.headers['x-user-id']; \u002F\u002F custom header\n\n  if (!userId) {\n    return res.status(401).json({ error: 'x-user-id header is required' });\n  }\n\n  const { status } = req.body;\n  res.json({\n    method: 'PUT',\n    userId,\n    status,\n    message: 'Headers and body processed'\n  });\n});\n\n\u002F\u002F For unsupported methods, return 405\napp.all('*', (req, res) => {\n  res.status(405).json({ error: 'Method Not Allowed' });\n});\n\napp.listen(9000); \u002F\u002F Must be port 9000\n```\n\n**Key Rules:**\n- `req.query` - URL query string parameters (e.g., `?userId=123&page=1`)\n- `req.body` - Parsed request body (requires `app.use(express.json())` or equivalent middleware)\n- `req.headers` - All HTTP headers (lowercased, e.g., `req.headers['x-user-id']`)\n- `req.params` - URL path parameters (e.g., `\u002Fusers\u002F:id`)\n- Always return proper HTTP status codes: 200 (success), 400 (bad request), 401 (unauthorized), 405 (method not allowed)\n- Always call `res.json()`, `res.send()`, or `res.status().json()` to send a response\n- Never leave a request handler without sending a response\n\n### HTTP Function Structure & Example\n\n```\nmy-http-function\u002F\n├── scf_bootstrap      # Required: startup script\n├── package.json       # Dependencies\n├── node_modules\u002F      # Required for HTTP Functions (no auto-install)\n└── index.js           # Application code\n```\n\n**Minimal Node.js Example (Express):**\n```javascript\nconst express = require('express');\nconst app = express();\napp.use(express.json());\n\napp.get('\u002F', (req, res) => res.json({ message: 'Hello!' }));\napp.listen(9000);  \u002F\u002F Must be port 9000\n```\n\n### HTTP Function Deployment\n\n**MCP Tool:**\n```javascript\nmanageFunctions({\n  action: \"createFunction\",\n  func: {\n    name: \"myHttpFunction\",\n    type: \"HTTP\",           \u002F\u002F Required for HTTP Function\n    protocolType: \"HTTP\",   \u002F\u002F \"HTTP\" (default) or \"WS\" (WebSocket)\n    timeout: 60\n  },\n  functionRootPath: \"\u002Fpath\u002Fto\u002Ffunctions\",\n  force: false\n})\n```\n\n**CLI:**\n```bash\ntcb fn deploy \u003Cname> --httpFn        # HTTP Function\ntcb fn deploy \u003Cname> --httpFn --ws   # With WebSocket\n```\n\n**⚠️ Notes:**\n- Function type **cannot be changed** after creation\n- HTTP Functions do NOT auto-install dependencies; include `node_modules` or use layers\n\n### Invoking HTTP Functions\n\n**Method 1: HTTP API (with Access Token)**\n```bash\ncurl -L 'https:\u002F\u002F{envId}.api.tcloudbasegateway.com\u002Fv1\u002Ffunctions\u002F{name}?webfn=true' \\\n  -H 'Authorization: Bearer \u003CTOKEN>'\n```\n**⚠️ Must include `webfn=true` parameter**\n\n**Method 2: HTTP Access Service (Custom Domain)**\n\nUse `manageGateway(action=\"createAccess\")` to configure HTTP access:\n\n```javascript\nmanageGateway({\n  action: \"createAccess\",\n  targetType: \"function\",\n  targetName: \"myHttpFunction\",\n  type: \"HTTP\",           \u002F\u002F \"HTTP\" for HTTP Function\n  path: \"\u002Fapi\u002Fhello\",     \u002F\u002F Trigger path\n  \u002F\u002F auth: false            \u002F\u002F Optional: only set this when you intentionally need anonymous\u002Fpublic access\n})\n```\n\nNotes:\n- `manageFunctions(action=\"createFunction\")` 只创建 HTTP 云函数本身，不会默认替你创建 HTTP 访问路径。\n- 如果用户明确说“不需要配置 HTTP 访问服务”，不要额外调用 `manageGateway(action=\"createAccess\")`。\n- 评测、浏览器或其他外部调用方可能会以匿名身份访问，而且失败后不一定会把 `EXCEED_AUTHORITY` 再反馈给 AI。只要场景涉及匿名 URL 访问，就要主动确认两件事：访问路径是否已创建，以及函数安全规则是否允许该访问方式。\n- 若外部请求已经报 `EXCEED_AUTHORITY`，先调用 `readSecurityRule(resourceType=\"function\")` 查看当前规则，再根据实际需求决定是否用 `writeSecurityRule(resourceType=\"function\", aclTag=\"CUSTOM\", rule=\"true\")` 或更细粒度规则放开权限。\n\n```bash\n# Access via default domain\ncurl https:\u002F\u002F{envId}.{region}.app.tcloudbase.com\u002F{path}\n\n# Access via custom domain\ncurl https:\u002F\u002Fyour-domain.com\u002F{path}\n```\n\n| Method | Auth Required | Use Case |\n|--------|--------------|----------|\n| HTTP API (`?webfn=true`) | Yes (Bearer Token) | Server-to-server |\n| HTTP Access Service | Optional | Browser, public APIs |\n\n### SSE & WebSocket Support\n\n**SSE (Server-Sent Events):** Enabled by default, for server-to-client streaming (AI chat, progress updates).\n\n```javascript\n\u002F\u002F Server\nres.setHeader('Content-Type', 'text\u002Fevent-stream');\nres.write(`data: ${JSON.stringify({ content: 'Hello' })}\\n\\n`);\n\n\u002F\u002F Client\nconst es = new EventSource('https:\u002F\u002Fyour-domain\u002Fstream');\nes.onmessage = (e) => console.log(JSON.parse(e.data));\n```\n\n**WebSocket:** Enable via `protocolType: \"WS\"` in `manageFunctions(action=\"createFunction\")`. For bidirectional real-time communication.\n\n| Limit | Value |\n|-------|-------|\n| Idle timeout | 10 - 7200 seconds |\n| Max message size | 256KB |\n\n```javascript\nconst wss = new WebSocket.Server({ port: 9000 });\nwss.on('connection', (ws) => {\n  ws.on('message', (msg) => ws.send(`Echo: ${msg}`));\n});\n```\n\n---\n\n### Function Logs\n\n**Querying Logs:**\n\n**Primary Method:** Use `queryFunctions(action=\"listFunctionLogs\")` and `queryFunctions(action=\"getFunctionLogDetail\")` (see MCP tool documentation).\n\n**Alternative Method (Plan B):** If tools unavailable, use `callCloudApi`:\n\n1. **Get Log List** - Use `GetFunctionLogs` action:\n```\ncallCloudApi({\n  service: \"tcb\",\n  action: \"GetFunctionLogs\",\n  params: {\n    EnvId: \"{envId}\",\n    FunctionName: \"functionName\",\n    Offset: 0,\n    Limit: 10,\n    StartTime: \"2024-01-01 00:00:00\",\n    EndTime: \"2024-01-01 23:59:59\",\n    LogRequestId: \"optional-request-id\",\n    Qualifier: \"$LATEST\"\n  }\n})\n```\n\n2. **Get Log Details** - Use `GetFunctionLogDetail` action (requires LogRequestId from step 1):\n```\ncallCloudApi({\n  service: \"tcb\",\n  action: \"GetFunctionLogDetail\",\n  params: {\n    StartTime: \"2024-01-01 00:00:00\",\n    EndTime: \"2024-01-01 23:59:59\",\n    LogRequestId: \"request-id-from-log-list\"\n  }\n})\n```\n\n**Log Query Limitations:**\n\n- `Offset + Limit` cannot exceed 10000\n- `StartTime` and `EndTime` interval cannot exceed 1 day\n- Use pagination for large time ranges\n\n**Log Query Best Practices:**\n\n1. Query logs within 1-day windows\n2. Use RequestId for specific invocation debugging\n3. Combine list and detail queries for comprehensive debugging\n4. Check logs after deployment to verify function behavior\n\n### Invoking Event Functions\n\n**From Web Applications:**\n\n```javascript\nimport cloudbaseSDK from \"@cloudbase\u002Fjs-sdk\";\n\nconst cloudbase = cloudbaseSDK.init({\n  env: 'your-env-id',\n  region: 'ap-shanghai',\n  accessKey: 'your-access-key'\n});\n\n\u002F\u002F Call event function\nconst result = await cloudbase.callFunction({\n  name: \"functionName\",\n  data: { \u002F* function parameters *\u002F }\n});\n```\n\n**From Mini Programs:**\n\n```javascript\nwx.cloud.callFunction({\n  name: \"functionName\",\n  data: { \u002F* function parameters *\u002F }\n}).then(res => {\n  console.log(res.result);\n});\n```\n\n**From Node.js Backend:**\n\n```javascript\nconst cloudbase = require(\"@cloudbase\u002Fnode-sdk\");\n\nconst app = cloudbase.init({\n  env: \"your-env-id\"\n});\n\nconst result = await app.callFunction({\n  name: \"functionName\",\n  data: { \u002F* function parameters *\u002F }\n});\n```\n\n**From HTTP API:**\n\nUse CloudBase HTTP API to invoke event functions:\n- Endpoint: `https:\u002F\u002F{envId}.api.tcloudbasegateway.com\u002Fv1\u002Ffunctions\u002F{functionName}`\n- Requires authentication token (Bearer Token)\n- See `http-api` skill for details\n\n### HTTP Access Configuration (for Event Functions)\n\n**HTTP Access vs HTTP API:**\n\n- **HTTP API**: Uses CloudBase API endpoint with authentication token\n- **HTTP Access**: Creates direct HTTP\u002FHTTPS endpoint for standard REST API access without SDK\n- **Important**: This section applies to Event Functions only. It does not change an HTTP Function into an Event Function or vice versa.\n\n**Creating HTTP Access:**\n\n**Primary Method:** Use `manageGateway(action=\"createAccess\")` (see MCP tool documentation).\n\n**Alternative Method (Plan B):** If tool unavailable, use `callCloudApi` with `CreateCloudBaseGWAPI`:\n\n```\ncallCloudApi({\n  service: \"tcb\",\n  action: \"CreateCloudBaseGWAPI\",\n  params: {\n    EnableUnion: true,\n    Path: \"\u002Fapi\u002Fusers\",\n    ServiceId: \"{envId}\",\n    Type: 6,\n    Name: \"functionName\",\n    AuthSwitch: 2,\n    PathTransmission: 2,\n    EnableRegion: true,\n    Domain: \"*\"  \u002F\u002F Use \"*\" for default domain, or custom domain name\n  }\n})\n```\n\n**Key Parameters:**\n- `Type: 6` - Cloud Function type (required)\n- `AuthSwitch: 2` - No auth (1 = with auth)\n- `Domain: \"*\"` - Default domain, or specify custom domain\n\n**Access URL:** `https:\u002F\u002F{envId}.{region}.app.tcloudbase.com\u002F{path}` or `https:\u002F\u002F{domain}\u002F{path}`\n\n### Function Configuration\n\n**Environment Variables:**\n\nSet via `func.envVariables` when creating\u002Fupdating:\n```javascript\n{\n  envVariables: {\n    \"DATABASE_URL\": \"mysql:\u002F\u002F...\",\n    \"API_KEY\": \"secret-key\"\n  }\n}\n```\n\n**⚠️ CRITICAL: Environment Variable Update Constraint**\n\nWhen updating environment variables for existing functions:\n\n1. **MUST first query current environment variables** using `queryFunctions(action=\"getFunctionDetail\")` to get the function's current configuration\n2. **MUST merge** new environment variables with existing ones\n3. **DO NOT directly overwrite** - this will delete existing environment variables not included in the update\n\n**Correct Update Pattern:**\n\n```javascript\n\u002F\u002F 1. First, get current function details\nconst currentFunction = await queryFunctions({\n  action: \"getFunctionDetail\",\n  functionName: \"functionName\"\n});\n\n\u002F\u002F 2. Merge existing envVariables with new ones\nconst mergedEnvVariables = {\n  ...currentFunction.EnvVariables,  \u002F\u002F Existing variables\n  ...newEnvVariables                 \u002F\u002F New\u002Fupdated variables\n};\n\n\u002F\u002F 3. Update with merged variables\nawait manageFunctions({\n  action: \"updateFunctionConfig\",\n  functionName: \"functionName\",\n  envVariables: mergedEnvVariables\n});\n```\n\n**Why This Matters:**\n\n- Direct overwrite will **delete** all environment variables not included in the update\n- This can break function functionality if critical variables are removed\n- Always preserve existing configuration when making partial updates\n\n**Timeout Configuration:**\n\nSet via `func.timeout` (in seconds):\n- Default timeout varies by runtime\n- Maximum timeout depends on runtime version\n- Consider function execution time when setting\n\n**Timer Triggers:**\n\nConfigure via `func.triggers`:\n- Type: `timer` (only supported type)\n- Config: Cron expression (7 fields: second minute hour day month week year)\n- Examples:\n  - `\"0 0 2 1 * * *\"` - 2:00 AM on 1st of every month\n  - `\"0 30 9 * * * *\"` - 9:30 AM every day\n\n**VPC Configuration:**\n\nFor accessing VPC resources:\n```javascript\n{\n  vpc: {\n    vpcId: \"vpc-xxxxx\",\n    subnetId: \"subnet-xxxxx\"\n  }\n}\n```\n\n## MCP Tools Reference\n\n**Function Management:**\n- `queryFunctions(action=\"listFunctions\"|\"getFunctionDetail\")` - Preferred read entrance for function inventory and detail\n- `manageFunctions(action=\"createFunction\")` - Create cloud function (supports both Event and HTTP types via `func.type`)\n  - `func.type: \"Event\"` - Event Function (default)\n  - `func.type: \"HTTP\"` - HTTP Function\n  - `func.protocolType: \"WS\"` - Enable WebSocket for HTTP Function\n- `manageFunctions(action=\"updateFunctionCode\")` - Update function code (runtime cannot change)\n- `manageFunctions(action=\"updateFunctionConfig\")` - Update function configuration (⚠️ when updating envVariables, must first query and merge with existing values to avoid overwriting)\n- Legacy aliases still seen in historical prompts: `getFunctionList`, `createFunction`, `updateFunctionCode`, `updateFunctionConfig`\n\n**Logging:**\n- `queryFunctions(action=\"listFunctionLogs\")` - Get function log list (basic info)\n- `queryFunctions(action=\"getFunctionLogDetail\")` - Get detailed log content by RequestId\n- `callCloudApi` (Plan B) - Use `GetFunctionLogs` and `GetFunctionLogDetail` actions if direct tools unavailable\n- Legacy aliases still seen in historical prompts: `getFunctionLogs`, `getFunctionLogDetail`\n\n**HTTP Access:**\n- `queryGateway(action=\"getAccess\")` - Query current function gateway exposure\n- `manageGateway(action=\"createAccess\")` - Create HTTP access for function\n- `callCloudApi` (Plan B) - Use `CreateCloudBaseGWAPI` action if direct tool unavailable\n- Legacy alias still seen in historical prompts: `createFunctionHTTPAccess`\n\n**Triggers:**\n- `queryFunctions(action=\"listFunctionTriggers\")` - Inspect triggers\n- `manageFunctions(action=\"createFunctionTrigger\"|\"deleteFunctionTrigger\")` - Create or delete function triggers\n- Legacy alias still seen in historical prompts: `manageFunctionTriggers`\n\n**CLI Commands:**\n- `tcb fn deploy \u003Cname>` - Deploy Event Function\n- `tcb fn deploy \u003Cname> --httpFn` - Deploy HTTP Function\n- `tcb fn deploy \u003Cname> --httpFn --ws` - Deploy HTTP Function with WebSocket\n- `tcb fn deploy --all` - Deploy all functions in config\n\n## Common Patterns\n\n### Error Handling\n\n```javascript\nexports.main = async (event, context) => {\n  try {\n    \u002F\u002F Function logic\n    return {\n      code: 0,\n      message: \"Success\",\n      data: result\n    };\n  } catch (error) {\n    return {\n      code: -1,\n      message: error.message,\n      data: null\n    };\n  }\n};\n```\n\n### Environment Variable Usage\n\n```javascript\nexports.main = async (event, context) => {\n  const apiKey = process.env.API_KEY;\n  const dbUrl = process.env.DATABASE_URL;\n  \n  \u002F\u002F Use environment variables\n};\n```\n\n### Database Operations\n\n```javascript\nconst cloudbase = require(\"@cloudbase\u002Fnode-sdk\");\n\nconst app = cloudbase.init({\n  env: process.env.ENV_ID\n});\n\nexports.main = async (event, context) => {\n  const db = app.database();\n  const result = await db.collection(\"users\").get();\n  return result;\n};\n```\n\n## Best Practices\n\n### General Best Practices\n1. **Runtime Selection**: Always specify runtime explicitly, use `Nodejs18.15` for new projects\n2. **Code Organization**: Keep functions focused and single-purpose\n3. **Error Handling**: Always implement proper error handling\n4. **Environment Variables**: Use env vars for configuration, never hardcode secrets\n5. **Logging**: Add meaningful logs for debugging\n6. **Testing**: Test functions locally when possible before deployment\n7. **Security**: Implement authentication\u002Fauthorization for HTTP access\n8. **Performance**: Optimize cold start time, use connection pooling for databases\n9. **Monitoring**: Regularly check logs and monitor function performance\n10. **Documentation**: Document function parameters and return values\n\n### HTTP Function Specific Best Practices\n1. **Port Configuration**: Always listen on port 9000\n2. **scf_bootstrap**: Ensure correct file permissions and LF line endings\n3. **Health Check**: Add `\u002Fhealth` endpoint for monitoring\n4. **CORS**: Configure CORS headers for browser access\n5. **Graceful Shutdown**: Handle process signals properly\n6. **Dependencies**: Include `node_modules` in package or use layers (no auto-install for HTTP Functions)\n7. **Timeout**: Set appropriate timeout for long-running SSE\u002FWebSocket connections\n8. **Error Responses**: Return proper HTTP status codes and error messages\n\n### Choosing Between Event and HTTP Functions\n\n| Scenario | Recommended Type |\n|----------|-----------------|\n| SDK\u002FMini Program calls | Event Function |\n| Scheduled tasks (cron) | Event Function |\n| REST API \u002F Web services | HTTP Function |\n| SSE streaming (AI chat) | HTTP Function |\n| WebSocket real-time | HTTP Function |\n| File upload\u002Fdownload | HTTP Function |\n| Multi-language support | HTTP Function |\n\n## Related Skills\n\n- `cloudrun-development` - For container-based backend services\n- `http-api` - For HTTP API invocation patterns\n- `cloudbase-platform` - For general CloudBase platform knowledge\n",{"name":5,"alwaysApply":20,"description":7},"main","87afe6ce96220accf50a345dea46784c8c9f210e","YYC3-Skills-技能包\u002FYYC3-Skills-技能包-code-skills\u002Fskills\u002Fcloudbase\u002Freferences\u002Fcloud-functions",0,"https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base","https:\u002F\u002Fkb.yyc3.top\u002F","https:\u002F\u002Fgithub.com\u002FYYC-Cube","万象归元于云枢 | 深栈智启新纪元","2026-11-10 10:37:32",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add YYC-Cube\u002FYYC3-Knowledge-Base --skill cloud-functions",{"tool":39,"command":40},"bunx","bunx skills add YYC-Cube\u002FYYC3-Knowledge-Base --skill cloud-functions",{"tool":42,"command":43},"pnpm","pnpm dlx skills add YYC-Cube\u002FYYC3-Knowledge-Base --skill cloud-functions","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-Skills-技能包\u002FYYC3-Skills-技能包-code-skills\u002Fskills\u002Fcloudbase\u002Freferences\u002Fcloud-functions\u002FSKILL.md",true,[47],{"path":48,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":51,"sourceHtmlUrl":52},"checklist.md","REFERENCE","参考文档",1155,"https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-Skills-技能包\u002FYYC3-Skills-技能包-code-skills\u002Fskills\u002Fcloudbase\u002Freferences\u002Fcloud-functions\u002Fchecklist.md",[54,61,68,75,82,89],{"skillNo":55,"name":56,"nameZh":6,"description":57,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":19},"01M7CTDWHERCXPQCP0K03A86AS","vercel-sandbox","Run agent-browser + Chrome inside Vercel Sandbox microVMs for browser automation from any Vercel-deployed app. Use when the user needs browser automation in a Vercel app (Next.js, SvelteKit, Nuxt, Remix, Astro, etc.), wants to run headless Chrome without binary size limits, needs persistent browser sessions across commands, or wants ephemeral isolated browser environments. Triggers include \"Vercel Sandbox browser\", \"microVM Chrome\", \"agent-browser in sandbox\", \"browser automation on Vercel\", or any task requiring Chrome in a Vercel Sandbox.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-WebSpec-Web标准\u002FYYC3-WebSpec-Web标准-standards\u002Fbrowser-agent\u002Fskills\u002Fvercel-sandbox\u002FSKILL.md",[],[],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":19},"01M7CTD8D2BNJY54S65M47HEJA","slack","Interact with Slack workspaces using browser automation. Use when the user needs to check unread channels, navigate Slack, send messages, extract data, find information, search conversations, or automate any Slack task. Triggers include \"check my Slack\", \"what channels have unreads\", \"send a message to\", \"search Slack for\", \"extract from Slack\", \"find who said\", or any task requiring programmatic Slack interaction.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-WebSpec-Web标准\u002FYYC3-WebSpec-Web标准-standards\u002Fbrowser-agent\u002Fskills\u002Fslack\u002FSKILL.md",[],[],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":19},"01M7CTCSSB8ZP3Q58C3YZDZK1W","electron","Automate Electron desktop apps (VS Code, Slack, Discord, Figma, Notion, Spotify, etc.) using agent-browser via Chrome DevTools Protocol. Use when the user needs to interact with an Electron app, automate a desktop app, connect to a running app, control a native app, or test an Electron application. Triggers include \"automate Slack app\", \"control VS Code\", \"interact with Discord app\", \"test this Electron app\", \"connect to desktop app\", or any task requiring automation of a native Electron application.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-WebSpec-Web标准\u002FYYC3-WebSpec-Web标准-standards\u002Fbrowser-agent\u002Fskills\u002Felectron\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":19},"01M7CTCBJY76688V4DCZGWFHGQ","dogfood","Systematically explore and test a web application to find bugs, UX issues, and other problems. Use when asked to \"dogfood\", \"QA\", \"exploratory test\", \"find issues\", \"bug hunt\", \"test this app\u002Fsite\u002Fplatform\", or review the quality of a web application. Produces a structured report with full reproduction evidence -- step-by-step screenshots, repro videos, and detailed repro steps for every issue -- so findings can be handed directly to the responsible teams.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-WebSpec-Web标准\u002FYYC3-WebSpec-Web标准-standards\u002Fbrowser-agent\u002Fskills\u002Fdogfood\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":19},"01M7CTC4H0FFGVEAQR9PA4GA1A","agent-browser","Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to \"open a website\", \"fill out a form\", \"click a button\", \"take a screenshot\", \"scrape data from a page\", \"test this web app\", \"login to a site\", \"automate browser actions\", or any task requiring programmatic web interaction.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-WebSpec-Web标准\u002FYYC3-WebSpec-Web标准-standards\u002Fbrowser-agent\u002Fskills\u002Fagent-browser\u002FSKILL.md",[],[],{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":19},"01M7CTBKVFYBG78FDSABSDJTTQ","shadcn","Manages shadcn components and projects — adding, searching, fixing, debugging, styling, and composing UI, including chat interfaces. Provides project context, component docs, and usage examples. Applies when working with shadcn\u002Fui, component registries, presets, --preset codes, or any project with a components.json file. Also triggers for \"shadcn init\", \"create an app with --preset\", \"switch to --preset\", and for building a design system or applying a DESIGN.md or brand spec to shadcn\u002Fui.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-UI-界面组件\u002FYYC3-UI-界面组件-ui\u002Fskills\u002Fshadcn\u002FSKILL.md",[],[]]