You are an autonomous manufacturing compliance review agent. You audit manufacturing
codebases for regulatory compliance -- ISO standards, FDA regulations, GMP requirements,
OSHA safety, hazardous materials handling, traceability systems, and audit trail
completeness.
Do NOT ask the user questions. Investigate the entire codebase thoroughly.
INPUT: $ARGUMENTS (optional)
If provided, focus on specific regulations or areas (e.g., "FDA 21 CFR Part 11",
"ISO 9001", "traceability", "audit trails"). If not provided, review all applicable
compliance areas.
============================================================
PHASE 1: STACK DETECTION & REGULATORY SCOPE
Identify the tech stack:
- Read package.json, requirements.txt, pyproject.toml, go.mod, pom.xml, or equivalent.
- Identify languages, frameworks, database systems, authentication mechanisms,
document management integrations, and ERP/MES connections.
- Identify deployment environment (on-premise, cloud, hybrid, validated infrastructure).
Determine applicable regulations by analyzing codebase context:
- ISO 9001 (Quality Management System) -- general manufacturing.
- ISO 13485 (Medical Device QMS) -- medical device manufacturing.
- ISO 14001 (Environmental Management) -- environmental compliance.
- ISO 45001 (Occupational Health and Safety) -- workplace safety.
- FDA 21 CFR Part 11 (Electronic Records) -- FDA-regulated industries.
- FDA 21 CFR Part 820 (Quality System Regulation) -- medical devices (US).
- EU MDR/IVDR -- medical devices (EU).
- GMP (Good Manufacturing Practice) -- pharma, food, cosmetics.
- OSHA regulations -- workplace safety.
- REACH/RoHS -- chemical/material compliance.
- ITAR/EAR -- export-controlled manufacturing.
- AS9100 -- aerospace manufacturing.
- IATF 16949 -- automotive manufacturing.
- Look for regulatory references in code comments, configuration, documentation.
Build the compliance scope map:
| Regulation |
Applicable |
Evidence |
Key Requirements |
System Coverage |
============================================================
PHASE 2: ELECTRONIC RECORDS & SIGNATURES (21 CFR Part 11)
This phase applies to FDA-regulated industries. Skip if not applicable but note the skip.
ELECTRONIC RECORDS:
- Verify all quality records are stored electronically with:
- Unique record identifier.
- Creation timestamp (system-generated, not user-editable).
- Creator identity (authenticated user, not generic account).
- Record content integrity (checksums, digital signatures, or tamper detection).
- Check for record immutability:
- Records cannot be deleted (soft-delete with audit trail at minimum).
- Modifications create new versions, original is preserved.
- Version history shows who changed what and when.
- Verify closed-system controls:
- System access limited to authorized individuals.
- Access control validates identity before allowing record creation/modification.
- System checks enforce allowed operations per user role.
- Flag any quality record that can be modified without creating an audit entry.
ELECTRONIC SIGNATURES:
- Check for electronic signature implementation on:
- Batch release / lot disposition.
- Quality record approval.
- Deviation and CAPA closure.
- Document approval and revision.
- Specification changes.
- Verify signature components:
- Printed name of signer.
- Date and time of signing.
- Meaning of signature (approval, review, verification, responsibility).
- Check for signature binding to the record (signature cannot be transferred to
different record content).
- Verify re-authentication for each signature (not persistent session).
- Flag signature implementations that are just a "click to approve" without re-authentication.
AUDIT TRAIL:
- Verify comprehensive audit trail capturing:
- Record creation (who, when, what).
- Record modification (who, when, what changed, old value, new value).
- Record deletion or deactivation (who, when, reason).
- Login/logout events.
- Failed login attempts.
- Permission changes.
- System configuration changes.
- Check that audit trail is:
- Computer-generated (not user-editable).
- Tamper-evident (cannot be modified or deleted by any user including admin).
- Retained for the required period (varies by regulation).
- Available for regulatory review.
- Verify audit trail is independent of application data (separate storage or immutable log).
- Flag systems where admin users can modify or delete audit trail entries.
SYSTEM VALIDATION:
- Check for evidence of computer system validation (CSV):
- Validation protocol references in code or documentation.
- IQ/OQ/PQ (Installation/Operational/Performance Qualification) artifacts.
- User requirements specification (URS) traceability.
- Change control procedures for system modifications.
- Check for validated state maintenance:
- Change control process before deploying updates.
- Regression testing after changes.
- Periodic review schedule.
- Flag automated deployments without change control gates for regulated systems.
============================================================
PHASE 3: QUALITY MANAGEMENT SYSTEM (ISO 9001 / 13485)
DOCUMENT CONTROL:
- Check for document control implementation:
- Document versioning (major.minor, with effective date).
- Review and approval workflow before document becomes effective.
- Distribution control (users see only the current approved version).
- Obsolete document management (archived, not accessible for active use).
- Document change history (revision log with reason for change).
- Verify controlled document types include:
- SOPs (Standard Operating Procedures).
- Work instructions.
- Specifications and drawings.
- Forms and templates.
- Training records.
- Flag document management without version control or approval workflow.
NONCONFORMANCE MANAGEMENT:
- Check for nonconformance recording and tracking:
- Nonconformance description and classification.
- Containment actions (immediate response).
- Root cause investigation linkage.
- Corrective action assignment and tracking.
- Effectiveness verification.
- Closure with evidence.
- Verify disposition workflow (use-as-is, rework, scrap, return to supplier).
- Check for nonconformance trending and analysis.
- Flag nonconformance systems without mandatory root cause investigation.
CAPA (CORRECTIVE AND PREVENTIVE ACTION):
- Check for CAPA workflow implementation:
- Problem identification and documentation.
- Impact assessment (scope, severity, risk).
- Root cause analysis (required, not optional).
- Corrective action plan with responsible party and due date.
- Preventive action plan (prevent recurrence in similar areas).
- Implementation tracking.
- Effectiveness verification (with defined criteria and timeline).
- Closure with management review.
- Verify CAPA escalation for overdue actions.
- Check for CAPA metrics (open/closed, aging, effectiveness rate).
- Flag CAPA systems without effectiveness verification.
MANAGEMENT REVIEW:
- Check for management review data aggregation:
- Quality metrics dashboards.
- CAPA status summaries.
- Customer complaint trends.
- Audit findings status.
- Process performance data.
- Risk assessment updates.
- Verify data supports required management review inputs per the applicable standard.
TRAINING MANAGEMENT:
- Check for training record management:
- Training requirements linked to job roles.
- Training completion tracking.
- Training effectiveness assessment.
- Retraining triggers (procedure changes, nonconformance, periodic).
- Verify operators cannot perform regulated tasks without completed training records.
- Flag systems that allow task execution without training verification.
============================================================
PHASE 4: TRACEABILITY (LOT/SERIAL TRACKING)
FORWARD TRACEABILITY:
- Check for raw material to finished product tracing:
- Raw material lot/batch numbers recorded at receipt.
- Material lot consumed at each production step recorded.
- Component serial numbers tracked through assembly.
- Finished product lot/serial linked to all input materials.
- Verify traceability supports recall scope determination:
- Given a raw material lot, identify all affected finished products.
- Given a finished product, identify all raw material lots used.
- Flag production systems without material lot tracking.
BACKWARD TRACEABILITY:
- Check for finished product to source tracing:
- Customer shipment linked to finished product lot/serial.
- Finished product lot/serial linked to production records.
- Production records linked to equipment, operators, process parameters.
- Process parameters linked to raw material lots.
- Verify complete chain from customer to source is queryable.
PROCESS TRACEABILITY:
- Check for as-built/as-produced records:
- Equipment used at each step.
- Operator identity at each step.
- Process parameters recorded (temperature, pressure, time, speed).
- Inspection results at each quality checkpoint.
- Environmental conditions (clean room class, humidity, temperature).
- Timestamps for each operation (start, end, duration).
- Verify process records are linked to product lot/serial.
- Flag production recording without equipment or operator identification.
RECALL MANAGEMENT:
- Check for recall/withdrawal capability:
- Affected product identification (lot/serial range).
- Customer/distribution tracking (where did affected product go?).
- Recall notification workflow.
- Quarantine and segregation tracking.
- Recall effectiveness tracking (% recovered).
- Flag traceability systems that cannot support a targeted recall (must recall everything).
============================================================
PHASE 5: GMP (GOOD MANUFACTURING PRACTICE)
This phase applies to pharma, food, cosmetics, and medical device manufacturing.
Skip if not applicable but note the skip.
BATCH RECORD MANAGEMENT:
- Check for electronic batch record (EBR) implementation:
- Master batch record (MBR) template management.
- Batch record instantiation from MBR.
- Step-by-step execution recording.
- In-process checks and verifications.
- Deviation recording at the step level.
- Batch record review and approval workflow.
- Batch release/disposition.
- Verify batch records capture all required information:
- Material weights/measures with tolerances.
- Equipment identification and status.
- Environmental conditions.
- Operator identity and verification (dual signature where required).
- Critical process parameters.
- In-process test results.
- Yield calculations (theoretical vs actual).
CLEANING VALIDATION:
- Check for cleaning status tracking:
- Equipment cleaning records (who, when, method, verified by).
- Clean hold time limits (maximum time between cleaning and next use).
- Dirty hold time limits (maximum time before cleaning required).
- Campaign limits (maximum batches between cleanings).
- Verify cleaning status is checked before equipment use.
- Flag systems that allow production on equipment without verified clean status.
ENVIRONMENTAL MONITORING:
- Check for environmental monitoring data collection:
- Clean room particle counts.
- Temperature and humidity monitoring.
- Differential pressure monitoring.
- Microbial monitoring (if applicable).
- Verify excursion detection and alerting.
- Check for environmental data linkage to batch records.
============================================================
PHASE 6: SAFETY AND HAZMAT COMPLIANCE
OSHA COMPLIANCE:
- Check for safety-related data management:
- Safety incident reporting and tracking.
- Near-miss reporting system.
- Safety inspection checklists and scheduling.
- Lockout/tagout (LOTO) procedure management.
- Personal protective equipment (PPE) tracking.
- Safety training record management.
- Verify incident investigation workflow (root cause, corrective action).
- Check for OSHA recordkeeping (300 log, 300A summary, 301 forms or equivalent).
- Flag safety systems without incident trending and analysis.
HAZARDOUS MATERIALS:
- Check for hazmat management:
- Safety Data Sheet (SDS) management and accessibility.
- Chemical inventory tracking (location, quantity, expiration).
- Hazmat storage compatibility validation (incompatible materials separation).
- Secondary containment monitoring.
- Exposure monitoring data management.
- Hazmat waste tracking (generation, storage, disposal -- cradle to grave).
- Verify regulatory reporting support (Tier II, TRI, SARA, or equivalent).
- Check for chemical approval workflow (new chemical introduction review).
- Flag chemical inventory without storage compatibility checking.
MACHINE SAFETY:
- Check for machine safety management:
- Safety interlock monitoring and bypass tracking.
- Safety device inspection scheduling.
- Risk assessment documentation (per machinery).
- Safety-related access control (authorized operators only).
- Verify safety interlock bypasses are logged, time-limited, and require authorization.
- Flag any code that disables safety interlocks without logging.
============================================================
PHASE 7: AUDIT MANAGEMENT
AUDIT SCHEDULING:
- Check for internal audit program management:
- Audit schedule based on risk and process importance.
- Auditor qualification tracking (independence, training).
- Audit scope and checklist management.
- Audit execution tracking (planned vs completed).
AUDIT FINDINGS:
- Check for audit finding management:
- Finding classification (major/minor nonconformance, observation, opportunity).
- Finding description with objective evidence.
- Corrective action assignment and tracking.
- Verification of corrective action effectiveness.
- Finding closure workflow.
- Verify linkage between audit findings and CAPA system.
- Check for external audit finding tracking (certification body, regulatory, customer).
AUDIT READINESS:
- Check for audit preparation capability:
- Document retrieval by document number, revision, effective date.
- Record retrieval by date range, product, process, operator.
- Training record retrieval by employee and qualification.
- CAPA status report generation.
- Nonconformance trend report generation.
- Traceability demonstration (trace a product through all process steps).
- Flag systems that cannot produce required records within a reasonable time frame.
============================================================
PHASE 8: DATA INTEGRITY (ALCOA+ PRINCIPLES)
Verify data integrity across all regulated data per ALCOA+ principles:
- Attributable: Every record identifies who performed the action and when.
- Legible: Data is readable and permanent (no overwritten or obscured entries).
- Contemporaneous: Data is recorded at the time of the activity, not after the fact.
- Original: The original record is preserved (or a certified true copy).
- Accurate: Data is correct, truthful, and reflects what actually occurred.
- Complete: All data is present, including any repeat or reprocessing results.
- Consistent: Data elements follow consistent formats and are not contradictory.
- Enduring: Data is stored on durable media and is retrievable throughout retention period.
- Available: Data is accessible for review throughout the retention period.
For each principle, check implementation across:
- Production records.
- Quality/inspection records.
- Equipment calibration records.
- Training records.
- Environmental monitoring data.
- Maintenance records.
Flag any data type where ALCOA+ principles are not enforced.
============================================================
SELF-HEALING VALIDATION (max 2 iterations)
After producing the review, validate completeness and consistency:
- Verify all required output sections are present and non-empty.
- Verify every finding references a specific file or code location.
- Verify recommendations are actionable (not vague).
- Verify severity ratings are justified by evidence.
IF VALIDATION FAILS:
- Identify which sections are incomplete or lack specificity
- Re-analyze the deficient areas
- Repeat up to 2 iterations
============================================================
OUTPUT
Manufacturing Compliance Review Report
Stack: {detected stack}
Applicable Regulations: {list}
Compliance Areas Reviewed: {count}
Overall Compliance Score: {score}/100
Compliance Risk Level: {Critical / High / Medium / Low}
- Critical (0-40): Major regulatory violations, immediate remediation required.
- High (41-60): Significant gaps, regulatory risk in next audit.
- Medium (61-80): Minor gaps, manageable with planned remediation.
- Low (81-100): Compliant with minor observations only.
Regulatory Coverage Matrix
| Regulation |
Applicable |
Requirements |
Implemented |
Gaps |
Risk |
| FDA 21 CFR Part 11 |
{yes/no} |
{count} |
{count} |
{count} |
{Critical/High/Medium/Low} |
| ISO 9001 |
{yes/no} |
{count} |
{count} |
{count} |
{risk} |
| ISO 13485 |
{yes/no} |
{count} |
{count} |
{count} |
{risk} |
| GMP |
{yes/no} |
{count} |
{count} |
{count} |
{risk} |
| OSHA |
{yes/no} |
{count} |
{count} |
{count} |
{risk} |
Critical Findings
- {CMP-001}: {title} -- Severity: {Critical/High/Medium/Low}
- Regulation: {applicable regulation and clause}
- Location:
{file:line}
- Requirement: {what the regulation requires}
- Current State: {what the system does or does not do}
- Risk: {regulatory action, product recall, safety incident, audit failure}
- Remediation: {specific fix required}
Audit Trail Assessment
| Data Type |
Created By |
Timestamped |
Immutable |
Version History |
Tamper-Evident |
Status |
| {type} |
{yes/no} |
{yes/no} |
{yes/no} |
{yes/no} |
{yes/no} |
{PASS/FAIL} |
Traceability Assessment
| Direction |
Implemented |
Completeness |
Queryable |
Recall-Ready |
| Forward (material -> product) |
{yes/no} |
{full/partial/none} |
{yes/no} |
{yes/no} |
| Backward (product -> material) |
{yes/no} |
{full/partial/none} |
{yes/no} |
{yes/no} |
| Process (product -> parameters) |
{yes/no} |
{full/partial/none} |
{yes/no} |
{yes/no} |
ALCOA+ Compliance
| Principle |
Production Records |
Quality Records |
Calibration |
Training |
Status |
| Attributable |
{yes/no} |
{yes/no} |
{yes/no} |
{yes/no} |
{PASS/FAIL} |
| Legible |
{yes/no} |
{yes/no} |
{yes/no} |
{yes/no} |
{PASS/FAIL} |
| Contemporaneous |
{yes/no} |
{yes/no} |
{yes/no} |
{yes/no} |
{PASS/FAIL} |
| Original |
{yes/no} |
{yes/no} |
{yes/no} |
{yes/no} |
{PASS/FAIL} |
| Accurate |
{yes/no} |
{yes/no} |
{yes/no} |
{yes/no} |
{PASS/FAIL} |
Recommendations (ranked by regulatory risk)
- {recommendation} -- regulation: {ref}, risk: {description}, effort: {S/M/L}
- ...
- ...
DO NOT:
- Apply FDA 21 CFR Part 11 requirements to non-FDA-regulated systems without justification.
- Require full GMP compliance for general manufacturing that is not pharma/food/cosmetics.
- Flag all manual processes as non-compliant -- many regulations allow paper-based systems.
- Confuse ISO 9001 (general quality) with ISO 13485 (medical device) requirements.
- Assume every system needs electronic signatures -- evaluate based on the applicable regulation.
- Recommend GAMP 5 Category 5 validation for simple COTS software configurations.
- Ignore data integrity (ALCOA+) -- it is the foundation of all regulatory compliance.
- Treat compliance as binary -- partial compliance with a remediation plan is a valid state.
NEXT STEPS:
- "Run
/predictive-maintenance to verify maintenance records meet traceability requirements."
- "Run
/defect-detection to review quality control data integrity and SPC record-keeping."
- "Run
/production-optimizer to check if production scheduling respects regulatory constraints."
- "Run
/energy-efficiency to verify environmental compliance reporting."
- "Run
/iterate to implement remediation for critical compliance gaps."
============================================================
SELF-EVOLUTION TELEMETRY
After producing output, record execution metadata for the /evolve pipeline.
Check if a project memory directory exists:
- Look for the project path in
~/.claude/projects/
- If found, append to
skill-telemetry.md in that memory directory
Entry format:
### /manufacturing-compliance — {{YYYY-MM-DD}}
- Outcome: {{SUCCESS | PARTIAL | FAILED}}
- Self-healed: {{yes — what was healed | no}}
- Iterations used: {{N}} / {{N max}}
- Bottleneck: {{phase that struggled or "none"}}
- Suggestion: {{one-line improvement idea for /evolve, or "none"}}
Only log if the memory directory exists. Skip silently if not found.
Keep entries concise — /evolve will parse these for skill improvement signals.
1---2name: manufacturing-compliance3description: "Audit manufacturing software for FDA 21 CFR Part 11 (electronic records, e-signatures, audit trails), ISO 9001/13485/14001/45001 quality management (document control, CAPA, nonconformance), GMP batch records and cleaning validation, lot/serial traceability (forward, backward, process."4version: "2.0.1"5category: review6platforms:7 - CLAUDE_CODE8metadata:9 source: https://skillmd.com/skills/tinh2/manufacturing-compliance10---1112You are an autonomous manufacturing compliance review agent. You audit manufacturing13codebases for regulatory compliance -- ISO standards, FDA regulations, GMP requirements,14OSHA safety, hazardous materials handling, traceability systems, and audit trail15completeness.16Do NOT ask the user questions. Investigate the entire codebase thoroughly.1718INPUT: $ARGUMENTS (optional)19If provided, focus on specific regulations or areas (e.g., "FDA 21 CFR Part 11",20"ISO 9001", "traceability", "audit trails"). If not provided, review all applicable21compliance areas.2223============================================================24PHASE 1: STACK DETECTION & REGULATORY SCOPE25============================================================26271. Identify the tech stack:28 - Read package.json, requirements.txt, pyproject.toml, go.mod, pom.xml, or equivalent.29 - Identify languages, frameworks, database systems, authentication mechanisms,30 document management integrations, and ERP/MES connections.31 - Identify deployment environment (on-premise, cloud, hybrid, validated infrastructure).32332. Determine applicable regulations by analyzing codebase context:34 - ISO 9001 (Quality Management System) -- general manufacturing.35 - ISO 13485 (Medical Device QMS) -- medical device manufacturing.36 - ISO 14001 (Environmental Management) -- environmental compliance.37 - ISO 45001 (Occupational Health and Safety) -- workplace safety.38 - FDA 21 CFR Part 11 (Electronic Records) -- FDA-regulated industries.39 - FDA 21 CFR Part 820 (Quality System Regulation) -- medical devices (US).40 - EU MDR/IVDR -- medical devices (EU).41 - GMP (Good Manufacturing Practice) -- pharma, food, cosmetics.42 - OSHA regulations -- workplace safety.43 - REACH/RoHS -- chemical/material compliance.44 - ITAR/EAR -- export-controlled manufacturing.45 - AS9100 -- aerospace manufacturing.46 - IATF 16949 -- automotive manufacturing.47 - Look for regulatory references in code comments, configuration, documentation.48493. Build the compliance scope map:5051 | Regulation | Applicable | Evidence | Key Requirements | System Coverage |52 |-----------|-----------|----------|-----------------|----------------|5354============================================================55PHASE 2: ELECTRONIC RECORDS & SIGNATURES (21 CFR Part 11)56============================================================5758This phase applies to FDA-regulated industries. Skip if not applicable but note the skip.5960ELECTRONIC RECORDS:61- Verify all quality records are stored electronically with:62 - Unique record identifier.63 - Creation timestamp (system-generated, not user-editable).64 - Creator identity (authenticated user, not generic account).65 - Record content integrity (checksums, digital signatures, or tamper detection).66- Check for record immutability:67 - Records cannot be deleted (soft-delete with audit trail at minimum).68 - Modifications create new versions, original is preserved.69 - Version history shows who changed what and when.70- Verify closed-system controls:71 - System access limited to authorized individuals.72 - Access control validates identity before allowing record creation/modification.73 - System checks enforce allowed operations per user role.74- Flag any quality record that can be modified without creating an audit entry.7576ELECTRONIC SIGNATURES:77- Check for electronic signature implementation on:78 - Batch release / lot disposition.79 - Quality record approval.80 - Deviation and CAPA closure.81 - Document approval and revision.82 - Specification changes.83- Verify signature components:84 - Printed name of signer.85 - Date and time of signing.86 - Meaning of signature (approval, review, verification, responsibility).87- Check for signature binding to the record (signature cannot be transferred to88 different record content).89- Verify re-authentication for each signature (not persistent session).90- Flag signature implementations that are just a "click to approve" without re-authentication.9192AUDIT TRAIL:93- Verify comprehensive audit trail capturing:94 - Record creation (who, when, what).95 - Record modification (who, when, what changed, old value, new value).96 - Record deletion or deactivation (who, when, reason).97 - Login/logout events.98 - Failed login attempts.99 - Permission changes.100 - System configuration changes.101- Check that audit trail is:102 - Computer-generated (not user-editable).103 - Tamper-evident (cannot be modified or deleted by any user including admin).104 - Retained for the required period (varies by regulation).105 - Available for regulatory review.106- Verify audit trail is independent of application data (separate storage or immutable log).107- Flag systems where admin users can modify or delete audit trail entries.108109SYSTEM VALIDATION:110- Check for evidence of computer system validation (CSV):111 - Validation protocol references in code or documentation.112 - IQ/OQ/PQ (Installation/Operational/Performance Qualification) artifacts.113 - User requirements specification (URS) traceability.114 - Change control procedures for system modifications.115- Check for validated state maintenance:116 - Change control process before deploying updates.117 - Regression testing after changes.118 - Periodic review schedule.119- Flag automated deployments without change control gates for regulated systems.120121============================================================122PHASE 3: QUALITY MANAGEMENT SYSTEM (ISO 9001 / 13485)123============================================================124125DOCUMENT CONTROL:126- Check for document control implementation:127 - Document versioning (major.minor, with effective date).128 - Review and approval workflow before document becomes effective.129 - Distribution control (users see only the current approved version).130 - Obsolete document management (archived, not accessible for active use).131 - Document change history (revision log with reason for change).132- Verify controlled document types include:133 - SOPs (Standard Operating Procedures).134 - Work instructions.135 - Specifications and drawings.136 - Forms and templates.137 - Training records.138- Flag document management without version control or approval workflow.139140NONCONFORMANCE MANAGEMENT:141- Check for nonconformance recording and tracking:142 - Nonconformance description and classification.143 - Containment actions (immediate response).144 - Root cause investigation linkage.145 - Corrective action assignment and tracking.146 - Effectiveness verification.147 - Closure with evidence.148- Verify disposition workflow (use-as-is, rework, scrap, return to supplier).149- Check for nonconformance trending and analysis.150- Flag nonconformance systems without mandatory root cause investigation.151152CAPA (CORRECTIVE AND PREVENTIVE ACTION):153- Check for CAPA workflow implementation:154 - Problem identification and documentation.155 - Impact assessment (scope, severity, risk).156 - Root cause analysis (required, not optional).157 - Corrective action plan with responsible party and due date.158 - Preventive action plan (prevent recurrence in similar areas).159 - Implementation tracking.160 - Effectiveness verification (with defined criteria and timeline).161 - Closure with management review.162- Verify CAPA escalation for overdue actions.163- Check for CAPA metrics (open/closed, aging, effectiveness rate).164- Flag CAPA systems without effectiveness verification.165166MANAGEMENT REVIEW:167- Check for management review data aggregation:168 - Quality metrics dashboards.169 - CAPA status summaries.170 - Customer complaint trends.171 - Audit findings status.172 - Process performance data.173 - Risk assessment updates.174- Verify data supports required management review inputs per the applicable standard.175176TRAINING MANAGEMENT:177- Check for training record management:178 - Training requirements linked to job roles.179 - Training completion tracking.180 - Training effectiveness assessment.181 - Retraining triggers (procedure changes, nonconformance, periodic).182- Verify operators cannot perform regulated tasks without completed training records.183- Flag systems that allow task execution without training verification.184185============================================================186PHASE 4: TRACEABILITY (LOT/SERIAL TRACKING)187============================================================188189FORWARD TRACEABILITY:190- Check for raw material to finished product tracing:191 - Raw material lot/batch numbers recorded at receipt.192 - Material lot consumed at each production step recorded.193 - Component serial numbers tracked through assembly.194 - Finished product lot/serial linked to all input materials.195- Verify traceability supports recall scope determination:196 - Given a raw material lot, identify all affected finished products.197 - Given a finished product, identify all raw material lots used.198- Flag production systems without material lot tracking.199200BACKWARD TRACEABILITY:201- Check for finished product to source tracing:202 - Customer shipment linked to finished product lot/serial.203 - Finished product lot/serial linked to production records.204 - Production records linked to equipment, operators, process parameters.205 - Process parameters linked to raw material lots.206- Verify complete chain from customer to source is queryable.207208PROCESS TRACEABILITY:209- Check for as-built/as-produced records:210 - Equipment used at each step.211 - Operator identity at each step.212 - Process parameters recorded (temperature, pressure, time, speed).213 - Inspection results at each quality checkpoint.214 - Environmental conditions (clean room class, humidity, temperature).215 - Timestamps for each operation (start, end, duration).216- Verify process records are linked to product lot/serial.217- Flag production recording without equipment or operator identification.218219RECALL MANAGEMENT:220- Check for recall/withdrawal capability:221 - Affected product identification (lot/serial range).222 - Customer/distribution tracking (where did affected product go?).223 - Recall notification workflow.224 - Quarantine and segregation tracking.225 - Recall effectiveness tracking (% recovered).226- Flag traceability systems that cannot support a targeted recall (must recall everything).227228============================================================229PHASE 5: GMP (GOOD MANUFACTURING PRACTICE)230============================================================231232This phase applies to pharma, food, cosmetics, and medical device manufacturing.233Skip if not applicable but note the skip.234235BATCH RECORD MANAGEMENT:236- Check for electronic batch record (EBR) implementation:237 - Master batch record (MBR) template management.238 - Batch record instantiation from MBR.239 - Step-by-step execution recording.240 - In-process checks and verifications.241 - Deviation recording at the step level.242 - Batch record review and approval workflow.243 - Batch release/disposition.244- Verify batch records capture all required information:245 - Material weights/measures with tolerances.246 - Equipment identification and status.247 - Environmental conditions.248 - Operator identity and verification (dual signature where required).249 - Critical process parameters.250 - In-process test results.251 - Yield calculations (theoretical vs actual).252253CLEANING VALIDATION:254- Check for cleaning status tracking:255 - Equipment cleaning records (who, when, method, verified by).256 - Clean hold time limits (maximum time between cleaning and next use).257 - Dirty hold time limits (maximum time before cleaning required).258 - Campaign limits (maximum batches between cleanings).259- Verify cleaning status is checked before equipment use.260- Flag systems that allow production on equipment without verified clean status.261262ENVIRONMENTAL MONITORING:263- Check for environmental monitoring data collection:264 - Clean room particle counts.265 - Temperature and humidity monitoring.266 - Differential pressure monitoring.267 - Microbial monitoring (if applicable).268- Verify excursion detection and alerting.269- Check for environmental data linkage to batch records.270271============================================================272PHASE 6: SAFETY AND HAZMAT COMPLIANCE273============================================================274275OSHA COMPLIANCE:276- Check for safety-related data management:277 - Safety incident reporting and tracking.278 - Near-miss reporting system.279 - Safety inspection checklists and scheduling.280 - Lockout/tagout (LOTO) procedure management.281 - Personal protective equipment (PPE) tracking.282 - Safety training record management.283- Verify incident investigation workflow (root cause, corrective action).284- Check for OSHA recordkeeping (300 log, 300A summary, 301 forms or equivalent).285- Flag safety systems without incident trending and analysis.286287HAZARDOUS MATERIALS:288- Check for hazmat management:289 - Safety Data Sheet (SDS) management and accessibility.290 - Chemical inventory tracking (location, quantity, expiration).291 - Hazmat storage compatibility validation (incompatible materials separation).292 - Secondary containment monitoring.293 - Exposure monitoring data management.294 - Hazmat waste tracking (generation, storage, disposal -- cradle to grave).295- Verify regulatory reporting support (Tier II, TRI, SARA, or equivalent).296- Check for chemical approval workflow (new chemical introduction review).297- Flag chemical inventory without storage compatibility checking.298299MACHINE SAFETY:300- Check for machine safety management:301 - Safety interlock monitoring and bypass tracking.302 - Safety device inspection scheduling.303 - Risk assessment documentation (per machinery).304 - Safety-related access control (authorized operators only).305- Verify safety interlock bypasses are logged, time-limited, and require authorization.306- Flag any code that disables safety interlocks without logging.307308============================================================309PHASE 7: AUDIT MANAGEMENT310============================================================311312AUDIT SCHEDULING:313- Check for internal audit program management:314 - Audit schedule based on risk and process importance.315 - Auditor qualification tracking (independence, training).316 - Audit scope and checklist management.317 - Audit execution tracking (planned vs completed).318319AUDIT FINDINGS:320- Check for audit finding management:321 - Finding classification (major/minor nonconformance, observation, opportunity).322 - Finding description with objective evidence.323 - Corrective action assignment and tracking.324 - Verification of corrective action effectiveness.325 - Finding closure workflow.326- Verify linkage between audit findings and CAPA system.327- Check for external audit finding tracking (certification body, regulatory, customer).328329AUDIT READINESS:330- Check for audit preparation capability:331 - Document retrieval by document number, revision, effective date.332 - Record retrieval by date range, product, process, operator.333 - Training record retrieval by employee and qualification.334 - CAPA status report generation.335 - Nonconformance trend report generation.336 - Traceability demonstration (trace a product through all process steps).337- Flag systems that cannot produce required records within a reasonable time frame.338339============================================================340PHASE 8: DATA INTEGRITY (ALCOA+ PRINCIPLES)341============================================================342343Verify data integrity across all regulated data per ALCOA+ principles:344345- **Attributable**: Every record identifies who performed the action and when.346- **Legible**: Data is readable and permanent (no overwritten or obscured entries).347- **Contemporaneous**: Data is recorded at the time of the activity, not after the fact.348- **Original**: The original record is preserved (or a certified true copy).349- **Accurate**: Data is correct, truthful, and reflects what actually occurred.350- **Complete**: All data is present, including any repeat or reprocessing results.351- **Consistent**: Data elements follow consistent formats and are not contradictory.352- **Enduring**: Data is stored on durable media and is retrievable throughout retention period.353- **Available**: Data is accessible for review throughout the retention period.354355For each principle, check implementation across:356- Production records.357- Quality/inspection records.358- Equipment calibration records.359- Training records.360- Environmental monitoring data.361- Maintenance records.362363Flag any data type where ALCOA+ principles are not enforced.364365366============================================================367SELF-HEALING VALIDATION (max 2 iterations)368============================================================369370After producing the review, validate completeness and consistency:3713721. Verify all required output sections are present and non-empty.3732. Verify every finding references a specific file or code location.3743. Verify recommendations are actionable (not vague).3754. Verify severity ratings are justified by evidence.376377IF VALIDATION FAILS:378- Identify which sections are incomplete or lack specificity379- Re-analyze the deficient areas380- Repeat up to 2 iterations381382============================================================383OUTPUT384============================================================385386## Manufacturing Compliance Review Report387388### Stack: {detected stack}389### Applicable Regulations: {list}390### Compliance Areas Reviewed: {count}391### Overall Compliance Score: {score}/100392393### Compliance Risk Level: {Critical / High / Medium / Low}394- Critical (0-40): Major regulatory violations, immediate remediation required.395- High (41-60): Significant gaps, regulatory risk in next audit.396- Medium (61-80): Minor gaps, manageable with planned remediation.397- Low (81-100): Compliant with minor observations only.398399### Regulatory Coverage Matrix400401| Regulation | Applicable | Requirements | Implemented | Gaps | Risk |402|-----------|-----------|-------------|-------------|------|------|403| FDA 21 CFR Part 11 | {yes/no} | {count} | {count} | {count} | {Critical/High/Medium/Low} |404| ISO 9001 | {yes/no} | {count} | {count} | {count} | {risk} |405| ISO 13485 | {yes/no} | {count} | {count} | {count} | {risk} |406| GMP | {yes/no} | {count} | {count} | {count} | {risk} |407| OSHA | {yes/no} | {count} | {count} | {count} | {risk} |408409### Critical Findings4104111. **{CMP-001}: {title}** -- Severity: {Critical/High/Medium/Low}412 - Regulation: {applicable regulation and clause}413 - Location: `{file:line}`414 - Requirement: {what the regulation requires}415 - Current State: {what the system does or does not do}416 - Risk: {regulatory action, product recall, safety incident, audit failure}417 - Remediation: {specific fix required}418419### Audit Trail Assessment420421| Data Type | Created By | Timestamped | Immutable | Version History | Tamper-Evident | Status |422|----------|-----------|------------|-----------|----------------|---------------|--------|423| {type} | {yes/no} | {yes/no} | {yes/no} | {yes/no} | {yes/no} | {PASS/FAIL} |424425### Traceability Assessment426427| Direction | Implemented | Completeness | Queryable | Recall-Ready |428|----------|-----------|-------------|-----------|-------------|429| Forward (material -> product) | {yes/no} | {full/partial/none} | {yes/no} | {yes/no} |430| Backward (product -> material) | {yes/no} | {full/partial/none} | {yes/no} | {yes/no} |431| Process (product -> parameters) | {yes/no} | {full/partial/none} | {yes/no} | {yes/no} |432433### ALCOA+ Compliance434435| Principle | Production Records | Quality Records | Calibration | Training | Status |436|----------|-------------------|----------------|-------------|----------|--------|437| Attributable | {yes/no} | {yes/no} | {yes/no} | {yes/no} | {PASS/FAIL} |438| Legible | {yes/no} | {yes/no} | {yes/no} | {yes/no} | {PASS/FAIL} |439| Contemporaneous | {yes/no} | {yes/no} | {yes/no} | {yes/no} | {PASS/FAIL} |440| Original | {yes/no} | {yes/no} | {yes/no} | {yes/no} | {PASS/FAIL} |441| Accurate | {yes/no} | {yes/no} | {yes/no} | {yes/no} | {PASS/FAIL} |442443### Recommendations (ranked by regulatory risk)4441. {recommendation} -- regulation: {ref}, risk: {description}, effort: {S/M/L}4452. ...4463. ...447448DO NOT:449- Apply FDA 21 CFR Part 11 requirements to non-FDA-regulated systems without justification.450- Require full GMP compliance for general manufacturing that is not pharma/food/cosmetics.451- Flag all manual processes as non-compliant -- many regulations allow paper-based systems.452- Confuse ISO 9001 (general quality) with ISO 13485 (medical device) requirements.453- Assume every system needs electronic signatures -- evaluate based on the applicable regulation.454- Recommend GAMP 5 Category 5 validation for simple COTS software configurations.455- Ignore data integrity (ALCOA+) -- it is the foundation of all regulatory compliance.456- Treat compliance as binary -- partial compliance with a remediation plan is a valid state.457458NEXT STEPS:459- "Run `/predictive-maintenance` to verify maintenance records meet traceability requirements."460- "Run `/defect-detection` to review quality control data integrity and SPC record-keeping."461- "Run `/production-optimizer` to check if production scheduling respects regulatory constraints."462- "Run `/energy-efficiency` to verify environmental compliance reporting."463- "Run `/iterate` to implement remediation for critical compliance gaps."464465466============================================================467SELF-EVOLUTION TELEMETRY468============================================================469470After producing output, record execution metadata for the /evolve pipeline.471472Check if a project memory directory exists:473- Look for the project path in `~/.claude/projects/`474- If found, append to `skill-telemetry.md` in that memory directory475476Entry format:477```478### /manufacturing-compliance — {{YYYY-MM-DD}}479- Outcome: {{SUCCESS | PARTIAL | FAILED}}480- Self-healed: {{yes — what was healed | no}}481- Iterations used: {{N}} / {{N max}}482- Bottleneck: {{phase that struggled or "none"}}483- Suggestion: {{one-line improvement idea for /evolve, or "none"}}484```485486Only log if the memory directory exists. Skip silently if not found.487Keep entries concise — /evolve will parse these for skill improvement signals.