privacy-review-rails
Skill32 starsChanged 8 months agoMITView on GitHub
Review uncommitted or recently changed files for privacy-by-design rule violations (based on privacy laws like GDPR and LGPD) before committing.
In this repository9 other files it gives its agents.
- AGENTS.mdAGENTS.md
- adr-setupSkill
- capability-mapSkill
- privacy-assessment-railsSkill
- privacy-by-design-railsSkill
- review-that-runsSkill
- sherlockSkill
- template-skillSkill
- threat-modelSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
17 rules. About 0 are common, 5 are distinctive, and 12 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
12
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 17
If the dependency path above is NOT_FOUND, stop and tell the user:
- Distinctive: line 23
Do not proceed until the dependency is installed.
- Very specific: line 27
If ruby is not found when running the command below, ask the user how to run Ruby in their environment instead of trying to resolve it …
- Very specific: line 29
Run the scanner in --changed-only mode.
- Very specific: line 41
If changed_files is empty, tell the user there are no privacy-relevant changes and stop.
- Very specific: line 48
PII classification: Read the model and its schema columns.
- Very specific: line 51
ransackable_attributes: If the model defines ransackable_attributes, are sensitive fields (encrypted_password, reset_password_token) or PII …
- Very specific: line 54
Read the corresponding model (from related_files) to check if encrypts declarations exist for new PII columns.
- Very specific: line 55
Check if config/initializers/filter_parameter_logging.rb (from related_files) includes the new PII field names.
- Very specific: line 58
Check from: addresses for PII (user emails as sender).
- Distinctive: line 59
Check subject lines for PII (names, emails visible in inbox previews).
- Distinctive: line 60
Check template bodies: distinguish emails sent to OTHER users (violation) vs emails sent to the data subject themselves (acceptable — note …
- Very specific: line 64
Do perform parameters pass PII data instead of record IDs?
- Very specific: line 68
Do render json: responses include PII that shouldn't be exposed?
- Very specific: line 71
If it configures an error reporter (Rollbar, Sentry, Bugsnag): are scrub_fields configured?
- Distinctive: line 86
If no violations, tell the user their changes look privacy-compliant.
- Distinctive: line 90
Ask the user if they want fixes applied.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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
Check Privacy — Review Changed Files
Prerequisite
Dependency path: !test -d "${CLAUDE_SKILL_DIR}/../privacy-by-design-rails" && echo "${CLAUDE_SKILL_DIR}/../privacy-by-design-rails" || echo "NOT_FOUND"
If the dependency path above is NOT_FOUND, stop and tell the user:
This skill depends on privacy-by-design-rails, which is not installed. Install it with:
npx skills add codeminer42/skills --skill privacy-by-design-rails(add-gfor global installation)
Do not proceed until the dependency is installed.
Step 1: Scan Changed Files + Related Files
If ruby is not found when running the command below, ask the user how to run Ruby in their environment instead of trying to resolve it yourself.
Run the scanner in --changed-only mode. This scans the changed files AND automatically pulls in related files (e.g., a changed migration pulls in its model and filter_parameter_logging.rb; a changed mailer template pulls in its mailer class):
ruby ${CLAUDE_SKILL_DIR}/../privacy-by-design-rails/scripts/scanner.rb --changed-onlyParse the JSON output. It includes:
changed_files— files the developer actually modifiedrelated_files— files pulled in for context (not changed, but affected by the changes)findings— scanner findings across both changed and related fileschecklist— privacy checklist status
If changed_files is empty, tell the user there are no privacy-relevant changes and stop.
Step 2: Deep-Dive on Changed Files
The scanner catches mechanical violations. Now verify the findings and check for things the scanner can't detect. For each changed file, apply the relevant checks from ${CLAUDE_SKILL_DIR}/../privacy-by-design-rails/references/pii-definition.md and the rules in ${CLAUDE_SKILL_DIR}/../privacy-by-design-rails/rules/:
For changed models:
- PII classification: Read the model and its schema columns. Apply the Mandatory Classification Rules (Rules 1-4) from
references/pii-definition.mdto classify every column. Don't just rely on the scanner's pattern matching — check for domain-specific fields with non-standard names. - Encryption: Does every PII column have
encrypts? - filter_attributes: Does the model declare
self.filter_attributeslisting all its PII fields? - ransackable_attributes: If the model defines
ransackable_attributes, are sensitive fields (encrypted_password, reset_password_token) or PII fields exposed?
For changed migrations:
- Read the corresponding model (from
related_files) to check ifencryptsdeclarations exist for new PII columns. - Check if
config/initializers/filter_parameter_logging.rb(fromrelated_files) includes the new PII field names.
For changed mailers/templates:
- Check
from:addresses for PII (user emails as sender). - Check subject lines for PII (names, emails visible in inbox previews).
- Check template bodies: distinguish emails sent to OTHER users (violation) vs emails sent to the data subject themselves (acceptable — note with justification).
For changed jobs/workers:
- Does the base class (
ApplicationJob) setself.log_arguments = false? - Do
performparameters pass PII data instead of record IDs?
For changed controllers:
- Is
session[...]assigned a full ActiveRecord object instead of just an ID? - Do
render json:responses include PII that shouldn't be exposed?
For changed initializers:
- If it configures an error reporter (Rollbar, Sentry, Bugsnag): are
scrub_fieldsconfigured? Isanonymize_user_ipenabled? Areperson_*_methodsettings restricted to ID only?
For changed services:
- Does the service send data to an external API? If so, does the payload include PII?
Step 3: Report
Group verified violations by severity (CRITICAL > HIGH > MEDIUM). For each violation:
- Location:
file:line - What's wrong: clear description
- Correct pattern: code example from the relevant rule in
${CLAUDE_SKILL_DIR}/../privacy-by-design-rails/rules/ - Changed vs related: note whether the violation is in a changed file (developer should fix) or a related file (pre-existing issue exposed by the change)
For scanner findings you verified as false positives, briefly explain why you dismissed them.
If no violations, tell the user their changes look privacy-compliant.
Step 4: Offer to Fix
Ask the user if they want fixes applied. Apply unambiguous fixes directly; ask about ambiguous ones (e.g., deterministic vs non-deterministic encryption, whether a field is genuinely PII).
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.

