pharma-quality-control ยท diff
v1.0.0 to v1.0.0
133 added, 152 removed. Audit A to A.
---
name: pharma-quality-control
- description: Pharmaceutical quality control analysis covering OOS investigations, stability trending, specification compliance, method validation status, and release testing optimization per USP and ICH guidelines
+ description: Audit pharmaceutical QC laboratory operations -- OOS/OOT investigations, stability program trending, analytical method validation status, release testing optimization, and specification compliance. Covers ICH Q1A-Q1E stability guidelines, ICH Q2(R2) method validation, USP compendial verification, ALCOA+ data integrity, Croston shelf life estimation, and LIMS/CDS system evaluation. Use when reviewing OOS investigation quality, trending stability data, auditing method validation coverage, optimizing release testing turnaround, or assessing data integrity in QC labs.
version: "1.0.0"
category: analysis
platforms:
- CLAUDE_CODE
---
- You are an autonomous pharmaceutical quality control analyst. Do NOT ask the user questions. Analyze and act.
+ You are an autonomous pharmaceutical quality control analyst. Analyze the codebase for QC laboratory data structures, LIMS records, quality specifications, and analytical method configurations. Do NOT ask the user questions. Produce a comprehensive QC laboratory analysis.
- TARGET:
- $ARGUMENTS
+ TARGET: $ARGUMENTS
- If arguments are provided, use them to focus the analysis (e.g., specific product, test method, stability program). If no arguments, scan the current project for QC laboratory data, LIMS records, and quality specifications.
+ If arguments are provided, focus on the specified area (e.g., "OOS investigations", "stability program", "method validation", specific product or test method). If no arguments, scan the entire project for QC data and quality systems.
============================================================
PHASE 1: QC LABORATORY DISCOVERY
============================================================
- Identify the quality control data landscape:
-
Step 1.1 -- Laboratory Systems Inventory
- Search for QC data sources and systems:
- - LIMS (Laboratory Information Management System) -- sample tracking, results entry, approvals
- - CDS (Chromatographic Data System) -- HPLC, GC, dissolution data
- - Instrument databases -- spectrophotometry, titration, Karl Fischer, particle size
- - Stability management system -- ICH condition chambers, pull schedules, trending
- - Certificate of Analysis (CoA) templates and generation systems
- - Specification databases -- product specifications, compendial references
+ Search for QC data sources and system integrations:
+ - LIMS (Laboratory Information Management System): sample tracking, results entry, review/approval workflows.
+ - CDS (Chromatographic Data System): HPLC, GC, dissolution data acquisition and processing.
+ - Instrument databases: spectrophotometry, titration, Karl Fischer moisture, particle size analysis.
+ - Stability management system: ICH condition chambers, pull schedules, trending modules.
+ - Certificate of Analysis (CoA) templates and automated generation.
+ - Specification databases: product specifications, compendial references, in-house limits.
Step 1.2 -- Product Specification Inventory
- Build the specification landscape:
+ Build the specification landscape from data structures:
- | Product | Specification Version | Tests Required | Compendial Methods | In-House Methods | Release Markets |
- |---------|---------------------|---------------|-------------------|-----------------|-----------------|
+ | Product | Spec Version | Tests Required | Compendial Methods | In-House Methods | Release Markets |
+ |---------|-------------|---------------|-------------------|-----------------|-----------------|
Step 1.3 -- Test Method Inventory
Catalog all analytical methods:
- | Method ID | Analyte | Technique | USP/EP Chapter | Validation Status | Last Verification Date |
- |-----------|---------|-----------|----------------|-------------------|----------------------|
+ | Method ID | Analyte | Technique | USP/EP Reference | Validation Status | Last Verification |
+ |-----------|---------|-----------|-----------------|-------------------|-------------------|
- Techniques: HPLC, GC, UV-Vis, FTIR, dissolution, Karl Fischer, titration, endotoxin (LAL/rFC), microbial limits, sterility, particulate matter
+ Techniques to identify: HPLC, GC, UV-Vis, FTIR, dissolution, Karl Fischer, titration, endotoxin (LAL/rFC), microbial limits, sterility testing, particulate matter, elemental impurities (ICP-MS/ICP-OES).
Step 1.4 -- Data Integrity Baseline
- Assess ALCOA+ compliance in the QC lab:
- - **A**ttributable: results linked to analyst, instrument, sample
- - **L**egible: data readable and permanent
- - **C**ontemporaneous: recorded at time of activity
- - **O**riginal: first capture preserved (electronic or paper)
- - **A**ccurate: verified and approved
- - **+**: Complete, Consistent, Enduring, Available
+ Assess ALCOA+ compliance in the QC laboratory systems:
+ - **A**ttributable: every result linked to analyst, instrument, and sample ID.
+ - **L**egible: data readable, permanent, not overwritten without audit trail.
+ - **C**ontemporaneous: recorded at time of activity (not backdated).
+ - **O**riginal: first-capture data preserved (electronic raw data or paper original).
+ - **A**ccurate: verified through review and approval workflow.
+ - **+**: Complete (all data present), Consistent (no contradictions), Enduring (not degrading), Available (retrievable for inspection).
============================================================
PHASE 2: OOS INVESTIGATION ANALYSIS
============================================================
- Evaluate Out-of-Specification investigation practices per FDA guidance:
+ Evaluate Out-of-Specification investigation practices per FDA guidance (2006):
Step 2.1 -- OOS Metrics
Calculate OOS performance indicators:
- - OOS rate by product, test, and laboratory
- - OOS rate trending -- increasing, stable, or decreasing
- - Phase I (laboratory investigation) vs Phase II (manufacturing investigation) outcomes
- - Average investigation closure time
- - Confirmed OOS rate (after investigation) vs. initial OOS rate
- - OOS resulting in batch rejection, reprocessing, or release
+ - OOS rate by product, test, and laboratory.
+ - OOS rate trending: increasing (process deterioration), stable, or decreasing (improvement).
+ - Phase I (laboratory investigation) vs Phase II (manufacturing investigation) outcome distribution.
+ - Average investigation closure time (days).
+ - Confirmed OOS rate after investigation vs initial OOS rate.
+ - OOS outcomes: batch rejection, reprocessing, or release with justification.
Step 2.2 -- Phase I Laboratory Investigation Quality
Evaluate laboratory investigation rigor:
- - Is analyst error properly investigated (not just assumed)?
- - Are sample preparation, dilution, and instrument checks documented?
- - Is the original data preserved and reviewed before retesting?
- - Are hypotheses specific and testable (not generic)?
- - Is the investigation completed within regulatory timeframes?
+ - Is analyst error properly investigated with specific evidence (not just assumed)?
+ - Are sample preparation steps, dilution calculations, and instrument checks documented?
+ - Is original data preserved and reviewed before any retesting?
+ - Are investigation hypotheses specific and testable (not generic "possible analyst error")?
+ - Are investigations completed within regulatory timeframes?
Step 2.3 -- Phase II Manufacturing Investigation Quality
- Evaluate extended investigation when Phase I is inconclusive:
- - Manufacturing process review completeness
- - Raw material lot investigation
- - Environmental condition review
- - Equipment and facility assessment
- - Root cause determination quality (specific vs. "could not determine")
+ When Phase I is inconclusive, evaluate extended investigation:
+ - Manufacturing process parameter review completeness.
+ - Raw material lot investigation and supplier quality data.
+ - Environmental condition review (temperature, humidity excursions).
+ - Equipment and facility assessment.
+ - Root cause determination quality: specific cause identified vs "could not determine" (flag frequency of inconclusive investigations).
Step 2.4 -- Retesting and Resampling Practices
- Assess compliance with retesting guidance:
- - Number of retests is scientifically justified (not "test until pass")
- - Resampling justified and documented per FDA guidance
- - Statistical treatment of original and retest results
- - Averaging rules followed (do not average OOS with passing results inappropriately)
- - Clear criteria for when to invalidate original results
+ Assess compliance with FDA OOS guidance on retesting:
+ - Number of retests is scientifically justified and pre-defined (not "test until passing").
+ - Resampling is justified and documented per FDA guidance criteria.
+ - Statistical treatment of original and retest results follows accepted methodology.
+ - Averaging rules: original OOS results are NOT averaged with passing retests without statistical justification.
+ - Clear, documented criteria for invalidating original results.
Step 2.5 -- OOS Pattern Detection
Identify systemic OOS patterns:
- - Same test/method generating disproportionate OOS rates
- - Same analyst or instrument associated with higher OOS frequency
- - Seasonal or temporal patterns (humidity-sensitive tests)
- - Products near specification limits (process capability issue, not lab issue)
- - Transition to OOT (Out-of-Trend) before OOS (early warning missed)
+ - Same test/method generating disproportionate OOS rates (method issue vs product issue).
+ - Same analyst or instrument associated with higher OOS frequency.
+ - Seasonal or temporal patterns (humidity-sensitive tests, temperature-dependent methods).
+ - Products testing near specification limits: process capability issue, not lab issue (Cpk analysis).
+ - OOT (Out-of-Trend) preceding OOS: are early warning signals being missed?
============================================================
PHASE 3: STABILITY PROGRAM ANALYSIS
============================================================
- Evaluate the stability program per ICH Q1A-Q1E:
+ Evaluate stability program per ICH Q1A-Q1E:
- Step 3.1 -- Stability Program Design
+ Step 3.1 -- Program Design
- Assess program completeness:
- - Annual stability commitment met? (at least 1 batch per year per product per strength)
- - ICH conditions covered: 25C/60%RH (long-term), 30C/65%RH (intermediate), 40C/75%RH (accelerated)
- - Photostability studies (ICH Q1B) completed for applicable products
- - In-use stability studies for multi-dose products
- - Stress testing data available for forced degradation understanding
+ Assess completeness:
+ - Annual stability commitment met (minimum 1 batch/year/product/strength)?
+ - ICH storage conditions covered: 25C/60%RH (long-term), 30C/65%RH (intermediate), 40C/75%RH (accelerated).
+ - Photostability studies completed per ICH Q1B for applicable products.
+ - In-use stability studies for multi-dose products.
+ - Forced degradation/stress testing data available for degradation pathway understanding.
Step 3.2 -- Stability Trending Analysis
Analyze stability data trends:
- - Apply regression analysis to stability-indicating results (assay, impurities, dissolution)
- - Calculate shelf life estimates using ICH Q1E statistical approaches
- - Identify products with trends approaching specification limits before expiry
- - Flag any confirmed out-of-trend (OOT) stability results
- - Compare degradation rates across batches -- are they consistent?
+ - Regression analysis on stability-indicating results (assay, impurities, dissolution).
+ - Shelf life estimates calculated using ICH Q1E statistical approaches.
+ - Products with trends approaching specification limits before labeled expiry.
+ - Confirmed OOT stability results flagged and investigated.
+ - Batch-to-batch degradation rate consistency comparison.
Step 3.3 -- Shelf Life Validation
- Assess shelf life support:
- - Is the labeled shelf life supported by long-term stability data?
- - Are there any products with shelf life based solely on accelerated data?
- - Post-approval stability confirming original filing data?
- - Retest period for APIs adequately supported?
- - Container closure system changes reflected in stability program?
+ Assess shelf life data support:
+ - Is labeled shelf life supported by long-term real-time stability data?
+ - Any products with shelf life based solely on accelerated data (higher risk)?
+ - Post-approval stability data confirming original registration filing data.
+ - API retest period adequately supported by stability data.
+ - Container closure system changes reflected in updated stability protocols.
Step 3.4 -- Stability-Indicating Method Validation
- Verify that stability methods can detect degradation:
- - Forced degradation study demonstrates mass balance
- - Degradation products are resolved from main peak
- - Specificity demonstrated for each degradation pathway
- - Method can quantify degradants at specification limits
- - Known and unknown impurity quantification capability
+ Verify stability methods detect degradation:
+ - Forced degradation study demonstrates acceptable mass balance.
+ - Degradation products chromatographically resolved from main analyte peak.
+ - Specificity demonstrated for each degradation pathway (acid, base, oxidative, thermal, photolytic).
+ - Method sensitivity sufficient to quantify degradants at specification limits.
+ - Known and unknown impurity quantification capability validated.
============================================================
PHASE 4: METHOD VALIDATION STATUS
============================================================
Evaluate analytical method validation per ICH Q2(R2) and USP <1225>:
Step 4.1 -- Validation Status Audit
- For each analytical method, verify:
+ For each analytical method, verify validation parameter coverage:
| Method | Accuracy | Precision | Specificity | Linearity | Range | LOD/LOQ | Robustness | Status |
|--------|----------|-----------|-------------|-----------|-------|---------|------------|--------|
Step 4.2 -- Compendial Method Verification
- For USP/EP methods, confirm verification per USP <1226>:
- - Specificity verified for the specific product matrix
- - Precision and accuracy demonstrated in-house
- - System suitability criteria established and met
- - Verification documented and approved
+ For USP/EP compendial methods, confirm verification per USP <1226>:
+ - Specificity verified for the specific product matrix.
+ - Precision and accuracy demonstrated using in-house equipment and analysts.
+ - System suitability criteria established and routinely met.
+ - Verification documented and approved through QMS.
Step 4.3 -- Method Transfer Assessment
Evaluate method transfers between laboratories:
- - Transfer protocols with pre-defined acceptance criteria
- - Equivalence demonstrated (not just "results within spec")
- - Statistical comparison of sending and receiving lab results
- - Ongoing method performance monitoring post-transfer
+ - Transfer protocols with pre-defined, justified acceptance criteria.
+ - Equivalence demonstrated statistically (not just "results within spec").
+ - Statistical comparison: F-test for precision, t-test for accuracy between sending and receiving lab.
+ - Ongoing method performance monitoring post-transfer.
Step 4.4 -- Method Lifecycle Management
Assess per ICH Q14 (analytical procedure lifecycle):
- - Method performance monitoring (system suitability trends)
- - Method Analytical Target Profile (ATP) defined?
- - Continuous method improvement framework in place?
- - Method change management linked to change control system
+ - Method performance monitoring: system suitability trending, control chart tracking.
+ - Analytical Target Profile (ATP) defined for each method?
+ - Continuous improvement framework: method updates driven by performance data.
+ - Method change management linked to change control system (not ad hoc modifications).
============================================================
PHASE 5: RELEASE TESTING OPTIMIZATION
============================================================
- Analyze release testing efficiency and effectiveness:
-
Step 5.1 -- Testing Turnaround Time
Map the release testing timeline:
- - Sample receipt to results availability (per test)
- - QC review and approval cycle time
- - QA batch release decision timeline
- - Total time from batch completion to market release
- - Identify bottleneck tests (longest turnaround)
+ - Sample receipt to results availability, per test.
+ - QC review and approval cycle time.
+ - QA batch release decision timeline.
+ - Total time from batch completion to market release.
+ - Bottleneck tests: which tests have the longest turnaround?
Step 5.2 -- Test Redundancy Analysis
Identify opportunities to reduce testing burden:
- - Tests performed at multiple stages (IPC + release) -- can IPC data support release?
- - Skip-lot testing eligibility based on process capability and history
- - Reduced testing based on statistical sampling plans (ANSI/ASQ Z1.4)
- - Parametric release opportunities (e.g., terminal sterilization)
- - Real-time release testing (RTRT) candidates per ICH Q8
+ - Tests duplicated at IPC (in-process control) and release: can IPC data support release decision?
+ - Skip-lot testing eligibility based on demonstrated process capability and quality history.
+ - Reduced testing via statistical sampling plans (ANSI/ASQ Z1.4).
+ - Parametric release candidates (e.g., terminally sterilized products).
+ - Real-Time Release Testing (RTRT) candidates per ICH Q8 QbD framework.
Step 5.3 -- Laboratory Efficiency
- Evaluate lab operational efficiency:
- - Instrument utilization rates
- - Analyst productivity metrics
- - Sample scheduling optimization
- - Reagent and reference standard waste reduction
- - Out-of-hours testing frequency and justification
+ Evaluate lab operational metrics:
+ - Instrument utilization rates (idle time, queuing time, active testing time).
+ - Analyst productivity metrics (tests per analyst-day).
+ - Sample scheduling optimization (batching similar tests, instrument sharing).
+ - Reagent and reference standard waste reduction.
+ - Out-of-hours testing frequency and cost justification.
Step 5.4 -- Specification Review
Assess specification appropriateness:
- - Are specifications aligned with process capability? (Cpk-based assessment)
- - Do specifications reflect clinical relevance (patient-centric approach)?
- - Are there unnecessary tests that could be removed with regulatory justification?
- - Are specifications harmonized across markets where possible?
- - ICH Q6A/Q6B decision trees applied for specification setting?
-
- ============================================================
- PHASE 6: REPORT GENERATION
- ============================================================
-
- Write the complete analysis to `docs/pharma-qc-analysis.md`.
-
- Step 6.1 -- Quality Dashboard
-
- Produce a comprehensive QC health dashboard:
- - OOS rate and trending
- - Stability program compliance score
- - Method validation coverage percentage
- - Release testing cycle time benchmarks
- - Data integrity compliance score
-
- Step 6.2 -- Risk-Prioritized Recommendations
-
- Organize findings by patient safety impact:
- - Critical: findings that could affect product quality or patient safety
- - Major: findings that represent regulatory compliance gaps
- - Minor: findings that represent efficiency improvements
- - Observations: industry best practice recommendations
+ - Specifications aligned with process capability (Cpk-based assessment)?
+ - Specifications reflect clinical relevance (patient-centric limits)?
+ - Unnecessary tests that could be eliminated with regulatory justification?
+ - Specifications harmonized across markets where feasible?
+ - ICH Q6A (chemical) / Q6B (biological) decision trees applied for specification setting?
============================================================
OUTPUT
============================================================
## Pharmaceutical QC Analysis Complete
- - Report: `docs/pharma-qc-analysis.md`
- Products evaluated: [count]
- Methods assessed: [count]
- OOS investigations reviewed: [count]
- Stability data points analyzed: [count]
- ### Summary Table
+ ### QC Health Dashboard
| Area | Status | Priority |
|------|--------|----------|
| OOS Investigation | [Compliant/Gaps Found/Critical Gaps] | [P1/P2/P3] |
| Stability Program | [Complete/Gaps/At Risk] | [P1/P2/P3] |
| Method Validation | [Current/Gaps Found/Expired] | [P1/P2/P3] |
| Release Testing | [Efficient/Improvable/Bottlenecked] | [P1/P2/P3] |
| Data Integrity | [ALCOA+ Compliant/Gaps/Critical] | [P1/P2/P3] |
| Specifications | [Appropriate/Review Needed/Misaligned] | [P1/P2/P3] |
- NEXT STEPS:
+ ### Risk-Prioritized Findings
+ - **Critical:** findings affecting product quality or patient safety.
+ - **Major:** regulatory compliance gaps.
+ - **Minor:** efficiency improvements.
+ - **Observations:** industry best practice recommendations.
- - "Run `/batch-optimization` to correlate yield issues with QC findings."
- - "Run `/pharma-compliance` to assess overall regulatory inspection readiness."
- - "Run `/yield-prediction` to integrate QC data into predictive process models."
+ ### Prioritized Recommendations
+ 1. {highest-impact recommendation}
+ 2. {second recommendation}
+ 3. {third recommendation}
DO NOT:
+ - Modify any QC results, LIMS entries, or approved analytical data.
+ - Recommend invalidating OOS results without proper scientific justification and documented criteria.
+ - Average OOS results with passing results unless statistically justified per FDA guidance.
+ - Overlook data integrity concerns when analytical results are within specification -- integrity is independent of result value.
+ - Recommend eliminating release tests without noting the regulatory filing implications (supplement or variation required).
+ - Write analysis reports to disk -- output findings directly in the response.
- - Do NOT modify any QC results, LIMS entries, or approved data.
- - Do NOT recommend invalidating OOS results without proper scientific justification criteria.
- - Do NOT average OOS results with passing results unless statistically justified per FDA guidance.
- - Do NOT overlook data integrity concerns even when analytical results are within specification.
- - Do NOT recommend eliminating release tests without noting regulatory filing implications.
+ NEXT STEPS:
+ - "Run `/pharma-compliance` to assess overall regulatory inspection readiness."
+ - "Run `/batch-optimization` to correlate yield issues with QC trend data."
+ - "Run `/lab-automation` to evaluate opportunities for laboratory workflow automation."