Agent Skills

Buffer Calculator

AIPOCH

Calculate precise buffer recipes with accurate mass and volume measurements for molecular biology and biochemistry. Supports PBS, RIPA, and TAE with concentration scaling, stock solution preparation, pH adjustment guidance, and step-by-step protocols.

3
0
FILES
buffer-calculator/
skill.md
scripts
main.py
87100Total Score
View Evaluation Report
Core Capability
86 / 100
Functional Suitability
11 / 12
Reliability
11 / 12
Performance & Context
7 / 8
Agent Usability
14 / 16
Human Usability
7 / 8
Security
10 / 12
Maintainability
11 / 12
Agent-Specific
15 / 20
Medical Task
12 / 12 Passed
87Calculate 1X PBS recipe for 500 mL
4/4
87Calculate 10X PBS stock solution for 1000 mL
4/4
88Request for a buffer type not in the library (e.g., HEPES buffer)
4/4

SKILL.md

Buffer Calculator

Calculate precise buffer formulations with accurate mass and volume measurements for molecular biology, biochemistry, and cell culture applications. Supports predefined common buffers and customizable calculations with pH adjustment guidance.

Key Capabilities:

  • Predefined Buffer Library: PBS, RIPA, TAE with accurate molecular weights
  • Precise Mass Calculations: Component masses to milligram precision
  • Volume-Based Components: Handle liquid components (detergents, acids)
  • Concentration Scaling: Scale from stock solutions (10X, 20X) to working concentrations
  • Step-by-Step Protocols: Detailed preparation instructions with safety notes

Input Validation

This skill accepts: a buffer type (PBS, RIPA, TAE), final volume in mL, and optional concentration multiplier (default 1X).

If the request does not involve calculating a laboratory buffer recipe — for example, asking to design a drug formulation, interpret pH meter readings, or perform chemical synthesis — do not proceed. Instead respond:

"Buffer Calculator is designed to calculate precise buffer recipes for molecular biology and biochemistry. Please provide a buffer type (PBS, RIPA, or TAE) and target volume. For other formulation tasks, use a more appropriate tool."


Quick Check

python -m py_compile scripts/main.py
python scripts/main.py --help

Workflow

  1. Confirm buffer type, final volume, and concentration multiplier.
  2. Validate that the buffer type is in the supported library; stop if unsupported without guessing.
  3. Run the calculation script or apply the documented formula path.
  4. Return a structured result separating assumptions, deliverables, risks, and unresolved items.
  5. If execution fails or inputs are incomplete, switch to the fallback path and state exactly what blocked full completion.

Fallback: If buffer type is missing or unrecognized, respond: "Buffer type not specified or not in library. Available buffers: PBS, RIPA, TAE. Use --list to see all options. Cannot calculate without a valid buffer type."


Core Capabilities

1. Predefined Buffer Library

from scripts.main import BufferCalculator
calc = BufferCalculator()
# List available buffers
for buf in calc.BUFFER_RECIPES.keys():
    print(f"  {buf}: pH {calc.BUFFER_RECIPES[buf].get('pH', 'N/A')}")
BufferApplicationpHKey Components
PBSCell washing, immunostaining7.4NaCl, KCl, Phosphates
RIPACell lysis, protein extraction7.4Tris, NaCl, Detergents
TAEDNA electrophoresis~8.0Tris, Acetate, EDTA
HEPESCell culture, pH-sensitive assays7.0–7.6HEPES, NaCl
Tris-HCl (pH 7.4)Protein buffers, Western blot7.4Tris, HCl
Tris-HCl (pH 8.0)DNA/RNA work, enzyme reactions8.0Tris, HCl
MOPSRNA electrophoresis, cell culture7.0–7.5MOPS, NaCl

2. Mass Calculations

result = calc.calculate("PBS", final_volume_ml=500, concentration_x=1.0)
for comp in result['components']:
    if 'amount_mg' in comp:
        print(f"{comp['component']}: {comp['amount_mg']:.2f} mg")

Formula: mass (mg) = concentration (mM) × volume (mL) × MW (g/mol) / 1000

3. Stock Solution Scaling

# 10X PBS stock (500 mL)
stock_result = calc.calculate("PBS", final_volume_ml=500, concentration_x=10.0)
ConcentrationStorage StabilityUse Case
1X1–2 weeks at 4°CImmediate use
10X3–6 months at 4°CRegular daily use
20X–50X6–12 months frozenLong-term storage

CLI Usage

# Calculate PBS buffer (1X, 500 mL)
python scripts/main.py PBS --volume 500

# Calculate 10X PBS
python scripts/main.py PBS --volume 500 --concentration 10

# List all available buffers
python scripts/main.py --list

Parameters

ParameterTypeRequiredDescription
bufferstringYesBuffer type (PBS, RIPA, TAE)
--volume, -vfloatNoFinal volume in mL
--concentration, -cfloatNo (default 1.0)Concentration multiplier (X)
--list, -lflagNoList available buffers

Output Requirements

Every final response must make these explicit:

  • Objective or requested deliverable
  • Inputs used (buffer type, volume, concentration) and assumptions introduced
  • Calculation formula applied
  • Core result: component masses/volumes with units
  • Constraints and risks (verify MW for hydrates; check pH after preparation)
  • Unresolved items and next-step checks (pH verification, sterile filtration if needed)

Error Handling

  • If buffer type is missing or unrecognized, list available options and request clarification. If the user provides component names, concentrations, and molecular weights, offer to calculate a custom recipe using the formula: mass (mg) = concentration (mM) × volume (mL) × MW (g/mol) / 1000.
  • If volume is not provided, use a sensible default (500 mL) and state the assumption explicitly.
  • If scripts/main.py fails, report the failure point and provide manual calculation fallback using the formula above.
  • Do not fabricate molecular weights or component amounts.

Quick Verification

Expected output for PBS 1X 500 mL:

  • NaCl: 4,000 mg (137 mM × 500 mL × 58.44 g/mol / 1000)
  • KCl: 100 mg (2.7 mM × 500 mL × 74.55 g/mol / 1000)
  • Na₂HPO₄: 720 mg (10.1 mM × 500 mL × 141.96 g/mol / 1000)
  • KH₂PO₄: 120 mg (1.76 mM × 500 mL × 136.09 g/mol / 1000)

Common Pitfalls

  • Confusing mM and M: 1000-fold concentration error — always verify units
  • Wrong molecular weight: Account for hydrates (e.g., Na₂HPO₄·7H₂O vs anhydrous)
  • Adding water to acid: Always add acid to water, never reverse
  • Incomplete dissolution: Dissolve each component completely before adding next
  • pH drift during storage: Check pH before each use for critical applications

Molecular Weight Reference

CompoundFormulaMW (g/mol)
NaClNaCl58.44
KClKCl74.55
Tris baseC₄H₁₁NO₃121.14
EDTA (disodium)C₁₀H₁₄N₂Na₂O₈·2H₂O372.24
Na₂HPO₄ (anhydrous)Na₂HPO₄141.96
KH₂PO₄KH₂PO₄136.09

References

→ Full troubleshooting: references/troubleshooting.md (if available)