Postgresql Best Practices Cloudbase logo

Postgresql Best Practices Cloudbase

OrganizationPopular
TencentCloudBase
postgresql-best-practices-cloudbase

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.

Overview

PublisherTencentCloudBase
RepositoryCloudBase-AI-Toolkit
Skill namepostgresql-best-practices-cloudbase
Stars
1.1K
Forks
141
Bundled files
4
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 4 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by TencentCloudBase on GitHub. Read the source before you install it.

Installation

Install the Postgresql Best Practices Cloudbase AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/TencentCloudBase/CloudBase-AI-Toolkit.git /tmp/CloudBase-AI-Toolkit
mkdir -p .claude/skills
cp -r /tmp/CloudBase-AI-Toolkit/config/source/skills/postgresql-best-practices-cloudbase .claude/skills/postgresql-best-practices-cloudbase
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Postgresql Best Practices Cloudbase in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Postgresql Best Practices Cloudbase on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Postgresql Best Practices Cloudbase is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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.

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.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Postgresql Best Practices Cloudbase AI skill do?

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.

Why use Postgresql Best Practices Cloudbase on TypingMind?

Because you install it once and use it with any model. Postgresql Best Practices Cloudbase is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Postgresql Best Practices Cloudbase in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/TencentCloudBase/CloudBase-AI-Toolkit/tree/main/config/source/skills/postgresql-best-practices-cloudbase. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Postgresql Best Practices Cloudbase?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Postgresql Best Practices Cloudbase?

As many as you like. As long as a model supports skills, you can use Postgresql Best Practices Cloudbase with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Postgresql Best Practices Cloudbase AI skill free?

Yes. It is published on GitHub by TencentCloudBase under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