Token导航 LogoToken导航

Agent Skill · 开发

cloud-functions(云功能)

cloud-functions 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

cloud-functions 是开发类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证为 MIT,第三方扫描已通过,按安装量在开发类的 21,746 个 Skill 里排第 2,350。

总安装 18,042周安装 775GitHub Stars 50下载 6,324核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:cloud-functions(云功能)
来源仓库:https://github.com/tencentcloudbase/skills
仓库路径:skills/cloud-functions
安装命令:
npx skills add https://github.com/tencentcloudbase/skills --skill cloud-functions
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/tencentcloudbase/skills --skill cloud-functions

这个 Skill 是做什么的

开发类 Skill 面向写代码、改代码和排查问题,一般会读写仓库文件,部分还会执行构建或测试命令。

有关使用事件和 HTTP 类型开发、部署和管理 CloudBase 云功能的完整指南。

支持两种函数类型:事件函数(Node.js,事件驱动)和 HTTP 函数(Node.js/Python/Go/Java,端口 9000 上的 Web 服务) 运行时在创建后是不可变的;必须在初始部署期间选择正确的 Node.js 版本,或者删除并重新创建以进行更改 HTTP 函数需要 scf_bootstrap 具有执行权限和 LF 行结尾的启动脚本;事件函数不 包括通过 getFunctionLogs 进行日志记录 和 getFunctionLogDetail 工具,具有 1 天查询窗口限制和分页约束 涵盖 SSE 和 WebSocket 支持、HTTP 访问配置、环境变量管理(更新时必须与现有值合并)以及通过 cron 表达式进行计时器触发器

来源仓库内路径:skills/cloud-functions

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/tencentcloudbase/skills --skill cloud-function…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

cloud-functions 怎么安装?

在终端执行 npx skills add https://github.com/tencentcloudbase/skills --skill cloud-functions。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

cloud-functions 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

cloud-functions 需要什么权限?

权限级别是接触敏感数据。该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

cloud-functions 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

cloud-functions 用的人多吗?

公开数据是累计安装 18,042 次,近一周安装 775 次,下载 6,324 次,GitHub 50 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

cloud-functions 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理开发类任务、又不想每次都手写提示词的人。
  • 需要许可证清楚、并且有第三方扫描结果的团队项目。

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要厂商级技术支持和 SLA 的生产系统。

开发类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
skill-vetter

技能审查员 · OpenClaw

8,779,018986操作浏览器MIT-0通过
ontology

本体论 · OpenClaw

6,636,960576只读MIT-0通过
entra-app-registration

内部应用程序注册 · Codex、Claude

6,631,872764接触敏感数据未明确通过
entra-app-registration

内部应用程序注册 · Codex、Claude

3,757,680201接触敏感数据未明确通过
nano-banana-pro

纳米香蕉专业版 · OpenClaw

3,526,898364接触敏感数据MIT-0有提醒
cloud-functions

云功能 · 本页

18,04250接触敏感数据MIT通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Standalone Install Note

If this environment only installed the current skill, start from the CloudBase main entry and use the published cloudbase/references/... paths for sibling skills.

  • CloudBase main entry: https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/SKILL.md
  • Current skill raw source: https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/references/cloud-functions/SKILL.md

Keep local references/... paths for files that ship with the current skill directory. When this file points to a sibling skill such as auth-tool or web-development, use the standalone fallback URL shown next to that reference.

Cloud Functions Development

Activation Contract

Use this first when

  • The task is to create, update, deploy, inspect, or debug a CloudBase Event Function or HTTP Function that serves application runtime logic.
  • The request mentions function runtime, function logs, scf_bootstrap, function triggers, or function gateway exposure.

Read before writing code if

  • You still need to decide between Event Function and HTTP Function.
  • The task mentions manageFunctions, queryFunctions, manageGateway, or legacy function-tool names.
  • The task might require callCloudApi as a fallback for logs or gateway setup.

Then also read

  • Detailed reference routing -> ./references.md
  • Auth setup or provider-related backend work -> ../auth-tool/SKILL.md (standalone fallback: https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/references/auth-tool/SKILL.md)
  • AI in functions -> ../ai-model-nodejs/SKILL.md (standalone fallback: https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/references/ai-model-nodejs/SKILL.md)
  • Long-lived container services or Agent runtimes -> ../cloudrun-development/SKILL.md (standalone fallback: https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/references/cloudrun-development/SKILL.md)
  • Calling CloudBase official platform APIs from a client or script -> ../http-api/SKILL.md (standalone fallback: https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/references/http-api/SKILL.md)

