Generates database audit logging implementation for compliance and debugging, including SQL trigger templates, CDC strategies, and application-level logging options.
npx claudepluginhub flight505/skill-forge --plugin database-audit-logger# Database Audit Logger Track database changes for compliance and debugging. ## Audit Strategies 1. **Trigger-Based**: Database triggers on INSERT/UPDATE/DELETE 2. **Application-Level**: Log in application code 3. **CDC (Change Data Capture)**: Stream changes 4. **Database Logs**: Parse database transaction logs ## Audit Table Template ## When Invoked Generate audit logging implementation for compliance tracking.
/audit-logGenerates database audit logging implementation for compliance and debugging, including SQL trigger templates, CDC strategies, and application-level logging options.
/auditAudits specified target (e.g., user access logs) for compliance with optional framework (e.g., SOC2, GDPR), producing logging and tracking reports for enterprise requirements.
/stored-procGenerates production-ready stored procedures, functions, triggers, and custom database logic for PostgreSQL, MySQL, and SQL Server.
/design-database-schemaDesigns optimized database schemas from business requirements, modeling entities, relationships, data types, constraints, and generating SQL DDL examples like user management and e-commerce.
/archivalImplements automated archival for PostgreSQL/MySQL databases, moving historical records to archive tables or cold storage (S3, Azure Blob, GCS) with retention policies, compression, and compliance tracking.
/transactionsSets up real-time database transaction monitoring with alerting for performance issues, long-running txns, locks, and rollbacks. Generates Python monitor script, SQL queries, and alert configs.
Share bugs, ideas, or general feedback.
Track database changes for compliance and debugging.
CREATE TABLE audit_log (
id SERIAL PRIMARY KEY,
table_name VARCHAR(100) NOT NULL,
operation VARCHAR(10) NOT NULL,
old_data JSONB,
new_data JSONB,
user_id INTEGER,
timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
-- Trigger example
CREATE OR REPLACE FUNCTION audit_trigger()
RETURNS TRIGGER AS $$
BEGIN
INSERT INTO audit_log (table_name, operation, old_data, new_data)
VALUES (TG_TABLE_NAME, TG_OP, row_to_json(OLD), row_to_json(NEW));
RETURN NEW;
END;
$$ LANGUAGE plpgsql;
Generate audit logging implementation for compliance tracking.