cloudbase-platform

0
0
Source

CloudBase platform knowledge and best practices. Use this skill for general CloudBase platform understanding, including storage, hosting, authentication, cloud functions, database permissions, and data models.

Install

mkdir -p .claude/skills/cloudbase-platform && curl -L -o skill.zip "https://mcp.directory/api/skills/download/6368" && unzip -o skill.zip -d .claude/skills/cloudbase-platform && rm skill.zip

Installs to .claude/skills/cloudbase-platform

About this skill

Activation Contract

Use this first when

  • The user asks which CloudBase capability, service, or tool to use, or needs a high-level understanding of hosting, storage, authentication, cloud functions, or database options.
  • The task is about console navigation, cross-platform differences, permission models, or platform-level best practices before implementation.

Read before writing code if

  • It is still unclear whether the task belongs to Web, mini program, cloud functions, storage, MySQL / NoSQL, or auth.
  • The response needs platform selection, conceptual explanation, or control-plane navigation more than direct implementation steps.

Then also read

  • Web app implementation -> ../web-development/SKILL.md
  • Web auth and provider setup -> ../auth-tool/SKILL.md, ../auth-web/SKILL.md
  • Mini program development -> ../miniprogram-development/SKILL.md
  • Cloud functions -> ../cloud-functions/SKILL.md
  • Official HTTP API clients -> ../http-api/SKILL.md
  • Document database -> ../no-sql-web-sdk/SKILL.md or ../no-sql-wx-mp-sdk/SKILL.md
  • Relational database / data modeling -> ../relational-database-tool/SKILL.md or ../data-model-creation/SKILL.md
  • Cloud storage -> ../cloud-storage-web/SKILL.md

Do NOT use for

  • Direct implementation of web pages, auth flows, functions, or database operations when a more specific skill already fits.
  • Low-level API parameter references or SDK recipes that belong in specialized skills.

Common mistakes / gotchas

  • Treating this general skill as the default entry point for all CloudBase development.
  • Staying here after the correct implementation skill is already clear.
  • Mixing platform overview with platform-specific API shapes or SDK details.

When to use this skill

Use this skill for CloudBase platform knowledge when you need to:

  • Understand CloudBase storage and hosting concepts
  • Compare platform capabilities before implementation
  • Understand cross-platform auth differences (Web vs Mini Program)
  • Understand database permissions and access control
  • Access CloudBase console management pages

This skill provides foundational knowledge that applies to all CloudBase projects, regardless of whether they are Web, Mini Program, or backend services.


How to use this skill (for a coding agent)

  1. Understand platform differences

    • Web and Mini Program have completely different authentication approaches
    • Must strictly distinguish between platforms
    • Never mix authentication methods across platforms
  2. Follow best practices

    • Use SDK built-in authentication features (Web)
    • Understand natural login-free feature (Mini Program)
    • Configure appropriate database permissions
    • Use cloud functions for cross-collection operations
  3. Use correct SDKs and APIs

    • Different platforms require different SDKs for data models
    • MySQL data models must use models SDK, not collection API
    • Use envQuery tool to get environment ID
  4. Use CloudBase MCP via mcporter (CLI) when IDE MCP is not available

    • You do not need to hard-code Secret ID / Secret Key / Env ID in config
    • CloudBase MCP will support device-code login via the auth tool, so credentials can be obtained interactively
    • Add CloudBase MCP server in config/mcporter.json: If other MCP servers already exist, keep them and only add the cloudbase entry.
      {
        "mcpServers": {
          "cloudbase": {
            "command": "npx",
            "args": ["@cloudbase/cloudbase-mcp@latest"],
            "description": "CloudBase MCP",
            "lifecycle": "keep-alive"
          }
        }
      }
      
    • Discover tools and schemas:
      • npx mcporter list — list configured servers
      • npx mcporter describe cloudbase --all-parameters — inspect CloudBase server config and get full tool schemas with all parameters (⚠️ 必须加 --all-parameters 才能获取完整参数信息)
      • npx mcporter list cloudbase --schema — get full JSON schema for all CloudBase tools
      • npx mcporter call cloudbase.help --output json — discover available CloudBase tools and their schemas
    • Call CloudBase tools (auth flow examples):
      • npx mcporter call cloudbase.auth action=status --output json
      • npx mcporter call cloudbase.auth action=start_auth authMode=device --output json
      • npx mcporter call cloudbase.auth action=set_env envId=env-xxx --output json

CloudBase Platform Knowledge

Storage and Hosting

  1. Static Hosting vs Cloud Storage:

    • CloudBase static hosting and cloud storage are two different buckets
    • Generally, publicly accessible files can be stored in static hosting, which provides a public web address
    • Static hosting supports custom domain configuration (requires console operation)
    • Cloud storage is suitable for files with privacy requirements, can get temporary access addresses via temporary file URLs
    • If the task needs COS SDK polling, file metadata lookup, or temporary URLs for an uploaded object, use cloud storage tools (manageStorage / queryStorage), not uploadFiles
  2. Static Hosting Domain:

    • CloudBase static hosting domain can be obtained via getWebsiteConfig tool
    • Combine with static hosting file paths to construct final access addresses
    • Important: If access address is a directory, it must end with /

Environment and Authentication

  1. SDK Initialization:
    • CloudBase SDK initialization requires environment ID
    • Can query environment ID via envQuery tool
    • For Web, always initialize synchronously:
      • import cloudbase from "@cloudbase/js-sdk"; const app = cloudbase.init({ env: "xxxx-yyy" });
      • Do not use dynamic imports like import("@cloudbase/js-sdk") or async wrappers such as initCloudBase() with internal initPromise
    • Then proceed with login, for example using anonymous login

Authentication Best Practices

Important: Authentication methods for different platforms are completely different, must strictly distinguish!

Web Authentication

  • Must use SDK built-in authentication: CloudBase Web SDK provides complete authentication features
  • Recommended method: SMS login with auth.getVerification(), for detailed, refer to web auth related docs
  • Forbidden behavior: Do not use cloud functions to implement login authentication logic
  • User management: After login, get user information via auth.getCurrentUser()

Mini Program Authentication

  • Login-free feature: Mini program CloudBase is naturally login-free, no login flow needed
  • User identifier: In cloud functions, get wxContext.OPENID via wx-server-sdk
  • User management: Manage user data in cloud functions based on openid
  • Forbidden behavior: Do not generate login pages or login flow code

Cloud Functions

  1. Node.js Cloud Functions:
    • Node.js cloud functions need to include package.json, declaring required dependencies
    • Can use manageFunctions(action="createFunction") to create functions
    • Use manageFunctions(action="updateFunctionCode") to deploy cloud functions
    • Prioritize cloud dependency installation, do not upload node_modules
    • functionRootPath refers to the parent directory of function directories, e.g., cloudfunctions directory

Database Permissions

⚠️ CRITICAL: Always configure permissions BEFORE writing database operation code!

  1. Permission Model:

    • CloudBase database access has permissions
    • Default basic permissions include:
      • READONLY: Everyone can read, only creator/admin can write
      • PRIVATE: Only creator/admin can read/write
      • ADMINWRITE: Everyone can read, only admin can write (⚠️ NOT for Web SDK write!)
      • ADMINONLY: Only admin can read/write
      • CUSTOM: Fine-grained control with custom rules
  2. Platform Compatibility (CRITICAL):

    • ⚠️ Web SDK cannot use ADMINWRITE or ADMINONLY for write operations
    • ✅ For user-generated content in Web apps, use CUSTOM rules
    • ✅ For admin-managed data (products, settings), use READONLY
    • ✅ Cloud functions have full access regardless of permission type
  3. Configuration Workflow:

    Create collection → Configure security rules → Write code → Test
    
    • Use writeSecurityRule MCP tool to configure permissions
    • Wait 2-5 minutes for cache to clear before testing
    • See no-sql-web-sdk/security-rules.md for detailed examples
  4. Common Scenarios:

    • E-commerce products: READONLY (admin manages via cloud functions)
    • Shopping carts: CUSTOM with auth.uid check (users manage their own)
    • Orders: CUSTOM with ownership validation
    • System logs: PRIVATE or ADMINONLY
  5. Cross-Collection Operations:

    • If user has no special requirements, operations involving cross-database collections must be implemented via cloud functions
  6. Cloud Function Optimization:

    • If involving cloud functions, while ensuring security, can minimize the number of cloud functions as much as possible
    • For example: implement one cloud function for client-side requests, implement one cloud function for data initialization

Data Models

  1. Get Data Model Operation Object:

    • Mini Program: Need @cloudbase/wx-cloud-client-sdk, initialize const client = initHTTPOverCallFunction(wx.cloud), use client.models
    • Cloud Function: Need @cloudbase/node-sdk@3.10+, initialize const app = cloudbase.init({env}), use app.models
    • Web: Need @cloudbase/js-sdk, initialize const app = cloudbase.init({env}), after login use app.models
  2. Data Model Query:

    • Can call MCP manageDataModel tool to:
      • Query model list
      • Get model detailed information (including Schema fields)
      • Get specific models SDK usage documentation
  3. MySQL Data Model Invocation Rules:

    • MySQL data models cannot use collection

Content truncated.

spec-workflow

TencentCloudBase

Standard software engineering workflow for requirement analysis, technical design, and task planning. Use this skill when developing new features, complex architecture designs, multi-module integrations, or projects involving database/UI design.

773

auth-web-cloudbase

TencentCloudBase

CloudBase Web Authentication Quick Guide - Provides concise and practical Web frontend authentication solutions with multiple login methods and complete user management.

30

ai-model-nodejs

TencentCloudBase

Use this skill when developing Node.js backend services or CloudBase cloud functions (Express/Koa/NestJS, serverless, backend APIs) that need AI capabilities. Features text generation (generateText), streaming (streamText), AND image generation (generateImage) via @cloudbase/node-sdk ≥3.16.0. Built-in models include Hunyuan (hunyuan-2.0-instruct-20251111 recommended), DeepSeek (deepseek-v3.2 recommended), and hunyuan-image for images. This is the ONLY SDK that supports image generation. NOT for browser/Web apps (use ai-model-web) or WeChat Mini Program (use ai-model-wechat).

00

cloud-functions

TencentCloudBase

Complete guide for CloudBase cloud functions development - runtime selection, deployment, logging, invocation, and HTTP access configuration.

00

auth-wechat-miniprogram

TencentCloudBase

Complete guide for WeChat Mini Program authentication with CloudBase - native login, user identity, and cloud function integration.

00

data-model-creation

TencentCloudBase

Optional advanced tool for complex data modeling. For simple table creation, use relational-database-tool directly with SQL statements.

00

You might also like

flutter-development

aj-geddes

Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.

643969

drawio-diagrams-enhanced

jgtolentino

Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.

591705

ui-ux-pro-max

nextlevelbuilder

"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."

318398

godot

bfollington

This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.

339397

nano-banana-pro

garg-aayush

Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.

451339

fastapi-templates

wshobson

Create production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling. Use when building new FastAPI applications or setting up backend API projects.

304231

Stay ahead of the MCP ecosystem

Get weekly updates on new skills and servers.