relational-database-web-cloudbase
Initializes and manages CloudBase relational database connections for frontend web applications.
Install
mkdir -p .claude/skills/relational-database-web-cloudbase-leoyeai && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/16013" && unzip -o skill.zip -d .claude/skills/relational-database-web-cloudbase-leoyeai && rm skill.zipInstalls to .claude/skills/relational-database-web-cloudbase-leoyeai
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Use when building frontend Web apps that talk to CloudBase Relational Database via @cloudbase/js-sdk – provides the canonical init pattern so you can then use Supabase-style queries from the browser.Key capabilities
- →Initialize CloudBase Relational Database on the frontend.
- →Replace an existing Supabase client with CloudBase Relational Database.
- →Share a single `db` client across a Web app.
- →Perform Supabase-style queries like `select`, `order`, `insert`, `update`, and `delete`.
- →Handle user authentication separately using Web Auth skills.
- →Use synchronous initialization for the CloudBase SDK.
How it works
The skill provides a canonical JavaScript initialization pattern for `@cloudbase/js-sdk` to connect frontend Web apps to CloudBase Relational Database, enabling Supabase-style queries.
Inputs & outputs
When to use relational-database-web-cloudbase
- →Connecting frontend apps to CloudBase
- →Initializing database clients
- →Querying data in React or Vue apps
About this skill
When to use this skill
Use this skill whenever you need to access CloudBase Relational Database from a browser app (React, Vue, vanilla JS) using @cloudbase/js-sdk.
Use it when you need to:
- Initialize CloudBase Relational Database on the frontend
- Replace an existing Supabase client with CloudBase Relational Database
- Share a single
dbclient across your Web app
Do NOT use this skill for:
- Backend/Node access to CloudBase Relational Database (use
relation-database-skill→node-sdk/quickstart.md) - MCP/agent database management (use
relation-database-skill→mcp-tools/mcp-guide.md) - Auth flows (use the Web/Node/Auth skills instead)
How to use this skill (for a coding agent)
- Confirm environment
- Ask the user for:
env– CloudBase environment ID
- Ask the user for:
- Follow the initialization pattern in this file exactly
- Only change values like
env, never the object shape.
- Only change values like
- After initialization, use Supabase knowledge for queries
- Treat
dbas a Supabase client – method names and patterns are identical.
- Treat
- Avoid re-initializing CloudBase
- Create a single shared
dbclient and reuse it across components.
- Create a single shared
Installation
npm install @cloudbase/js-sdk
Initialization pattern (canonical)
import cloudbase from "@cloudbase/js-sdk";
const app = cloudbase.init({
env: "your-env-id", // CloudBase environment ID
});
const auth = app.auth();
// Handle user authentication separately (Web Auth skill)
const db = app.rdb();
// Use db exactly like a Supabase client
Initialization rules (Web, @cloudbase/js-sdk):
- Always use synchronous initialization with the pattern above
- Do not lazy-load the SDK with
import("@cloudbase/js-sdk") - Do not wrap SDK initialization in async helpers such as
initCloudBase()with internalinitPromisecaches - Create a single shared
dbclient and reuse it instead of re-initializing
Rules:
- Do not invent new properties on the
cloudbase.initoptions. - Always call
app.rdb()to get the database client;appis not the DB client.
Scenario 1: Replace Supabase client in a React app
// lib/db.js (shared database client)
import cloudbase from "@cloudbase/js-sdk";
const app = cloudbase.init({
env: "your-env-id",
});
export const db = app.rdb();
// hooks/usePosts.js
import { useEffect, useState } from "react";
import { db } from "../lib/db";
export function usePosts() {
const [posts, setPosts] = useState([]);
useEffect(() => {
async function fetchPosts() {
const { data } = await db.from("posts").select("*");
setPosts(data || []);
}
fetchPosts();
}, []);
return { posts };
}
Scenario 2: Basic query pattern (Supabase-style)
// Fetch latest posts
const { data, error } = await db
.from("posts")
.select("*")
.order("created_at", { ascending: false });
if (error) {
console.error("Failed to load posts", error.message);
}
Scenario 3: Insert / update / delete rows
// Insert
await db.from("posts").insert({ title: "Hello" });
// Update
await db.from("posts").update({ title: "Updated" }).eq("id", 1);
// Delete
await db.from("posts").delete().eq("id", 1);
Key principle: CloudBase Relational Database = Supabase API
- After you have
db = app.rdb(), use Supabase documentation and patterns for all queries. - This skill only standardizes Web initialization and client sharing.
- Do not duplicate Supabase docs into this skill; rely on the model's built-in Supabase knowledge for query shapes and options.
When not to use it
- →For backend/Node access to CloudBase Relational Database.
- →For MCP/agent database management.
- →For Auth flows, which should use dedicated Web/Node/Auth skills.
Limitations
- →The skill focuses on Web initialization and client sharing.
- →The skill does not duplicate Supabase documentation.
- →The skill requires a CloudBase environment ID for initialization.
How it compares
This workflow standardizes the initialization and client sharing for CloudBase Relational Database in web applications, allowing developers to use familiar Supabase API patterns without needing to re-learn database interaction specifics.
Compared to similar skills
relational-database-web-cloudbase side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| relational-database-web-cloudbase (this skill) | 0 | 2mo | Review | Beginner |
| sigma-audio-crm | 0 | 3mo | Caution | Advanced |
| backend-development | 17 | 4mo | No flags | Intermediate |
| laravel-specialist | 12 | 3mo | No flags | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by LeoYeAI
View all by LeoYeAI →You might also like
sigma-audio-crm
YuvrajGaykhe
Use this skill for ALL development, debugging, review, refactoring, feature building, and integration work on the Sigma Audio Dealer & Sales Intelligence Platform. Trigger whenever the user mentions leads, dealers, follow-ups, RBAC, CRM, audit logs, Kanban pipeline, analytics, sales executive, Djang
backend-development
skillcreatorai
Backend API design, database architecture, microservices patterns, and test-driven development. Use for designing APIs, database schemas, or backend system architecture.
laravel-specialist
Jeffallan
Use when building Laravel 10+ applications requiring Eloquent ORM, API resources, or queue systems. Invoke for Laravel models, Livewire components, Sanctum authentication, Horizon queues.
cloudbase-document-database-in-wechat-miniprogram
TencentCloudBase
Use CloudBase document database WeChat MiniProgram SDK to query, create, update, and delete data. Supports complex queries, pagination, aggregation, and geolocation queries.
writing-hashql-jexpr
hashintel
HashQL J-Expr syntax for writing queries. Use when writing J-Expr code, using #literal/#struct/#list constructs, understanding function call syntax, or working with HashQL query files (.jsonc).
supabase-python
alinaqi
FastAPI with Supabase and SQLAlchemy/SQLModel