Agent skill

cargo-pgrx Commands and Tests

by yugabyte in yugabyte/yugabyte-db

Helps choose and run cargo-pgrx commands and decide whether a Rust test is a plain test or a pg_test, so code never crosses the Postgres boundary the wrong way.

Custom licenceAuto-check passedTesting & QA

Install cargo-pgrx Commands and Tests

skills CLI
$ npx skills add yugabyte/yugabyte-db --skill cargo-pgrx -a claude-code

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

GitHub CLI
$ gh skill install yugabyte/yugabyte-db cargo-pgrx --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/yugabyte/yugabyte-db.git skills-src && mkdir -p .claude/skills && cp -r skills-src/src/postgres/third-party-extensions/pgrx/skills/cargo-pgrx .claude/skills/cargo-pgrx && 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
cargo-pgrx
GitHub stars
11k
Token cost
~1.9k tokens
SKILL.md length
940 words
Files
12
Skills in repo
7
Repo updated
First seen
Licence
Custom licence

At a glance

Helps choose and run cargo-pgrx commands and decide whether a Rust test is a plain test or a pg_test, so code never crosses the Postgres boundary the wrong way.

  • Writing tests for a pgrx Postgres extension in Rust
  • SKILL.md covers The two worlds, Test classification, Command routing and Anti-patterns, plus 1 more section
  • Calls cargo
  • Deciding between cargo pgrx test, regress and run

What it does

The central idea is that a pgrx extension lives in two worlds. The extension's shared library runs inside the Postgres backend with access to its symbols, while the Rust test binary is an ordinary executable with none, so any reference to `pg_sys::*` there causes linker errors. Every choice about building, testing and running follows from knowing which world the code is in.

Tests are classified by one question: does the function, or anything it calls, need a symbol that lives in Postgres? If yes it is a `#[pg_test]`, which `cargo pgrx test` runs inside a live backend; if no it is a `#[test]`; and if unsure it is a `#[pg_test]`. Eleven reference files cover the bench, init, install, instance management, new, package, regress, run, schema, test and utilities commands. The excerpt is truncated.

When your agent uses it

  • Writing tests for a pgrx Postgres extension in Rust
  • Deciding between cargo pgrx test, regress and run
  • Debugging linker errors caused by pg_sys symbols in tests

Example prompts

  • “Should this pgrx test be a #[test] or a #[pg_test]?”
  • “Run the pgrx tests for my extension and explain which ones need a live Postgres.”
  • “My test binary fails to link with pg_sys symbols. What's wrong?”

Requirements

  • Rust with `cargo-pgrx` installed
  • A Postgres instance that pgrx can start for `pg_test` runs

What it can do on your machine

Read from SKILL.md and the folder at commit 4a1e3de. 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

    Shell commands in SKILL.md call:

    • cargo

    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

cargo-pgrx Commands and Tests loads about 1.9k tokens when it runs. Until then it costs about 26 tokens; SKILL.md has 940 words of instructions outside code blocks.

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

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

Its licence (Custom licence) doesn't allow us to republish the file, so here is its outline and opening line. It has 940 words (~1,913 tokens).

“You understand that a pgrx extension lives in two worlds. The extension's shared library runs inside the Postgres backend -- it shares an address space with the server, has access to every internal symbol, and obeys Postgres memory management. The…”

— opening of SKILL.md by yugabyte, Custom licence
name
cargo-pgrx
user-invocable
false

Read the full SKILL.md on GitHub

Files

SKILL.md and 11 other files in src/postgres/third-party-extensions/pgrx/skills/cargo-pgrx of yugabyte/yugabyte-db.

  • SKILL.md
  • bench.md
  • init.md
  • install.md
  • instance-management.md
  • new.md
  • package.md
  • regress.md
  • run.md
  • schema.md
  • test.md
  • utilities.md

Open the folder on GitHubat commit 4a1e3de

Compare with similar skills

cargo-pgrx Commands and Tests 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.

cargo-pgrx Commands and Tests compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
cargo-pgrx Commands and Tests this skillyugabyte/yugabyte-db11k—~1.9kAutomated safety check: PassCustom licence
Rust Testingaxone-protocol/contracts123—~501Automated safety check: PassBSD-3-Clause
Rust Testingkurealnum/dotfiles2906 repos~2.9kAutomated safety check: PassNone
Validationjosstei/maestro-orchestrate465—~2.3kAutomated safety check: PassApache-2.0
Scaffolding Oracle To Postgres Migration Test Projectgithub/awesome-copilot40k—~687Automated safety check: PassMIT
Rust Sqlx Postgres Servicehashgraph-online/awesome-codex-plugins1.3k—~938Automated safety check: PassMIT

Similar skills

  • Rust Testing

    axone-protocol/contracts

    Patterns for Rust testing in Axone CosmWasm contracts. An agent skill from axone-protocol/contracts.

    123 GitHub stars~501 tokensUpdated today
    Testing & QAAuto-check passed
  • Rust Testing

    kurealnum/dotfiles

    Rust testing patterns including unit tests, integration tests, async testing, property-based testing, mocking, and coverage.

    290 GitHub starsUsed in 6 repos~2.9k tokens
    Testing & QAAuto-check passed
  • Validation

    josstei/maestro-orchestrate

    Cross-cutting validation methodology for verifying phase outputs and project integrity

    465 GitHub stars~2.3k tokensUpdated 3 days ago
    Testing & QAAuto-check passed
  • Rust Sqlx Postgres Service

    hashgraph-online/awesome-codex-plugins

    A skill your agent uses when adding, changing, testing, or reviewing Postgres persistence in Rust services that use sqlx, especially when designing migrations, query!

    1.3k GitHub stars~938 tokensUpdated today
    Testing & QAAuto-check passed
  • Scaffolds an xUnit integration test project for validating Oracle-to-PostgreSQL database migration behavior in .NET solutions.

    276 GitHub stars~632 tokensUpdated 5 mo ago
    Testing & QAAuto-check passed

More from yugabyte/yugabyte-db

  • YugabyteDB ASH Instrumentation

    yugabyte/yugabyte-db

    Procedure for adding or changing YugabyteDB Active Session History wait states in TServer and DocDB C++ code, including the macro to use for sync and async paths.

    11k GitHub stars~4.5k tokensUpdated today
    Auto-check passed
  • YugabyteDB Phorge Diff Creator

    yugabyte/yugabyte-db

    Creates a Phorge code review diff for the current branch with arc diff, while applying public-repo confidentiality rules since Phorge content later lands verbatim on the public GitHub repo.

    11k GitHub stars~3.1k tokensUpdated today
    Auto-check passed
  • YugabyteDB Issue Creator

    yugabyte/yugabyte-db

    Creates a GitHub issue or JIRA ticket for a YugabyteDB change or bug, after scrubbing customer data, secrets and unreleased details from anything public.

    11k GitHub stars~2k tokensUpdated today
    Auto-check passed
  • YugabyteDB Backport Review

    yugabyte/yugabyte-db

    Checks a YugabyteDB backport revision on Phorge against the original diff it was ported from and flags differences, tracing unexplained code back to master.

    11k GitHub stars~2.5k tokensUpdated today
    Auto-check passed
  • YBA Read-Only Query CLI

    yugabyte/yugabyte-db

    Runs read-only lookups - list, describe, get - against a live YugabyteDB Anywhere control plane using the yba CLI, with mutating commands explicitly off-limits.

    11k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Create Fork Pull Request

    yugabyte/yugabyte-db

    Pushes the current branch to your fork and opens a cross-repository GitHub pull request, with a strict check against leaking customer data into public text.

    11k GitHub stars~5.6k tokensUpdated today
    Auto-check passed

Works with

Questions about cargo-pgrx Commands and Tests

What does cargo-pgrx Commands and Tests do?

Helps choose and run cargo-pgrx commands and decide whether a Rust test is a plain test or a pg_test, so code never crosses the Postgres boundary the wrong way. The central idea is that a pgrx extension lives in two worlds. The extension's shared library runs inside the Postgres backend with access to its symbols, while the Rust test binary is an ordinary executable with none, so any reference to `pg_sys::*` there causes linker errors.

When should I use cargo-pgrx Commands and Tests?

cargo-pgrx Commands and Tests fits situations like: writing tests for a pgrx Postgres extension in Rust; deciding between cargo pgrx test, regress and run; debugging linker errors caused by pg_sys symbols in tests.

How do I install cargo-pgrx Commands and Tests in Claude Code?

Run `npx skills add yugabyte/yugabyte-db --skill cargo-pgrx -a claude-code`. Or copy the skill folder (src/postgres/third-party-extensions/pgrx/skills/cargo-pgrx in yugabyte/yugabyte-db) into .claude/skills/cargo-pgrx in your project. Claude Code loads it when a task matches its description.

How do I install cargo-pgrx Commands and Tests in Codex?

Run `npx skills add yugabyte/yugabyte-db --skill cargo-pgrx -a codex`. Or copy the skill folder (src/postgres/third-party-extensions/pgrx/skills/cargo-pgrx in yugabyte/yugabyte-db) into .agents/skills/cargo-pgrx in your project. Codex loads it when a task matches its description.

Can I use cargo-pgrx Commands and Tests 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 yugabyte/yugabyte-db --skill cargo-pgrx -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/cargo-pgrx, .gemini/skills/cargo-pgrx, .github/skills/cargo-pgrx and .opencode/skills/cargo-pgrx in your project.

What does cargo-pgrx Commands and Tests need to run?

Going by SKILL.md and its folder, cargo-pgrx Commands and Tests needs the command-line tools its instructions call (cargo). Our summary lists: Rust with `cargo-pgrx` installed; A Postgres instance that pgrx can start for `pg_test` runs.

Does cargo-pgrx Commands and Tests 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 cargo-pgrx Commands and Tests 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 cargo-pgrx Commands and Tests use?

cargo-pgrx Commands and Tests has a licence file (the repository's licence) that doesn't match a standard licence. Read it on GitHub before reusing the skill.

How many tokens does cargo-pgrx Commands and Tests use?

About 1.9k tokens (SKILL.md is roughly 7.7k 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 cargo-pgrx Commands and Tests?

Skills that share tags, products or a category with cargo-pgrx Commands and Tests: Rust Testing (axone-protocol/contracts, 123 stars), Rust Testing (kurealnum/dotfiles, 290 stars), Validation (josstei/maestro-orchestrate, 465 stars) and Scaffolding Oracle To Postgres Migration Test Project (github/awesome-copilot, 40k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains cargo-pgrx Commands and Tests?

yugabyte (a GitHub organization) maintains it in yugabyte/yugabyte-db, which has 10,586 GitHub stars. The repository holds 7 skills in this directory. The repository was last updated on October 10, 2026.

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