xiaohongshu
xiaohongshu
cloudrun-development
CloudBase Run backend development rules (Function mode/Container mode). Use this skill when deploying backend services that require long connections, multi-language support, custom environments, or AI agent development.
Full skill instructions
Use this skill for CloudBase Run backend service development when you need:
callContainer internal direct connectionDo NOT use for:
Choose the right mode
Follow mandatory requirements
PORT environment variable (real port in container)Mem = 2 × CPU (e.g., 0.25 vCPU → 0.5 GB)Use tools correctly
queryCloudRun (list, detail, templates)manageCloudRun (init, download, run, deploy, delete, createAgent)targetPathforce: true for delete operationsFollow the workflow
A concise guide for AI assistants and engineering collaboration, providing "when to use, how to use" rules and tool workflows.
callContainer internal direct connection| Dimension | Function Mode | Container Mode |
|---|---|---|
| Language/Framework | Node.js (via @cloudbase/functions-framework) | Any language/runtime (Java/Go/PHP/.NET/Python/Node.js, etc.) |
| Runtime | Function framework loads functions (Runtime) | Docker image starts process |
| Port | Fixed 3000 | Application listens on PORT (injected by platform during deployment) |
| Dockerfile | Not required | Required (and must pass local build) |
| Local Running | Supported (built-in tools) | Not supported (recommend using Docker for debugging) |
| Typical Scenarios | WebSocket/SSE/streaming responses, forms/files, low latency, multiple functions per instance, shared memory | Arbitrary system dependencies/languages, migrating existing containerized applications |
PORT environment variable (real port in container)Mem = 2 × CPU (e.g., 0.25 vCPU → 0.5 GB)queryCloudRun):
list: What services do I have? Can filter by name/typedetail: Current configuration, version, access address of a servicetemplates: Ready-to-use starter templatesmanageCloudRun):
init: Create local project (optional template)download: Pull existing service code to localrun: Run locally (Function mode only, supports normal function and Agent mode)deploy: Deploy local code to CloudRundelete: Delete service (requires explicit confirmation)createAgent: Create AI agent (based on Function mode CloudRun)targetPath: Local directory (must be absolute path)serverConfig: Deployment parameters (CPU/Mem/instance count/access type/environment variables, etc.)runOptions: Local running port and temporary environment variables (Function mode), supports runMode: 'normal' | 'agent'agentConfig: Agent configuration (agentName, botTag, description, template)force: true, otherwise it won't executeChoose mode
Initialize local project
init (both Function mode and Container mode can start from templates)FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --omit=dev
COPY . .
ENV NODE_ENV=production
EXPOSE 3000
CMD ["node","server.js"]
FROM python:3.11-slim
WORKDIR /app
COPY requirements.txt ./
RUN pip install -r requirements.txt --no-cache-dir
COPY . .
ENV PORT=3000
EXPOSE 3000
CMD ["python","app.py"]
Local running (Function mode only)
npm run dev/start or entry file via runConfigure access
OpenAccessTypes (WEB/VPC/PRIVATE) as needed; configure security domain and authentication for Web scenariosDeploy
deployVerify
detail to confirm access address and configuration meet expectations{ "name": "queryCloudRun", "arguments": { "action": "templates" } }
{ "name": "queryCloudRun", "arguments": { "action": "detail", "detailServerName": "my-svc" } }
{ "name": "manageCloudRun", "arguments": { "action": "init", "serverName": "my-svc", "targetPath": "/abs/ws/my-svc", "template": "helloworld" } }
{ "name": "manageCloudRun", "arguments": { "action": "download", "serverName": "my-svc", "targetPath": "/abs/ws/my-svc" } }
{ "name": "manageCloudRun", "arguments": { "action": "run", "serverName": "my-svc", "targetPath": "/abs/ws/my-svc", "runOptions": { "port": 3000 } } }
{ "name": "manageCloudRun", "arguments": { "action": "deploy", "serverName": "my-svc", "targetPath": "/abs/ws/my-svc", "serverConfig": { "OpenAccessTypes": ["WEB"], "Cpu": 0.5, "Mem": 1, "MinNum": 0, "MaxNum": 5 } } }
{ "name": "manageCloudRun", "arguments": { "action": "createAgent", "serverName": "my-agent", "targetPath": "/abs/ws/agents", "agentConfig": { "agentName": "MyAgent", "botTag": "demo", "description": "My agent", "template": "blank" } } }
{ "name": "manageCloudRun", "arguments": { "action": "run", "serverName": "my-agent", "targetPath": "/abs/ws/agents/my-agent", "runOptions": { "port": 3000, "runMode": "agent" } } }
callContainer, reduce public network exposurequeryCloudRun.detail to verify configuration and accessibility before and after deployment@cloudbase/aiagent-framework, supports SSE streaming responses, BotId format is ibot-{name}-{tag}package.json dev/start or entry index.js|app.js|server.js@cloudbase/aiagent-framework dependency, BotId format, SSE response format@cloudbase/functions-framework) + function code, making container service development as simple as writing cloud functions@cloudbase/aiagent-framework, supports SSE streaming responses and personalized AI applicationsmanageCloudRun → run); deploy using manageCloudRun → deploy; query using queryCloudRuncurl -L "https://<your-service-domain>"
// app.js (ensure wx.cloud.init() is called)
const res = await wx.cloud.callContainer({
config: { env: "<envId>" },
path: "/",
method: "GET",
header: { "X-WX-SERVICE": "<serviceName>" }
});
import cloudbase from "@cloudbase/js-sdk";
const app = cloudbase.init({ env: "<envId>" }); // Collect user's phone number into variable `phoneNum` by providing a input UI
const auth = app.auth();
// Send SMS code
const verificationInfo = await auth.getVerification({
phone_number: `+86 ${phoneNum}`,
});
// Collect user's phone number into variable `verificationCode` by providing a input UI
// Sign in
await auth.signInWithSms({
verificationInfo,
verificationCode,
phoneNum,
});
const res = await app.callContainer({
name: "<serviceName>", method: "POST", path: "/api",
header: { "Content-Type": "application/json" },
data: { key: "value" }
});
// Web JS SDK initialization MUST be synchronous:
// - Always use top-level import cloudbase from "@cloudbase/js-sdk";
// - Do NOT use dynamic imports like import("@cloudbase/js-sdk") or async wrappers such as initCloudBase() with internal initPromise
import tcb from "@cloudbase/node-sdk";
const app = tcb.init({});
const res = await app.callContainer({
name: "<serviceName>", method: "GET", path: "/health",
timeout: 5000
});
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience