Skip to content

lidge-jun/codexclaw / plugins/codexclaw/skills/dev-data

cxc-dev-data

Verified

Use for analytics and data pipelines. Triggers: ETL, ELT, data quality, SQL optimization, schema drift, backfill, 데이터 파이프라인, 데이터 품질, 백필.

references/governance.md

View on GitHub
# Data Governance — PII, Masking, Compliance

**Last reviewed**: 2026-07-02

Security and privacy patterns for production data pipelines.

---

## PII Masking Techniques

| Technique | Reversible | Use Case |
|-----------|------------|----------|
| **Pseudonymization** | Yes (with mapping) | Analytics needing re-identification |
| **Anonymization** | No | Public datasets, research |
| **Dynamic masking** | N/A (query-time) | Production DBs with mixed access levels |
| **Static masking** | No | Non-production environments (dev/QA) |
| **Tokenization** | Yes (separate vault) | Payment data (PCI-DSS), SSNs |

**Rule:** Always use static masking for non-production environments. Never copy production PII to dev/staging.

---

## GDPR Engineering Patterns

### Right to Erasure (Article 17)
```
User deletion request
→ Soft delete in application DB
→ Batch purge job (after grace period)
→ Propagate to all downstream stores:
  ├── Data warehouse (DELETE or partition drop)
  ├── Data lake (Delta Lake/Iceberg row-level delete)
  ├── Search indices (Elasticsearch delete-by-query)
  ├── Caches (Redis DEL)
  └── Backups (mark for purge at next rotation)
```

### Consent-Aware Pipelines
- Check consent flags before processing PII columns
- Different processing paths per consent level
- Store consent as versioned events (not mutable flags)

### Data Subject Access Request (DSAR)
- Build export endpoint that collects all user data across systems
- Format: JSON or CSV per GDPR Article 20 (data portability)
- Automate where possible — manual DSAR handling doesn't scale

---

## CCPA Additions

| CCPA Requirement | Difference from GDPR | Engineering Pattern |
|-----------------|---------------------|---------------------|
| Right to opt-out of sale | No GDPR equivalent | Boolean `do_not_sell` flag on user profile; filter in data sharing pipelines |
| Financial incentive disclosure | No GDPR equivalent | Metadata on loyalty/discount programs linked to data collection |
| 12-month lookback | GDPR has no fixed window | Retain deletion request logs for 12 months |

---

## Row-Level Security (RLS)

```
Access Control Hierarchy:
├── Table-level: Can this role access this table?
├── Column-level: Which columns visible? (mask PII)
├── Row-level: Which rows visible? (filter by org_id)
└── Cell-level: Dynamic masking per field per role
```

**PostgreSQL RLS example:**
```sql
ALTER TABLE orders ENABLE ROW LEVEL SECURITY;
CREATE POLICY org_isolation ON orders
    USING (org_id = current_setting('app.current_org_id')::int);
```

**Snowflake dynamic masking:**
```sql
CREATE MASKING POLICY email_mask AS (val STRING) RETURNS STRING ->
  CASE
    WHEN CURRENT_ROLE() IN ('ADMIN', 'DATA_STEWARD') THEN val
    ELSE REGEXP_REPLACE(val, '.+@', '***@')
  END;
```

---

## Data Retention Policy

| Tier | Retention | Storage | Access Pattern |
|------|-----------|---------|----------------|
| **Hot** | 0-90 days | Primary warehouse | Real-time queries |
| **Warm** | 90 days - 2 years | Archive tables / cold storage | Occasional queries |
| **Cold** | 2-7 years | Object storage (S3/GCS) Parquet | Compliance/audit only |
| **Purge** | Beyond retention | Permanently deleted | N/A |

Automate tiering with lifecycle policies. Tag tables with `retention_days` and `data_classification` metadata.
writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deploymentStars: 321kUpdated Claude CodeCodexVerifiedInstall
xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.Stars: 197kUpdated Claude CodeCodexVerifiedInstall
shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release.Stars: 118kUpdated Claude CodeCodexVerifiedInstall