ai-model-nodejs
Use this skill for Node.js backend AI via @cloudbase/node-sdk (>=3.16.0) — cloud functions, CloudRun, Express/Koa/NestJS,…
CloudBase PostgreSQL access-pattern and slow-query quality guidance. Use when designing how tables are read and written, eliminating per-row database calls, adding indexes for filters or joins, reviewing high-traffic data access, or explaining a slow SQL query. Not for
$ npx -y skills add tencentcloudbase/awesome-cloudbase-examples --skill postgresql-best-practices-cloudbase --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/postgresql-best-practices-cloudbaseContext preview
The summary Claude sees to decide when to auto-load this skill.
CloudBase PostgreSQL access-pattern and slow-query quality guidance. Use when designing how tables are read and written, eliminating per-row database calls, adding indexes for filters or joins, reviewing high-traffic data access, or explaining a slow SQL query. Not for
name: postgresql-best-practices-cloudbase description: "CloudBase PostgreSQL access-pattern and slow-query quality guidance. Use when designing how tables are read and written, eliminating per-row database calls, adding indexes for filters or joins, reviewing high-traffic data access, or explaining a slow SQL query. Not for first-time PG SDK setup, login UI, or NoSQL collections." version: 2.36.1 license: MIT alwaysApply: false
This skill turns a working CloudBase PG implementation into a reviewable access design. It makes query paths, indexes, row authorization, and launch capacity explicit before code is considered complete.
Sibling CloudBase skills ship beside this skill. Use local relative paths such as `../postgresql-development-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.
List every changed endpoint, job, RPC, or UI flow and its reads and writes. Record filters, joins, sort keys, expected cardinality, and request frequency.
**Complete when:** every changed path has a concrete query inventory; unknown volume or peak concurrency is marked as an assumption for the user.
Derive columns and indexes from the query inventory. Every frequent filter, join, and stable ordering path must have a deliberate index decision. For user-owned rows, use the role as the policy gate and identity as the row predicate:
CREATE POLICY orders_select_own ON public.orders FOR SELECT TO authenticated USING ((SELECT auth.uid()) = owner_id);
Apply schema DDL through the versioned `applyMigration` workflow defined by `../postgresql-development-cloudbase/SKILL.md`. This keeps Git, development, and production reproducible; the tradeoff is that experiments require a new migration version instead of ad hoc schema mutation.
**Complete when:** every query predicate has an index decision, every user-owned path has an ownership predicate, and all DDL is represented in one reviewable migration for the change.
Batch related keys, combine repeated reads, and execute independent queries concurrently. Keep each result bounded by a filter plus `.limit()` / `.range()`, or by an RPC that implements keyset pagination.
const userIds = [...new Set(rows.map((row) => row.user_id))];
const { data: profiles, error } = await db
.from("profiles")
.select("id, display_name")
.in("id", userIds);
if (error) throw error;Send request logs, traces, and high-volume analytics to the platform logging service or purpose-built analytics storage. Keep PG for transactional data that participates in business queries and constraints.
**Complete when:** the changed code has no database call inside an item loop, no repeated read of the same row in one request, and no unbounded hot-path query.
For campaigns, rankings, polling endpoints, or other bursty paths, inspect the target environment with `queryEnv(action="info", envId=...)`. Report the observed PG allocation, expected peak load, and unresolved capacity risk. CloudBase currently requires an explicit capacity plan; do not represent autoscaling as guaranteed.
**Complete when:** the current allocation is recorded and either judged against an explicit traffic assumption or raised to the user as an unresolved launch blocker.
| Current branch | Read | | --- | --- | | Repeated calls, serial queries, polling, pagination, or logging tables | `references/access-patterns.md` | | Missing indexes, slow SQL/RPC, or query-plan review | `references/indexes-and-explain.md` | | New schema, tenant isolation, or RLS performance | `references/schema-and-rls.md` | | Campaign launch or database sizing | `references/capacity-and-connections.md` |
Load only the references required by the current branch.
精选的腾讯云开发(Tencent CloudBase,TCB)示例项目和资源列表 云开发(Tencent CloudBase,TCB) 是腾讯云提供的云原生一体化开发环境和工具平台,为开发者提供高可用、自动弹性扩缩的后端云服务,包含计算、存储、托管等能力,可用于构建多种应用场景下的应用系统。
Use this skill for Node.js backend AI via @cloudbase/node-sdk (>=3.16.0) — cloud functions, CloudRun, Express/Koa/NestJS,…
Use this skill for WeChat Mini Program AI via wx.cloud.extend.AI (小程序, wx.cloud apps). Covers generateText and streamText with…
CloudBase Node SDK auth guide for server-side identity, user lookup, and custom login tickets. This skill should be used when…
CloudBase auth provider configuration and login-readiness guide. This skill should be used when users need to inspect, enable,…
CloudBase WeChat Mini Program native authentication guide. This skill should be used when users need mini program identity…
Operate Tencent Cloud control-plane resources (monitoring/alarms, CLB, CAM roles, COS, MySQL, SCF) via cloud APIs when no…