Compliance Code Review Skill
Review PR #{{ pr_number }} in {{ repository }} for {{ compliance_frameworks }} compliance.
Workflow
Phase 1 — Data Handling
DATA HANDLING REVIEW
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[ ] Data classification:
[ ] Data types identified (PII, PHI, PCI, public)
[ ] Handling appropriate for classification level
[ ] Data flow documented
[ ] Data storage:
[ ] Encryption at rest for sensitive data
[ ] Encryption keys managed via KMS (not hardcoded)
[ ] Data retention policies enforced
[ ] Data deletion/anonymization capabilities
[ ] Data transmission:
[ ] TLS 1.2+ enforced for all transmissions
[ ] No sensitive data in URLs or query parameters
[ ] API responses filtered to authorized data only
[ ] Data minimization:
[ ] Only necessary data collected
[ ] Data not retained beyond required period
[ ] Unnecessary PII fields removed
Phase 2 — Audit Logging
AUDIT TRAIL
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[ ] Audit events:
[ ] Authentication events logged (login, logout, failures)
[ ] Authorization failures logged
[ ] Data access logged (read of sensitive records)
[ ] Data modification logged (create, update, delete)
[ ] Configuration changes logged
[ ] Log integrity:
[ ] Logs written to tamper-evident store
[ ] Log retention meets compliance requirement: ___ days
[ ] Logs include: timestamp, actor, action, resource, outcome
[ ] No sensitive data in log entries (passwords, tokens)
Phase 3 — Access Controls
ACCESS CONTROL REVIEW
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[ ] Authentication:
[ ] MFA enforced for privileged operations
[ ] Session management secure (timeout, invalidation)
[ ] Password policy meets requirements
[ ] Authorization:
[ ] Role-based access control implemented
[ ] Least-privilege principle applied
[ ] Separation of duties enforced
[ ] Administrative access restricted and audited
[ ] Access review:
[ ] Service accounts documented
[ ] API key rotation supported
[ ] Access provisioning/deprovisioning automated
Phase 4 — Framework-Specific Requirements
SOC 2 SPECIFIC
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[ ] Change management process followed
[ ] Code review by authorized personnel
[ ] Monitoring and alerting for security events
[ ] Incident response procedures referenced
HIPAA SPECIFIC
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[ ] PHI access logged with BAA compliance
[ ] Minimum necessary standard applied
[ ] Emergency access procedures defined
[ ] Patient data de-identification where possible
PCI DSS SPECIFIC
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[ ] Cardholder data not stored unless necessary
[ ] PAN masked in display (first 6, last 4)
[ ] Cryptographic key management documented
[ ] No storage of CVV, track data, or PIN
GDPR SPECIFIC
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[ ] Consent management implemented
[ ] Right to erasure supported (data deletion)
[ ] Data portability supported (export)
[ ] Privacy by design principles applied
[ ] Data processing agreement compliance
Counter-Rationalizations
| Shortcut |
Counter |
Why |
| "We can skip some steps for this case" |
Adapt the workflow steps, don't skip them |
Skipped steps are where incidents and oversights originate |
| "The user seems to already know what to do" |
Complete all workflow phases with the user |
The workflow catches blind spots that experience alone misses |
| "This is a minor case, full process is overkill" |
Scale the process down, don't turn it off |
Minor cases become major when unstructured; the process scales, not disappears |
| "I'll fill in the details later" |
Complete each section before moving on |
Deferred details are forgotten; real-time capture is more accurate |
| "The template output isn't necessary" |
Always produce the structured output format |
Structured output enables comparison, audit trails, and handoff to other teams |
Output Format
Produce a compliance review report with:
- Compliance status per framework (compliant / gaps found / non-compliant)
- Findings by control area (data handling, audit, access)
- Risk rating per finding (critical / high / medium / low)
- Remediation requirements with regulatory references
- Evidence of compliance for audit documentation
1---2name: compliance-code-review3enabled: true4description: |5 Use when performing compliance code review — regulatory compliance code review6 template covering SOC 2, HIPAA, PCI DSS, and GDPR requirements. Evaluates code7 changes for data handling compliance, audit logging, access controls,8 encryption standards, and data retention policies to ensure regulatory9 requirements are met in code.10required_connections:11 - prefix: github12 label: "GitHub"13config_fields:14 - key: repository15 label: "Repository"16 required: true17 placeholder: "e.g., org/payments-service"18 - key: pr_number19 label: "PR Number"20 required: true21 placeholder: "e.g., 1234"22 - key: compliance_frameworks23 label: "Compliance Frameworks"24 required: true25 placeholder: "e.g., SOC2, HIPAA, PCI-DSS, GDPR"26features:27 - CODE_REVIEW28metadata:29 source: https://skillmd.com/skills/cloudthinker-ai/compliance-code-review30---3132# Compliance Code Review Skill3334Review PR **#{{ pr_number }}** in **{{ repository }}** for **{{ compliance_frameworks }}** compliance.3536## Workflow3738### Phase 1 — Data Handling3940```41DATA HANDLING REVIEW42━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━43[ ] Data classification:44 [ ] Data types identified (PII, PHI, PCI, public)45 [ ] Handling appropriate for classification level46 [ ] Data flow documented47[ ] Data storage:48 [ ] Encryption at rest for sensitive data49 [ ] Encryption keys managed via KMS (not hardcoded)50 [ ] Data retention policies enforced51 [ ] Data deletion/anonymization capabilities52[ ] Data transmission:53 [ ] TLS 1.2+ enforced for all transmissions54 [ ] No sensitive data in URLs or query parameters55 [ ] API responses filtered to authorized data only56[ ] Data minimization:57 [ ] Only necessary data collected58 [ ] Data not retained beyond required period59 [ ] Unnecessary PII fields removed60```6162### Phase 2 — Audit Logging6364```65AUDIT TRAIL66━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━67[ ] Audit events:68 [ ] Authentication events logged (login, logout, failures)69 [ ] Authorization failures logged70 [ ] Data access logged (read of sensitive records)71 [ ] Data modification logged (create, update, delete)72 [ ] Configuration changes logged73[ ] Log integrity:74 [ ] Logs written to tamper-evident store75 [ ] Log retention meets compliance requirement: ___ days76 [ ] Logs include: timestamp, actor, action, resource, outcome77 [ ] No sensitive data in log entries (passwords, tokens)78```7980### Phase 3 — Access Controls8182```83ACCESS CONTROL REVIEW84━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━85[ ] Authentication:86 [ ] MFA enforced for privileged operations87 [ ] Session management secure (timeout, invalidation)88 [ ] Password policy meets requirements89[ ] Authorization:90 [ ] Role-based access control implemented91 [ ] Least-privilege principle applied92 [ ] Separation of duties enforced93 [ ] Administrative access restricted and audited94[ ] Access review:95 [ ] Service accounts documented96 [ ] API key rotation supported97 [ ] Access provisioning/deprovisioning automated98```99100### Phase 4 — Framework-Specific Requirements101102```103SOC 2 SPECIFIC104━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━105[ ] Change management process followed106[ ] Code review by authorized personnel107[ ] Monitoring and alerting for security events108[ ] Incident response procedures referenced109110HIPAA SPECIFIC111━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━112[ ] PHI access logged with BAA compliance113[ ] Minimum necessary standard applied114[ ] Emergency access procedures defined115[ ] Patient data de-identification where possible116117PCI DSS SPECIFIC118━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━119[ ] Cardholder data not stored unless necessary120[ ] PAN masked in display (first 6, last 4)121[ ] Cryptographic key management documented122[ ] No storage of CVV, track data, or PIN123124GDPR SPECIFIC125━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━126[ ] Consent management implemented127[ ] Right to erasure supported (data deletion)128[ ] Data portability supported (export)129[ ] Privacy by design principles applied130[ ] Data processing agreement compliance131```132133## Counter-Rationalizations134135| Shortcut | Counter | Why |136|----------|---------|-----|137| "We can skip some steps for this case" | Adapt the workflow steps, don't skip them | Skipped steps are where incidents and oversights originate |138| "The user seems to already know what to do" | Complete all workflow phases with the user | The workflow catches blind spots that experience alone misses |139| "This is a minor case, full process is overkill" | Scale the process down, don't turn it off | Minor cases become major when unstructured; the process scales, not disappears |140| "I'll fill in the details later" | Complete each section before moving on | Deferred details are forgotten; real-time capture is more accurate |141| "The template output isn't necessary" | Always produce the structured output format | Structured output enables comparison, audit trails, and handoff to other teams |142143## Output Format144145Produce a compliance review report with:1461. **Compliance status per framework** (compliant / gaps found / non-compliant)1472. **Findings by control area** (data handling, audit, access)1483. **Risk rating** per finding (critical / high / medium / low)1494. **Remediation requirements** with regulatory references1505. **Evidence of compliance** for audit documentation