Agent skill

Cloudbase Document Database Web SDK

by TencentCloudBase in TencentCloudBase/CloudBase-AI-Toolkit

Use CloudBase document database Web SDK only for confirmed NoSQL collection work.

MITAuto-check passedDatabases

Install Cloudbase Document Database Web SDK

skills CLI
$ npx skills add TencentCloudBase/CloudBase-AI-Toolkit --skill cloudbase-document-database-web-sdk -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install TencentCloudBase/CloudBase-AI-Toolkit cloudbase-document-database-web-sdk --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/TencentCloudBase/CloudBase-AI-Toolkit.git skills-src && mkdir -p .claude/skills && cp -r skills-src/config/source/skills/cloudbase-document-database-web-sdk .claude/skills/cloudbase-document-database-web-sdk && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
cloudbase-document-database-web-sdk
GitHub stars
1.1k
Used in
2 other repos
Token cost
~2.4k tokens
SKILL.md length
1,110 words
Files
8
Skills in repo
49
Repo updated
First seen
Licence
MIT

At a glance

Use CloudBase document database Web SDK only for confirmed NoSQL collection work.

  • Works in 5 steps: Start from the auth model → Keep browser code browser-native → Respect security rules → …
  • Tasks that involve NoSQL databases
  • SKILL.md covers Sibling skills (local only), Activation Contract, Overview and Canonical initialization, plus 5 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Cloudbase Document Database Web SDK is an agent skill from TencentCloudBase/CloudBase-AI-Toolkit. Use CloudBase document database Web SDK only for confirmed NoSQL collection work. Query, create, update, and delete document data; if the task mentions PostgreSQL / CloudBase PG / app.rdb(), route to postgresql-development instead.

Its SKILL.md is about 2.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 7 other files (for example `aggregation.md`, `complex-queries.md` and `crud-operations.md`).

It sits in Databases, covering NoSQL databases. It works with PostgreSQL. The repository describes itself as: Backend for AI coding agents on CloudBase — database, auth, functions via Plugin, Skills & MCP. The licence is MIT.

When your agent uses it

  • Tasks that involve NoSQL databases

Example prompts

  • “/cloudbase-document-database-web-sdk”

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Start from the auth model
  2. Keep browser code browser-native
  3. Respect security rules
  4. Return user-friendly errors
  5. Persist IDs from create operations correctly

What it can do on your machine

Read from SKILL.md and the folder at commit 21af91c. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are javascript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Cloudbase Document Database Web SDK loads about 2.4k tokens when it runs. Until then it costs about 67 tokens; SKILL.md has 1,110 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~67
When it runs · the whole SKILL.md, loaded when a task matches
~2.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from TencentCloudBase/CloudBase-AI-Toolkit at commit 21af91c, republished under its MIT licence (© TencentCloudBase). 1,110 words, ~2,382 tokens.

