pymatgen

pymatgen is a skill for Claude Code, Codex from benchflow-ai/skillsbench. It costs 38 tokens per session (5,298 once invoked), scanned A, a copy of pymatgen, Apache-2.0.

A Python toolkit for studying materials such as crystals and molecules. It can read common structure files, analyze crystal and electronic properties, and connect to the Materials Project database.

In plain words
What is it for?
Use it to inspect crystal structures, calculate phase diagrams and thermodynamic properties, study band structures and density of states, or create surfaces and interfaces.
Why use it?
It removes the need to build common materials-science calculations and file conversions from scratch.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to inspect crystal structures, calculate phase diagrams and thermodynamic properties, study band structures and density of states, or create surfaces and interfaces.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/benchflow-ai/skillsbench/pymatgen
About the project

SkillsBench is a benchmark for measuring how effectively AI agents use modular skills—folders containing instructions, scripts, and resources—to complete specialized tasks. It helps researchers and developers evaluate both skill quality and agent behavior, including tasks that require combining multiple skills. The catalogue’s skills and instructions are evaluated as part of this workflow.

benchflow-ai/skillsbench · 1,757 stars · on GitHub · skillsbench.ai

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add benchflow-ai/skillsbench --skill pymatgen
Clone the repo
git clone --depth 1 https://github.com/benchflow-ai/skillsbench

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for pymatgen

README.md
[![agentmods](https://agentmods.dev/badge/skills/benchflow-ai/skillsbench/pymatgen/github.svg)](https://agentmods.dev/skills/benchflow-ai/skillsbench/pymatgen)
Your own site
<a href="https://agentmods.dev/skills/benchflow-ai/skillsbench/pymatgen"><img src="https://agentmods.dev/badge/skills/benchflow-ai/skillsbench/pymatgen/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for pymatgen

Your own site · 80×15
<a href="https://agentmods.dev/skills/benchflow-ai/skillsbench/pymatgen"><img src="https://agentmods.dev/badge/skills/benchflow-ai/skillsbench/pymatgen.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 38 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,298 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 88% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00038 $0.05298
Opus 5 $0.00019 $0.02649
Sonnet 5 $0.00008 $0.01060
Haiku 4.5 $0.00004 $0.00530

Measured 7d ago against content hash eeb3616b03e2, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

pymatgen scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

The scan reads SKILL.md. This mod also ships 3 executable files (scripts/phase_diagram_generator.py, scripts/structure_analyzer.py, scripts/structure_converter.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

88% identical to pymatgen — 3 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

tasks/crystallographic-wyckoff-position-analysis/environment/skills/pymatgen/SKILL.md · 693 lines

How it starts

The opening of the file, as written. The whole thing — 693 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Pymatgen - Python Materials Genomics

Overview

Pymatgen is a comprehensive Python library for materials analysis that powers the Materials Project. Create, analyze, and manipulate crystal structures and molecules, compute phase diagrams and thermodynamic properties, analyze electronic structure (band structures, DOS), generate surfaces and interfaces, and access Materials Project's database of computed materials. Supports 100+ file formats from various computational codes.

When to Use This Skill

This skill should be used when:

  • Working with crystal structures or molecular systems in materials science
  • Converting between structure file formats (CIF, POSCAR, XYZ, etc.)
  • Analyzing symmetry, space groups, or coordination environments
  • Extracting Wyckoff letters, multiplicities, and representative fractional coordinates from CIF files (see references/wyckoff-positions-from-cif.md — use get_symmetry_dataset().wyckoffs, not get_symmetrized_structure().wyckoff_symbols)
  • Computing phase diagrams or assessing thermodynamic stability
  • Analyzing electronic structure data (band gaps, DOS, band structures)
  • Generating surfaces, slabs, or studying interfaces
  • Accessing the Materials Project database programmatically
  • Setting up high-throughput computational workflows
  • Analyzing diffusion, magnetism, or mechanical properties
  • Working with VASP, Gaussian, Quantum ESPRESSO, or other computational codes

Quick Start Guide

Installation

# Core pymatgen
uv pip install pymatgen

# With Materials Project API access
uv pip install pymatgen mp-api

# Optional dependencies for extended functionality
uv pip install pymatgen[analysis]  # Additional analysis tools
uv pip install pymatgen[vis]       # Visualization tools

Basic Structure Operations

from pymatgen.core import Structure, Lattice

# Read structure from file (automatic format detection)
struct = Structure.from_file("POSCAR")

# Create structure from scratch
lattice = Lattice.cubic(3.84)
struct = Structure(lattice, ["Si", "Si"], [[0,0,0], [0.25,0.25,0.25]])

# Write to different format
struct.to(filename="structure.cif")

# Basic properties
print(f"Formula: {struct.composition.reduced_formula}")
print(f"Space group: {struct.get_space_group_info()}")
print(f"Density: {struct.density:.2f} g/cm³")

Read the full file on GitHub · 693 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago First seen · 693 lines · 38 tokens per session scan A eeb3616b03e2

Subscribe to this mod's changes

pymatgen is a skill published in the GitHub repository benchflow-ai/skillsbench (1,757 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 38 tokens to every session and 5,298 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. It is 88% identical to pymatgen, differing in 3 lines, and is treated as a copy.