From architect
Analyze project for compliance gaps across SOC2, HIPAA, GDPR, and PCI DSS frameworks
npx claudepluginhub navraj007in/architecture-cowork-plugin --plugin architect# /architect:compliance ## Trigger `/architect:compliance [options]` Options: - `[frameworks:sox2,hipaa,gdpr,pci]` — specify which to audit (comma-separated; default: all applicable) - `[non_interactive:true]` — skip all questions, derive from SDL ## Purpose Production systems need to comply with regulatory frameworks. This command scans your project for compliance gaps, produces a prioritized remediation plan, and documents the current control state. Covers SOC2 Type II, HIPAA, GDPR, and PCI DSS — mapping each framework's controls to code-level implementation patterns. ## Workflow #...
/complianceGenerate compliance reports, track controls, export audit evidence, and manage exceptions for SOC2, GDPR, and ISO27001
/complianceSOC 2 compliance for Terraform — gap analysis, control implementation, evidence collection, and remediation guidance mapped to SOC 2 Trust Services Criteria.
/architect:compliance [options]
Options:
[frameworks:sox2,hipaa,gdpr,pci] — specify which to audit (comma-separated; default: all applicable)[non_interactive:true] — skip all questions, derive from SDLProduction systems need to comply with regulatory frameworks. This command scans your project for compliance gaps, produces a prioritized remediation plan, and documents the current control state. Covers SOC2 Type II, HIPAA, GDPR, and PCI DSS — mapping each framework's controls to code-level implementation patterns.
| Phase | Steps |
|---|---|
| Setup | Step 1 · Step 1.5 |
| Analysis | Step 2 · Step 2.5 |
| Scanning | Step 3 · Step 3.5 |
| Completion | Step 4 · Step 4.5 · Step 5 |
ℹ️ CONTEXT LOADING: _state.json → SDL → project structure
First, read architecture-output/_state.json if it exists. Extract:
project.name, project.stagetech_stack.backend, tech_stack.database (determines scope)compliance section (if this is a re-audit)Then, read SDL to detect compliance flags:
nonFunctional.security.compliance[] — list of applicable frameworks (SOC2, HIPAA, GDPR, PCI)nonFunctional.security.pii — does system handle Personally Identifiable Information?nonFunctional.security.phi — does system handle Protected Health Information (healthcare)?nonFunctional.security.pci — does system handle payment card data?Check project structure:
docs/compliance/, docs/security/, audit reportssrc/lib/encryption.ts, .env with encryption keyssrc/lib/logger.ts, src/lib/auditLog.ts❓ DECISION POINT: Framework applicability detection
Based on SDL + project structure, determine which frameworks MUST be audited:
| Flag | Framework | Requirement |
|---|---|---|
compliance.includes('SOC2') | SOC2 Type II | Explicitly declared |
pii: true | GDPR | Always applicable if handling EU user data |
phi: true | HIPAA | Always applicable if handling healthcare data |
pci: true | PCI DSS | Always applicable if handling payment cards |
If frameworks are not declared in SDL:
❓ DECISION POINT: User-specified frameworks and audit scope
If not in non-interactive mode, ask:
Which frameworks to audit?
"Which compliance frameworks apply to your project?"
- SOC2 Type II (SaaS, security best practice)
- HIPAA (healthcare, if handling PHI)
- GDPR (if serving EU users or handling personal data)
- PCI DSS (if accepting payments or storing card data)
- All that apply
Data sensitivity scope (if not obvious from SDL):
"What's the highest sensitivity data you handle?"
- Public data (no compliance needed)
- Internal data (SOC2 only)
- Personal/PII data (SOC2 + GDPR)
- Healthcare/PHI (SOC2 + HIPAA)
- Payment card data (SOC2 + PCI DSS)
Timeline for audit (if frameworks declared):
"When do you need to be audit-ready?"
- Already in audit (critical path)
- Next 3 months (plan remediation soon)
- Next 6 months (can prioritize)
- Planning/informational (lower priority)
If [non_interactive:true], derive:
nonFunctional.security.compliance[]pii, phi, pci flags🔄 SKILL LOAD: Read skills/compliance/SKILL.md
Before delegating, read skills/compliance/SKILL.md in full. This skill is the authoritative guide for:
The compliance-scanner agent will reference this skill for all gap analysis.
🔄 AGENT DELEGATION: Launch compliance-scanner agent (autonomous, gap-analyzing)
Pass the following to the compliance-scanner agent:
Frameworks to audit (from Step 2):
Project context:
_state.json.project.stage — MVP/growth/enterprise (affects control expectations)_state.json.tech_stack — languages, databases, cloud providernonFunctional.security sectionData sensitivity (from Step 2):
Reference materials:
skills/compliance/SKILL.md — agent will read and followThe agent MUST:
architecture-output/compliance/ with:
compliance-index.md — overview and quick navigationcompliance-soc2.md — SOC2 controls + gaps (if applicable)compliance-hipaa.md — HIPAA safeguards + gaps (if applicable)compliance-gdpr.md — GDPR articles + gaps (if applicable)compliance-pci.md — PCI DSS scope + gaps (if applicable)compliance-remediation.md — prioritized fix list (critical → high → medium → low)compliance-audit-checklist.md — evidence collection guide for auditorsThe agent MUST NOT:
✅ QUALITY GATE: Check generated files before proceeding
After the agent completes, verify the compliance reports:
For each framework:
compliance-{framework}.md existscompliance-remediation.md prioritizes gaps (critical first)compliance-audit-checklist.md lists evidence needed per controlIf verification fails:
Append one line to architecture-output/_activity.jsonl:
{"ts":"<ISO-8601>","phase":"compliance","outcome":"completed","frameworks":["SOC2","GDPR"],"gap_count":12,"critical_gaps":2,"high_gaps":5,"files_generated":6,"summary":"Compliance audit complete: SOC2 + GDPR. 2 critical gaps (encryption, audit logging), 5 high gaps (GDPR rights), 5 medium gaps. Remediation plan in compliance-remediation.md."}
For each framework audited, also append to architecture-output/compliance/_activity.jsonl (create if needed):
{"ts":"<ISO-8601>","framework":"SOC2","status":"scanned","controls_total":22,"controls_implemented":18,"controls_partial":2,"controls_missing":2,"summary":"SOC2 Type II: 18/22 controls implemented. Gaps: CC6.4 (backup testing), CC7.4 (key management)."}
Read existing architecture-output/_state.json (or start with {}).
Merge ONLY the compliance field:
{
"compliance": {
"generated_at": "<ISO-8601>",
"frameworks": ["SOC2", "GDPR"],
"gap_count": 12,
"critical_gaps": 2,
"high_gaps": 5,
"medium_gaps": 4,
"low_gaps": 1,
"controls_by_framework": {
"SOC2": {
"total": 22,
"implemented": 18,
"partial": 2,
"missing": 2
},
"GDPR": {
"total": 7,
"implemented": 5,
"partial": 1,
"missing": 1
}
},
"remediation_effort_hours": 48,
"files_generated": 6
}
}
Write back to architecture-output/_state.json without overwriting other fields.
🚀 COMPLETION MARKER: Emit [COMPLIANCE_DONE]
Emit the completion marker:
[COMPLIANCE_DONE]
This ensures the compliance audit phase is marked as complete in the project state.
If SDL is missing or nonFunctional.security is not defined:
"I need an SDL with security configuration to audit compliance. Run
/architect:blueprintfirst, then come back here."
If user answers "none" to all framework questions:
If source code cannot be scanned (syntax errors, large files, unsupported languages):
"code_scan_failed_<file>"If total remediation effort exceeds 200 hours:
If architecture-output/compliance/ cannot be created due to permissions: