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 the council needs to surface organizational knowledge buried across multiple internal sources (wikis, design docs, ADRs, past tickets, postmortems, chat archives, code repos). Plans where to look, what to cross-reference, and how to synthesize findings into evidence the council can act on. Do not use for external market research (use competitive-analysis), library evaluation (use library-evaluation), or technology trend assessment (use technology-radar).
testing
Use to convert a Word .docx file to PDF and/or verify its page count. Triggers on: converting docx to pdf, rendering a document, checking how many pages a docx produces, or asserting a page-count constraint (e.g. a resume must stay 2 pages). Wraps LibreOffice headless conversion.
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
Interactive wizard to craft effective prompts using Claude Code best practices