Skip to content

Guide · Agent skill

How to use the COBRApy metabolic modeling agent skill

Updated · written with AI from the project's own documentation and checked against our catalogue data

The COBRApy skill teaches an AI agent to work with genome-scale metabolic models using the COBRApy Python library. This guide explains what the skill does, how to install it from a ZIP file, how to ask for its work in plain language, and what it needs to run safely. By the end you will know how to trigger a metabolic analysis and what to check in the results.

COBRApy Metabolic ModelingK-Dense-AI/scientific-agent-skills · MIT

Quick start

  1. 1Download the ZIP. Download the COBRApy skill ZIP from the skill page on this site.
  2. 2Unzip into a skills folder. Unzip the skill into ~/.claude/skills/ for personal use, or into .claude/skills/ inside a project.
  3. 3Or upload it in the Claude apps. In the Claude apps, open Settings, go to Capabilities, then Skills, and upload the skill.
  4. 4Install cobra. Install the pinned cobra version with uv, as shown in the requirements section.
  5. 5Ask a metabolic question. Describe the analysis in plain language, such as an FBA run, a knockout screen or a medium design, and name the model.
  6. 6Check the output. Confirm the solve status is optimal, then check the reported assumptions, medium and constraints before you trust the numbers.

What does the COBRApy skill make the agent do?

The skill covers constraint-based metabolic modeling. Given a metabolic network, the agent can load or build a model, predict steady-state fluxes and growth with flux balance analysis (FBA), compare related methods such as parsimonious FBA (pFBA) and flux variability analysis (FVA), simulate gene knockouts, design growth media, and sample feasible flux states.

It also checks models for errors, including SBML validation and gap filling, and it records settings such as solver, objective, medium, bounds and random seeds so an analysis can be repeated later.

  • Load bundled models (textbook, iJO1366, salmonella) or download remote models from BiGG or BioModels
  • Run FBA, pFBA, FVA and production envelopes
  • Run single and double gene knockout screens
  • Design growth media and find minimal media
  • Sample feasible flux distributions

How do you install the COBRApy skill?

Download the skill ZIP from the skill page on this site and unzip it. Place the resulting skill folder in one of two locations: your personal skills folder at ~/.claude/skills/, or a project-specific .claude/skills/ folder inside the project you are working in.

If you use the Claude apps instead, open Settings, go to Capabilities, and upload the skill under Skills.

  • Personal install: unzip into ~/.claude/skills/
  • Project install: unzip into .claude/skills/ inside your project folder
  • Claude apps: Settings → Capabilities → Skills, then upload the skill

What do you need installed before running it?

The skill needs Python and the cobra package. The skill's compatibility note lists the minimum Python version and the tested cobra release. Install the pinned cobra version with uv. GLPK, the default solver, installs through swiglpk, so you do not need a separate solver for the examples.

Plotting, SciPy and hopsy are optional. hopsy is only needed for the CHRR sampler. Commercial solvers need their own installation and licence.

  • Python and cobra (pinned version in the install command below)
  • GLPK solver, installed via swiglpk
  • Optional: SciPy, matplotlib, pandas, seaborn, hopsy
  • Network access only if you download remote models
uv pip install cobra==0.32.1

How do you trigger the skill with natural requests?

You do not need special syntax. Describe the metabolic question in plain language and name the model if you have one. The agent should pick up the skill when your request involves metabolic networks, fluxes, knockouts or growth media.

Name the organism or model, the question, and any conditions. Clear constraints, such as an oxygen-free medium or a 90% growth floor, give more useful results than a general request.

  • Run FBA on the textbook E. coli model and report the biomass flux.
  • Which single gene knockouts drop growth below 1% of wild type in the iJO1366 model?
  • Find a minimal medium that supports at least half of the wild-type growth.
  • Use FVA at 90% of optimal growth to show the range for PFK, FBA and PGI.
  • Check this SBML file for mass or charge imbalances and missing chemistry.

Run a first analysis

The skill's first workflow loads a bundled model and checks that it solves. The bundled textbook model works offline. Its ID is e_coli_core, and the code below uses the bundled alias textbook.

The result should be an optimal solution with a positive objective value. Treat it as a demonstration of the workflow, not a validated prediction for a real organism.

from cobra.io import load_model model = load_model('textbook') model.solver = 'glpk' solution = model.optimize(raise_error=True) print(solution.objective_value)

What are the safety notes for scripts and network access?

The skill runs scripts, and it uses the network. The network is needed only to download remote models from BiGG or BioModels. The bundled textbook examples run offline.

Review the scripts the agent writes before you run them on sensitive data. Predictions depend heavily on model quality and the constraints you set, so do not use model output alone for clinical or safety decisions. FBA is a constraint-based prediction and does not establish measured growth or kinetic rates.

  • Runs scripts: yes
  • Uses network: yes, for remote model downloads
  • Offline: bundled textbook, iJO1366 and salmonella models

Tips for reproducible results

Record the model source, version or checksum, the cobra and solver versions, the objective, the medium, the bounds, the tolerances and any random seed with each analysis. The skill's guidance expects this.

Choose the sampling method explicitly rather than relying on the automatic choice, because the automatic choice can change with what is installed. Start with a single process, since multiprocessing scripts need a guarded entry point.

  • Save the source files of any model you download
  • Set the solver explicitly and check which solvers are available
  • Pick the sampling method explicitly
  • Use one process first, then scale up

What people use it for

  • Teaching flux balance analysis to systems biology students using the bundled textbook model
  • Screening single gene knockouts for growth defects in a bundled E. coli or Salmonella model
  • Designing a minimal growth medium for a stated growth target
  • Producing reproducible FVA and sampling results with recorded solver and version settings

Frequently asked questions

How do I install the COBRApy agent skill?

Download the ZIP from the skill page and unzip it into ~/.claude/skills/ for personal use or into .claude/skills/ in a project. In the Claude apps, you can instead upload it under Settings, then Capabilities, then Skills.

Is the COBRApy skill free to use?

The directory lists the skill under the MIT licence, but the SKILL.md metadata in the source says GPL-2.0. Check the licence file included in the download before reusing or redistributing it. The skill's own requirements do not list a paid component, but commercial solvers need separate licensing.

What do I need to run the COBRApy skill?

You need Python and the cobra package, plus the GLPK solver, which installs through swiglpk. SciPy, matplotlib, pandas, seaborn and hopsy are optional, and network access is needed only to download remote models.

Can the COBRApy skill run without internet access?

Yes, for the bundled models. The textbook examples run offline, and the bundled iJO1366 and salmonella models load locally. Network access is needed only to download remote models from BiGG or BioModels.

Does flux balance analysis predict real growth of a cell?

No. The skill describes FBA as a constraint-based prediction. It does not establish experimental growth, kinetic rates or thermodynamic feasibility, so compare results with experimental data before drawing conclusions.

What is the difference between COBRApy and other metabolic modeling tools?

The source does not compare COBRApy with other tools. The skill is built around the COBRApy Python library, so if you need a different modeling environment, check its own documentation and choose based on your workflow.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

This skill suits systems biology students learning flux balance analysis, and researchers running knockout screens or medium design who want explicit, recorded settings. It is not the right choice if you need predictions of measured growth or kinetics, or if you plan to base clinical or safety decisions on model output alone.

Download the skill