Agent skill

Postgresql Best Practices Cloudbase

by TencentCloudBase in TencentCloudBase/CloudBase-AI-Toolkit

CloudBase PostgreSQL access-pattern and slow-query quality guidance.

MITAuto-check passedDatabases

Install Postgresql Best Practices Cloudbase

skills CLI
$ npx skills add TencentCloudBase/CloudBase-AI-Toolkit --skill postgresql-best-practices-cloudbase -a claude-code

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

GitHub CLI
$ gh skill install TencentCloudBase/CloudBase-AI-Toolkit postgresql-best-practices-cloudbase --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/postgresql-best-practices-cloudbase .claude/skills/postgresql-best-practices-cloudbase && 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
postgresql-best-practices-cloudbase
GitHub stars
1.1k
Used in
1 other repo
Token cost
~1.3k tokens
SKILL.md length
595 words
Files
5 (incl. references)
Skills in repo
49
Repo updated
First seen
Licence
MIT

At a glance

CloudBase PostgreSQL access-pattern and slow-query quality guidance.

  • Works in 4 steps: Inventory access paths → Design schema, indexes, and row… → Implement bounded database access → …
  • Designing how tables are read and written
  • SKILL.md covers Sibling skills (local only), When to use, Do NOT use for and Workflow, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Postgresql Best Practices Cloudbase is an agent skill from TencentCloudBase/CloudBase-AI-Toolkit. 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.

Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 5 other files, including reference files (for example `references/access-patterns.md`, `references/capacity-and-connections.md` and `references/indexes-and-explain.md`).

It sits in Databases, covering NoSQL databases, SQL and Query optimization. It works with PostgreSQL and SQL. 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

  • Designing how tables are read and written
  • Eliminating per-row database calls
  • Adding indexes for filters
  • Reviewing high-traffic data access

Example prompts

  • “/postgresql-best-practices-cloudbase”

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Inventory access paths
  2. Design schema, indexes, and row authorization together
  3. Implement bounded database access
  4. Check launch capacity when traffic is material

What it can do on your machine

Read from SKILL.md and the folder at commit ea2c202. 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 sql and typescript).

    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

Postgresql Best Practices Cloudbase loads about 1.3k tokens when it runs, and up to ~4.5k if it reads all its reference files. Until then it costs about 91 tokens; SKILL.md has 595 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~91
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~4.5k

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 ea2c202, republished under its MIT licence (© TencentCloudBase). 595 words, ~1,307 tokens.

Download SKILL.mdSave it as .claude/skills/postgresql-best-practices-cloudbase/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.
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.34.8
alwaysApply
false

CloudBase PostgreSQL Best Practices

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 skills (local only)

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.

When to use

  • A feature needs a new or changed access pattern.
  • Application code performs repeated, serial, or high-frequency PG queries.
  • A SQL query, RPC, endpoint, or polling path is slow.
  • A high-traffic launch needs a database readiness review.

Do NOT use for

  • PG environment setup, app.rdb() syntax, migrations, GRANTs, or base RLS correctness: use ../postgresql-development-cloudbase/SKILL.md.
  • Login provider or UI implementation: use the matching auth skill.
  • Confirmed NoSQL collection work: use the document database skill.
  • Platform alarm diagnosis or slow-log collection: use ../ops-inspector/SKILL.md.

Workflow

1. Inventory access paths

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.

2. Design schema, indexes, and row authorization together

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:

sql
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.

Show full SKILL.md (265 more words)Show less
3. Implement bounded database access

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.

ts
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.

4. Check launch capacity when traffic is material

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.

Routing

Current branchRead
Repeated calls, serial queries, polling, pagination, or logging tablesreferences/access-patterns.md
Missing indexes, slow SQL/RPC, or query-plan reviewreferences/indexes-and-explain.md
New schema, tenant isolation, or RLS performancereferences/schema-and-rls.md
Campaign launch or database sizingreferences/capacity-and-connections.md

Load only the references required by the current branch.

Minimum self-check

  • Every changed access path is accounted for.
  • Every frequent filter, join, and stable sort has an index decision.
  • Database round trips are bounded independently of result cardinality.
  • RLS separates role gating (TO) from row authorization (auth.uid()).
  • Schema changes use the canonical migration workflow.
  • Capacity claims are based on observed allocation and stated traffic assumptions.

© 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 4 other files (references) in config/source/skills/postgresql-best-practices-cloudbase of TencentCloudBase/CloudBase-AI-Toolkit.

  • SKILL.md
  • references/access-patterns.md
  • references/capacity-and-connections.md
  • references/indexes-and-explain.md
  • references/schema-and-rls.md

