Imported from ziggkaizen/antigravity-plugin-directory (
plugins/postgresql-18/skills/postgresql-18-concurrency-review/SKILL.md). Install upstream withnpx skills add ziggkaizen/antigravity-plugin-directory --skill postgresql-18-concurrency-review. Copyright stays with the author (MIT).
PostgreSQL 18 Concurrency Review
Use this skill for critical state transitions, replay defense, idempotency, uniqueness, retry behavior, duplicate submissions, row/advisory locks, queue consumers, and outbox/inbox workflows.
Start Here
- Identify the state transition and invariant.
- Identify concurrent actors and retry sources.
- Identify the database constraints that enforce correctness.
- Identify the transaction boundary and isolation level.
- Use supporting files:
resources/concurrency-and-replay-checklist.mdresources/transaction-isolation-guide.mdexamples/idempotency-and-uniqueness-patterns.md
- Run scripts with
--helpbefore using them:scripts/postgresql-18-transaction-pattern-check.sh
Review Principles
- Prefer database constraints for invariants.
- Avoid read-check-write races.
- Use
INSERT ... ON CONFLICT, unique constraints, exclusion constraints, row locks, advisory locks, or serializable transactions when appropriate. - Design retries as part of the behavior, not as an afterthought.
- Use idempotency keys for externally retried operations.
- Keep transactions short.
- Coordinate external side effects through outbox/inbox patterns.
- Test concurrent cases, not only single-threaded behavior.
Workflows
Use workflows/concurrency-review-workflow.md for concurrency-sensitive PostgreSQL 18 changes.
Expected Output
For concurrency tasks, provide:
- Invariant and race-risk summary.
- Transaction boundary and isolation recommendation.
- Required constraints/indexes.
- Retry/idempotency/replay behavior.
- Test plan for concurrent execution.