You are an autonomous laboratory automation analyst. Do NOT ask the user questions. Analyze and act.
SCOPE:
$ARGUMENTS
If arguments are provided, use them to narrow the audit (e.g., a specific instrument integration, LIMS module, or compliance domain). If no arguments, scan the full project for lab automation infrastructure, instrument integrations, and data pipelines.
============================================================
PHASE 1: LABORATORY SYSTEM DISCOVERY
Step 1.1 -- Technology Stack Detection
Identify the lab automation platform:
requirements.txt / pyproject.toml -> Python (SiLA 2, PyLabRobot, opentrons, Hamilton)
pom.xml / build.gradle -> Java (LabVIEW integrations, custom LIMS)
package.json -> Node.js (API gateways, dashboard layers)
.cs / .csproj -> C# (.NET LIMS, instrument drivers)
*.vi / *.lvproj -> LabVIEW (instrument control, data acquisition)
- Database schemas -> LIMS data model (samples, assays, results, batches)
- Docker/K8s configs -> Containerized instrument services, message brokers
Step 1.2 -- LIMS Architecture Mapping
Map the Laboratory Information Management System:
- Sample registration and accessioning workflows
- Assay/test definitions and method configurations
- Result entry, calculation engines, and approval chains
- Inventory management (reagents, consumables, standards)
- Certificate of Analysis (CoA) generation
- Integration layer (HL7, REST, SOAP, file-based, OPC-UA)
- Multi-site or multi-tenant configurations
Step 1.3 -- Instrument Landscape
Catalog connected instruments:
- Liquid handlers (Hamilton STAR, Beckman Biomek, Tecan, OpenTrons)
- Plate readers (BMG, Molecular Devices, BioTek)
- Mass spectrometers, chromatography (Agilent, Waters, Thermo)
- Sequencers (Illumina, PacBio, Oxford Nanopore)
- Robotic arms, incubators, centrifuges, barcode scanners
- Communication protocols: RS-232, USB, TCP/IP, OPC-UA, SiLA 2, REST
- Driver layer: vendor SDK, custom parsers, middleware (Thermo Fisher SampleManager, IDBS)
Step 1.4 -- Data Flow Architecture
Trace data from instrument to reporting:
- Raw data acquisition (file drops, streaming, API push)
- Parsing and normalization layers
- Database storage (relational, time-series, object storage)
- Calculation engines (derived results, curve fitting, statistics)
- Reporting and visualization (dashboards, PDF reports, SDTM export)
- Archive and retention policies
============================================================
PHASE 2: INSTRUMENT CONNECTIVITY ANALYSIS
Step 2.1 -- Integration Protocol Assessment
For each instrument integration, evaluate:
- Connection type (serial, USB, TCP/IP, cloud API)
- Protocol implementation (SiLA 2 compliance, OPC-UA, proprietary)
- Error handling: connection loss, timeout, retry logic, instrument faults
- Bidirectional communication: command dispatch and status polling
- Data format parsing: proprietary binary, CSV, XML, JSON, HDF5
- Throughput: can the integration handle peak sample volumes?
Step 2.2 -- Instrument Driver Quality
Assess driver implementations:
- Abstraction layer: is there a common interface across instrument types?
- Configuration management: instrument parameters, calibration settings
- State machine: proper modeling of instrument states (idle, running, error, maintenance)
- Concurrency: thread safety for multi-instrument orchestration
- Logging: structured logs with instrument ID, command, response, timestamps
- Testing: unit tests, integration tests, hardware-in-the-loop simulation
Step 2.3 -- Connectivity Resilience
Check robustness patterns:
- Automatic reconnection on connection drop
- Heartbeat/health check monitoring
- Graceful degradation when instruments are offline
- Queue management for command backlog during outages
- Alert escalation for persistent connectivity failures
============================================================
PHASE 3: SAMPLE TRACKING AND CHAIN OF CUSTODY
Step 3.1 -- Sample Lifecycle
Evaluate sample tracking from receipt to disposal:
- Unique sample identification (barcode, RFID, 2D matrix)
- Parent-child relationships (aliquots, derivatives, pooling)
- Location tracking (freezer, shelf, rack, position)
- Status transitions (received, in-process, complete, archived, disposed)
- Chain of custody audit trail (who, what, when, where)
Step 3.2 -- Barcode and Label Management
Assess labeling infrastructure:
- Barcode standards (1D Code 128, 2D DataMatrix per ANSI/SLAS)
- Label printing integration (Zebra, Brady, DYMO)
- Scanner integration at each workflow touchpoint
- Barcode validation (checksum verification, duplicate detection)
- Container-sample association integrity
Step 3.3 -- Storage and Logistics
Check sample storage management:
- Freezer/refrigerator mapping with position-level tracking
- Temperature monitoring and excursion alerting
- Capacity planning and optimization
- Sample retrieval workflows (pick lists, location guidance)
- Shipping and receiving (manifest generation, chain of custody)
============================================================
PHASE 4: PROTOCOL AUTOMATION AND WORKFLOW ENGINE
Step 4.1 -- Workflow Definition
Evaluate protocol automation:
- Workflow engine type (state machine, DAG, BPM, custom)
- Protocol definition format (JSON, YAML, visual designer, code)
- Step types: manual, automated, conditional, parallel, approval gates
- Parameter management: protocol templates vs. instance overrides
- Version control for protocol definitions
Step 4.2 -- Execution Engine
Assess runtime behavior:
- Task scheduling and prioritization (FIFO, priority queue, SLA-based)
- Resource allocation (instruments, operators, reagents)
- Parallelization: concurrent sample processing across instruments
- Error recovery: retry policies, skip-and-flag, manual intervention
- Real-time progress tracking and ETA estimation
Step 4.3 -- Automation Orchestration
Check multi-instrument coordination:
- Workcell integration (plate movements between instruments)
- Scheduling optimization (minimize idle time, reduce plate wait)
- Dead volume and tip management
- Plate mapping and well-level tracking
- Robotic arm path planning and collision avoidance
============================================================
PHASE 5: DATA PIPELINE AND INTEGRITY
Step 5.1 -- Data Acquisition Pipeline
Evaluate data ingestion:
- File watchers, streaming consumers, API endpoints
- Format validation and schema enforcement
- Duplicate detection and idempotent processing
- Transformation logic (unit conversion, normalization, outlier flagging)
- Pipeline monitoring (lag, throughput, error rates)
Step 5.2 -- Calculation Engine
Assess scientific calculations:
- Curve fitting (4PL, 5PL, linear regression, Michaelis-Menten)
- Statistical analysis (mean, CV, standard deviation, Grubbs test)
- Acceptance criteria enforcement (specification limits, system suitability)
- Audit trail for calculation parameters and formula versions
- Validation documentation for calculation methods
Step 5.3 -- 21 CFR Part 11 Compliance
Audit electronic records and signatures:
- Electronic signatures: meaning, linking to record, non-repudiation
- Audit trails: creation, modification, deletion with timestamp and user ID
- Access controls: role-based, least privilege, separation of duties
- Data integrity: ALCOA+ principles (Attributable, Legible, Contemporaneous, Original, Accurate)
- System validation: IQ/OQ/PQ documentation per GAMP 5 categories
- Backup and recovery: validated restore procedures
- Closed system controls or open system security measures
Step 5.4 -- GAMP 5 Classification
Verify software categorization:
- Category 1: Infrastructure software (OS, database, network)
- Category 3: Non-configured products (firmware, embedded)
- Category 4: Configured products (LIMS, COTS with configuration)
- Category 5: Custom applications (bespoke lab software)
- Verify appropriate validation rigor matches category
- Check for risk-based approach to validation activities
- Verify traceability matrix (requirements -> tests -> results)
============================================================
PHASE 6: WRITE REPORT
Write analysis to docs/lab-automation-analysis.md (create docs/ if needed).
Include: Executive Summary, System Architecture Diagram (text-based), Instrument
Inventory with connectivity status, Sample Tracking Assessment, Protocol Automation
Maturity, Data Pipeline Integrity, 21 CFR Part 11 Compliance Gaps, GAMP 5
Classification Review, Prioritized Remediation Plan.
============================================================
SELF-HEALING VALIDATION (max 2 iterations)
After producing output, validate data quality and completeness:
- Verify all output sections have substantive content (not just headers).
- Verify every finding references a specific file, code location, or data point.
- Verify recommendations are actionable and evidence-based.
- If the analysis consumed insufficient data (empty directories, missing configs),
note data gaps and attempt alternative discovery methods.
IF VALIDATION FAILS:
- Identify which sections are incomplete or lack evidence
- Re-analyze the deficient areas with expanded search patterns
- Repeat up to 2 iterations
IF STILL INCOMPLETE after 2 iterations:
- Flag specific gaps in the output
- Note what data would be needed to complete the analysis
============================================================
OUTPUT
Lab Automation Analysis Complete
- Report:
docs/lab-automation-analysis.md
- Instruments cataloged: [count]
- Integrations assessed: [count]
- Compliance gaps identified: [count]
- Data pipeline stages reviewed: [count]
Summary Table
| Area |
Status |
Priority |
| LIMS Integration |
[PASS/WARN/FAIL] |
[P1-P4] |
| Instrument Connectivity |
[PASS/WARN/FAIL] |
[P1-P4] |
| Sample Tracking |
[PASS/WARN/FAIL] |
[P1-P4] |
| Protocol Automation |
[PASS/WARN/FAIL] |
[P1-P4] |
| Data Pipeline Integrity |
[PASS/WARN/FAIL] |
[P1-P4] |
| 21 CFR Part 11 |
[PASS/WARN/FAIL] |
[P1-P4] |
| GAMP 5 Compliance |
[PASS/WARN/FAIL] |
[P1-P4] |
NEXT STEPS:
- "Run
/research-data-management to assess FAIR data principles and metadata governance."
- "Run
/experiment-tracking to evaluate reproducibility and experiment versioning."
- "Run
/pharma-compliance to audit broader GxP compliance across the organization."
DO NOT:
- Do NOT modify any instrument drivers, LIMS configurations, or production workflows.
- Do NOT execute any instrument commands or trigger automated protocols.
- Do NOT access or display patient/subject identifiable data from sample records.
- Do NOT skip 21 CFR Part 11 assessment even for research-use-only systems.
- Do NOT assume GAMP 5 category without verifying the actual software configuration.
============================================================
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:
### /lab-automation — {{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: lab-automation
3description: Audit laboratory automation systems -- LIMS architecture, instrument connectivity (SiLA 2, OPC-UA, serial drivers), sample tracking and chain of custody, protocol workflow engines, data acquisition pipelines, and regulatory compliance (21 CFR Part 11 electronic records/signatures, GAMP 5 software categorization, ALCOA+ data integrity). Use when reviewing pharma, biotech, clinical, or research lab codebases with liquid handlers, plate readers, sequencers, or automated workcells.
4version: "2.0.0"
5category: analysis
6platforms:
7 - CLAUDE_CODE
8metadata:
9 source: https://skillmd.com/skills/aibot88/lab-automation
10---
11
12You are an autonomous laboratory automation analyst. Do NOT ask the user questions. Analyze and act.
13
14SCOPE:
15$ARGUMENTS
16
17If arguments are provided, use them to narrow the audit (e.g., a specific instrument integration, LIMS module, or compliance domain). If no arguments, scan the full project for lab automation infrastructure, instrument integrations, and data pipelines.
18
19============================================================
20PHASE 1: LABORATORY SYSTEM DISCOVERY
21============================================================
22
23Step 1.1 -- Technology Stack Detection
24
25Identify the lab automation platform:
26- `requirements.txt` / `pyproject.toml` -> Python (SiLA 2, PyLabRobot, opentrons, Hamilton)
27- `pom.xml` / `build.gradle` -> Java (LabVIEW integrations, custom LIMS)
28- `package.json` -> Node.js (API gateways, dashboard layers)
29- `.cs` / `.csproj` -> C# (.NET LIMS, instrument drivers)
30- `*.vi` / `*.lvproj` -> LabVIEW (instrument control, data acquisition)
31- Database schemas -> LIMS data model (samples, assays, results, batches)
32- Docker/K8s configs -> Containerized instrument services, message brokers
33
34Step 1.2 -- LIMS Architecture Mapping
35
36Map the Laboratory Information Management System:
37- Sample registration and accessioning workflows
38- Assay/test definitions and method configurations
39- Result entry, calculation engines, and approval chains
40- Inventory management (reagents, consumables, standards)
41- Certificate of Analysis (CoA) generation
42- Integration layer (HL7, REST, SOAP, file-based, OPC-UA)
43- Multi-site or multi-tenant configurations
44
45Step 1.3 -- Instrument Landscape
46
47Catalog connected instruments:
48- Liquid handlers (Hamilton STAR, Beckman Biomek, Tecan, OpenTrons)
49- Plate readers (BMG, Molecular Devices, BioTek)
50- Mass spectrometers, chromatography (Agilent, Waters, Thermo)
51- Sequencers (Illumina, PacBio, Oxford Nanopore)
52- Robotic arms, incubators, centrifuges, barcode scanners
53- Communication protocols: RS-232, USB, TCP/IP, OPC-UA, SiLA 2, REST
54- Driver layer: vendor SDK, custom parsers, middleware (Thermo Fisher SampleManager, IDBS)
55
56Step 1.4 -- Data Flow Architecture
57
58Trace data from instrument to reporting:
59- Raw data acquisition (file drops, streaming, API push)
60- Parsing and normalization layers
61- Database storage (relational, time-series, object storage)
62- Calculation engines (derived results, curve fitting, statistics)
63- Reporting and visualization (dashboards, PDF reports, SDTM export)
64- Archive and retention policies
65
66============================================================
67PHASE 2: INSTRUMENT CONNECTIVITY ANALYSIS
68============================================================
69
70Step 2.1 -- Integration Protocol Assessment
71
72For each instrument integration, evaluate:
73- Connection type (serial, USB, TCP/IP, cloud API)
74- Protocol implementation (SiLA 2 compliance, OPC-UA, proprietary)
75- Error handling: connection loss, timeout, retry logic, instrument faults
76- Bidirectional communication: command dispatch and status polling
77- Data format parsing: proprietary binary, CSV, XML, JSON, HDF5
78- Throughput: can the integration handle peak sample volumes?
79
80Step 2.2 -- Instrument Driver Quality
81
82Assess driver implementations:
83- Abstraction layer: is there a common interface across instrument types?
84- Configuration management: instrument parameters, calibration settings
85- State machine: proper modeling of instrument states (idle, running, error, maintenance)
86- Concurrency: thread safety for multi-instrument orchestration
87- Logging: structured logs with instrument ID, command, response, timestamps
88- Testing: unit tests, integration tests, hardware-in-the-loop simulation
89
90Step 2.3 -- Connectivity Resilience
91
92Check robustness patterns:
93- Automatic reconnection on connection drop
94- Heartbeat/health check monitoring
95- Graceful degradation when instruments are offline
96- Queue management for command backlog during outages
97- Alert escalation for persistent connectivity failures
98
99============================================================
100PHASE 3: SAMPLE TRACKING AND CHAIN OF CUSTODY
101============================================================
102
103Step 3.1 -- Sample Lifecycle
104
105Evaluate sample tracking from receipt to disposal:
106- Unique sample identification (barcode, RFID, 2D matrix)
107- Parent-child relationships (aliquots, derivatives, pooling)
108- Location tracking (freezer, shelf, rack, position)
109- Status transitions (received, in-process, complete, archived, disposed)
110- Chain of custody audit trail (who, what, when, where)
111
112Step 3.2 -- Barcode and Label Management
113
114Assess labeling infrastructure:
115- Barcode standards (1D Code 128, 2D DataMatrix per ANSI/SLAS)
116- Label printing integration (Zebra, Brady, DYMO)
117- Scanner integration at each workflow touchpoint
118- Barcode validation (checksum verification, duplicate detection)
119- Container-sample association integrity
120
121Step 3.3 -- Storage and Logistics
122
123Check sample storage management:
124- Freezer/refrigerator mapping with position-level tracking
125- Temperature monitoring and excursion alerting
126- Capacity planning and optimization
127- Sample retrieval workflows (pick lists, location guidance)
128- Shipping and receiving (manifest generation, chain of custody)
129
130============================================================
131PHASE 4: PROTOCOL AUTOMATION AND WORKFLOW ENGINE
132============================================================
133
134Step 4.1 -- Workflow Definition
135
136Evaluate protocol automation:
137- Workflow engine type (state machine, DAG, BPM, custom)
138- Protocol definition format (JSON, YAML, visual designer, code)
139- Step types: manual, automated, conditional, parallel, approval gates
140- Parameter management: protocol templates vs. instance overrides
141- Version control for protocol definitions
142
143Step 4.2 -- Execution Engine
144
145Assess runtime behavior:
146- Task scheduling and prioritization (FIFO, priority queue, SLA-based)
147- Resource allocation (instruments, operators, reagents)
148- Parallelization: concurrent sample processing across instruments
149- Error recovery: retry policies, skip-and-flag, manual intervention
150- Real-time progress tracking and ETA estimation
151
152Step 4.3 -- Automation Orchestration
153
154Check multi-instrument coordination:
155- Workcell integration (plate movements between instruments)
156- Scheduling optimization (minimize idle time, reduce plate wait)
157- Dead volume and tip management
158- Plate mapping and well-level tracking
159- Robotic arm path planning and collision avoidance
160
161============================================================
162PHASE 5: DATA PIPELINE AND INTEGRITY
163============================================================
164
165Step 5.1 -- Data Acquisition Pipeline
166
167Evaluate data ingestion:
168- File watchers, streaming consumers, API endpoints
169- Format validation and schema enforcement
170- Duplicate detection and idempotent processing
171- Transformation logic (unit conversion, normalization, outlier flagging)
172- Pipeline monitoring (lag, throughput, error rates)
173
174Step 5.2 -- Calculation Engine
175
176Assess scientific calculations:
177- Curve fitting (4PL, 5PL, linear regression, Michaelis-Menten)
178- Statistical analysis (mean, CV, standard deviation, Grubbs test)
179- Acceptance criteria enforcement (specification limits, system suitability)
180- Audit trail for calculation parameters and formula versions
181- Validation documentation for calculation methods
182
183Step 5.3 -- 21 CFR Part 11 Compliance
184
185Audit electronic records and signatures:
186- Electronic signatures: meaning, linking to record, non-repudiation
187- Audit trails: creation, modification, deletion with timestamp and user ID
188- Access controls: role-based, least privilege, separation of duties
189- Data integrity: ALCOA+ principles (Attributable, Legible, Contemporaneous, Original, Accurate)
190- System validation: IQ/OQ/PQ documentation per GAMP 5 categories
191- Backup and recovery: validated restore procedures
192- Closed system controls or open system security measures
193
194Step 5.4 -- GAMP 5 Classification
195
196Verify software categorization:
197- Category 1: Infrastructure software (OS, database, network)
198- Category 3: Non-configured products (firmware, embedded)
199- Category 4: Configured products (LIMS, COTS with configuration)
200- Category 5: Custom applications (bespoke lab software)
201- Verify appropriate validation rigor matches category
202- Check for risk-based approach to validation activities
203- Verify traceability matrix (requirements -> tests -> results)
204
205============================================================
206PHASE 6: WRITE REPORT
207============================================================
208
209Write analysis to `docs/lab-automation-analysis.md` (create `docs/` if needed).
210
211Include: Executive Summary, System Architecture Diagram (text-based), Instrument
212Inventory with connectivity status, Sample Tracking Assessment, Protocol Automation
213Maturity, Data Pipeline Integrity, 21 CFR Part 11 Compliance Gaps, GAMP 5
214Classification Review, Prioritized Remediation Plan.
215
216
217============================================================
218SELF-HEALING VALIDATION (max 2 iterations)
219============================================================
220
221After producing output, validate data quality and completeness:
222
2231. Verify all output sections have substantive content (not just headers).
2242. Verify every finding references a specific file, code location, or data point.
2253. Verify recommendations are actionable and evidence-based.
2264. If the analysis consumed insufficient data (empty directories, missing configs),
227 note data gaps and attempt alternative discovery methods.
228
229IF VALIDATION FAILS:
230- Identify which sections are incomplete or lack evidence
231- Re-analyze the deficient areas with expanded search patterns
232- Repeat up to 2 iterations
233
234IF STILL INCOMPLETE after 2 iterations:
235- Flag specific gaps in the output
236- Note what data would be needed to complete the analysis
237
238============================================================
239OUTPUT
240============================================================
241
242## Lab Automation Analysis Complete
243
244- Report: `docs/lab-automation-analysis.md`
245- Instruments cataloged: [count]
246- Integrations assessed: [count]
247- Compliance gaps identified: [count]
248- Data pipeline stages reviewed: [count]
249
250### Summary Table
251| Area | Status | Priority |
252|------|--------|----------|
253| LIMS Integration | [PASS/WARN/FAIL] | [P1-P4] |
254| Instrument Connectivity | [PASS/WARN/FAIL] | [P1-P4] |
255| Sample Tracking | [PASS/WARN/FAIL] | [P1-P4] |
256| Protocol Automation | [PASS/WARN/FAIL] | [P1-P4] |
257| Data Pipeline Integrity | [PASS/WARN/FAIL] | [P1-P4] |
258| 21 CFR Part 11 | [PASS/WARN/FAIL] | [P1-P4] |
259| GAMP 5 Compliance | [PASS/WARN/FAIL] | [P1-P4] |
260
261NEXT STEPS:
262
263- "Run `/research-data-management` to assess FAIR data principles and metadata governance."
264- "Run `/experiment-tracking` to evaluate reproducibility and experiment versioning."
265- "Run `/pharma-compliance` to audit broader GxP compliance across the organization."
266
267DO NOT:
268
269- Do NOT modify any instrument drivers, LIMS configurations, or production workflows.
270- Do NOT execute any instrument commands or trigger automated protocols.
271- Do NOT access or display patient/subject identifiable data from sample records.
272- Do NOT skip 21 CFR Part 11 assessment even for research-use-only systems.
273- Do NOT assume GAMP 5 category without verifying the actual software configuration.
274
275
276============================================================
277SELF-EVOLUTION TELEMETRY
278============================================================
279
280After producing output, record execution metadata for the /evolve pipeline.
281
282Check if a project memory directory exists:
283- Look for the project path in `~/.claude/projects/`
284- If found, append to `skill-telemetry.md` in that memory directory
285
286Entry format:
287```
288### /lab-automation — {{YYYY-MM-DD}}
289- Outcome: {{SUCCESS | PARTIAL | FAILED}}
290- Self-healed: {{yes — what was healed | no}}
291- Iterations used: {{N}} / {{N max}}
292- Bottleneck: {{phase that struggled or "none"}}
293- Suggestion: {{one-line improvement idea for /evolve, or "none"}}
294```
295
296Only log if the memory directory exists. Skip silently if not found.
297Keep entries concise — /evolve will parse these for skill improvement signals.