Do NOT use for

  • CloudRun container services.
  • Web authentication UI implementation.
  • Database-schema design or general data-model work.
  • CloudBase official platform API clients or raw HTTP integrations that only consume platform endpoints.

Common mistakes / gotchas

  • Picking the wrong function type and trying to compensate later.
  • Confusing official CloudBase API client work with building your own HTTP function.
  • Mixing Event Function code shape (exports.main(event, context)) with HTTP Function code shape (req / res on port 9000).
  • 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.
  • Assuming db.collection("name").add(...) will create a missing document-database collection automatically. Collection creation is a separate management step.
  • Forgetting that runtime cannot be changed after creation.
  • Using cloud functions as the first answer for Web login.
  • Forgetting that HTTP Functions must ship scf_bootstrap, listen on port 9000, and include dependencies.
  • Forgetting to configure function security rules after creating an HTTP Function. Default rules reject anonymous callers with EXCEED_AUTHORITY. Use managePermissions(action="updateResourcePermission", resourceType="function") to allow public access.
  • Mismatching the scf_bootstrap Node.js binary path with the function runtime (e.g. using /var/lang/node18/bin/node but setting runtime: "Nodejs16.13").

Minimal checklist

  • Read Cloud Functions Execution Checklist before deployment or runtime changes.
  • Decide whether the task is Event Function, HTTP Function, or actually CloudRun.
  • Pick the detailed reference file in references.md before writing implementation code.

Overview

Use this skill when developing, deploying, and operating CloudBase cloud functions. CloudBase has two different programming models:

  • Event Functions: serverless handlers driven by SDK calls, timers, and other events.
  • HTTP Functions: standard web services for HTTP endpoints, SSE, or WebSocket workloads.

Writing mode at a glance

  • If the request is for SDK calls, timers, or event-driven workflows, write an Event Function with exports.main = async (event, context) => {}.
  • If the request is for REST APIs, browser-facing endpoints, SSE, or WebSocket, write an HTTP Function with req / res on port 9000.
  • For Node.js HTTP Functions, default to the native http module unless the user explicitly asks for Express, Koa, NestJS, or another framework.
  • If the user mentions HTTP access for an existing Event Function, keep the Event Function code shape and add gateway access separately.

HTTP Function authoring contract

Use these rules whenever you are writing the function code itself:

  • Do not write an HTTP Function as exports.main(event, context). That is the Event Function contract.
  • Treat the function as a standard web server process that must listen on port 9000.
  • With Node.js, prefer http.createServer((req, res) => {...}) by default so the runtime contract stays explicit.
  • With the Node.js native http module, do not assume Express-style helpers exist. req.body, req.query, and req.params are not provided for you.
  • For Node.js HTTP Functions, choose one module system up front and keep it consistent. Default to CommonJS for simple functions (require(...), no "type": "module" in package.json) unless you explicitly want ES Modules.
  • If you do choose ES Modules ("type": "module" + import...), do not mix in CommonJS-only globals or APIs such as require(...), module.exports, or bare __dirname. In ESM, derive file paths from import.meta.url with fileURLToPath(...) only when needed.
  • With the native http module, parse req.url yourself with new URL(...), collect the request body from the stream, and only then call JSON.parse. Empty bodies should be handled explicitly instead of assuming JSON is always present.
  • Return responses explicitly with res.writeHead(...) and res.end(...), including Content-Type such as application/json; charset=utf-8 for JSON APIs.
  • Keep routing and method handling explicit. Unknown paths should return 404, and known paths with unsupported methods should normally return 405.
  • Keep gateway setup and security-rule changes separate from the runtime code. They affect access, not the HTTP Function programming model.
  • Do not add HTTP access service configuration when the task is only to create an HTTP Function itself. Gateway paths or custom domains are separate access-layer work; anonymous or public invocation requirements should be handled through the function security rule workflow.

Quick decision table

QuestionChoose
Triggered by SDK calls or timers?Event Function
Needs browser-facing HTTP endpoint?HTTP Function
Needs SSE or WebSocket service?HTTP Function
Needs long-lived container runtime or custom system environment?CloudRun
Only needs HTTP access for an existing Event Function?Event Function + gateway access

How to use this skill (for a coding agent)

  1. Choose the correct runtime model first

- Event Function -> exports.main(event, context) - HTTP Function -> web server on port 9000 - If the requirement is really a container service, reroute to CloudRun early

  1. Use the converged MCP entrances

- Reads -> queryFunctions, queryGateway - Writes -> manageFunctions, manageGateway - Translate legacy names before acting rather than copying them literally

  1. Write code and deploy, do not stop at local files

- Use manageFunctions(action="createFunction") for creation - Use manageFunctions(action="updateFunctionCode") for code updates - Keep functionRootPath as the directory that directly contains function folders (e.g., cloudfunctions/ or functions/), NOT the project root and NOT the function subdirectory itself - Use CLI only as a fallback when MCP tools are unavailable

  1. Prefer doc-first fallbacks

- If a task falls back to callCloudApi, first check the official docs or knowledge-base entry for that action - Confirm the exact action name and parameter contract before calling it - Do not guess raw cloud API payloads from memory

  1. Read the right detailed reference

- Event Function details -> ./references/event-functions.md - HTTP Function details -> ./references/http-functions.md - Logs, gateway, env vars, and legacy mappings -> ./references/operations-and-config.md

Database write reminder

  • If a function will write to CloudBase document database, create the target collection first through console or management tooling.
  • db.collection("feedback").add(...) only inserts into an existing collection; it does not auto-create feedback when absent.
  • If the product requirement says "create when missing", implement that as an explicit collection-management step before the first write instead of assuming the runtime write call will provision it.

Function types comparison

FeatureEvent FunctionHTTP Function
Primary triggerSDK call, timer, eventHTTP request
Entry shapeexports.main(event, context)web server with req / res
PortNo portMust listen on 9000
scf_bootstrapNot requiredRequired
DependenciesAuto-installed from package.jsonMust be packaged with function code
Best forserverless handlers, scheduled jobsAPIs, SSE, WebSocket, browser-facing services

Minimal code skeletons

Event Function hello world

cloudfunctions/hello-event/index.js

exports.main = async (event, context) => {
  return {
    ok: true,
    message: "hello from event function",
    event,
  };
};

cloudfunctions/hello-event/package.json

{
  "name": "hello-event",
  "version": "1.0.0"
}

HTTP Function hello world

cloudfunctions/hello-http/index.js

const http = require("http");
const { URL } = require("url");

function sendJson(res, statusCode, data) {
  res.writeHead(statusCode, { "Content-Type": "application/json; charset=utf-8" });
  res.end(JSON.stringify(data));
}

function readJsonBody(req) {
  return new Promise((resolve, reject) => {
    let raw = "";
    req.on("data", (chunk) => { raw += chunk; });
    req.on("end", () => {
      if (!raw) { resolve({}); return; }
      try { resolve(JSON.parse(raw)); } catch { resolve({}); }
    });
    req.on("error", reject);
  });
}

const server = http.createServer(async (req, res) => {
  const url = new URL(req.url || "/", "http://127.0.0.1");

  if (req.method === "GET" && url.pathname === "/") {
    sendJson(res, 200, { ok: true, message: "hello from http function" });
  } else if (req.method === "POST" && url.pathname === "/") {
    const body = await readJsonBody(req);
    sendJson(res, 200, { received: body });
  } else {
    sendJson(res, 404, { error: "Not Found" });
  }
});

server.listen(9000);

For a more complete example with routing, method checks, and error handling, see ./references/http-functions.md.

cloudfunctions/hello-http/scf_bootstrap

#!/bin/bash
/var/lang/node18/bin/node index.js

The scf_bootstrap binary path must match the runtime — see the full mapping table in ./references/http-functions.md.

cloudfunctions/hello-http/package.json

{
  "name": "hello-http",
  "version": "1.0.0"
}

Preferred tool map

Function management

  • queryFunctions(action="listFunctions"|"getFunctionDetail")
  • manageFunctions(action="createFunction")
  • manageFunctions(action="updateFunctionCode")
  • manageFunctions(action="updateFunctionConfig")

Logs

  • queryFunctions(action="listFunctionLogs")
  • queryFunctions(action="getFunctionLogDetail")
  • If these are unavailable, read ./references/operations-and-config.md before any callCloudApi fallback

Gateway exposure

  • queryGateway(action="getAccess")
  • manageGateway(action="createAccess")
  • If gateway operations need raw cloud API fallback, read ./references/operations-and-config.md first

Related skills

  • cloudrun-development -> container services, long-lived runtimes, Agent hosting
  • http-api -> raw CloudBase HTTP API invocation patterns
  • cloudbase-platform -> general CloudBase platform decisions

平台分布

Claude Code

30.14%
按下载量换算1,906

Cursor

21.21%
按下载量换算1,341

Codex

17.85%
按下载量换算1,129

codebuddy

11.33%
按下载量换算717

trae

7.45%
按下载量换算471

Gemini CLI

3.31%
按下载量换算209

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

接触敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

继续浏览同类 Skills