build-audit-logs

Build and review tamper-evident audit trails in TypeScript applications using evlog.

Updated Sep 5, 2023
One-click install
npx skills add https://github.com/eyenalxai/dotfiles --skill build-audit-logs-eyenalxai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: build-audit-logs
Source: https://github.com/eyenalxai/dotfiles/tree/main/.agents/skills/build-audit-logs
Command: npx skills add https://github.com/eyenalxai/dotfiles --skill build-audit-logs-eyenalxai

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires evlog, and includes references (resource) components.

What problem does it solve? Applications that handle sensitive operations need a forensic record of who did what, on which resource, and with what outcome, but teams often ship audit logging that misses denials, leaks PII, or lacks tamper evidence required by SOC2, HIPAA, or PCI DSS. ## Core Features & Use Cases - End-to-end audit buildout: Wire the evlog pipeline with auditEnricher, auditOnly sinks, signed drains (HMAC or hash-chain), typed action catalogs, and redaction presets across Nuxt, Hono, Express, Next.js, and standalone workers. - Structured review mode: Four grep-driven audit passes covering pipeline wiring, call-site coverage, redaction and integrity, and test coverage, with findings grouped into P0/P1/P2 severity. - Compliance guidance: Design decisions for sink selection, retention windows, multi-tenant isolation, and GDPR crypto-shredding against append-only storage. - Use Case: A developer adding an audit trail to a billing app can follow the steps to define a typed action catalog, wrap refund logic with withAudit, log denials, and verify everything with mockAudit tests. ## Quick Start Ask the assistant to add an evlog audit trail to your TypeScript app, or to review your existing audit logging setup for coverage and compliance gaps.

Frequently Asked Questions about build-audit-logs

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add audit logging to a TypeScript app with evlog?

Register auditEnricher to auto-fill request context, add a main drain plus an auditOnly signed sink, then instrument call sites with withAudit, log.audit, or the standalone audit function. Define actions centrally with defineAuditCatalog or defineAuditAction.

How do I review an existing audit logging setup for compliance gaps?

Run four grep-based passes: check pipeline wiring for auditEnricher and auditOnly, inventory mutating endpoints and 403 throws for coverage, verify redact presets and signing strategy, and confirm mockAudit tests exist. Findings are grouped into P0, P1, and P2 severity.

Does evlog audit logging work with Next.js, Hono, and Express?

Yes, the same pipeline shape works across frameworks: register auditEnricher and wire drains through each framework's evlog integration helper. The references file includes wiring examples for Hono, Express, Next.js App Router, and standalone scripts or queue workers.

How do I make audit logs tamper-evident for SOC2 or HIPAA?

Wrap the audit sink with signed using the hmac or hash-chain strategy, and persist hash-chain state externally such as in Redis for multi-process deployments. Alternatively use a WORM sink like S3 Object Lock, and document retention per framework.

Why are denial events missing from my audit trail?

Denials are missed when 403 or Forbidden errors are thrown without a paired log.audit.deny call. Every authorization check should log the denial with action, actor, and target, and tests should assert denied outcomes using mockAudit.