Privacy By Design Rails logo

Privacy By Design Rails

Organization
Codeminer42
privacy-by-design-rails

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.

Overview

PublisherCodeminer42
Repositoryskills
Skill nameprivacy-by-design-rails
Stars
33
Forks
2
Bundled files
36
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 36 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by Codeminer42 on GitHub. Read the source before you install it.

Installation

Install the Privacy By Design Rails AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/Codeminer42/skills/tree/main/privacy-by-design-rails
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Codeminer42/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/privacy-by-design-rails .claude/skills/privacy-by-design-rails
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Privacy By Design Rails in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Privacy By Design Rails on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Privacy By Design Rails is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Privacy by Design with Rails 8

When generating or reviewing code that handles personal data, run the scanner first: ruby .claude/skills/privacy-by-design-rails/scripts/scanner.rb --files <relevant files>

For deeper context on any topic, read the relevant reference file from references/.

What counts as PII? Any data that can identify a person directly or indirectly (GDPR Art. 4, LGPD Art. 5, NIST SP 800-122). This includes data that isn't identifying alone but becomes PII when linked to a person — farm names, animal names with known owners, license plates, vehicle VINs, student IDs, property addresses, social media handles, company names of sole proprietors, device IDs linked to accounts, IP addresses. See references/pii-definition.md for the full definition and linkability test. When in doubt, treat it as PII.

Quick Reference

PrincipleRails FeatureFile
Log + inspect filteringconfig.filter_parameters (covers both)references/log-and-output-protection.md
Per-model PII declarationself.filter_attributes (self-documenting)references/log-and-output-protection.md
Job arg protection (ActiveJob)self.log_arguments = false (set in ApplicationJob)references/log-and-output-protection.md
Job arg protection (Sidekiq)Server middleware + pass IDs onlyreferences/log-and-output-protection.md
PII redaction in logslogstop gemreferences/log-and-output-protection.md
IP anonymizationip_anonymizer middlewarereferences/log-and-output-protection.md
Error reporter scrubbingScrub PII from Sentry/Rollbar/etc.references/log-and-output-protection.md
APM/monitoring scrubbingScrub PII from AppSignal/NewRelic/etc.references/log-and-output-protection.md
Data minimizationStrong parameters + serializersreferences/data-minimization.md
Searchable encryptionencrypts :field, deterministic: truereferences/encryption.md
Non-searchable encryptionencrypts :fieldreferences/encryption.md
Password hashinghas_secure_passwordreferences/encryption.md
Key rotationencrypts :field, previous: [...]references/encryption.md
Secrets managementbin/rails credentials:editreferences/secrets-management.md
Security auditingbundler-audit, Brakeman, pdscanreferences/secrets-management.md
HTTPS enforcementconfig.force_ssl = true + HSTSreferences/session-security.md
Session securitySigned cookies / Bearer tokensreferences/session-security.md
Consent managementImmutable append-only audit trailreferences/consent-management.md
Consent enforcementController concern gating actionsreferences/consent-management.md
Consent-gated exportsConsentGatedExportSerializer for processingreferences/consent-management.md
AnonymizationReplace PII with [ANONYMIZED]references/anonymization.md
PseudonymizationHMAC hash preserving analytics linksreferences/pseudonymization.md
DSAR workflowAccess / Rectification / Erasurereferences/dsar.md
Data retentionSolid Queue scheduled jobsreferences/data-retention.md

Putting It All Together — The User Model

ruby
class User < ApplicationRecord
  has_secure_password
  has_many :sessions, dependent: :destroy
  has_many :addresses, dependent: :destroy
  has_many :orders, dependent: :restrict_with_error
  has_many :consents, dependent: :destroy
  has_many :data_subject_requests, dependent: :destroy

  include Anonymizable
  include Pseudonymizable
  include DataExportable
  include HasConsent

  encrypts :email_address, deterministic: true, downcase: true
  encrypts :first_name
  encrypts :last_name
  encrypts :phone
  encrypts :date_of_birth

  self.filter_attributes = %i[
    first_name last_name phone date_of_birth
    email_address password_digest
  ]

  enum :role, { customer: 0, admin: 1 }

  anonymizable :first_name, :last_name, :phone, :date_of_birth
  exportable :uuid, :email_address, :first_name, :last_name, :phone, :date_of_birth

  normalizes :email_address, with: ->(e) { e.strip.downcase }
end

Common Mistakes (not caught by scanner)

MistakeFix
Deleting records with dependents for right to erasurePrefer anonymization when the record has dependents — preserves referential integrity. Some authorities prefer true deletion, so check local requirements
Storing consents as a boolean flagUse immutable append-only records for audit trail
Exposing sequential IDs in APIsUse UUIDs as public identifiers
Manual data retentionAutomate with Solid Queue scheduled jobs

External References

Consult these when you need the latest guidance or to verify patterns against official sources. Use WebFetch when needed — don't fetch all of them upfront.

Rails

GDPR

LGPD (Brazil)

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Privacy By Design Rails AI skill do?

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.

Why use Privacy By Design Rails on TypingMind?

Because you install it once and use it with any model. Privacy By Design Rails is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Privacy By Design Rails in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/Codeminer42/skills/tree/main/privacy-by-design-rails. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Privacy By Design Rails?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Privacy By Design Rails?

As many as you like. As long as a model supports skills, you can use Privacy By Design Rails with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Privacy By Design Rails AI skill free?

Yes. It is published on GitHub by Codeminer42 under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