PostgreSQL-native Auth, Config, Metering & Queues

VerifiedCaution

Use PostKit, PostgreSQL-native SQL functions for user management, sessions, permissions, versioned configuration, usage metering, and job queues.

Sby Skills Guide Bot
DevelopmentIntermediate
8/9/2026
Claude CodeCursorCodex
#postgresql#authentication#authorization#job-queue#metering

Recommended for

Automated summary

Installs and documents PostKit, a set of PostgreSQL SQL functions covering authentication, ReBAC permissions, versioned configuration, usage metering, and job queues.

Strengths

  • SQL-function-only API, so it works from any language or database driver
  • Modular install: one SQL file per module (authn, authz, config, meter, queue)
  • Per-module reference docs for both raw SQL and the Python SDK
  • Includes advanced behaviour such as usage reservations, billing periods, job retries, and dead letters

Limitations

  • Requires cloning the repository and running `make build` before anything works
  • The memory module depends on the pgvector extension and is not installed by default
  • No official SDK beyond Python, so other languages must call the SQL functions directly
When to use it

Use it when adding authentication, permissions, versioned config, quotas, or background jobs to an application already built on PostgreSQL.

When not to use it

Avoid it if the project does not use PostgreSQL, or if it relies on a managed third-party auth provider.

Security analysis

Caution
Quality score75/100

The skill instructs cloning and building a third-party project, then installing its SQL schema into the user's database. These are legitimate integration steps for a PostgreSQL toolkit, but they execute remote code and modify the database, so caution is warranted.

Findings
  • •Clones an external GitHub repository and runs `make build` without pinning a version or verifying checksums, creating supply chain risk.
  • •Executes SQL schema files directly against the user's database via `psql`, which can alter database structure and data.
  • •Uses `pip install postkit` from PyPI, an external dependency with no integrity verification.
How this analysis is made

Examples

User accounts and sessions
Add signup, login, session management, MFA and password resets to my Postgres app using postkit authn. Set up the schema first, then show me the SQL calls for each flow.
Relationship-based permissions
Set up postkit authz in my database so a document owner can share a document with a team and grant read-only access to specific users.
Background jobs with retries
Use postkit queue to create a background job queue in Postgres with automatic retries and a dead-letter table for jobs that keep failing.

name: postkit description: PostgreSQL-native identity, configuration, metering, and job queues. SQL functions that work with any language or driver. Use when working with user management, sessions, permissions, access control, login/logout, MFA, password resets, relationship-based access, versioned configuration, prompts, usage tracking, quotas, billing periods, or background jobs in PostgreSQL. Covers authn (user/session management), authz (ReBAC permissions), config (versioned key-value storage), meter (usage tracking with reservations), and queue (job scheduling with retries and dead letters).

Setup (REQUIRED FIRST STEP)

Clone the repository if not already present:

[ -d postkit ] || git clone https://github.com/varunchopra/postkit.git

Then build the dist files:

cd postkit && make build && cd ..

Install the SQL schema on the user's database:

psql $DATABASE_URL -f postkit/dist/postkit.sql
# memory is separate and needs pgvector: psql $DATABASE_URL -f postkit/dist/memory.sql
# Or individual modules: postkit/dist/authn.sql, postkit/dist/authz.sql, postkit/dist/config.sql, postkit/dist/meter.sql, postkit/dist/queue.sql

For the optional Python SDK:

pip install postkit

Requirements

All languages (SQL functions):

  • PostgreSQL 14+
  • Schema installed from dist/ files

Python SDK only (optional wrapper):

  • psycopg>=3.1.0 (not psycopg2)
  • Python 3.11+

Instructions

  1. Read postkit/AGENTS.md for multi-tenancy, hashing, login flows, and module API maps
  2. Read the relevant module docs based on what the user needs:
    • Authentication (users/sessions): postkit/docs/authn/
    • Authorization (permissions): postkit/docs/authz/
    • Configuration (versioned key-value): postkit/docs/config/
    • Metering (usage tracking, quotas): postkit/docs/meter/
    • Job Queues (scheduling, retries): postkit/docs/queue/

Documentation Map

| What you need | Where to look | |---------------|---------------| | Integration guide | postkit/AGENTS.md | | authn SQL reference | postkit/docs/authn/sql.md | | authn Python SDK | postkit/docs/authn/sdk.md | | authz SQL reference | postkit/docs/authz/sql.md | | authz Python SDK | postkit/docs/authz/sdk.md | | config SQL reference | postkit/docs/config/sql.md | | config Python SDK | postkit/docs/config/sdk.md | | meter SQL reference | postkit/docs/meter/sql.md | | meter Python SDK | postkit/docs/meter/sdk.md | | queue SQL reference | postkit/docs/queue/sql.md | | queue Python SDK | postkit/docs/queue/sdk.md |

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/postgresql-native-auth-config-metering-queues-msl9ceu8/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/postgresql-native-auth-config-metering-queues-msl9ceu8' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/postgresql-native-auth-config-metering-queues-msl9ceu8/download' --output '.skill-downloads/postgresql-native-auth-config-metering-queues-msl9ceu8/SKILL.md.part' && mv '.skill-downloads/postgresql-native-auth-config-metering-queues-msl9ceu8/SKILL.md.part' '.skill-downloads/postgresql-native-auth-config-metering-queues-msl9ceu8/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

Original excerpt: Requirements

All languages (SQL functions):

  • PostgreSQL 14+
  • Schema installed from dist/ files

Python SDK only (optional wrapper):

  • psycopg>=3.1.0 (not psycopg2)
  • Python 3.11+

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/postgresql-native-auth-config-metering-queues-msl9ceu8/SKILL.md' && test -s '.skill-downloads/postgresql-native-auth-config-metering-queues-msl9ceu8/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/postkit' && cp -R '.skill-downloads/postgresql-native-auth-config-metering-queues-msl9ceu8' '.claude/skills/postkit'

Cursor
test -f '.skill-downloads/postgresql-native-auth-config-metering-queues-msl9ceu8/SKILL.md' && test -s '.skill-downloads/postgresql-native-auth-config-metering-queues-msl9ceu8/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/postkit' && cp -R '.skill-downloads/postgresql-native-auth-config-metering-queues-msl9ceu8' '.cursor/skills/postkit'

Codex
test -f '.skill-downloads/postgresql-native-auth-config-metering-queues-msl9ceu8/SKILL.md' && test -s '.skill-downloads/postgresql-native-auth-config-metering-queues-msl9ceu8/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/postkit' && cp -R '.skill-downloads/postgresql-native-auth-config-metering-queues-msl9ceu8' '.agents/skills/postkit'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/postgresql-native-auth-config-metering-queues-msl9ceu8'

openskills read 'postgresql-native-auth-config-metering-queues-msl9ceu8'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/postgresql-native-auth-config-metering-queues-msl9ceu8/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills