skills/council/guardian/audit-trail-design/SKILL.md
Use when designing audit logging systems for accountability and compliance evidence. Covers event catalogs, log schemas, retention policies, immutability requirements, and compliance reporting. Do not use for regulatory gap analysis (use compliance-review) or data sensitivity classification (use data-classification).
npx skillsauth add dtsong/my-claude-setup audit-trail-designInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Design audit logging systems that provide accountability, traceability, and compliance evidence. Produce event catalogs, log schemas, and retention policies that satisfy regulatory requirements and support forensic investigation.
Reads system architecture, regulatory requirements, and data classification outputs for audit design. Does not implement logging infrastructure or access production log stores.
No user-provided values are used in commands or file paths. All inputs are treated as read-only analysis targets.
Catalog every event that must be recorded for compliance, security, or operational accountability:
Design a consistent schema that answers who/what/when/where/why for every event:
Define retention based on regulatory and business requirements:
Ensure audit records cannot be tampered with after creation:
Define who can access audit records and under what circumstances:
Specify the reports and dashboards that audit data must support:
Compaction resilience: If context was lost during a long session, re-read the Inputs section to reconstruct what system is being analyzed, check the Progress Checklist for completed steps, then resume from the earliest incomplete step.
| Event Category | Event Type | Trigger | Data Captured | Retention Tier | |---|---|---|---|---| | Authentication | login_success | User login | user_id, timestamp, IP, method | Hot 90d → Cold 1y | | Authentication | login_failure | Failed login | attempted_user, timestamp, IP, reason | Hot 90d → Cold 1y | | Data Access | pii_read | PII field accessed | user_id, accessor_id, field, purpose | Hot 90d → Cold 7y | | Consent | consent_granted | User gives consent | user_id, purpose, scope, version, timestamp | Hot 90d → Cold 7y | | ... | ... | ... | ... | ... |
{
"event_id": "uuid-v4",
"event_type": "enum(event_catalog)",
"timestamp": "2024-01-15T10:30:00.000Z",
"actor": {
"type": "user|service|system",
"id": "user_123",
"ip": "192.168.x.x",
"session_id": "sess_abc"
},
"resource": {
"type": "user|record|config",
"id": "res_456",
"field": "email"
},
"action": "read|create|update|delete|grant|revoke",
"outcome": "success|failure",
"context": {
"service": "user-service",
"request_id": "req_789",
"region": "us-east-1"
},
"metadata": {}
}
| Tier | Storage Type | Duration | Query SLA | Cost Model | |---|---|---|---|---| | Hot | Primary database / search index | 90 days | < 1s | $$$ | | Warm | Indexed archive | 1 year | < 30s | $$ | | Cold | Object storage (compressed) | Regulatory max (up to 7y) | Minutes | $ |
| Role | Read Events | Search PII Fields | Export | Admin | |---|---|---|---|---| | Security Team | All | Yes | With approval | No | | Compliance Officer | All | Yes (masked) | With approval | No | | Engineering | Operational only | No | No | No | | Audit Log Admin | Metadata only | No | No | Yes (config, not content) |
development
Use when planning implementation steps, deciding commit format, or structuring development approach. Provides brainstorm-plan-implement flow with conventional commits. Triggers on 'how should I approach this', 'commit format'.
development
Security audit checklist for web applications. Use when reviewing, auditing, or hardening a web app's security posture. Covers rate limiting, auth headers, IP blocking, CORS, security middleware, input validation, file upload limits, ORM usage, and password hashing. Triggers on requests like "review security", "harden this app", "security audit", "check for vulnerabilities", or when building/reviewing API endpoints.
development
Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".
development
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.