jinzhezenggroup/openbabel
> A versatile CLI tool for converting molecular file formats, generating 3D atomic coordinates from SMILES, rendering 2D chemical structure images, and preparing or extracting structures for computational workflows. USE WHEN you need to convert between chemical file formats (e.g., xyz, pdb, mol, smi, gjf), generate 3D structures from SMILES using `--gen3d`, render molecule images (PNG/SVG), or extract geometries from simulation logs to build new inputs.
npx skills add https://github.com/jinzhezenggroup/computational-chemistry-agent-skills --skill openbabel
This skill provides practical Open Babel command patterns for common chemistry data tasks.
Check installation through uvx:
uvx --from openbabel obabel -V
Typical conversion syntax:
uvx --from openbabel obabel input.ext -i<input_format> -o<output_format> -O output.ext
Convert XYZ to PDB:
uvx --from openbabel obabel C.xyz -ixyz -opdb -O C.pdb
Open Babel supports a large set of chemistry formats (e.g., xyz, mol, mol2, pdb, smi, Gaussian gjf/log/fchk, etc.).
Generate methane (3D coordinates required):
uvx --from openbabel obabel -:C --gen3d -omol -O C.mol
Generate a single carbon atom:
uvx --from openbabel obabel -:[C] --gen3d -omol -O C.mol
Generate methyl radical:
uvx --from openbabel obabel -:[CH3] --gen3d -omol -O CH3.mol
> Important: quote SMILES when they contain brackets or special characters.
Equivalent explicit form:
uvx --from openbabel obabel -:"[C]([H])([H])[H]" --gen3d -omol -O CH3.mol
uvx --from openbabel obabel C.mol C.mol2 C.pdb C.xyz --osmi -O C.smi
Generate PNG:
uvx --from openbabel obabel -:"C([C@@H](C(=O)O)N)S" -opng -O cys.png
Generate SVG:
uvx --from openbabel obabel -:"C([C@@H](C(=O)O)N)S" -osvg -O cys.svg
Convert Gaussian log directly to image:
uvx --from openbabel obabel phosphate.log -ilog -opng -O phosphate.png
Generate Gaussian input from SMILES, then patch header with sed:
uvx --from openbabel obabel -:CC --gen3d -ogjf | sed "1c %nproc=28\n#opt b3lyp/6-31g(d,p)" > CC.gjf
Generate next-step input from a previous Gaussian log:
uvx --from openbabel obabel CC.log -ilog -ogjf | sed "1c %nproc=28\n#freq b3lyp/6-31g(d,p)" > CC2.gjf
When using this skill for users:
-i and -o format flags for reproducibility.--gen3d when converting SMILES to coordinate-bearing structures.%nproc, method/basis) after generation.uvx --from openbabel obabel ... consistently to minimize local dependency setup.Take jinzhezenggroup/openbabel from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.
The instructions reference uvx.
Without those the skill loads but fails at the first command.