Replace Redis, MongoDB, n8n, Elasticsearch with native PostgreSQL. A Claude Skill.
SaferSkills independently audited postgres-first (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Use PostgreSQL first only when measured requirements show it is sufficient. This skill is an evidence gate, not a mandate to replace every specialized system.
Before adding, removing, or replacing a data service, collect evidence for:
If these are unknown, classify the decision as NOT_PROVEN; do not claim that PostgreSQL is sufficient.
Classify the requirement before choosing infrastructure:
| Workload | PostgreSQL-native candidate | Keep/split a specialist when… |
|---|---|---|
| Flexible documents | JSONB + GIN | access patterns or scale are proven unsuitable |
| Durable work queue | row table + FOR UPDATE SKIP LOCKED | broker semantics, partition isolation, replay/fan-out or throughput require it |
| Cache | ordinary/unlogged tables, materialized views | latency or independent failure isolation requires an external cache |
| Full-text/fuzzy search | tsvector, GIN, pg_trgm | relevance, indexing scale or search features exceed measured targets |
| Vector retrieval | pgvector | measured recall/latency/cost justify a dedicated vector service |
| Schedules | pg_cron + durable jobs | orchestration graph complexity or execution isolation requires a workflow engine |
| Pub/sub wake-ups | LISTEN/NOTIFY backed by durable rows | durable streams, replay or large fan-out are required |
| Rate limits | atomic counters/window tables | global edge latency or extremely high write rates require another store |
| Audit trail | append-only relational tables | regulatory isolation or immutable external retention requires another system |
Write the boundary before implementation. Example:
queue_slo:
sustained_jobs_per_second: 250
p99_claim_latency_ms: 100
replay_required: false
cross_region_active_active: false
max_recovery_time_minutes: 15
exit_to_specialist_if:
- p99 exceeds target under representative load
- database contention harms transactional workloads
- required semantics cannot be implemented economicallyDo not substitute row-count folklore or generic CPU formulas for measurement. Connection counts, pool sizes, partition thresholds, cache policies and indexes are workload-specific. Use EXPLAIN (ANALYZE, BUFFERS), pg_stat_statements, realistic concurrency, and failure tests.
At minimum, test:
Return one of:
VERIFIED_POSTGRES_FIT — representative tests meet explicit requirements with headroom.PARTIAL — promising pattern, incomplete evidence.KEEP_SPECIALIST — a specialist provides required semantics/isolation economically.NOT_PROVEN — requirements or runtime evidence are missing.Never use production-ready as a synonym for “the SQL parses.”
Use a durable row as the source of truth and claim work transactionally:
WITH claimed AS (
SELECT id
FROM job_queue
WHERE status IN ('pending', 'retrying')
AND run_at <= now()
ORDER BY priority DESC, run_at, id
LIMIT 1
FOR UPDATE SKIP LOCKED
)
UPDATE job_queue AS q
SET status = 'processing',
started_at = now(),
attempts = attempts + 1
FROM claimed
WHERE q.id = claimed.id
RETURNING q.*;SKIP LOCKED is appropriate for queue-like consumers; it intentionally does not provide a consistent general-purpose snapshot.
Use a unique business/idempotency key rather than an in-memory duplicate guard:
INSERT INTO processed_events (idempotency_key, payload)
VALUES ($1, $2)
ON CONFLICT (idempotency_key) DO NOTHING
RETURNING id;No returned row means the event was already accepted.
When a workflow must survive retries, crashes or deployments, persist the run's specification version, resumable state and externally relevant receipts. Use expiring execution leases and stable idempotency keys for side effects; never replay an unfinished old run implicitly under the newest code. See patterns/durable-workflow-replay.md.
A reclaimed workflow lease does not make every unfinished mutation safe to execute again. Commit the effect intent first, classify it as REPLAY_SAFE, IDEMPOTENT_WITH_KEY, NON_REPLAYABLE, or UNKNOWN_SIDE_EFFECT, and fail closed to interruption/reconciliation when the remote outcome is uncertain. See patterns/durable-side-effect-recovery.md.
When permission depends on prior outcomes, use an ordered durable ledger rather than model memory or mutable current state. Persist the action request, evaluate against the policy version active at that request, bind evidence to the exact revision/tenant, and keep the enforcement point outside the model. See patterns/temporal-authorization.md.
Use reconstructible cache tables only when losing them is acceptable. UNLOGGED tables are not durable and are not replicated to standbys; never use them for authoritative state.
Start with PostgreSQL search when the corpus and relevance requirements fit. Benchmark before replacing a dedicated search engine; do not use document count alone as an exit threshold.
Enable pg_stat_statements when the platform supports it, then measure planning/execution statistics and query concentration. Remember that it requires shared_preload_libraries and a server restart to add or remove.
LISTEN/NOTIFY is a wake-up signal, not durable storage.pg_cron, pgvector, pg_partman, PostGIS and similar extensions are deployment capabilities, not assumptions.patterns/README.mdmigrations/README.mdanti-patterns/README.mdreferences/SKILL.pre-2026-08-15.mdVERIFICATION.mdevals/cases.jsonlpython scripts/validate_skill.py.tests/ against PostgreSQL 18 or the target production major.NOT_PROVEN.~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.