Source: https://github.com/aipoch/medical-research-skills
Chemical Storage Sorter
Organize laboratory chemicals into safe storage groups based on chemical compatibility and hazard classification. Prevents dangerous reactions by identifying incompatible pairs and providing segregation guidelines compliant with OSHA, NFPA, and institutional safety standards.
Key Capabilities:
- Automatic Chemical Classification: Categorize chemicals into hazard groups
- Compatibility Checking: Identify incompatible pairs that could react dangerously
- Storage Grouping: Sort chemical inventories into safe storage arrangements
- Safety Warnings: Generate warnings for incompatible combinations
- Regulatory Compliance: Follow OSHA and NFPA segregation rules
Input Validation
This skill accepts: a list of chemical names (comma-separated or one per line), or a single chemical name for compatibility checking. Chemical names should be standard IUPAC or common names; CAS numbers are also accepted.
If the request does not involve sorting or checking laboratory chemicals for safe storage — for example, asking to synthesize chemicals, interpret SDS documents, or provide medical advice about chemical exposure — do not proceed. Instead respond:
"Chemical Storage Sorter is designed to classify and sort laboratory chemicals for safe storage. Please provide a list of chemical names. For other chemical safety tasks, use a more appropriate tool."
Quick Check
python -m py_compile scripts/main.py
python scripts/main.py --help
Workflow
- Confirm the chemical list, required inputs, and any special constraints (custom classifications, lab-specific rules).
- Validate that the request matches the documented scope; stop if the task requires unsupported assumptions.
- Run the script or apply the documented classification path with only the inputs available.
- Return a structured result separating assumptions, deliverables, risks, and unresolved items.
- If execution fails or inputs are incomplete, switch to the fallback path and state exactly what blocked full completion.
Fallback: If no chemicals are provided, respond: "No chemical list provided. Please supply chemical names via --chemicals or as a text list. Cannot sort without input chemicals."
Core Capabilities
1. Chemical Classification
from scripts.main import ChemicalStorageSorter
sorter = ChemicalStorageSorter()
group = sorter.classify_chemical("Hydrochloric acid") # → "acids"
| Group |
Examples |
Storage Requirements |
| Acids |
HCl, H₂SO₄, HNO₃ |
Acid cabinet, secondary containment |
| Bases |
NaOH, KOH, ammonia |
Base cabinet, separate from acids |
| Oxidizers |
H₂O₂, KMnO₄, nitrates |
Cool, dry, away from organics |
| Flammables |
Ethanol, acetone, hexane |
Flammable storage cabinet |
| Toxics |
Cyanides, mercury, arsenic |
Locked cabinet, limited access |
| General |
NaCl, PBS, sucrose |
Standard storage |
2. Compatibility Checking
compatible, message = sorter.check_compatibility("Hydrochloric acid", "Sodium hydroxide")
# → False, "INCOMPATIBLE: acids cannot be stored with bases"
| Chemical Group |
Incompatible With |
Reaction Risk |
| Acids |
Bases, oxidizers, cyanides |
Violent neutralization, toxic gas |
| Oxidizers |
Flammables, acids, bases |
Fire, explosion |
| Flammables |
Oxidizers, acids |
Fire, combustion |
3. Storage Plan Generation
groups = sorter.sort_chemicals(inventory)
sorter.print_storage_plan(groups)
CLI Usage
# Sort list of chemicals
python scripts/main.py --chemicals "HCl,NaOH,ethanol,H2O2"
# Check compatibility between two chemicals
python scripts/main.py --chemicals "HCl" --check "NaOH"
# List all storage groups
python scripts/main.py --list-groups
Parameters
| Parameter |
Type |
Required |
Description |
--chemicals, -c |
string |
No |
Comma-separated chemical list |
--check |
string |
No |
Check compatibility with another chemical |
--list-groups, -l |
flag |
No |
List all storage groups |
Output Requirements
Every final response must make these explicit:
- Objective or requested deliverable
- Inputs used (chemical list) and assumptions introduced
- Classification method and any manual overrides applied
- Core result: storage groups with chemicals assigned, incompatibility warnings
- Constraints and risks (tool is first-check only; always verify with SDS)
- Unresolved items and next-step checks
Error Handling
- If no chemicals are provided, list the required input format and request it.
- If a chemical cannot be classified, assign to "general" and flag for manual review. Suggest: (1) provide the CAS number for lookup, (2) consult the SDS for GHS hazard classification, (3) contact the institutional safety officer.
- If
scripts/main.py fails, report the failure point and provide manual classification fallback using the hazard group table above.
- Do not fabricate classifications or compatibility results.
Common Pitfalls
- Assuming dilute = safe: Even dilute acids/bases need proper storage
- Storing by alphabetical order: Acetic acid next to acetone — always prioritize compatibility
- Inadequate separation: Use physical barriers (cabinets), not just distance
- Outdated storage plans: Update documentation whenever chemicals are relocated
- Ignoring multi-hazard chemicals: Concentrated HNO₃ is both acid and oxidizer — store in most restrictive group; multi-hazard chemicals are automatically assigned to the most restrictive applicable group
Storage Requirements by Group
| Group |
Cabinet Type |
Special Requirements |
| Acids |
Acid cabinet |
Secondary containment, corrosion-resistant |
| Bases |
Base cabinet |
Minimum 3 feet from acids |
| Oxidizers |
Standard/oxidizer |
Away from ignition sources |
| Flammables |
Flammable cabinet |
Bonding/grounding for dispensing |
| Toxics |
Locked cabinet |
Access log, limited quantities |
References
- OSHA Chemical Storage Guidelines: https://www.osha.gov/chemical-storage
- NFPA 45: Fire Protection for Laboratories Using Chemicals
- Prudent Practices in the Laboratory (National Research Council)
1---
2name: chemical-storage-sorter
3description: Sort laboratory chemicals into safe storage groups by hazard classification (acids, bases, oxidizers, flammables, toxics). Identifies incompatible pairs, generates storage plans with warnings, and supports OSHA/NFPA compliance for lab safety.
4license: MIT
5author: aipoch
6metadata:
7 source: https://skillmd.com/skills/aibot88/chemical-storage-sorter
8---
9
10> **Source**: [https://github.com/aipoch/medical-research-skills](https://github.com/aipoch/medical-research-skills)
11
12# Chemical Storage Sorter
13
14Organize laboratory chemicals into safe storage groups based on chemical compatibility and hazard classification. Prevents dangerous reactions by identifying incompatible pairs and providing segregation guidelines compliant with OSHA, NFPA, and institutional safety standards.
15
16**Key Capabilities:**
17- **Automatic Chemical Classification**: Categorize chemicals into hazard groups
18- **Compatibility Checking**: Identify incompatible pairs that could react dangerously
19- **Storage Grouping**: Sort chemical inventories into safe storage arrangements
20- **Safety Warnings**: Generate warnings for incompatible combinations
21- **Regulatory Compliance**: Follow OSHA and NFPA segregation rules
22
23---
24
25## Input Validation
26
27This skill accepts: a list of chemical names (comma-separated or one per line), or a single chemical name for compatibility checking. Chemical names should be standard IUPAC or common names; CAS numbers are also accepted.
28
29If the request does not involve sorting or checking laboratory chemicals for safe storage — for example, asking to synthesize chemicals, interpret SDS documents, or provide medical advice about chemical exposure — do not proceed. Instead respond:
30> "Chemical Storage Sorter is designed to classify and sort laboratory chemicals for safe storage. Please provide a list of chemical names. For other chemical safety tasks, use a more appropriate tool."
31
32---
33
34## Quick Check
35
36```bash
37python -m py_compile scripts/main.py
38python scripts/main.py --help
39```
40
41## Workflow
42
431. Confirm the chemical list, required inputs, and any special constraints (custom classifications, lab-specific rules).
442. Validate that the request matches the documented scope; stop if the task requires unsupported assumptions.
453. Run the script or apply the documented classification path with only the inputs available.
464. Return a structured result separating assumptions, deliverables, risks, and unresolved items.
475. If execution fails or inputs are incomplete, switch to the fallback path and state exactly what blocked full completion.
48
49**Fallback:** If no chemicals are provided, respond: "No chemical list provided. Please supply chemical names via `--chemicals` or as a text list. Cannot sort without input chemicals."
50
51---
52
53## Core Capabilities
54
55### 1. Chemical Classification
56
57```python
58from scripts.main import ChemicalStorageSorter
59sorter = ChemicalStorageSorter()
60group = sorter.classify_chemical("Hydrochloric acid") # → "acids"
61```
62
63| Group | Examples | Storage Requirements |
64|-------|----------|---------------------|
65| **Acids** | HCl, H₂SO₄, HNO₃ | Acid cabinet, secondary containment |
66| **Bases** | NaOH, KOH, ammonia | Base cabinet, separate from acids |
67| **Oxidizers** | H₂O₂, KMnO₄, nitrates | Cool, dry, away from organics |
68| **Flammables** | Ethanol, acetone, hexane | Flammable storage cabinet |
69| **Toxics** | Cyanides, mercury, arsenic | Locked cabinet, limited access |
70| **General** | NaCl, PBS, sucrose | Standard storage |
71
72### 2. Compatibility Checking
73
74```python
75compatible, message = sorter.check_compatibility("Hydrochloric acid", "Sodium hydroxide")
76# → False, "INCOMPATIBLE: acids cannot be stored with bases"
77```
78
79| Chemical Group | Incompatible With | Reaction Risk |
80|----------------|------------------|---------------|
81| **Acids** | Bases, oxidizers, cyanides | Violent neutralization, toxic gas |
82| **Oxidizers** | Flammables, acids, bases | Fire, explosion |
83| **Flammables** | Oxidizers, acids | Fire, combustion |
84
85### 3. Storage Plan Generation
86
87```python
88groups = sorter.sort_chemicals(inventory)
89sorter.print_storage_plan(groups)
90```
91
92---
93
94## CLI Usage
95
96```text
97# Sort list of chemicals
98python scripts/main.py --chemicals "HCl,NaOH,ethanol,H2O2"
99
100# Check compatibility between two chemicals
101python scripts/main.py --chemicals "HCl" --check "NaOH"
102
103# List all storage groups
104python scripts/main.py --list-groups
105```
106
107---
108
109## Parameters
110
111| Parameter | Type | Required | Description |
112|-----------|------|----------|-------------|
113| `--chemicals`, `-c` | string | No | Comma-separated chemical list |
114| `--check` | string | No | Check compatibility with another chemical |
115| `--list-groups`, `-l` | flag | No | List all storage groups |
116
117---
118
119## Output Requirements
120
121Every final response must make these explicit:
122
123- Objective or requested deliverable
124- Inputs used (chemical list) and assumptions introduced
125- Classification method and any manual overrides applied
126- Core result: storage groups with chemicals assigned, incompatibility warnings
127- Constraints and risks (tool is first-check only; always verify with SDS)
128- Unresolved items and next-step checks
129
130---
131
132## Error Handling
133
134- If no chemicals are provided, list the required input format and request it.
135- If a chemical cannot be classified, assign to "general" and flag for manual review. Suggest: (1) provide the CAS number for lookup, (2) consult the SDS for GHS hazard classification, (3) contact the institutional safety officer.
136- If `scripts/main.py` fails, report the failure point and provide manual classification fallback using the hazard group table above.
137- Do not fabricate classifications or compatibility results.
138
139---
140
141## Common Pitfalls
142
143- **Assuming dilute = safe**: Even dilute acids/bases need proper storage
144- **Storing by alphabetical order**: Acetic acid next to acetone — always prioritize compatibility
145- **Inadequate separation**: Use physical barriers (cabinets), not just distance
146- **Outdated storage plans**: Update documentation whenever chemicals are relocated
147- **Ignoring multi-hazard chemicals**: Concentrated HNO₃ is both acid and oxidizer — store in most restrictive group; multi-hazard chemicals are automatically assigned to the most restrictive applicable group
148
149---
150
151## Storage Requirements by Group
152
153| Group | Cabinet Type | Special Requirements |
154|-------|-------------|---------------------|
155| **Acids** | Acid cabinet | Secondary containment, corrosion-resistant |
156| **Bases** | Base cabinet | Minimum 3 feet from acids |
157| **Oxidizers** | Standard/oxidizer | Away from ignition sources |
158| **Flammables** | Flammable cabinet | Bonding/grounding for dispensing |
159| **Toxics** | Locked cabinet | Access log, limited quantities |
160
161---
162
163## References
164
165- OSHA Chemical Storage Guidelines: https://www.osha.gov/chemical-storage
166- NFPA 45: Fire Protection for Laboratories Using Chemicals
167- Prudent Practices in the Laboratory (National Research Council)