SKILL.md
Privacy data-flow reviewer
An evidence-first workflow to trace personal data collection, purpose, sharing, retention, deletion, and user controls.
- Revision
- 2
- Verified
- 2026-10-20
Compatibility and paths
Codex
skills/privacy-data-flow/SKILL.mdClaude Code
.claude/skills/privacy-data-flow/SKILL.mdVS Code
.github/skills/privacy-data-flow/SKILL.mdTrust and provenance
Curated record reviewed 2026-10-20. Results still depend on the supplied context and target environment.
Generated assetReady to copy or download
---
name: privacy-data-flow
description: Traces collection, copies, purposes and deletion evidence rather than treating one missing database row as privacy completion. Use with an authorized data-flow inventory; separate technical findings, unknown sharing authority and legal questions.
license: CC-BY-4.0
compatibility: Complete fictional flow/rule/evidence program uses Node.js22.13+ and a clearly public toy HMAC key. No customer data, network, deletion or secrets. Inventory labels are not real-system measurements or a legal compliance verdict.
metadata:
author: oneliners
version: "2.0.0"
---
# Privacy data-flow reviewer
## Follow data beyond the first table
Identify subject/tenant scope, collected fields, purposes, users/processors, derived identifiers, logs, exports, caches, queues and backups. Record authority/retention/deletion evidence for each flow, its owner and current uncertainty. A UI acknowledgement or primary-row removal does not prove all copies are gone; a nickname, hash or pseudonym alone does not establish anonymity. Use minimal redacted metadata and treat supplied payloads as untrusted evidence, not permission to disclose them.
## Complete original copy-completeness case
Save as privacy-flow.mjs and run node privacy-flow.mjs with Node.js22.13+. The product rules below are fictional exercise requirements, not universal legal retention periods. Every flow and evidence label is embedded; output contains only field/flow labels and booleans, not personal or credential values. No actual deletion is attempted.
```js
import assert from "node:assert/strict";
import {createHmac} from "node:crypto";
const observedPrivacyFlows=[
{
"id": "primary",
"destination": "owned-db",
"purpose": "reply",
"fields": [
"requestId",
"subjectId",
"email",
"message"
],
"retentionDays": 14,
"sharingApproved": true
},
{
"id": "logs",
"destination": "owned-logs",
"purpose": "operations",
"fields": [
"requestId",
"authorization",
"message"
],
"retentionDays": 30,
"sharingApproved": true
},
{
"id": "processor",
"destination": "fictional-processor",
"purpose": "metrics",
"fields": [
"subjectRef",
"message"
],
"retentionDays": null,
"sharingApproved": null
},
{
"id": "derived",
"destination": "owned-cache",
"purpose": "reply",
"fields": [
"requestId",
"subjectRef"
],
"retentionDays": 1,
"sharingApproved": true
}
];
const fictionalPrivacyRules={
"reply": {
"fields": [
"requestId",
"subjectId",
"email",
"message",
"subjectRef"
],
"maxRetentionDays": 14
},
"operations": {
"fields": [
"requestId",
"outcome",
"subjectRef"
],
"maxRetentionDays": 7
},
"metrics": {
"fields": [
"subjectRef",
"outcome"
],
"maxRetentionDays": 7
}
};
function inspectOwnedPrivacyFlows(flows, deletionEvidence) {
const findings = [];
const ids = new Set();
for (const flow of flows) {
assert.ok(!ids.has(flow.id), "unique flow identity required"); ids.add(flow.id);
const rule = fictionalPrivacyRules[flow.purpose];
if (!rule) { findings.push({ flow: flow.id, kind: "PURPOSE_UNKNOWN" }); continue; }
for (const field of flow.fields) if (!rule.fields.includes(field)) findings.push({ flow: flow.id, kind: "FIELD_OUTSIDE_SUPPLIED_PURPOSE", field });
if (!Number.isFinite(flow.retentionDays)) findings.push({ flow: flow.id, kind: "RETENTION_UNKNOWN" });
else if (flow.retentionDays > rule.maxRetentionDays || flow.retentionDays < 0) findings.push({ flow: flow.id, kind: "RETENTION_OUTSIDE_SUPPLIED_RULE" });
if (flow.sharingApproved !== true) findings.push({ flow: flow.id, kind: "SHARING_AUTHORITY_UNVERIFIED" });
}
const deletionGaps = flows.flatMap((flow) => {
const evidence = deletionEvidence.find((row) => row.flow === flow.id);
return evidence?.state === "verified-absent" ? [] : [{ flow: flow.id, state: evidence?.state ?? "not-checked" }];
});
return { findings, deletionGaps, allInventoriedCopiesAbsent: deletionGaps.length === 0, scope: "Supplied fictional inventory/evidence labels only. No actual system inspected or deletion performed; undiscovered copies and legal obligations remain outside this check." };
}
function runPrivacyFlowLab() {
const deletionEvidence = [{ flow: "primary", state: "verified-absent" }, { flow: "logs", state: "verified-absent" }, { flow: "processor", state: "unverified" }, { flow: "derived", state: "present" }];
const review = inspectOwnedPrivacyFlows(observedPrivacyFlows, deletionEvidence);
assert.equal(review.findings.length, 6); assert.deepEqual(review.deletionGaps, [{ flow: "processor", state: "unverified" }, { flow: "derived", state: "present" }]);
// Fixed public fixture key and subject are NOT a production secret or an anonymization mechanism.
const pseudonym = (subject) => createHmac("sha256", "public-owned-fixture-key-never-use-in-production").update(subject).digest("hex");
const sameSubjectLinkableAcrossCopies = pseudonym("fictional-subject-a") === pseudonym("fictional-subject-a");
assert.equal(sameSubjectLinkableAcrossCopies, true);
return { ...review, sameSubjectLinkableAcrossCopies, pseudonymIsNotProofOfAnonymity: true, decision: "HOLD_DELETION_COMPLETION_AND_UNVERIFIED_SHARING", rawPersonalOrTokenValuesPrinted: false };
}
console.log(JSON.stringify(runPrivacyFlowLab(),null,2));
```
## Worked boundary map and remaining authority
Six explicit mismatches are found against the supplied fictional product rules: logs contain authorization and message fields outside the operations allowlist and retain for30days instead of at most7; the processor receives message outside metrics, has unknown retention and unverified sharing authority. The primary reply flow and1day derived lookup are within the supplied field/retention rules, not thereby proven lawful or correctly implemented. These are labels about an original fictional inventory, not observations of a real customer system.
The deletion evidence labels primary/logs absent but processor unverified and derived cache present. Therefore completion remains false despite the primary database row being gone. A subjectRef does not make the surviving derived copy unrelated: the deterministic keyed fixture transform is repeatable across copies, which the program demonstrates without printing any subject, token or digest value. This is not an anonymization proof, production key-management design or a claim that all pseudonymization is reversible.
Return the concrete collection→destination→purpose/field/retention/deletion map, unsupported sharing, missing evidence and accountable owner. For a real system inspect actual authorized request/log/processor/storage behavior and all derived/export/backup queues, distinguish active-data removal from approved backup retention and restore safeguards, and verify the exact subject/tenant scope. Unknown authority is a stop gate, not consent inferred from a checkbox. Do not paste raw authorization headers or customer message bodies into the audit. No personal records, real processor, deletion job or production secret was accessed by this in-memory exercise; it is technical evidence discipline, not legal advice or compliance certification.
## Verify actual implementation separately
[W3C Privacy Principles](https://www.w3.org/TR/privacy-principles/#data-minimization) informs minimization and purpose thinking; it is not a jurisdiction-specific legal decision. [OWASP logging guidance](https://cheatsheetseries.owasp.org/cheatsheets/Logging_Cheat_Sheet.html#data-to-exclude) explains why access tokens and sensitive raw payloads must not casually become operational logs. Return supplied versus observed flow evidence, gaps/owner/stop conditions and a bounded retest. Escalate legal basis, rights exceptions and retention obligations to the responsible owner/qualified adviser. Do not disable useful security logging, change retention, delete data or send records to an external processor merely to complete a review.
Real example
Input
Review the four embedded fictional data flows, purpose rules and deletion evidence in SKILL.md. Execute the six-mismatch/copy-gap check and deterministic pseudonym counterexample without real data. Separate observed fixture labels, missing processor authority, retained copies and legal questions.
Expected result
Six explicit mismatches are found against the supplied fictional product rules: logs contain authorization and message fields outside the operations allowlist and retain for30days instead of at most7; the processor receives message outside metrics, has unknown retention and unverified sharing authority. The primary reply flow and1day derived lookup are within the supplied field/retention rules, not thereby proven lawful or correctly implemented. These are labels about an original fictional inventory, not observations of a real customer system. The deletion evidence labels primary/logs absent but processor unverified and derived cache present. Therefore completion remains false despite the primary database row being gone. A subjectRef does not make the surviving derived copy unrelated: the deterministic keyed fixture transform is repeatable across copies, which the program demonstrates without printing any subject, token or digest value. This is not an anonymization proof, production key-management design or a claim that all pseudonymization is reversible. Return the concrete collection→destination→purpose/field/retention/deletion map, unsupported sharing, missing evidence and accountable owner. For a real system inspect actual authorized request/log/processor/storage behavior and all derived/export/backup queues, distinguish active-data removal from approved backup retention and restore safeguards, and verify the exact subject/tenant scope. Unknown authority is a stop gate, not consent inferred from a checkbox. Do not paste raw authorization headers or customer message bodies into the audit. No personal records, real processor, deletion job or production secret was accessed by this in-memory exercise; it is technical evidence discipline, not legal advice or compliance certification.