hashgraph-online/awesome-codex-plugins / plugins/AltByteSG/personal-data-protection-skill/skills/personal-data-protection
personal-data-protection
VerifiedPersonal-data-protection compliance reference for engineers building applications subject to Singapore PDPA, Indonesia UU PDP, Thailand PDPA, Malaysia PDPA, Philippines DPA (RA 10173), or Vietnam PDPL (91/2025/QH15). Use when reviewing or modifying code that touches personal data — signup/auth/consent, data export, account deletion, retention/purging, admin access to personal-data stores, third-party processors, breach response, or privacy/T&C documents.
templates/pdp-nudge.sh.template
View on GitHub#!/bin/sh
# Reference material only — not legal advice. See ../DISCLAIMER.md. Verify with a qualified DPO / lawyer.
# Personal Data Protection compliance nudge — fired by .claude/settings.json PostToolUse hook on
# Edit/Write/MultiEdit. If the edited file matches a PDP-sensitive path, emit
# a stderr line that lands in the conversation, prompting Claude to consult
# the `personal-data-protection` skill before finalising.
#
# Non-blocking: never exits non-zero. False negatives are preferred to false
# positives that train Claude to ignore the channel.
#
# SETUP (Claude Code only — no Codex CLI equivalent at time of writing):
#
# 1. Copy this file to your project:
# cp templates/pdp-nudge.sh.template .claude/hooks/pdp-nudge.sh
# chmod +x .claude/hooks/pdp-nudge.sh
#
# 2. Customise the path patterns below to match your repo's PDP-sensitive
# paths (the defaults are illustrative).
#
# 3. Wire it into .claude/settings.json:
# {
# "hooks": {
# "PostToolUse": [
# {
# "matcher": "Edit|Write|MultiEdit",
# "hooks": [
# {
# "type": "command",
# "command": "\"$(git rev-parse --show-toplevel)/.claude/hooks/pdp-nudge.sh\" || true"
# }
# ]
# }
# ]
# }
# }
f="${TOOL_INPUT_file_path:-}"
[ -z "$f" ] && exit 0
nudge() {
printf '[pdpa-nudge] %s\n' "$1" >&2
}
skill_msg='Touched a PDP-sensitive path — consult skill `personal-data-protection` (.claude/skills/personal-data-protection/SKILL.md) before finalising. Match the change against the relevant layer + the active jurisdiction(s) obligation files.'
case "$f" in
# ─── Public-facing legal documents ──────────────────────────────
# Customise to your project's privacy policy / terms paths.
*/privacy.html|*/PRIVACY.md|*/terms.html|*/TERMS.md|*/_headers)
nudge "$skill_msg Layer: 06-disclosure. Verify sub-processors, retention table, and the 'Last updated' date." ;;
# ─── Auth + signup surface ──────────────────────────────────────
# Customise to your project's auth / signup screen paths.
*/auth_gate.dart|*/SignupScreen.tsx|*/signup_screen.dart|*/auth/login.tsx|*/auth/signup.tsx)
nudge "$skill_msg Layer: 05-feature-ux (signup, OAuth, age gate, T&C consent)." ;;
# ─── Settings + account-deletion screens ────────────────────────
*/settings/*|*/account/delete*|*/account/export*)
nudge "$skill_msg Layer: 05-feature-ux. Verify withdrawal symmetry and consent record write paths." ;;
# ─── Server-side functions / handlers (PDP-sensitive) ──────────
# Customise to your project's structure. Examples:
# - Supabase Edge Functions: */supabase/functions/*/index.ts
# - AWS Lambda handlers: */lambda/*.py, */lambda/*.ts
# - Express / Fastify routes: */routes/*.ts, */api/*.ts
# - Rails controllers: */app/controllers/**/*.rb
# - Django views: */views/*.py
*/functions/*/index.ts|*/lambda/*.py|*/lambda/*.ts|*/api/*.ts|*/routes/*.ts)
nudge "$skill_msg Layer: 04-controls-and-processes. Verify console / log calls run user data through safeError() / redactPII() / redactId() helpers." ;;
# ─── Admin tooling ──────────────────────────────────────────────
*/admin/*|*/internal/*)
nudge "$skill_msg Layer: 04-controls-and-processes. Admin role check at every layer. Read endpoints returning PII must be audit-logged with throttle." ;;
# ─── SQL migrations — only nudge when content suggests personal-data-protection touch
# Customise to your project's migration directory.
*/migrations/*.sql|*/db/migrate/*.sql|*/migrations/*.rb)
if grep -qiE 'consent|delete_account|export_user_data|retention|cleanup_|audit_log|notifications_enabled|email_notifications|tos_version|deleted_accounts|admin_get_|admin_update_|admin_delete_|location|latitude|longitude|birthday|RLS|SECURITY DEFINER|search_path' "$f" 2>/dev/null; then
nudge "$skill_msg Layer: 03-data-model + 04-controls-and-processes. Verify: per-user isolation enabled on new tables, audit logging on admin endpoints, retention rule wired into the canonical sweep, backwards-compat for any in-flight client versions."
fi ;;
esac
exit 0
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirements | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |