Communitygithub.com

GDPR 合规

实现数据删除、同意追踪、PII 匿名化及数据可移植性,确保 GDPR 合规。

GDPR 合规 是什么?

该技能为 AI 代理(如 Claude Code、Cursor 或 Codex)提供一套全面的 GDPR 合规规则与实现指南。它涵盖了 GDPR 的核心要求,包括:提供数据删除端点(被遗忘权)、追踪用户对特定政策版本的明确同意、在分析和日志中匿名化个人身份信息(PII)、实现数据导出端点(可移植性)、显示 Cookie 同意横幅、链接隐私政策、维护 PII 访问审计日志,并建立 72 小时违规通知流程。该技能通过 TypeScript 代码示例展示了如何使用 Koa/Express 风格框架实现数据删除和同意记录端点。支持所有面向欧盟用户的 Web 应用平台,无论其公司所在地。其核心价值在于将复杂的法律合规要求转化为可执行的开发规则和代码模式。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/YepAPI/skills/tree/HEAD/skills/gdpr-compliance

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

GDPR 合规 是做什么的?

规则

  • 实现数据删除端点(被遗忘权):根据请求删除或匿名化所有用户 PII
  • 使用时间戳追踪明确同意:记录用户同意内容、时间及政策版本
  • 在分析和日志中匿名化 PII:使用不透明 ID,绝不使用原始电子邮件或姓名
  • 实现数据导出端点(可移植性):以 JSON 或 CSV 格式返回所有用户数据
  • 显示 Cookie 同意横幅:在用户选择加入之前,不加载任何跟踪脚本
  • 在每个包含数据收集表单的页面上链接到隐私政策
  • 维护 PII 访问审计日志:记录谁查看了哪些个人数据以及查看时间
  • 72 小时违规通知:准备记录在案的处理流程和联系人名单
// 数据删除端点
app.delete("/api/user/data", requireAuth, async (req, res) => {
  const userId = req.user.id;
  await db.transaction(async (tx) => {
    await tx.delete(userProfiles).where(eq(userProfiles.userId, userId));
    await tx.delete(userSessions).where(eq(userSessions.userId, userId));
    await tx.update(users).set({
      email: `deleted_${userId}@anonymized.local`,
      name: "Deleted User",
      deletedAt: new Date(),
    }).where(eq(users.id, userId));
  });
  await auditLog("user_data_deleted", { userId, requestedBy: userId });
  res.json({ success: true });
});
// 同意追踪
const consentSchema = z.object({
  marketing: z.boolean(),
  analytics: z.boolean(),
  policyVersion: z.string(),
});

app.post("/api/consent", requireAuth, async (req, res) => {
  const consent = consentSchema.parse(req.body);
  await db.insert(consentRecords).values({
    userId: req.user.id,
    ...consent,
    consentedAt: new Date(),
    ipAddress: req.ip,
  });
  res.json({ success: true });
});

避免

  • 软删除用户数据而不实际移除 PII —— “已删除”用户的电子邮件仍留在数据库中
  • 在获得 Cookie 同意之前加载 Google Analytics 或跟踪像素
  • 在分析事件或应用程序日志中存储原始电子邮件
  • 没有数据导出机制 —— 用户对其数据拥有合法权利
  • 假设 GDPR 仅适用于欧盟公司 —— 它适用于任何为欧盟用户服务的应用程序

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

YepAPI/skills

WCAG 2.1 AA — semantic HTML, keyboard navigation, screen readers.

YepAPI/skills

Experiment setup, variant splitting, statistical significance, and feature flag integration.

YepAPI/skills

CRUD generators, data tables, user management, role-based access, and bulk operations.

YepAPI/skills

Monitor what ChatGPT and Gemini say about your brand using YepAPI.

YepAPI/skills

Queue workers with BullMQ/Inngest/Trigger.dev, job retries, dead letter queues, concurrency.

YepAPI/skills

Commander.js, interactive prompts with Clack, spinners, colors, config files, exit codes, and npm publishing.

YepAPI/skills

cmdk integration, Cmd+K trigger, fuzzy search, grouped actions, keyboard navigation, and dynamic action registration.

YepAPI/skills

Content planning with trend and sentiment data from YepAPI.

YepAPI/skills

Content calendar, keyword-driven planning, and content briefs.

YepAPI/skills

Theme switching with CSS variables, system preference detection, next-themes, and persistence.

YepAPI/skills

Threaded comments, @mentions, reactions, moderation queue, optimistic UI, and cursor pagination.

YepAPI/skills

Competitive analysis between domains using YepAPI.

YepAPI/skills

Layout grids, KPI cards, data tables with sorting/filtering, sidebar navigation, and responsive breakpoints.

YepAPI/skills

Data encryption — TLS everywhere, AES-256-GCM for PII, bcrypt passwords, encrypted backups.

YepAPI/skills

Chart patterns with Recharts/Nivo/D3, responsive containers, color scales, and accessibility.

YepAPI/skills

Drizzle schema definition, push vs migrate, type-safe queries, relations, transactions, and prepared statements.

YepAPI/skills

Upload handling, resize/compress, CDN delivery, blur placeholders, and next/image patterns.

YepAPI/skills

Local business and Google Maps research using YepAPI.

YepAPI/skills

Cursor-based pagination, IntersectionObserver, virtualized lists with @tanstack/react-virtual, and scroll position restoration.

YepAPI/skills

Chat UI components, streaming responses with AI SDK, context window management, and RAG patterns.

相关技能