Skip to content

pymatgen Materials Toolkit

Validate, analyze, convert and transform crystal structures and materials data with pymatgen

Stars
55,780
Licence
MIT
Files
15 files

What it does

Teaches the agent to work with chemical compositions and crystal structures using the pymatgen Python library, following careful provenance rules: check units, flag CIF parser warnings, report partial occupancies and oxidation states, sweep symmetry tolerances, and record checksums for every derived file. It ships small command-line helpers for validating compositions and structures, converting formats in a plan-first way, building phase diagrams from supplied energies, and optionally querying the Materials Project database with an API key.

Great for

  • Materials science students learning crystal structure and phase diagram analysis
  • Researchers who want reproducible, documented structure validation and format conversion
  • Developers building computational materials workflows that need auditable outputs

Skip it if

  • Untrusted CIF or structure files processed on a machine holding sensitive credentials, because parsers process file contents and the skill runs local Python scripts
  • Users expecting authoritative thermodynamic conclusions without their own vetted energy entries and correction schemes, since hull results depend entirely on the supplied data
  • Anyone needing Materials Project queries without reviewing the endpoint, filters and license terms first, since database access requires network approval and an API key

Try asking

  • “Validate this CIF file and report occupancy, disorder, oxidation-state and symmetry warnings”
  • “Build a phase diagram from my list of computed entries and explain which energies drive the hull”
  • “Convert this structure from CIF to POSCAR and tell me what information might be lost”
  • “Query Materials Project for Li-Fe-O compounds with a bounded result limit after showing me the filters”
Step-by-step guide: how to use pymatgen Materials ToolkitInstall, first run, examples, tips and FAQs

Install in 3 steps

  1. 1

    Download the skill

    The ZIP contains the 15 original files, the MIT licence and an attribution note.

    pymatgen.zip
  2. 2

    Add it to your agent

    Claude Code (all projects)

    mkdir -p ~/.claude/skills && unzip pymatgen.zip -d ~/.claude/skills/

    Claude Code / Agent SDK (this project only)

    mkdir -p .claude/skills && unzip pymatgen.zip -d .claude/skills/

    Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.

  3. 3

    Ask for the task

    No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.

Get better results

  • Run the bundled validator before any symmetry, conversion or thermodynamic step, and state the symprec and angle_tolerance values you used.
  • Keep Materials Project queries off until you have reviewed the endpoint, fields, result limit and data license, and set MP_API_KEY only in a trusted environment.
  • Process unfamiliar CIF files in an isolated sandbox rather than on a privileged machine, and keep the generated manifest with your outputs.

What's inside

  • references/analysis_modules.md
  • references/core_classes.md
  • references/io_formats.md
  • references/materials_project_api.md
  • references/transformations_workflows.md
  • scripts/_common.py
  • scripts/artifact_manifest.py
  • scripts/composition_structure_validator.py
  • scripts/io_conversion_plan.py
  • scripts/mp_query.py
  • scripts/phase_diagram_generator.py
  • scripts/structure_analyzer.py
  • scripts/structure_converter.py
  • scripts/symmetry_sensitivity_report.py
  • SKILL.md

Redistributed unmodified from K-Dense-AI/scientific-agent-skills under the MIT licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.