Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Implement and maintain compliance with SOC 2, HIPAA, PCI-DSS, and GDPR using unified control mapping, policy-as-code enforcement, and automated evidence collection. Use when building systems requiring regulatory compliance, implementing security controls across multiple frameworks, or automating audit preparation.
.claude/skills/ancoleman-implementing-compliance/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 75% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 82% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 145% | 0% |
| case-10 | ✗→✓ | ▲ Improved | 109% | 0% |
| case-12 | ✗→✓ | ▲ Improved | 160% | 0% |
Implement continuous compliance with major regulatory frameworks through unified control mapping, policy-as-code enforcement, and automated evidence collection.
Modern compliance is a continuous engineering discipline requiring technical implementation of security controls. This skill provides patterns for SOC 2 Type II, HIPAA, PCI-DSS 4.0, and GDPR compliance using infrastructure-as-code, policy automation, and evidence collection. Focus on unified controls that satisfy multiple frameworks simultaneously to reduce implementation effort by 60-80%.
Invoke when:
SOC 2 Type II
ISO 27001
HIPAA (Healthcare)
PCI-DSS 4.0 (Payment Card Industry)
GDPR (EU Privacy)
CCPA/CPRA (California Privacy)
For detailed framework requirements, see references/soc2-controls.md, references/hipaa-safeguards.md, references/pci-dss-requirements.md, and references/gdpr-articles.md.
Implement controls once, map to multiple frameworks. Reduces effort by 60-80%.
Implementation Priority:
Identity & Access:
Data Protection:
Logging & Monitoring:
Network Security:
Incident Response:
Business Continuity:
For complete control implementations, see references/control-mapping-matrix.md.
Enforce compliance policies in CI/CD before infrastructure deployment.
Architecture:
Git Push → Terraform Plan → JSON → OPA Evaluation
├─► Pass → Deploy
└─► Fail → BlockExample: Encryption Policy
Enforce encryption requirements (SOC 2 CC6.1, HIPAA §164.312(a)(2)(iv), PCI-DSS Req 3.4):
See examples/opa-policies/encryption.rego for complete implementation.
CI/CD Integration:
bashterraform plan -out=tfplan.binary terraform show -json tfplan.binary > tfplan.json opa eval --data policies/ --input tfplan.json 'data.compliance.main.deny'
For complete CI/CD patterns, see references/cicd-integration.md.
Scan IaC with built-in compliance framework support:
bashcheckov -d ./terraform \ --check SOC2 --check HIPAA --check PCI --check GDPR \ --output cli --output json
Create custom policies for organization-specific requirements. See examples/checkov-policies/ for examples.
Integrate compliance validation into test suites:
pythondef test_s3_encrypted(terraform_plan): """SOC2:CC6.1, HIPAA:164.312(a)(2)(iv)""" buckets = get_resources(terraform_plan, "aws_s3_bucket") encrypted = get_encryption_configs(terraform_plan) assert all_buckets_encrypted(buckets, encrypted) def test_opa_policies(): result = subprocess.run(["opa", "eval", "--data", "policies/", "--input", "tfplan.json", "data.compliance.main.deny"]) assert not json.loads(result.stdout)
For complete test patterns, see references/compliance-testing.md.
Standards: AES-256, managed KMS, automatic rotation
AWS Example:
hclresource "aws_kms_key" "data" { enable_key_rotation = true tags = { Compliance = "ENC-001" } } resource "aws_s3_bucket_server_side_encryption_configuration" "data" { bucket = aws_s3_bucket.data.id rule { apply_server_side_encryption_by_default { sse_algorithm = "aws:kms" kms_master_key_id = aws_kms_key.data.arn } } } resource "aws_db_instance" "main" { storage_encrypted = true kms_key_id = aws_kms_key.data.arn }
For complete encryption implementations including Azure and GCP, see references/encryption-implementations.md.
Standards: TLS 1.3 (TLS 1.2 minimum), strong ciphers, HSTS
ALB Example:
hclresource "aws_lb_listener" "https" { port = 443 protocol = "HTTPS" ssl_policy = "ELBSecurityPolicy-TLS13-1-2-2021-06" }
Standards: TOTP, hardware tokens, biometric for privileged access
AWS IAM Enforcement:
hclresource "aws_iam_policy" "require_mfa" { policy = jsonencode({ Statement = [{ Effect = "Deny" NotAction = ["iam:CreateVirtualMFADevice", "iam:EnableMFADevice"] Resource = "*" Condition = { BoolIfExists = { "aws:MultiFactorAuthPresent" = "false" } } }] }) }
For application-level MFA (TOTP), see examples/mfa-implementation.py.
Standards: Least privilege, job function-based roles, quarterly reviews
Kubernetes Example:
yamlapiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: name: developer namespace: development rules: - apiGroups: ["", "apps"] resources: ["pods", "deployments", "services"] verbs: ["get", "list", "watch", "create", "update", "patch", "delete"] - apiGroups: [""] resources: ["secrets"] verbs: ["get", "list"] # Read-only
For complete RBAC patterns including AWS IAM and OPA policies, see references/access-control-patterns.md.
Standards: Structured JSON, 7-year retention, immutable storage
Required Events: Authentication, authorization, data access, administrative actions, security events
Python Example:
pythonclass AuditLogger: def log_event(self, event_type, user_id, resource_type, resource_id, action, result, ip_address): audit_event = { "timestamp": datetime.utcnow().isoformat() + "Z", "event_type": event_type.value, "user_id": user_id, "action": action, "result": result, "resource": {"type": resource_type, "id": resource_id}, "source": {"ip": ip_address} } self.logger.info(json.dumps(audit_event))
Log Retention:
hclresource "aws_cloudwatch_log_group" "audit" { retention_in_days = 2555 # 7 years kms_key_id = aws_kms_key.logs.arn } resource "aws_s3_bucket_object_lock_configuration" "audit" { bucket = aws_s3_bucket.audit_logs.id rule { default_retention { mode = "COMPLIANCE"; years = 7 } } }
For complete audit logging patterns including HIPAA PHI access logging, see references/audit-logging-patterns.md.
Automate evidence collection for continuous compliance validation.
Architecture:
AWS Config → EventBridge → Lambda → S3 (Evidence)
→ DynamoDB (Status)Evidence Collection:
pythonclass EvidenceCollector: def collect_encryption_evidence(self): evidence = { "control_id": "ENC-001", "frameworks": ["SOC2-CC6.1", "HIPAA-164.312(a)(2)(iv)"], "timestamp": datetime.utcnow().isoformat(), "status": "PASS", "findings": [] } # Check S3, RDS, EBS encryption status # Document findings return evidence
For complete evidence collector, see examples/evidence-collection/evidence_collector.py.
Generate compliance reports automatically:
pythonclass AuditReportGenerator: def generate_soc2_report(self, start_date, end_date): controls = self.get_control_status("SOC2") return { "framework": "SOC 2 Type II", "compliance_score": self.calculate_score(controls), "trust_services_criteria": {...}, "controls": self.format_controls(controls) }
For complete report generator, see examples/evidence-collection/report_generator.py.
Unified control mapping across frameworks:
| Control | SOC 2 | HIPAA | PCI-DSS | GDPR | ISO 27001 | |---------|-------|-------|---------|------|-----------| | MFA | CC6.1 | §164.312(d) | Req 8.3 | Art 32 | A.9.4.2 | | Encryption at Rest | CC6.1 | §164.312(a)(2)(iv) | Req 3.4 | Art 32 | A.10.1.1 | | Encryption in Transit | CC6.1 | §164.312(e)(1) | Req 4.1 | Art 32 | A.13.1.1 | | Audit Logging | CC7.2 | §164.312(b) | Req 10.2 | Art 30 | A.12.4.1 | | Access Reviews | CC6.1 | §164.308(a)(3)(ii)(C) | Req 8.2.4 | Art 32 | A.9.2.5 | | Vulnerability Scanning | CC7.1 | §164.308(a)(8) | Req 11.2 | Art 32 | A.12.6.1 | | Incident Response | CC7.3 | §164.308(a)(6) | Req 12.10 | Art 33 | A.16.1.1 |
Strategy: Implement once with proper tagging, map to all applicable frameworks.
For complete control mapping with 45+ controls, see references/control-mapping-matrix.md.
Framework-Specific Timelines:
Required Elements:
For incident response templates, see references/incident-response-templates.md.
Business Associate Agreements (HIPAA):
Data Processing Agreements (GDPR):
Assessment Process:
For vendor management templates, see references/vendor-management.md.
Policy as Code:
Compliance Automation:
For tool selection guidance, see references/tool-recommendations.md.
Related Skills:
security-hardening: Technical security control implementationsecret-management: Secrets handling per HIPAA/PCI-DSSinfrastructure-as-code: IaC implementing compliance controlskubernetes-operations: K8s RBAC, network policiesbuilding-ci-pipelines: Policy enforcement in CI/CDsiem-logging: Audit logging and monitoringincident-management: Incident response proceduresImplementation Checklist:
Common Mistakes:
Framework Details:
Implementation Patterns:
Automation:
Code Examples:
Consult qualified legal counsel and auditors for legal interpretation and audit preparation.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 20,587 | 15,354 | -25% | 1 | 1 | 0% | 4,168 | 7,296 | +75% | 0 | 0 | — |
case-02 | pass→pass | 11,400 | 8,874 | -22% | 1 | 1 | 0% | 2,159 | 5,783 | +168% | 0 | 0 | — |
case-03 | pass→pass | 17,892 | 12,350 | -31% | 1 | 1 | 0% | 3,339 | 6,578 | +97% | 0 | 0 | — |
case-04 | pass→pass | 13,275 | 15,702 | +18% | 1 | 1 | 0% | 2,374 | 7,316 | +208% | 0 | 0 | — |
case-05 | fail→pass | 17,555 | 4,824 | -73% | 1 | 1 | 0% | 2,735 | 4,965 | +82% | 0 | 0 | — |
case-06 | fail→fail | 14,349 | 11,515 | -20% | 1 | 1 | 0% | 2,337 | 6,063 | +159% | 0 | 0 | — |
case-07 | pass→pass | 15,241 | 10,102 | -34% | 1 | 1 | 0% | 2,972 | 6,007 | +102% | 0 | 0 | — |
case-08 | pass→pass | 9,152 | 5,736 | -37% | 1 | 1 | 0% | 1,604 | 5,229 | +226% | 0 | 0 | — |
case-09 | fail→pass | 11,743 | 10,257 | -13% | 1 | 1 | 0% | 2,279 | 5,591 | +145% | 0 | 0 | — |
case-10 | fail→pass | 21,103 | 20,576 | -2% | 1 | 1 | 0% | 4,050 | 8,484 | +109% | 0 | 0 | — |
case-21 | pass→pass | 9,787 | 9,354 | -4% | 1 | 1 | 0% | 1,907 | 5,762 | +202% | 0 | 0 | — |
case-11 | pass→pass | 14,195 | 16,118 | +14% | 1 | 1 | 0% | 2,459 | 7,067 | +187% | 0 | 0 | — |
case-12 | fail→pass | 18,225 | 19,610 | +8% | 1 | 1 | 0% | 2,847 | 7,411 | +160% | 0 | 0 | — |
case-13 | pass→pass | 7,626 | 11,397 | +49% | 1 | 1 | 0% | 1,518 | 6,536 | +331% | 0 | 0 | — |
case-14 | fail→pass | 17,110 | 15,412 | -10% | 1 | 1 | 0% | 3,405 | 7,309 | +115% | 0 | 0 | — |
case-15 | pass→pass | 14,939 | 14,404 | -4% | 1 | 1 | 0% | 2,744 | 7,048 | +157% | 0 | 0 | — |
case-16 | fail→pass | 10,292 | 3,816 | -63% | 1 | 1 | 0% | 1,628 | 4,776 | +193% | 0 | 0 | — |
case-17 | pass→pass | 12,497 | 12,300 | -2% | 1 | 1 | 0% | 2,218 | 6,499 | +193% | 0 | 0 | — |
case-18 | pass→pass | 12,577 | 13,641 | +8% | 1 | 1 | 0% | 2,047 | 6,336 | +210% | 0 | 0 | — |
case-19 | pass→pass | 13,441 | 10,516 | -22% | 1 | 1 | 0% | 2,188 | 5,732 | +162% | 0 | 0 | — |
case-20 | pass→pass | 16,636 | 15,016 | -10% | 1 | 1 | 0% | 2,855 | 6,904 | +142% | 0 | 0 | — |
case-22 | pass→pass | 4,447 | 5,801 | +30% | 1 | 1 | 0% | 786 | 5,198 | +561% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +32 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.