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!
A skill your agent uses when building or modifying a Go application that uses cirello.io/pglock for PostgreSQL-backed distributed locks, per-resource mutual exclusion, leader election, leases…
$ npx skills add cirello-io/pglock --skill pglock-integration -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install cirello-io/pglock pglock-integration --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/cirello-io/pglock.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/pglock-integration .claude/skills/pglock-integration && rm -rf skills-srcUse ~/.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/
Install the "pglock-integration" agent skill from https://github.com/cirello-io/pglock/tree/main/skills/pglock-integration into .claude/skills/pglock-integration/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "pglock-integration", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/cirello-io/pglock/tree/main/skills/pglock-integrationType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add cirello-io/pglock --skill pglock-integration -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install cirello-io/pglock pglock-integration --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/cirello-io/pglock.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/pglock-integration .agents/skills/pglock-integration && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "pglock-integration" agent skill from https://github.com/cirello-io/pglock/tree/main/skills/pglock-integration into .agents/skills/pglock-integration/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "pglock-integration", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add cirello-io/pglock --skill pglock-integration -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install cirello-io/pglock pglock-integration --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/cirello-io/pglock.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/pglock-integration .cursor/skills/pglock-integration && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "pglock-integration" agent skill from https://github.com/cirello-io/pglock/tree/main/skills/pglock-integration into .cursor/skills/pglock-integration/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "pglock-integration", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/cirello-io/pglock.git --path skills/pglock-integration--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add cirello-io/pglock --skill pglock-integration -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install cirello-io/pglock pglock-integration --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/cirello-io/pglock.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/pglock-integration .gemini/skills/pglock-integration && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "pglock-integration" agent skill from https://github.com/cirello-io/pglock/tree/main/skills/pglock-integration into .gemini/skills/pglock-integration/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "pglock-integration", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install cirello-io/pglock pglock-integrationInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add cirello-io/pglock --skill pglock-integration -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/cirello-io/pglock.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/pglock-integration .github/skills/pglock-integration && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "pglock-integration" agent skill from https://github.com/cirello-io/pglock/tree/main/skills/pglock-integration into .github/skills/pglock-integration/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "pglock-integration", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add cirello-io/pglock --skill pglock-integration -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install cirello-io/pglock pglock-integration --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/cirello-io/pglock.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/pglock-integration .opencode/skills/pglock-integration && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "pglock-integration" agent skill from https://github.com/cirello-io/pglock/tree/main/skills/pglock-integration into .opencode/skills/pglock-integration/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "pglock-integration", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
pglock-integrationA skill your agent uses when building or modifying a Go application that uses cirello.io/pglock for PostgreSQL-backed distributed locks, per-resource mutual exclusion, leader election, leases…
Pglock Integration is an agent skill from cirello-io/pglock. Use when building or modifying a Go application that uses cirello.io/pglock for PostgreSQL-backed distributed locks, per-resource mutual exclusion, leader election, leases, heartbeats, lock metadata, or lock-aware workflows. Guide dependency and driver selection, schema provisioning, client configuration, acquisition and release, context cancellation, error handling, and integration tests. Do not use for changing pglock's own internals or for generic PostgreSQL administration.
Its SKILL.md is about 2.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 7 other files, including scripts and reference files (for example `evals/evals.json`, `evals/trigger_queries.json` and `references/integration-guide.md`). Compatibility notes: Requires a Go module compatible with the selected pglock version and PostgreSQL 15 or newer. The current package declares Go 1.25.0. Integration tests need a…
It sits in Testing & QA, covering Integration testing. It works with PostgreSQL and SQL. The repository describes itself as: PostgreSQL Lock Client for Go. The licence is Apache-2.0.
7 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit 6d39959. It shows what the files ask for, not the result of running them.
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.
Ships 1 file in scripts/ (Python), which the agent can run.
Shell commands in SKILL.md call:
python3From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Requires a Go module compatible with the selected pglock version and PostgreSQL 15 or newer. The current package declares Go 1.25.0. Integration tests need a reachable PostgreSQL primary and permission to create or migrate the lock table and sequence.
From compatibility in the SKILL.md frontmatter.
Pglock Integration loads about 2.2k tokens when it runs, and up to ~3.4k if it reads all its reference files. Until then it costs about 125 tokens; SKILL.md has 962 words of instructions outside code blocks.
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.
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); the scripts in this folder are not scanned.
The full file from cirello-io/pglock at commit 6d39959, republished under its Apache-2.0 licence (© cirello-io). 962 words, ~2,244 tokens.
.claude/skills/pglock-integration/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.Use this skill for application code that consumes cirello.io/pglock. Do not
modify the library's implementation or tests unless the user explicitly asks
for an upstream change. First identify the application operation that must be
exclusive, the stable lock key, the maximum hold time, the behavior on
contention, and what should happen if the database or lease becomes unhealthy.
cirello.io/pglock to the application's Go module at the version the
application supports. Use a PostgreSQL *sql.DB; keep one shared pool open
for the application's clients.pglock.New validates the
connection as the lib/pq driver. If the application uses pgx through
github.com/jackc/pgx/v5/stdlib, use pglock.UnsafeNew after verifying that
the *sql.DB really targets PostgreSQL. Do not use UnsafeNew to bypass an
unknown or non-PostgreSQL driver.<table>_rvn sequence once. Prefer a
migration or TryCreateTable during controlled startup; use CreateTable
when a duplicate table should be an error. Never drop the shared table from
normal application startup.WithCustomTable only with a trusted, validated identifier;
the package interpolates that table name into SQL. Never derive it directly
from user input.AcquireContext or Do with an application context, and always release
an acquired lock. Make long-running callbacks stop when their callback
context is canceled because that context is also canceled when heartbeat
loss is detected.For lib/pq, the safe constructor is:
import (
"context"
"database/sql"
"log"
"time"
"cirello.io/pglock"
_ "github.com/lib/pq"
)
ctx := context.Background()
db, err := sql.Open("postgres", dsn)
if err != nil {
log.Fatal(err)
}
if err := db.PingContext(ctx); err != nil {
log.Fatal(err)
}
client, err := pglock.New(db,
pglock.WithOwner(instanceID),
pglock.WithLeaseDuration(20*time.Second),
pglock.WithHeartbeatFrequency(5*time.Second),
)
if err != nil {
log.Fatal(err)
}
if err := client.TryCreateTable(); err != nil {
log.Fatal(err)
}For pgx stdlib, open with the pgx driver and call UnsafeNew; New will
return ErrNotPostgreSQLDriver because it only recognizes lib/pq:
import _ "github.com/jackc/pgx/v5/stdlib"
db, err := sql.Open("pgx", dsn)
client, err := pglock.UnsafeNew(db)Check err after every setup call and close db only after all locks using it
have been released.
Use a stable, bounded key shared by every process that must contend, such as
campaign:<id> or leader:<service>. The schema stores names and owners in
VARCHAR(255), so bound or hash longer application identifiers before passing
them to pglock.
For a bounded critical section:
import (
"errors"
"log"
)
lock, err := client.AcquireContext(ctx, lockKey)
if err != nil {
if errors.Is(err, pglock.ErrNotAcquired) {
// The context ended before acquisition, or use FailIfLocked below.
}
return err
}
defer func() {
if releaseErr := lock.Close(); releaseErr != nil &&
!errors.Is(releaseErr, pglock.ErrLockAlreadyReleased) {
log.Printf("release %q: %v", lockKey, releaseErr)
}
}()
// Do the exclusive work while the lock is held.Acquire waits until the key is available. Use FailIfLocked() when a
caller should get ErrNotAcquired immediately instead of waiting.AcquireContext returns ErrNotAcquired when its context is already done or
ends before acquisition. Give it a deadline when a request cannot wait
indefinitely.Do acquires, invokes func(context.Context, *pglock.Lock) error, cancels
that callback context on heartbeat loss, and releases on return. Callback
code must select on ctx.Done() around long work and must not continue
externally visible side effects after losing the lock.KeepOnRelease() retains the row after release. Combine it with WithData
when lock metadata should survive ownership changes. Use ReplaceData() on a
later acquisition when retained data must be replaced; otherwise existing
data is reused.Get, GetData, and GetAllLocks are inspection APIs. They do not acquire
ownership and must not be used as an authorization check for protected work.WithOwner makes the current process or instance visible to Get and
GetAllLocks. Use a stable, non-secret identifier, not a password or token.Use errors.Is and errors.As, never error-string matching:
ErrNotAcquired: contention or acquisition context ended.ErrLockAlreadyReleased: the lock was already released or lost; a deferred
close may treat this as an expected cleanup result.ErrLockNotFound and NotExistError: an inspection target is absent.ErrDurationTooSmall: the heartbeat is too slow relative to the lease.ErrNotPostgreSQLDriver: New received a driver other than lib/pq.UnavailableError, FailedPreconditionError, and OtherError classify
wrapped database failures. The client retries PostgreSQL serialization
failures (SQLSTATE 40001) internally, but application work must still be
idempotent if the caller chooses to retry after a returned error.Point the client at the PostgreSQL primary, not a read replica. Every contender
must reach the same database and lock table. Grant the application the DDL
permissions needed for one-time setup, or run the equivalent schema.sql
migration under a database owner and grant runtime DML/sequence access. Keep
credentials in the application's normal secret/configuration path.
At minimum, run these scenarios against a real PostgreSQL service:
FailIfLocked() receives ErrNotAcquired.AcquireContext and verify it does not enter
the critical section.Do, cancel the callback context and verify the callback exits and the
lock becomes available to another client.Get/GetData and test
KeepOnRelease and ReplaceData explicitly.Use unique trusted test table names or an isolated database, clean up with
DropTable only in test teardown, and do not let parallel tests share a fixed
table/key unless the contention is intentional. Run the application race
detector as well, but do not treat -race without PostgreSQL as proof of
distributed-lock correctness.
references/integration-guide.md for the API matrix, schema shape, and
failure-mode details when the integration spans multiple components.python3 scripts/validate_skill.py --help for the dependency-free skill
validator. It emits structured JSON and never prompts.evals/evals.json for application-level output evals and
evals/trigger_queries.json for description-trigger evaluation. Keep the
trigger train/validation split fixed when measuring a compatible agent
client's activation rate.© cirello-io, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 4 other files (scripts, references) in skills/pglock-integration of cirello-io/pglock.
Open the folder on GitHubat commit 6d39959
Pglock Integration 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.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Pglock Integration this skillcirello-io/pglock | 123 | — | ~2.2k | Automated safety check: Pass | Apache-2.0 | |
| Rust Sqlx Postgres Servicehashgraph-online/awesome-codex-plugins | 1.3k | — | ~938 | Automated safety check: Pass | MIT | |
| Database Testingpetrkindlmann/qa-skills | 168 | — | ~4.2k | Automated safety check: Pass | MIT | |
| Airbyte Postgres Source E2E Testsairbytehq/airbyte | 22k | — | ~2.5k | Automated safety check: Pass | Custom licence | |
| TiDB Integration Test Recorderpingcap/tidb | 41k | — | ~260 | Automated safety check: Pass | Apache-2.0 | |
| Postgres CDC E2E Test Harnessairbytehq/airbyte | 22k | — | ~1.9k | Automated safety check: Pass | Custom licence |
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!
petrkindlmann/qa-skills
Validate database integrity, test migrations forward and backward, verify schema constraints, manage seed data, detect migration drift, and identify query performance issues.
airbytehq/airbyte
Starts a local PostgreSQL 16 container, loads SQL fixtures and runs the Airbyte spec, check, discover and read commands against a chosen source-postgres image.
pingcap/tidb
Use when recording TiDB integration tests under tests/integrationtest and verifying regenerated result files stay minimal and correct.
airbytehq/airbyte
Reproduces PostgreSQL logical-decoding CDC behavior for Airbyte's source-postgres connector on a local backend, with CDC fixtures, a catalog and smoke case scripts.
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.
Works with
Categories
A skill your agent uses when building or modifying a Go application that uses cirello.io/pglock for PostgreSQL-backed distributed locks, per-resource mutual exclusion, leader election, leases…. Pglock Integration is an agent skill from cirello-io/pglock.io/pglock for PostgreSQL-backed distributed locks, per-resource mutual exclusion, leader election, leases, heartbeats, lock metadata, or lock-aware workflows.
Pglock Integration fits situations like: modifying a Go application that uses cirello.io/pglock for PostgreSQL-backed distributed locks; per-resource mutual exclusion; leader election; lock-aware workflows.
Run `npx skills add cirello-io/pglock --skill pglock-integration -a claude-code`. Or copy the skill folder (skills/pglock-integration in cirello-io/pglock) into .claude/skills/pglock-integration in your project. Claude Code loads it when a task matches its description.
Run `npx skills add cirello-io/pglock --skill pglock-integration -a codex`. Or copy the skill folder (skills/pglock-integration in cirello-io/pglock) into .agents/skills/pglock-integration in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add cirello-io/pglock --skill pglock-integration -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/pglock-integration, .gemini/skills/pglock-integration, .github/skills/pglock-integration and .opencode/skills/pglock-integration in your project.
Going by SKILL.md and its folder, Pglock Integration needs Python for the scripts in its folder and the command-line tools its instructions call (python3). Our summary lists: Python 3. Compatibility (from SKILL.md): Requires a Go module compatible with the selected pglock version and PostgreSQL 15 or newer. The current package declares Go 1.25.0. Integration tests need a reachable PostgreSQL primary and permission to create or migrate the lock table and sequence..
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.
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. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.
Pglock Integration is published under the Apache-2.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.2k tokens (SKILL.md is roughly 9k 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 1.2k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Pglock Integration: Rust Sqlx Postgres Service (hashgraph-online/awesome-codex-plugins, 1.3k stars), Database Testing (petrkindlmann/qa-skills, 168 stars), Airbyte Postgres Source E2E Tests (airbytehq/airbyte, 22k stars) and TiDB Integration Test Recorder (pingcap/tidb, 41k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
cirello-io (a GitHub organization) maintains it in cirello-io/pglock, which has 123 GitHub stars. The repository was last updated on October 8, 2026.
Source: cirello-io/pglock on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.