一键导入
privacy-assessment-rails
Assess a Rails app's full codebase for compliance with privacy laws, like GDPR and LGPD. Generates an assessment report, not a legal audit.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Assess a Rails app's full codebase for compliance with privacy laws, like GDPR and LGPD. Generates an assessment report, not a legal audit.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when building Rails features that handle personal data, adding encryption to models, implementing consent flows, building DSAR endpoints, or adding anonymization/pseudonymization. Also use when reviewing code for compliance with privacy laws like GDPR and LGPD, or when asked about privacy-by-design patterns in Rails.
Review uncommitted or recently changed files for privacy-by-design rule violations (based on privacy laws like GDPR and LGPD) before committing.
Autonomous investigation loop for finding and fixing performance issues, intermittent errors, flaky tests, memory leaks, slow operations, and reliability problems. Inspired by Karpathy's autoresearch: makes a change, measures the result, keeps or reverts, logs everything, and keeps going. Run it and walk away - it works until interrupted or the codebase is healthy.
Replace this with a clear description of what the skill does and when to use it. Include keywords that help agents identify relevant tasks.
| name | privacy-assessment-rails |
| description | Assess a Rails app's full codebase for compliance with privacy laws, like GDPR and LGPD. Generates an assessment report, not a legal audit. |
| license | MIT |
| metadata | {"author":"talyssonoc","version":"1.0"} |
| allowed-tools | Bash, Read, Glob, Grep, Write |
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.
Before starting, warn the user: "This assessment is token-intensive — it runs a scanner, then reads and analyzes many files across your codebase. Are you sure you want to proceed?" Wait for confirmation before continuing.
Before running any analysis, ask the user:
Before I begin the assessment, are there any privacy particularities I should know about this application? For example:
- Data that would normally be considered PII but is required by regulation (e.g., storing full IP addresses for legal compliance, retaining financial records for tax purposes)
- Special categories of data the app handles (health data, biometric data, data from minors)
- Third-party services that are contractually authorized to receive certain PII
- Known trade-offs or accepted risks the team has already evaluated
- Any other domain-specific context that might affect the assessment
- What markets/countries does this application serve? (e.g., "Brazil only", "EU and US", "Global", specific country names). This determines which privacy regulations and government document types are relevant for PII classification.
Wait for the user's response. Store their answers as context — this may affect severity ratings, whether certain findings are flagged, and what recommendations are appropriate.
The generated report must begin with the following note, placed before the Disclaimer:
Note: This report was generated by an AI assistant. You can discuss any finding with the agent — ask for more context, challenge a severity rating, provide additional information about your use case, or request that findings be re-evaluated. The agent can also help you prioritize and implement the recommended fixes.
The generated report must also include the following disclaimer, placed before the Executive Summary:
Disclaimer: This report is a technical codebase analysis produced by an automated tool and AI assistant. It does not constitute legal advice, has no legal validity, and does not bind Codeminer42 or any party to its findings. This report should not be used in court or as evidence of compliance or non-compliance. All legal matters related to data protection, GDPR, LGPD, or any other privacy regulation should be discussed with a qualified lawyer.
If ruby is not found when running the commands below, ask the user how to run Ruby in their environment instead of trying to resolve it yourself.
Run the scanner to get a mechanical baseline. Include the --markets flag with the markets the user provided in Step 0 (e.g., br for Brazil, eu for EU, us for US — comma-separated for multiple):
ruby ${CLAUDE_SKILL_DIR}/../privacy-by-design-rails/scripts/scanner.rb --markets <markets>
The scanner outputs JSON. Parse it to extract:
findings — pre-filled findings with severity, location, and confidence. Flag any medium-confidence findings for verification in Step 2.inventory — the scanner enumerates models, mailers, mailer templates, jobs, controllers, services, initializers, schema tables with PII columns, ransackable models, audit declarations, external API calls, and JSON endpoints. Use this inventory as the starting point for A3 in Step 2a — only supplement with manual discovery if you notice gaps.checklist — boolean pass/fail/null for each privacy check. You will update these during Step 2.Read ${CLAUDE_SKILL_DIR}/assessment-reference.md. The analysis proceeds in two mandatory passes:
Process checklist items A1 through A4 only. This builds your complete codebase inventory and verification matrix.
references/pii-definition.md.When A4 is complete, verify: does every model from the A3 enumeration that has PII columns have a row in the matrix? If not, go back and add the missing rows.
Process checklist items B1 through I2 sequentially. For each item:
encrypts?, B3 updates filter_attributes?, F1 updates ransackable reviewed?)Additionally:
${CLAUDE_SKILL_DIR}/../privacy-by-design-rails/rules/ and references in ${CLAUDE_SKILL_DIR}/../privacy-by-design-rails/references/ for correct patterns and context.Before proceeding to Step 3, verify ALL of the following. If any check fails, go back and fill the gap.
Only proceed to Step 3 when all checks pass.
Merge scanner findings with your deep-dive findings into a single report.
For every finding, include:
rules/file:lineImportant: For every recommended fix that includes code, read the corresponding reference file in ${CLAUDE_SKILL_DIR}/../privacy-by-design-rails/references/ and verify the API calls and configuration patterns are correct. Do not write library API calls from memory — copy patterns from the reference docs.
To ensure consistent finding counts across runs, follow these grouping rules:
ApplicationJob), plus one per child that explicitly re-enables. Dismiss children that inherit from a protected base.audited gem = 1 finding covering all affected columns).During Step 2a (Discovery Pass), collect all identified PII fields into a single PII master list. Reuse this exact list consistently across all remediation recommendations — filter_parameters, scrub_fields, filter_attributes, and ransackable_attributes exclusions should all reference the same canonical set of PII field names.
When writing recommended fixes, follow these defaults for consistency:
audited gem: Always recommend an allowlist approach (audited only: [...]) over expanding the denylist (except: [...])filter_parameters: Always list specific field names (e.g., :email, :name, :cpf). Never use regex patterns or partial-match wildcards.ransackable_attributes: Always recommend a minimal allowlist of only the fields genuinely needed for admin search.scrub_fields (error reporters): Include all fields from the PII master list.When the user confirms an external integration is authorized (Step 0), it must still be a numbered finding — never a separate "Accepted Trade-Offs" or "Context-Dependent" section. Handle as follows:
Within each severity level, order findings using these categories. When multiple findings share a category, use alphabetical order by model/service name as the tiebreaker:
Use severity-prefixed sequential numbers: C-1, C-2, ... for critical, H-1, H-2, ... for high, M-1, M-2, ... for medium. Do not use plain sequential numbers (1, 2, 3, ...) or unprefixed labels. Use this format in headings (#### Finding C-1: ...), cross-references, and the recommendations section.
Dismissed findings (false positives from the scanner) should not be counted in the totals. List them in a separate "Dismissed Findings" section after the severity sections. Each dismissed scanner finding must appear as a separate row in the Dismissed Findings table, even if multiple findings share the same dismissal reason. Do not group or summarize dismissed findings — one row per scanner finding.
The final report must use exactly these sections in this order: Header → Note → Disclaimer → Executive Summary → Findings by Severity → Dismissed Findings → Checklist Summary → Recommendations. The Note and Disclaimer (defined in Step 0) are inserted between the Header and Executive Summary. Do not add, rename, or reorganize sections beyond this. Specifically, do not create ad-hoc sections such as "Context-Dependent Findings", "Accepted Trade-Offs", "Team Evaluation Required", "PII Field Inventory", "User-Provided Context", or "Domain Context". User-provided context from Step 0 should inform finding descriptions and recommended fixes, not get its own section. All findings go in the numbered findings list under their severity.
Ask the user where to save the report (default: privacy-assessment.md at project root).
Then offer fix plan strategies:
For encryption changes on existing data, reference ${CLAUDE_SKILL_DIR}/../privacy-by-design-rails/references/encryption.md for brownfield migration phases.