Postgraphile Audit Plugin
Description
This plugin adds functionality to access pgMemento's audit data on an entity level from a postgraphile graphql api.
Installation
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open the source below and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
README
Motivation
This plugin adds functionality to access [pgMemento](https://github.com/pgMemento/pgMemento)'s audit data on an entity level from a [postgraphile](https://www.graphile.org/postgraphile/) graphql api.
Each Entity for an audited table can be extended automatically with the following properties:
interface Audited {
firstAuditEvent: AuditEvent!
lastAuditEvent: AuditEvent!
createdAt: String!
lastModifiedAt: String!
createdBy: String!
lastModifiedBy: String!
auditEvents(
first: Int
last: Int
offset: Int
before: Cursor
after: Cursor
): AuditEventsConnection!
}
interface AuditEvent {
id: BigInt
auditId: BigInt
eventId: Int
transactionId: Int
userName: String
stmtDate: Datetime
sessionInfo: JSON
valuesBefore: JSON
valuesAfter: JSON
}
Properties can be renamed using inflection and their presence can be configured.
Installation
npm install postgraphile-audit-plugin
# this will ask you for a target schema and then create the `AuditEvent` type and `get_audit_information` function.
psql -h host -p 5432 -U user -d database -f Setup.sql
Usage
The plugin comes preconfigured out of the box. It can be configured using a `.postgraphilerc.js`:
/**
* @type {import("./src").AuditPluginOptions}
*/
const auditPlugin = {
/**
* name of the schema that contains the `get_audit_information` function
*/
auditFunctionSchema: "public",
/**
* include "auditEvents" connection on audited types
*/
auditEventConnection: true,
/**
* include "firstAuditEvent" and "lastAuditEvent" field on audited types
*/
firstLastAuditEvent: true,
/**
* include "createdAt" and "lastModifiedAt" field on audited types
*/
dateProps: true,
/**
* include "createdBy" and "lastModifiedBy" on audited types
*/
nameProps: true,
/**
* define how "name" properties should be filled - either with the transaction's "user_name", or with a value from the "session_inf
Related Skills
Fastapi Review
Review a FastAPI application for architecture, async correctness, dependency injection, Pydantic schemas, secu
Security Defense in Depth
Implement multi-layered testing and security best practices.
Security SecLists Official Repository
[OWASP Testing Guide](https://owasp.org/www-project-web-security-testing-guide/)
Security Threat Hunting with Sigma Rules
Use Sigma detection rules to hunt for threats and analyze security events
Security Maintenance Walkthrough - 2026-03-29
- Re-triaged the full 2026-03-15 security finding set against current `main` and wrote a fresh current-head re
Security Google Workspace Model Armor
Filter user-generated content for safety
Security Related Agents
Django Reviewer
Expert Django code reviewer specializing in ORM correctness, DRF patterns, migration safety, security misconfi
Token Auditor
Scans ui/src/ for hardcoded visual values, duplicate components, and shadcn replacement candidates; produces d
Gitnexus Security Boundary Reviewer
GitNexus security and trust-boundary reviewer. Use for auth, permissions, secrets, injection, unsafe parsing,