Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

cloud-functions

БесплатноБез исполняемых скриптовНе проверен

Complete guide for CloudBase cloud functions development - supports both Event Functions (Node.js) and HTTP Functions (multi-language Web services). Covers…

bighardpersonот bighardperson★ 71 звезда на GitHub

Об этом скилле

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.

Read before writing code if

  • The request mentions runtime, HTTP function, scf_bootstrap, function logs, or function deployment.

Then also read

  • Auth setup or provider-related backend work -> ../auth-tool/SKILL.md
  • AI in functions -> ../ai-model-nodejs/SKILL.md

Do NOT use for

  • CloudRun container services or Web authentication UI implementation.

Common mistakes / gotchas

  • Picking the wrong function type and trying to compensate later.
  • 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.
  • Forgetting that runtime cannot be changed after creation.
  • Using cloud functions as the first solution for Web login.
  • Forgetting that HTTP Functions do NOT auto-install dependencies — always include node_modules.
  • Forgetting to add app.use(express.json()) or equivalent body parsing middleware for POST/PUT requests.
  • Leaving HTTP handlers without sending a response (causes request timeout).
  • Not returning proper HTTP status codes (400, 401, 405) for error cases.

Minimal checklist

Overview

Use this skill when developing, deploying, and managing CloudBase cloud functions. CloudBase supports two types of cloud functions:

  • Event Functions (普通云函数): Traditional serverless functions triggered by events (SDK calls, timers)
  • HTTP Functions (HTTP 云函数): Web service functions triggered by HTTP requests, supporting multiple languages

Writing mode at a glance

  • 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) => {}.
  • 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 / res.
  • If the user mentions HTTP access for an existing Event Function, keep the Event Function code shape and add gateway access separately.

When to use this skill

Use this skill for cloud function operations when you need to:

  • Create and deploy Event Functions (Node.js)
  • Create and deploy HTTP Functions (Node.js/Python/Go/Java)
  • Understand runtime limitations and selection
  • Query function logs and monitor execution
  • Invoke cloud functions from applications
  • Configure HTTP access for cloud functions
  • Implement SSE (Server-Sent Events) or WebSocket

Do NOT use for:

  • CloudRun backend services (use cloudrun-development skill)
  • Complex container-based services (use cloudrun-development skill)
  • Database operations (use database skills)

How to use this skill (for a coding agent)

  1. Choose the right function type

    • Event Function: For SDK calls, scheduled tasks, event-driven scenarios
    • HTTP Function: For Web APIs, REST services, SSE/WebSocket, multi-language support
    • If the prompt says "HTTP 云函数", use the HTTP Function model first; if it says "触发器云函数" or omits HTTP, default to the Event Function model.
  2. Understand runtime limitations

    • Runtime CANNOT be changed after function creation
    • Must select correct runtime during initial creation
    • If runtime needs to change, must delete and recreate function
  3. Write code AND deploy — do not stop after writing files

    • CRITICAL: After writing function code, you MUST also deploy it using manageFunctions. Creating files locally without deploying is incomplete.
    • Use manageFunctions(action="createFunction") to create AND deploy in one step
    • Provide functionRootPath as the parent directory of the function folder (e.g., /project/cloudfunctions/ not /project/cloudfunctions/myFunction/)
    • Preferred MCP Tools: Use queryFunctions for reads, manageFunctions(action="createFunction") for creation, and manageFunctions(action="updateFunctionCode") for code updates
    • Legacy compatibility: If older prompts mention createFunction / updateFunctionCode, map them to the manageFunctions actions above
    • CLI: Use tcb fn deploy (Event) or tcb fn deploy --httpFn (HTTP) only as a fallback when MCP tools are unavailable
    • In agent / non-interactive runs, never default to CLI login flows for deployment; keep the flow on manageFunctions
    • For HTTP functions, create or update them through manageFunctions with func.type="HTTP" as the primary path
    • HTTP Functions require scf_bootstrap file in the function directory
    • Provide correct functionRootPath (parent directory of function folder)
  4. **Query

Полный SKILL.md на GitHub

Установить cloud-functions в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

checklist.md

FAQ

Что делает скилл cloud-functions?

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.

Как установить скилл cloud-functions?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл cloud-functions запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить cloud-functions с