Download SKILL.mdSave it as .claude/skills/cloudbase-document-database-web-sdk/SKILL.md (or your agent's skills folder). This skill also uses 7 other files; get the full folder from GitHub.
name
cloudbase-document-database-web-sdk
description
Use CloudBase document database Web SDK only for confirmed NoSQL collection work. Query, create, update, and delete document data; if the task mentions PostgreSQL / CloudBase PG / app.rdb(), route to postgresql-development instead.
version
2.34.8
alwaysApply
false

Sibling skills (local only)

Sibling CloudBase skills ship beside this skill. Use local relative paths such as ../auth-tool-cloudbase/SKILL.md.

If a referenced sibling skill file is missing from this environment, ask the user to install the full CloudBase plugin (or the missing skill). Do not HTTP-fetch remote skill or protocol markdown into the agent context.

CloudBase Document Database Web SDK

Activation Contract

Use this first when
  • A browser or Web app must read or write CloudBase document database data through @cloudbase/js-sdk.
  • The request mentions app.database(), db.collection(), .where(), .watch(), pagination, aggregation, or geolocation queries in a Web frontend.
Read before writing code if
  • The task is clearly browser-side, but you still need to decide between Web SDK, Mini Program SDK, or backend access.
  • The request touches login state, collection permissions, or realtime updates.
Then also read
  • Web login and caller identity -> ../auth-web-cloudbase/SKILL.md
  • General Web app structure -> ../web-development/SKILL.md
  • Mini Program database code -> ../cloudbase-document-database-in-wechat-miniprogram/SKILL.md
Do NOT use for
  • Mini Program code using wx.cloud.database().
  • Server-side or cloud-function database access.
  • SQL / MySQL database operations.
  • Pure resource-permission administration with no browser SDK code.
  • NEW business tables that the task explicitly asks to put in CloudBase PostgreSQL (CloudBase PG). Before applying this skill, call queryEnv(action="info", envId=...) and read EnvInfo.RuntimeBackends. If postgresql === true AND the task asks for a new business table to live in PG, switch to the postgresql-development-cloudbase skill for that table: it goes through app.rdb(), uses PG row-level security (CREATE POLICY), and uploads via app.storage.from('<bucket>').upload('<key>', file) against an explicitly-created pgstore bucket.
    • Existing NoSQL collections in the same env keep using THIS skill — PG and NoSQL coexist in CloudBase PG environments. The rule is "follow the task / existing surface", not "PG env forbids NoSQL".
SDK Code vs MCP Tools

When to write SDK code (use this skill):

  • The task explicitly asks to "modify code" or "use SDK"
  • The task asks to implement app/frontend logic
  • The task mentions specific SDK methods like db.collection().add(), .get(), .update()
  • The context shows an existing Web project with SDK initialization (e.g., index.js already has cloudbase.init())

When to use MCP tools instead:

  • The task asks to manage CloudBase resources (create collection, set permissions, etc.)
  • The task involves admin/management operations without writing app code
  • The task mentions tools like writeNoSqlDatabaseContent, managePermissions, etc.

Key distinction: If the user says "使用 JS SDK 执行 XX 操作" (use JS SDK to perform XX operation) or "修改代码" (modify code), write SDK code in the project files. Do not use MCP database write tools for app-level data operations.

Common mistakes / gotchas
  • Querying before the user is signed in when the collection rules require identity.
  • Using wx.cloud.database() or Node SDK patterns in browser code.
  • Initializing CloudBase lazily with dynamic imports instead of a shared synchronous app instance.
  • Treating security rules as result filters rather than request validators.
  • Expecting a CUSTOM security rule to take effect immediately after you call managePermissions(updateResourcePermission). The backend caches rule evaluators for 2–5 minutes; first writes after a rule change may silently fail or be rejected with DATABASE_PERMISSION_DENIED even when the expression is correct. Either (a) wait a few minutes and retry the same write before assuming the rule is wrong, or (b) verify the rule is live by reading result.code / result.message on every write and by doing a get() round-trip on the just-written _id; do not treat a resolved promise as success. See security-rules.md → "Propagation And Verification" for the full pattern.
  • Misreading the return shape of db.collection(...).add(...). In the CloudBase Web SDK, the created document ID is exposed at top-level result._id, not result.id, result.data.id, or result.insertedId.
  • For CMS-style collections that need app-level admin users to edit/delete all records while editors can only edit/delete their own records, do not oversimplify the rule to READONLY. A validated pattern is a CUSTOM rule that reads role from user_roles by auth.uid and combines it with doc.authorId == auth.uid, while frontend writes can stay on .doc(id).update() / .doc(id).remove().
  • Forgetting pagination or indexes for larger collections.
Minimal checklist
  • Confirm this is browser-side document database work.
  • Initialize CloudBase once and reuse the same app / db instance.
  • Verify auth expectations before CRUD.
  • Read the right companion reference file for the specific operation.
Show full SKILL.md (434 more words)Show less

Overview

This skill covers browser-side document database usage via @cloudbase/js-sdk.

Use it for:

  • CRUD in a Web app
  • complex queries and pagination
  • aggregation
  • realtime listeners with watch()
  • geolocation queries

Canonical initialization

javascript
import cloudbase from "@cloudbase/js-sdk";

const app = cloudbase.init({
  env: "your-env-id"
});

const db = app.database();
const _ = db.command;

Important rules:

  • Sign in before querying if the collection rules require identity.
  • Keep a single shared app/database instance.
  • Do not hide initialization inside ad-hoc async loaders unless the framework truly requires it.

Quick routing

  • CRUD -> ./crud-operations.md
  • Complex queries -> ./complex-queries.md
  • Pagination -> ./pagination.md
  • Aggregation -> ./aggregation.md
  • Realtime listeners -> ./realtime.md
  • Geolocation -> ./geolocation.md
  • Security rules -> ./security-rules.md

Working rules for a coding agent

  1. Start from the auth model

    • If the page relies on logged-in user identity, read the Web auth skill before writing database code.
  2. Keep browser code browser-native

    • Use app.database() and collection references.
    • Do not mix in MCP management flows or SQL mental models.
  3. Respect security rules

    • Collection rules can reject requests before data is read.
    • If the requirement is simple owner-only write access, READONLY can be enough.
    • If the requirement is “app-level admin can edit/delete all, editor only own”, use a CUSTOM rule. A validated CMS pattern is get(`database.user_roles.${auth.uid}`).role == 'admin' || doc.authorId == auth.uid.
    • For that CMS pattern, frontend writes can stay on .doc(id).update() / .doc(id).remove().
    • Reuse whichever role collection already exists and can be addressed by _id == auth.uid. In this CMS pattern, user_roles keyed by uid is acceptable.
    • A get() whose target document is missing fails the request with HTTP 500 — it does not evaluate to false, and || does not skip it. If the app cannot guarantee a role document per user, keep the role list in one shared document and test auth.uid in get(`database.admin_registry.lock`).admins instead.
    • If the task fails with permission issues, inspect the rule model rather than assuming the query syntax is wrong.
  4. Return user-friendly errors

    • Database errors must become readable UI or application errors, not silent failures.
    • For writes, do not treat a resolved promise as success by default. Check write result fields such as updated / deleted or surfaced code / message.
  5. Persist IDs from create operations correctly

    • For Web SDK .add(...), the newly created document ID is result._id.
    • Do not look for the ID under result.id, result.data, or other driver-specific fields.

Quick examples

Simple query
javascript
const result = await db.collection("todos")
  .where({ completed: false })
  .get();
Create and capture document ID
javascript
const result = await db.collection("posts").add({
  title: "New article",
  content: "...",
  createdAt: new Date()
});

const articleId = result._id;
Ordered pagination
javascript
const result = await db.collection("posts")
  .orderBy("createdAt", "desc")
  .skip(20)
  .limit(10)
  .get();
Field selection
javascript
const result = await db.collection("users")
  .field({ name: true, email: true, _id: false })
  .get();

Best practices

  1. Define collection-level types or model wrappers in the app code.
  2. Use meaningful collection naming conventions.
  3. Select only required fields.
  4. Add indexes for frequent filters or sort keys.
  5. Pair frontend CRUD with explicit permission design.
  6. Use pagination instead of unbounded reads.

Error handling

javascript
try {
  const result = await db.collection("todos").get();
  console.log(result.data);
} catch (error) {
  console.error("Database error:", error);
}

When the SDK returns an operation result, check error indicators and translate them into readable application behavior.

© TencentCloudBase, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 7 other files in config/source/skills/cloudbase-document-database-web-sdk of TencentCloudBase/CloudBase-AI-Toolkit.

  • SKILL.md
  • aggregation.md
  • complex-queries.md
  • crud-operations.md
  • geolocation.md
  • pagination.md
  • realtime.md
  • security-rules.md

Open the folder on GitHubat commit 21af91c

Used in 2 other repositories

We found 5 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 2 other GitHub owners. This page covers the copy in TencentCloudBase/CloudBase-AI-Toolkit, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Cloudbase Document Database Web SDK next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Cloudbase Document Database Web SDK compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Cloudbase Document Database Web SDK this skillTencentCloudBase/CloudBase-AI-Toolkit1.1k2 repos~2.4kAutomated safety check: PassMIT
Database Design Patternscuriositech/some_claude_skills243—~3.1kAutomated safety check: PassMIT
Databaseaiskillstore/marketplace4303 repos~1.2kAutomated safety check: PassNone
Prisma Database Setupcurvenote/curvenote1693 repos~1.4kAutomated safety check: PassMIT
Rhctlsaidake/rhctl106—~4kAutomated safety check: NotesApache-2.0
Actions And Pg Migrationzkldi/Tachi237—~2.3kAutomated safety check: PassNone

Similar skills

  • Database Design Patterns

    curiositech/some_claude_skills

    Schema design, normalization decisions, indexing strategies, and migration safety for relational databases.

    243 GitHub stars~3.1k tokensUpdated 1 mo ago
    DatabasesAuto-check passed
  • Database

    aiskillstore/marketplace

    Database development and operations workflow covering SQL, NoSQL, database design, migrations, optimization, and data engineering.

    430 GitHub starsUsed in 3 repos~1.2k tokens
    DatabasesAuto-check passed
  • Prisma Database Setup

    curvenote/curvenote

    Guides for configuring Prisma with different database providers (PostgreSQL, MySQL, SQLite, MongoDB, etc.).

    169 GitHub starsUsed in 3 repos~1.4k tokens
    DatabasesAuto-check passed
  • Rhctl

    saidake/rhctl

    Run and author rhctl CLI workflows and remote environment scripts under scripts/ (PostgreSQL, JetStream, Docker, Redis, MongoDB, AWS LocalStack, execute/upload/patch).

    106 GitHub stars~4k tokensUpdated yesterday
    DatabasesAuto-check: notes
  • Patterns for writing actions (MakeAction/MakeAnonAction), using the Postgres DB (Kysely), and migrating Express routes from MongoDB to Postgres in the Tachi server.

    237 GitHub stars~2.3k tokensUpdated 2 days ago
    DatabasesAuto-check passed
  • Database Fundamentals

    DanielPodolsky/ownyourcode

    Reviews schema design, SQL queries, ORM patterns. An agent skill from DanielPodolsky/ownyourcode.

    290 GitHub starsUsed in 1 repo~1.6k tokens
    DatabasesAuto-check passed

More from TencentCloudBase/CloudBase-AI-Toolkit

All 49 skills in this repo
  • AI Model Nodejs

    TencentCloudBase/CloudBase-AI-Toolkit

    A skill your agent uses for Node.js backend AI via @cloudbase/node-sdk (=3.16.0) — cloud functions, CloudRun, Express/Koa/NestJS, serverless APIs, scheduled jobs, LLM proxies, agent orchestration.

    1.1k GitHub starsUsed in 3 repos~5k tokens
    Auto-check passed
  • HTTP API Cloudbase

    TencentCloudBase/CloudBase-AI-Toolkit

    CloudBase official HTTP API client guide. An agent skill from TencentCloudBase/CloudBase-AI-Toolkit.

    1.1k GitHub starsUsed in 3 repos~2.1k tokens
    Auto-check passed
  • Cloud API Recipe Authoring

    TencentCloudBase/CloudBase-AI-Toolkit

    Author or revise a cloud-api-operations recipe (config/source/skills/cloud-api-operations/references/recipes/).

    1.1k GitHub stars~3.7k tokensUpdated today
    Auto-check passed
  • Manage Local Skills

    TencentCloudBase/CloudBase-AI-Toolkit

    Analyze, standardize, validate, and sync locally maintained skills into agent skill directories with a skills CLI-aligned workflow.

    1.1k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Cloudbase Agent Python

    TencentCloudBase/CloudBase-AI-Toolkit

    Build production-ready AI agent backends using the CloudBase Agent Python SDK — create agents with LangGraph/CrewAI/LlamaIndex, serve them via FastAPI with AG-UI protocol streaming +…

    1.1k GitHub starsUsed in 2 repos~2.9k tokens
    Auto-check: notes
  • Cloudbase

    TencentCloudBase/CloudBase-AI-Toolkit

    A skill your agent uses when you develop, design, build, deploy, debug, migrate, or troubleshoot CloudBase (腾讯云开发, 云开发, TCB, 微信云开发) projects — Web, 微信小程序, 小程序, uni-app, mobile (iOS, Android…

    1.1k GitHub starsUsed in 1 repo~4.7k tokens
    Auto-check passed

Works with

Categories

Questions about Cloudbase Document Database Web SDK

What does Cloudbase Document Database Web SDK do?

Use CloudBase document database Web SDK only for confirmed NoSQL collection work. Cloudbase Document Database Web SDK is an agent skill from TencentCloudBase/CloudBase-AI-Toolkit. Use CloudBase document database Web SDK only for confirmed NoSQL collection work.

When should I use Cloudbase Document Database Web SDK?

Cloudbase Document Database Web SDK fits situations like: tasks that involve NoSQL databases.

How do I install Cloudbase Document Database Web SDK in Claude Code?

Run `npx skills add TencentCloudBase/CloudBase-AI-Toolkit --skill cloudbase-document-database-web-sdk -a claude-code`. Or copy the skill folder (config/source/skills/cloudbase-document-database-web-sdk in TencentCloudBase/CloudBase-AI-Toolkit) into .claude/skills/cloudbase-document-database-web-sdk in your project. Claude Code loads it when a task matches its description.

How do I install Cloudbase Document Database Web SDK in Codex?

Run `npx skills add TencentCloudBase/CloudBase-AI-Toolkit --skill cloudbase-document-database-web-sdk -a codex`. Or copy the skill folder (config/source/skills/cloudbase-document-database-web-sdk in TencentCloudBase/CloudBase-AI-Toolkit) into .agents/skills/cloudbase-document-database-web-sdk in your project. Codex loads it when a task matches its description.

Can I use Cloudbase Document Database Web SDK in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add TencentCloudBase/CloudBase-AI-Toolkit --skill cloudbase-document-database-web-sdk -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/cloudbase-document-database-web-sdk, .gemini/skills/cloudbase-document-database-web-sdk, .github/skills/cloudbase-document-database-web-sdk and .opencode/skills/cloudbase-document-database-web-sdk in your project.

What does Cloudbase Document Database Web SDK need to run?

SKILL.md names no scripts, command-line tools or credentials: Cloudbase Document Database Web SDK is instructions for the agent only.

Does Cloudbase Document Database Web SDK access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Cloudbase Document Database Web SDK safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Cloudbase Document Database Web SDK use?

Cloudbase Document Database Web SDK is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Cloudbase Document Database Web SDK use?

About 2.4k tokens (SKILL.md is roughly 9.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Cloudbase Document Database Web SDK?

Skills that share tags, products or a category with Cloudbase Document Database Web SDK: Database Design Patterns (curiositech/some_claude_skills, 243 stars), Database (aiskillstore/marketplace, 430 stars), Prisma Database Setup (curvenote/curvenote, 169 stars) and Rhctl (saidake/rhctl, 106 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Cloudbase Document Database Web SDK?

TencentCloudBase (a GitHub organization) maintains it in TencentCloudBase/CloudBase-AI-Toolkit, which has 1,133 GitHub stars. The repository holds 49 skills in this directory. The repository was last updated on October 7, 2026.

Source: TencentCloudBase/CloudBase-AI-Toolkit on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.