Open the folder on GitHubat commit ea2c202

Used in 1 other repository

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

Compare with similar skills

Postgresql Best Practices Cloudbase 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.

Postgresql Best Practices Cloudbase compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Postgresql Best Practices Cloudbase this skillTencentCloudBase/CloudBase-AI-Toolkit1.1k1 repos~1.3kAutomated safety check: PassMIT
Discover Databaserand/cc-polymath181—~2kAutomated safety check: PassMIT
Query Expertjamesrochabrun/skills215—~4.3kAutomated safety check: PassMIT
DatabasesMicrock/ordinary-claude-skills401—~1.9kAutomated safety check: NotesMIT
PostgreSQL Documentation Reference2025Emma/vibe-coding-cn23k1 repos~19kAutomated safety check: PassMIT
Rhctlsaidake/rhctl106—~4kAutomated safety check: NotesApache-2.0

Similar skills

  • Discover Database

    rand/cc-polymath

    Automatically discover database skills when working with SQL, PostgreSQL, MongoDB, Redis, database schema design, query optimization, migrations, connection pooling, ORMs, or database selection.

    181 GitHub stars~2k tokensUpdated 7 mo ago
    DatabasesAuto-check passed
  • Query Expert

    jamesrochabrun/skills

    Master SQL and database queries across multiple systems. An agent skill from jamesrochabrun/skills.

    215 GitHub stars~4.3k tokensUpdated 8 mo ago
    DatabasesAuto-check passed
  • Databases

    Microck/ordinary-claude-skills

    Work with MongoDB (document database, BSON documents, aggregation pipelines, Atlas cloud) and PostgreSQL (relational database, SQL queries, psql CLI, pgAdmin).

    401 GitHub stars~1.9k tokensUpdated 1 mo ago
    DatabasesAuto-check: notes
  • PostgreSQL Documentation Reference

    2025Emma/vibe-coding-cn

    PostgreSQL database documentation - SQL queries, database design, administration, performance tuning, and advanced features. Use when working with PostgreSQL…

    23k GitHub starsUsed in 1 repo~19k 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
  • 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 yesterday
    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 yesterday
    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 Postgresql Best Practices Cloudbase

What does Postgresql Best Practices Cloudbase do?

CloudBase PostgreSQL access-pattern and slow-query quality guidance. Postgresql Best Practices Cloudbase is an agent skill from TencentCloudBase/CloudBase-AI-Toolkit. CloudBase PostgreSQL access-pattern and slow-query quality guidance.

When should I use Postgresql Best Practices Cloudbase?

Postgresql Best Practices Cloudbase fits situations like: designing how tables are read and written; eliminating per-row database calls; adding indexes for filters; reviewing high-traffic data access.

How do I install Postgresql Best Practices Cloudbase in Claude Code?

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

How do I install Postgresql Best Practices Cloudbase in Codex?

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

Can I use Postgresql Best Practices Cloudbase 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 postgresql-best-practices-cloudbase -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/postgresql-best-practices-cloudbase, .gemini/skills/postgresql-best-practices-cloudbase, .github/skills/postgresql-best-practices-cloudbase and .opencode/skills/postgresql-best-practices-cloudbase in your project.

What does Postgresql Best Practices Cloudbase need to run?

SKILL.md names no scripts, command-line tools or credentials: Postgresql Best Practices Cloudbase is instructions for the agent only.

Does Postgresql Best Practices Cloudbase 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 Postgresql Best Practices Cloudbase 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 Postgresql Best Practices Cloudbase use?

Postgresql Best Practices Cloudbase 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 Postgresql Best Practices Cloudbase use?

About 1.3k tokens (SKILL.md is roughly 5.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 3.2k tokens, read only when the agent opens those files.

What are the alternatives to Postgresql Best Practices Cloudbase?

Skills that share tags, products or a category with Postgresql Best Practices Cloudbase: Discover Database (rand/cc-polymath, 181 stars), Query Expert (jamesrochabrun/skills, 215 stars), Databases (Microck/ordinary-claude-skills, 401 stars) and PostgreSQL Documentation Reference (2025Emma/vibe-coding-cn, 23k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Postgresql Best Practices Cloudbase?

TencentCloudBase (a GitHub organization) maintains it in TencentCloudBase/CloudBase-AI-Toolkit, which has 1,132 GitHub stars. The repository holds 49 skills in this directory. The repository was last updated on October 6, 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.