Agent skill
legal-sanity
Scan code for client project names, proprietary tool references, and legally sensitive content
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/legal-sanity
SKILL.md
Legal Sanity Skill
Version: 1.0.0 Category: Workspace Trigger: Before PRs, after code porting, on demand
Quick Start
# Scan a specific submodule
./scripts/legal/legal-sanity-scan.sh --repo=worldenergydata
# Scan all submodules
./scripts/legal/legal-sanity-scan.sh --all
# Scan only git-changed files (fast mode for PRs)
./scripts/legal/legal-sanity-scan.sh --repo=worldenergydata --diff-only
# JSON output for automation
./scripts/legal/legal-sanity-scan.sh --repo=worldenergydata --json
When to Use
- After code porting: Any time code is imported from a client project
- Before PR creation: Automated via pr-manager pre-hooks
- During cross-review: Runs as a mandatory pre-gate before Codex/Gemini
- On demand: When adding new deny-list patterns or auditing repos
How It Works
- Deny lists define patterns to block:
- Global:
.legal-deny-list.yaml(workspace root) - Per-project:
<submodule>/.legal-deny-list.yaml
- Global:
- Scanner merges both lists and runs
rg(ripgrep) against the target - Exclusions skip files like
.git/,*.md,*.lock - Exit code: 0 = pass, 1 = block violations found
Deny List Format
version: "1.0"
updated: "2026-02-02"
client_references:
- pattern: "CLIENT_NAME"
case_sensitive: true
description: "Why this is blocked"
proprietary_tools:
- pattern: "ToolName"
case_sensitive: false
description: "Client proprietary tool"
exclusions:
- ".legal-deny-list.yaml"
- ".git/"
default_severity: "block"
Execution Checklist
When invoked as a skill:
- Identify target scope (specific repo, all repos, or diff-only)
- Run the scan script with appropriate flags
- If violations found:
- List each violation with file:line detail
- Suggest replacement text
- Block PR creation until resolved
- If clean:
- Report PASS
- Proceed to next review gate
Output Format
Terminal (default)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Legal Sanity Scanner
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Scanning: worldenergydata
RESULT: PASS — no violations found
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
JSON (--json)
{"repo":"worldenergydata","pattern":"ENIGMA","file":"src/main.py","line":42,"severity":"block"}
Related
- Rule file:
.claude/rules/legal-compliance.md - Workflow:
.claude/skills/_internal/workflows/legal-sanity-review/SKILL.md - Cross-review:
.claude/skills/_internal/workflows/cross-review-policy/SKILL.md
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?