audit-log
Skill2 starsChanged 4 months agoMITView on GitHub
Add an audit trail that records who did what, when, and to what — for security-sensitive and compliance-relevant actions (logins, permission changes, data mutations, admin operations) — in an append-only, tamper-evident, PII-conscious way. Use when the user says "add an audit log", "track who changed what", "add an audit trail", "record admin actions", "who did this and when", "add compliance logging", or "log security-sensitive events".
7 other projects use a version of this.
Adopted by
Most recently taken up by
- berriosb/data-analytics-agentstheir own version, first seen Oct 20, 2026
- EmeaAppGbb/spec2cloudtheir own version, first seen Oct 9, 2026
- BuilderIO/agent-nativetheir own version, first seen Oct 8, 2026
- crgarcia12/Liliputtheir own version, first seen Jul 14, 2026
- thebharathkumar/agent-flight-recordertheir own version, first seen Jul 5, 2026
- SAQLAINAP/GitClaw-Agenttheir own version, first seen Apr 5, 2026
Other versions7 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 7
- BuilderIO/agent-native★ 7.7ksame name
- EmeaAppGbb/spec2cloud★ 100same name
- crgarcia12/Liliput★ 4same name
- SAQLAINAP/GitClaw-Agent★ 1same name
- berriosb/data-analytics-agents★ 0same name
- PalmCoast/clawlock-plugin★ 0same name
- thebharathkumar/agent-flight-recorder★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository68 other files it gives its agents.
- a11ySkill
- api-docsSkill
- benchmarkSkill
- bisectSkill
- cacheSkill
- changelogSkill
- cherry-pickSkill
- ci-setupSkill
- codeownersSkill
- commit-messageSkill
- connection-poolSkill
- contributingSkill
- coverageSkill
- db-migrateSkill
- dead-codeSkill
- debugSkill
- depsSkill
- diagramSkill
- dockerizeSkill
- docstringSkill
- e2eSkill
- env-exampleSkill
- error-handlingSkill
- explainSkill
- feature-flagSkill
- flaky-testSkill
- gitignoreSkill
- graceful-shutdownSkill
- graphqlSkill
- healthcheckSkill
- i18nSkill
- idempotencySkill
- licenseSkill
- lint-fixSkill
- loggingSkill
- migrateSkill
- mockSkill
- onboardSkill
- optimizeSkill
- paginationSkill
- pr-descriptionSkill
- pre-commitSkill
- profileSkill
- prune-branchesSkill
- rate-limitSkill
- readmeSkill
- rebaseSkill
- refactorSkill
- regexSkill
- releaseSkill
- resolve-conflictsSkill
- retrySkill
- review-diffSkill
- scaffoldSkill
- secrets-scanSkill
- security-headersSkill
- seedSkill
- soft-deleteSkill
- sqlSkill
- squashSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
5 rules. 0 are common, 4 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 5 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 23
Protect sensitive data: Never write secrets, passwords, tokens, or full card/PII into the audit record — store identifiers and redacted …
- Very specific: line 25
Verify: Add tests asserting that a sensitive action writes exactly one audit entry with the right actor/action/target/outcome, that a …
- Distinctive: line 30
Every entry must identify actor, action, target, timestamp (UTC), and outcome using a stable, queryable schema — not free-text prose.
- Distinctive: line 31
Write the audit entry atomically with the state change (same transaction) so records can't silently go missing or lie about rolled-back …
- Distinctive: line 32
Never store secrets or unnecessary PII in the trail.
“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Logger, ORM & auth signals
!grep -rilE "audit|logger|winston|pino|bunyan|structlog|logging|prisma|sequelize|typeorm|sqlalchemy|django|auth|currentUser|req\\.user" --include='*.*' package.json pyproject.toml go.mod Gemfile 2>/dev/null | grep -vE 'node_modules|\.git|dist|build' | head -8
Instructions
Add an audit trail for the actions in $ARGUMENTS. An audit log is a security/compliance record, distinct from debug logging: it must reliably capture who did what to what, when for sensitive operations, and be trustworthy after the fact. Reuse the project's datastore and request/auth context.
Method
- Identify the auditable events. Focus on security- and compliance-relevant actions, not everything: authentication (login success/failure, logout, MFA), authorization changes (role/permission grants, ownership transfers), sensitive data mutations (create/update/delete of protected records), and privileged/admin operations. Reads usually aren't audited unless the data is regulated.
- Capture a complete, structured record per event: the actor (user id + a stable identifier, not just a display name), the action (a stable verb like
user.role.granted), the target (entity type + id), a timestamp (UTC), the outcome (success/failure), and useful context (source IP, request id, before/after for changes). Use a consistent schema so the log is queryable. - Write to an append-only, separate store. Persist audit entries to a dedicated table/stream that the application only ever inserts into — no updates or deletes from app code. Keep it separate from ordinary application logs so retention, access, and integrity can be controlled independently. For stronger tamper-evidence, consider hash-chaining entries or shipping to write-once/external storage.
- Record reliably and in context. Write the audit entry as close to the action as possible — ideally in the same transaction as the state change so a committed change is never missing its audit record (and a rolled-back one leaves no false entry). Emit on failed attempts too (e.g. denied permission changes), since those matter most for security.
- Protect sensitive data. Never write secrets, passwords, tokens, or full card/PII into the audit record — store identifiers and redacted diffs. Balance "enough to reconstruct what happened" against not turning the audit log into a new data-leak surface (see the
secrets-scanandloggingskills). - Set retention and access. Define how long entries are kept (compliance often dictates this) and restrict who can read them. Note the chosen retention window.
- Verify. Add tests asserting that a sensitive action writes exactly one audit entry with the right actor/action/target/outcome, that a failed/denied attempt is also recorded, and that a rolled-back transaction leaves no entry.
Rules
- Audit records are append-only — application code inserts, never updates or deletes; enforce this at the store level where possible.
- Every entry must identify actor, action, target, timestamp (UTC), and outcome using a stable, queryable schema — not free-text prose.
- Write the audit entry atomically with the state change (same transaction) so records can't silently go missing or lie about rolled-back work; record failed/denied attempts too.
- Never store secrets or unnecessary PII in the trail; redact sensitive values and keep the audit log separate from debug logging with its own retention and access controls.
- End by summarizing which events are audited, the record schema, the store and its append-only guarantee, the retention window, and that failure cases are captured.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

