---
name: build-gdpr-friendly-features
description: Builds features that store personal data with a stated purpose, a retention date, and a path to export or erase a person. Not legal advice. Use when the user wants GDPR-friendly data handling, a deletion job for personal data, or retention on a new field.
license: MIT
metadata:
  category: backend
  tags: "gdpr,privacy"
  author: johnny-bravo
  version: "1.0"
  updated: "2026-11-15"
  status: published
  aliases: "gdpr-compliant, retention, erasure, data minimization, export personal data"
  source_url: "https://github.com/github/awesome-copilot/tree/5269f7ea2d6c3a9bfda5ed878b6726cf509121fd/skills/gdpr-compliant"
  source_license: MIT
  copyright: "Copyright GitHub, Inc."
  original_author: "GitHub awesome-copilot contributors (gdpr-compliant)"
  modified: "Adapted by TheSkillVault: rewritten as a feature checklist (purpose, retention, export and erasure, logs, fake test data); dropped the cloud catalogue, RoPA forms and encryption tables; noted it is not legal advice and not a brochure privacy page."
  imported_on: "2026-11-15"
---

# Build GDPR-friendly features

Use this when a feature stores personal data. It is an engineering checklist. It is not legal advice, and it is not a page of policy text for a brochure site.

## When to use
- A new feature will store personal data.
- You need a retention date and a way to erase or export one person.
- You are about to log, test, or forward that data.

## When not to use
- You need a public notice page and simple visitor counts. Use add-analytics-and-privacy-policy.
- You want a general security pass. Use audit-app-security.
- The only task is where an API key lives. Use set-up-env-variables-and-secrets.

## Steps
1. List each field and why you need it today. Drop a field you cannot justify. Do not collect it for later.
2. Default optional collection to off. The person opts in.
3. Set a retention end when you insert the row. A scheduled job deletes or anonymizes it after that date. Do not rely on memory.
4. Keep personal data out of URLs and query strings. Logs and browser history keep those.
5. Log the event and an internal id. Do not log an email address, the old value and the new value, a password, a token, or a card number.
6. Authenticate every route that reads or changes this data. Check that the caller owns the row. Use an opaque id in the public URL, not a counter people can guess.
7. Add the new fields to export and to erasure. If you must keep a record, anonymize it. Do not call it anonymous when it can still be linked.
8. Use fake data in development, test and CI. Do not restore a production backup there until personal data is gone. Use an example.com address.
9. Hash passwords with Argon2id or bcrypt. Do not use MD5 or a plain SHA hash.
10. Stop for a real review before high-risk work. That includes health data, biometrics and large-scale profiling. This page cannot approve that.

These retention spans are starting points from the source, not a legal limit.
- Auth and audit logs: 12 to 24 months.
- Session tokens: 30 to 90 days.
- Inactive accounts: warn, then delete, about 12 months after the last login.

## Gotchas
- A notice that says you never share data is false if this feature shares it.
- Personal data in a GET query is copied into logs. Put it in the body or the session.
- A soft delete is not erasure. Schedule a real delete after the request window.
- A production dump in CI leaks data. Scrub it, or do not load it.
- Keep secrets in a secret store. Do not commit them next to this feature.

## Portability
Works with any framework and any database. The cleanup job can be cron or a queue. If you use a cloud store, encrypt in transit and at rest, and write down the region. A brochure notice page is a different skill.

## Done when
- Every new field has a purpose and a retention end.
- Export and erasure include the new store.
- Logs and URLs do not hold the personal data.
- Dev and CI use fake data, and no secret is in the repo.
- Nobody treated this checklist as legal advice.

## Example prompt
"Add GDPR-friendly retention and erasure for the new profile fields. Do not log the email. Use fake data in tests. This is not a notice-page task."

---
Adapted from "gdpr-compliant" in github/awesome-copilot (MIT, Copyright GitHub, Inc.). See LICENSE.txt.
