legal-safety-audit
Skill11 starsChanged 12 days agoMITView on GitHub
Legal and compliance safety audit for an app so it does not get sued. Generates privacy policy, terms of service, refund, cookie policy plus consent banner and email footer drafts, and audits the app for consent, data minimization, third-party SDKs, dark patterns, hidden fees, fake reviews, unsupported claims, accessibility (alt text, contrast, keyboard), kids-data consent, and data-deletion. Use whenever the user says compliance audit, legal review, "won't get sued", GDPR, CCPA, COPPA, privacy policy, terms of service, cookie consent, dark patterns, accessibility audit, or data deletion request.
In this repository44 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- analyze-dataSkill
- brainstormingSkill
- craft-lessonSkill
- create-agentSkill
- create-skillSkill
- customize-agentSkill
- customize-skillSkill
- designSkill
- deslopSkill
- developSkill
- discovery-reportSkill
- elicitationSkill
- empathy-mapSkill
- explore-ideaSkill
- grill-meSkill
- help-meSkill
- humanizeSkill
- incidentSkill
- iterateSkill
- journey-mapSkill
- jtbdSkill
- kanbanSkill
- launchSkill
- maintenance-executeSkill
- maintenance-planSkill
- memorySkill
- motionSkill
- phaseSkill
- planSkill
- research-planSkill
- retroSkill
- reviewSkill
- root-causeSkill
- round-tableSkill
- shape-upSkill
- shut-upSkill
- statusSkill
- teach-meSkill
- testSkill
- unpack-problemSkill
- validate-ideaSkill
- validation-patternsSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
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 74
When inspection is inconclusive (e.g.
- Distinctive: line 78
Run Phase B before Phase A because the documents depend on audit findings (A1 privacy policy needs the B2 data inventory + B3 SDK …
- Very specific: line 92
Before writing, run the G4 redaction pass: scan all findings and ensure no captured personal-data value appears — field names only.
- Distinctive: line 142
Silent skips: Every skipped check is disclosed with reason + evidence (G6).
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Legal Safety Audit — compliance drafts + app audit
What this skill does
Runs a two-phase legal-risk sweep for an app. Phase A generates the 7 legal documents an app needs (privacy policy, terms, refund, cookie policy, consent banner, business details, email footer). Phase B audits the existing app across 13 checks and proposes fixes (20 checks total across both phases). It resolves the user's region first, tests each check for applicability before running it, and produces one consolidated report.
It orchestrates existing agents rather than re-implementing their expertise: @technical-writer drafts documents, @security-engineer audits data/SDKs/deletion/kids-data, @product-designer and @ux-researcher audit dark patterns and accessibility, @code-reviewer enforces fixes.
When to use
- "Audit my app so I don't get sued"
- "Draft my privacy policy / terms of service / cookie policy"
- "Check my app for GDPR / CCPA / COPPA compliance"
- "Find dark patterns / hidden fees / accessibility problems"
- "Do I need a cookie consent banner / data deletion flow?"
When NOT to use
- For actual legal sign-off — this produces drafts and flags, never legal advice. Route final review to a lawyer.
- For building a persistent compliance advisor persona (that would be an agent, backlogged as
@legal-counsel; see plan 02t). - For general security review unrelated to legal risk (use
@security-engineerdirectly).
Prerequisites
- Access to the app's codebase (for Phase B code inspection).
- The user available to answer the Step-0 app-profile intake.
References
references/jurisdiction-map.md— which legal regime drives each check, by region.references/applicability-map.md— the applies-when / skip-when test per check, with interview + code signals.references/checklist.md— the 20 checks in Phase A/B, owning agents, output shapes, guardrail semantics.
Guardrails (non-negotiable)
| # | Guardrail |
| G1 | Every generated legal document carries a DRAFT — requires human/lawyer review header. Never mark a legal doc "done". |
| G2 | Fake reviews, hidden fees, and unsupported claims are FLAGGED with evidence, never deleted or asserted as fact. The owner confirms. |
| G3 | Resolve the user's region(s) in Step 0 before any check runs. No hardcoded jurisdiction default. |
| G4 | Never echo captured PII. Reference form fields by name, not by value. |
| G5 | Test each check for applicability before running it. Skip checks that do not apply. |
| G6 | Every skipped check is disclosed in the report with its reason and the evidence behind the decision. Never skip silently. |
Workflow
Step 0 — Region + app-profile gate (non-skippable)
- Resolve region(s) — ask the user where their users are. This is why the frontmatter declares a question tool: a harness that reads
allowed-toolsrestricts the skill to what it declares, and this step cannot be skipped by guessing — the wrong region produces the wrong jurisdiction's documents. Load the matching regime(s) fromreferences/jurisdiction-map.md. Multi-region loads the union. Do not assume a default (G3). - Capture the app profile via the intake in
references/applicability-map.md(platform, monetization, audience, email, SDKs, reviews, sector, size). - Corroborate the profile with code inspection — grep dependency manifests for analytics/ad SDKs, look for payment integrations, forms, age gates, deletion endpoints. Where code and interview disagree, trust code and flag it (D6).
Halt if region is unresolved. Everything downstream depends on it.
Step 1 — Build the applicability plan
For each of the 20 checks, run its applies-when / skip-when test (applicability-map.md) against the Step-0 profile + code signals. Produce two lists:
- Will run — checks that apply, with the evidence.
- Will skip — checks that do not apply, each with a reason + evidence (held for the G6 report section).
When inspection is inconclusive (e.g. a possibly dynamically-loaded SDK), do NOT skip — mark "possibly applies, unconfirmed" and surface it.
Step 2 — Phase B first (audit), then Phase A (generate)
Run Phase B before Phase A because the documents depend on audit findings (A1 privacy policy needs the B2 data inventory + B3 SDK inventory).
Phase B — Audit & Remediate (checks B1–B13 in references/checklist.md):
- Delegate each check to its owning agent's expertise.
- Produce findings with evidence + a proposed fix.
- For B7/B8/B9 (hidden fees / fake reviews / unsupported claims) and B13 (licensing), FLAG ONLY (G2) — never delete, never assert falsity.
- G4 enforcement — redaction rule (mandatory). When a finding references a form field, database column, or captured input, record only the field/column name and its type (e.g. "field
email— collected without consent checkbox"). Never copy a captured value, sample row, log line, or user record into the finding. Before Step 3 writes the report, scan every finding and replace any concrete personal-data value with its field name. If a value cannot be safely abstracted, drop it and note "value withheld (G4)".
Phase A — Generate (documents A1–A7 in references/checklist.md):
- Draft each applicable document with
@technical-writer, feeding in the Phase-B inventories. - Stamp every document with the
DRAFT — requires human/lawyer reviewheader (G1).
Step 3 — Consolidated report
Before writing, run the G4 redaction pass: scan all findings and ensure no captured personal-data value appears — field names only. Then emit one report using the shape in references/checklist.md:
- Ran — applicable checks with findings + proposed fixes/drafts.
- Skipped (with reason + evidence) — the G6 table.
- Flagged for owner decision — G2 suspects (not acted on).
- Legal review required — every generated DRAFT document.
Open the report with one plain sentence stating overall risk posture and how many checks ran vs skipped vs flagged (DNA 8).
Done when — checked mechanically
Six guardrails and 20 checks were specified in prose, and almost none could be falsified. Nothing checked that all 20 checks were accounted for, so G6 — "never skip silently" — was a promise rather than a property: an audit could run two checks, skip eighteen without a word, and satisfy every written rule.
node .agents/scripts/legal_safety_audit_check.js check \
--report artifacts/output/legal-safety-audit/audit-report.md \
--drafts artifacts/output/legal-safety-audit/drafts --jsonIt checks four invariants that are genuinely mechanical:
| Guardrail | Check |
| G1 | every generated document carries the DRAFT — requires human/lawyer review header, and none is marked final/approved/done |
| G3 | the report names the region(s) it resolved — there is no default to fall back on |
| G5/G6 | all 20 checks (A1-A7, B1-B13) are accounted for as ran, skipped, or flagged; none appears as both |
| G6 | every skipped check carries a reason and evidence, not a bare id |
What it does not check: whether a legal judgement was correct, whether a finding is real, or whether the drafts are adequate. Those need a lawyer, and G1's own header says so on every document. A green result means the audit was conducted and disclosed completely — nothing more.
Exit 0 conformant · 1 failures · 2 usage/IO error, fail-closed.
Output Artifacts
artifacts/output/legal-safety-audit/audit-report.md— the consolidated report.artifacts/output/legal-safety-audit/drafts/— the Phase-A DRAFT documents.
Anti-patterns
- Running all 20 checks blind. Generating a cookie policy for a cookieless native app or a refund policy for a free app is noise that misleads. Always run the applicability gate (G5).
- Marking a legal document "done". It is always a DRAFT for human/lawyer review (G1).
- Deleting a "fake" review or "unsupported" claim. The skill lacks ground truth; it flags with evidence and the owner decides (G2).
- Silent skips. Every skipped check is disclosed with reason + evidence (G6).
- Re-implementing domain expertise inline. Delegate to the owning agent; keep this skill an orchestrator (D3).
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.

