Agent skill

Mat Defect Energy Dft

by learningmatter-mit in learningmatter-mit/AtomisticSkills

Calculate charged defect formation energies and transition level diagrams using pymatgen-analysis-defects and atomate2 VASP workflows.

MITAuto-check passedResearch & Science

Install Mat Defect Energy Dft

skills CLI
$ npx skills add learningmatter-mit/AtomisticSkills --skill mat-defect-energy-dft -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install learningmatter-mit/AtomisticSkills mat-defect-energy-dft --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/learningmatter-mit/AtomisticSkills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/mat-defect-energy-dft .claude/skills/mat-defect-energy-dft && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
mat-defect-energy-dft
GitHub stars
176
Token cost
~1.6k tokens
SKILL.md length
417 words
Files
11 (incl. scripts)
Skills in repo
129
Repo updated
First seen
Licence
MIT

At a glance

Calculate charged defect formation energies and transition level diagrams using pymatgen-analysis-defects and atomate2 VASP workflows.

  • Works in 5 steps: Obtain Bulk Structure → Generate Defect Structures → Run DFT Calculations (atomate2) → …
  • Tasks that involve Physical and earth sciences
  • SKILL.md covers Goal, Instructions, Examples and Constraints
  • Runs Python scripts from its folder

What it does

Mat Defect Energy Dft is an agent skill from learningmatter-mit/AtomisticSkills. Calculate charged defect formation energies and transition level diagrams using pymatgen-analysis-defects and atomate2 VASP workflows.

Its SKILL.md is about 1.6k tokens, which your agent loads only when the skill is triggered. The skill folder holds 13 other files, including scripts (for example `examples/MgO_charged_vacancy/README.md`, `examples/MgO_charged_vacancy/build_diagram.py` and `examples/MgO_charged_vacancy/charged_formation_energies.json`).

It sits in Research & Science, covering Physical and earth sciences and Diagrams. It works with Model Context Protocol. The repository describes itself as: Integrating AtomisticSkills into Agentic IDEs (Cursor, Claude Code, Codex, Google Antigravity, Hermes Agent, etc). The licence is MIT.

When your agent uses it

  • Tasks that involve Physical and earth sciences
  • Tasks that involve Diagrams

Example prompts

  • “/mat-defect-energy-dft”

Requirements

  • Python 3

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Obtain Bulk Structure
  2. Generate Defect Structures
  3. Run DFT Calculations (atomate2)
  4. Parse Results and Compute Formation Energies
  5. Interpret Results

What it can do on your machine

Read from SKILL.md and the folder at commit 6257444. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 2 files in scripts/ (Python), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Mat Defect Energy Dft loads about 1.6k tokens when it runs. Until then it costs about 39 tokens; SKILL.md has 417 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~39
When it runs · the whole SKILL.md, loaded when a task matches
~1.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from learningmatter-mit/AtomisticSkills at commit 6257444, republished under its MIT licence (© learningmatter-mit). 417 words, ~1,574 tokens.

Download SKILL.mdSave it as .claude/skills/mat-defect-energy-dft/SKILL.md (or your agent's skills folder). This skill also uses 10 other files; get the full folder from GitHub.
name
mat-defect-energy-dft
description
Calculate charged defect formation energies and transition level diagrams using pymatgen-analysis-defects and atomate2 VASP workflows.
metadata.category
materials
metadata.venv
cpu

Point-Defect Formation Energy (DFT)

<!-- mcp-tools-note -->

[!NOTE] Steps written server.tool are MCP tool calls: base.search_materials_project_by_formula is the search_materials_project_by_formula tool of the base server (mcp__base__search_materials_project_by_formula, or mcp__plugin_atomistic-skills_base__search_materials_project_by_formula when installed as a plugin). Without a connected server, run the same tools from the shell. Tools named in one command share a process, so a model loaded by load_model stays loaded:

bash
${CLAUDE_SKILL_DIR}/../../venv/run cpu python -m src.mcp_server.cli base search_materials_project_by_formula key=value
${CLAUDE_SKILL_DIR}/../../venv/run cpu python -m src.mcp_server.cli atomate2 run_atomate2_vasp_calculation key=value

Goal

To calculate the formation energy of point defects (vacancies, substitutions, interstitials) including charged defect states and finite-size corrections using DFT (VASP) via atomate2 workflows. This produces formation energy diagrams showing defect charge transition levels as a function of Fermi energy.

$$E_f[D^q] = E[D^q] - E[\text{bulk}] + \sum_i \Delta n_i \mu_i + q(E_\text{VBM} + \Delta E_F) + E_\text{corr}$$

where $q$ is the charge state, $E_\text{VBM}$ is the valence band maximum, $\Delta E_F$ is the Fermi energy relative to VBM, and $E_\text{corr}$ is the finite-size correction (Freysoldt/FNV).

Instructions

1. Obtain Bulk Structure

Start with a relaxed primitive cell:

bash
base.search_materials_project_by_formula(formula="MgO", save_to_file="MgO.cif")
2. Generate Defect Structures

Use pymatgen-analysis-defects to generate all symmetry-unique defect supercells with charge states:

bash
${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/scripts/generate_defect_structures.py \
    --bulk MgO.cif \
    --supercell_size 3 3 3 \
    --defect_type vacancy \
    --charge_range -2 2 \
    --output dft_defects/

This generates:

  • POSCAR files for each defect × charge state
  • A defect_index.json mapping defect names to charge states and structures
  • Pristine supercell for the bulk reference
3. Run DFT Calculations (atomate2)

Submit calculations via the atomate2 MCP tool:

python
# Bulk supercell reference
atomate2.run_atomate2_vasp_calculation(
    structures_path="dft_defects/pristine_supercell.cif",
    output_dir="./dft_bulk/",
    calculation_type="static",
    preset_type="matpes-pbe",
    execution_mode="remote"
)

# All defect structures
atomate2.run_atomate2_vasp_calculation(
    structures_path="dft_defects/",
    output_dir="./dft_defect_calcs/",
    calculation_type="relaxation",
    preset_type="matpes-pbe",
    execution_mode="remote"
)
Alternative: atomate2 FormationEnergyMaker

For fully automated defect workflows with built-in corrections:

python
# (Python API)
from atomate2.vasp.flows.defect import FormationEnergyMaker
from pymatgen.analysis.defects.generators import VacancyGenerator
from pymatgen.core import Structure

bulk = Structure.from_file("MgO.cif")
vac_gen = VacancyGenerator()
defects = vac_gen.generate(bulk)

maker = FormationEnergyMaker()
# Submit via jobflow-remote for each defect
4. Parse Results and Compute Formation Energies

After DFT calculations complete:

bash
${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/scripts/parse_defect_results.py \
    --bulk_dir dft_bulk/ \
    --defect_dir dft_defect_calcs/ \
    --defect_index dft_defects/defect_index.json \
    --dielectric 9.8 \
    --output formation_energies.json \
    --plot formation_energy_diagram.png

The script:

  • Parses VASP outputs for total energies
  • Applies Freysoldt (FNV) finite-size corrections for charged defects
  • Determines VBM and band gap from bulk calculation
  • Constructs the formation energy diagram
Show full SKILL.md (150 more words)Show less
5. Interpret Results

The formation energy diagram shows:

  • Slopes: Each line segment has slope = charge state $q$
  • Transition levels: Intersections where the stable charge state changes ($\epsilon(q/q')$)
  • Low formation energy → high concentration: Defects with low $E_f$ at the Fermi level are most abundant

Examples

Oxygen Vacancy in MgO
bash
# 1. Get MgO
base.search_materials_project_by_formula(formula="MgO")

# 2. Generate defects with charges -2 to +2
${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/scripts/generate_defect_structures.py \
    --bulk MgO.cif --supercell_size 3 3 3 --defect_type vacancy --charge_range -2 2 --output mgo_defects/

# 3. Run DFT (remote)
atomate2.run_atomate2_vasp_calculation(
    structures_path="mgo_defects/", output_dir="./mgo_dft/",
    calculation_type="relaxation", preset_type="matpes-pbe", execution_mode="remote"
)

# 4. Parse and plot (after DFT completes)
${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/scripts/parse_defect_results.py \
    --bulk_dir mgo_dft/pristine_supercell/ --defect_dir mgo_dft/ \
    --defect_index mgo_defects/defect_index.json --dielectric 9.8 --output mgo_fe.json

Constraints

  • VASP required: Actual DFT calculations require a valid VASP setup (PMG_VASP_PSP_DIR, atomate2/jobflow-remote configured).
  • Supercell size: Use at least 3×3×3 for cubic systems. Charged defect corrections are less reliable for small cells.
  • Dielectric constant: The Freysoldt correction requires the static dielectric constant of the host material. Use experimental or computed values.
  • Functional: PBE underestimates band gaps → transition levels may be shifted. For accurate results, use HSE06 hybrid functional (requires custom INCAR settings).
  • Environments:
    • Structure generation: cpu (pymatgen-analysis-defects)
    • DFT submission: cpu (via MCP tool)
    • Post-processing: cpu
  • For neutral defects only (no DFT): See mat-defect-energy for MLIP-based approach.

Author: Bowen Deng Contact: GitHub @learningmatter-mit

© learningmatter-mit, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 10 other files (scripts) in skills/mat-defect-energy-dft of learningmatter-mit/AtomisticSkills.

  • SKILL.md
  • examples/MgO_charged_vacancy/README.md
  • examples/MgO_charged_vacancy/build_diagram.py
  • examples/MgO_charged_vacancy/charged_formation_energies.json
  • examples/MgO_charged_vacancy/charged_formation_energy_diagram.png
  • examples/MgO_charged_vacancy/defect_index.json
  • examples/MgO_charged_vacancy/dft_energies.json
  • examples/MgO_charged_vacancy/formation_energy_diagram_PBE.png
  • examples/MgO_charged_vacancy/full_results.json
  • scripts/generate_defect_structures.py
  • scripts/parse_defect_results.py

Open the folder on GitHubat commit 6257444

Compare with similar skills

Mat Defect Energy Dft next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Mat Defect Energy Dft compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Mat Defect Energy Dft this skilllearningmatter-mit/AtomisticSkills176—~1.6kAutomated safety check: PassMIT
PymatgenzLanqing/codex-claude-academic-skills4.6k12 repos~5kAutomated safety check: PassMIT
Chemgraphargonne-lcf/ChemGraph162—~743Automated safety check: PassApache-2.0
Run Fluent AutoclaveCai-aa/CAE-Agent-Hub998—~984Automated safety check: PassMIT
PymatgenK-Dense-AI/scientific-agent-skills48k1 repos~4.6kAutomated safety check: NotesMIT
TamarindK-Dense-AI/scientific-agent-skills48k1 repos~3.4kAutomated safety check: PassMIT

Similar skills

  • Pymatgen

    zLanqing/codex-claude-academic-skills

    Materials science toolkit. An agent skill from zLanqing/codex-claude-academic-skills.

    4.6k GitHub starsUsed in 12 repos~5k tokens
    Research & ScienceAuto-check passed
  • Chemgraph

    argonne-lcf/ChemGraph

    Use ChemGraph Python and CLI workflows, agent-written batch scripts, and attached chemistry MCP tools.

    162 GitHub stars~743 tokensUpdated today
    Research & ScienceAuto-check passed
  • Run Fluent Autoclave

    Cai-aa/CAE-Agent-Hub

    Run, diagnose, reproduce, and validate ANSYS Fluent CFD simulations of forced-convection autoclaves using Fluent MCP or PyFluent.

    998 GitHub stars~984 tokensUpdated 7 days ago
    Research & ScienceAuto-check passed
  • Pymatgen

    K-Dense-AI/scientific-agent-skills

    Analyzes, validates, converts, and transforms materials structures and computed materials data with pymatgen.

    48k GitHub starsUsed in 1 repo~4.6k tokens
    Research & ScienceAuto-check: notes
  • Tamarind

    K-Dense-AI/scientific-agent-skills

    Provides access to a collection of open-source molecular design and structural biology tools on the Tamarind Bio platform, via its REST API or MCP server — no local GPUs required.

    48k GitHub starsUsed in 1 repo~3.4k tokens
    Research & ScienceAuto-check passed
  • Excalidraw Skill

    yctimlin/mcp_excalidraw

    Excalidraw canvas toolkit for creating, editing, and refining diagrams on a live canvas.

    2.5k GitHub stars~4.6k tokensUpdated 2 days ago
    DevelopmentAuto-check passed

More from learningmatter-mit/AtomisticSkills

All 129 skills in this repo
  • Drug Binding Site Definition

    learningmatter-mit/AtomisticSkills

    Define a docking search box (center coordinates + box dimensions in Angstroms) from a co-crystal ligand, binding-site residues, or a saved JSON specification.

    176 GitHub stars~2.9k tokensUpdated today
    Auto-check passed
  • Drug Complex System Builder

    learningmatter-mit/AtomisticSkills

    Build a solvated, charge-neutralized protein-ligand complex for OpenMM molecular dynamics simulation.

    176 GitHub stars~2k tokensUpdated today
    Auto-check passed
  • Drug Pocket Detection

    learningmatter-mit/AtomisticSkills

    Identify and rank ligandable pockets on a protein structure or model using geometry (fpocket) or an ML predictor (P2Rank).

    176 GitHub stars~4k tokensUpdated today
    Auto-check passed
  • Chem Bond Dissociation

    learningmatter-mit/AtomisticSkills

    Calculate homolytic and heterolytic bond dissociation energies (BDEs) for all single bonds in a molecule using MLIPs with RDKit fragmentation.

    176 GitHub stars~2.5k tokensUpdated today
    Auto-check passed
  • Chem Conformer Search

    learningmatter-mit/AtomisticSkills

    Generate molecular conformers with RDKit ETKDG, relax with MLIPs, and rank by energy with Boltzmann weighting.

    176 GitHub stars~1.3k tokensUpdated today
    Auto-check passed
  • Chem DB Mof

    learningmatter-mit/AtomisticSkills

    Query multiple MOF databases (QMOF via MPContribs; ARC-MOF DB7/Majumdar et al.

    176 GitHub stars~1.9k tokensUpdated today
    Auto-check passed

Questions about Mat Defect Energy Dft

What does Mat Defect Energy Dft do?

Calculate charged defect formation energies and transition level diagrams using pymatgen-analysis-defects and atomate2 VASP workflows. Mat Defect Energy Dft is an agent skill from learningmatter-mit/AtomisticSkills. Calculate charged defect formation energies and transition level diagrams using pymatgen-analysis-defects and atomate2 VASP workflows.

When should I use Mat Defect Energy Dft?

Mat Defect Energy Dft fits situations like: tasks that involve Physical and earth sciences; tasks that involve Diagrams.

How do I install Mat Defect Energy Dft in Claude Code?

Run `npx skills add learningmatter-mit/AtomisticSkills --skill mat-defect-energy-dft -a claude-code`. Or copy the skill folder (skills/mat-defect-energy-dft in learningmatter-mit/AtomisticSkills) into .claude/skills/mat-defect-energy-dft in your project. Claude Code loads it when a task matches its description.

How do I install Mat Defect Energy Dft in Codex?

Run `npx skills add learningmatter-mit/AtomisticSkills --skill mat-defect-energy-dft -a codex`. Or copy the skill folder (skills/mat-defect-energy-dft in learningmatter-mit/AtomisticSkills) into .agents/skills/mat-defect-energy-dft in your project. Codex loads it when a task matches its description.

Can I use Mat Defect Energy Dft in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add learningmatter-mit/AtomisticSkills --skill mat-defect-energy-dft -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/mat-defect-energy-dft, .gemini/skills/mat-defect-energy-dft, .github/skills/mat-defect-energy-dft and .opencode/skills/mat-defect-energy-dft in your project.

What does Mat Defect Energy Dft need to run?

Going by SKILL.md and its folder, Mat Defect Energy Dft needs Python for the scripts in its folder. Our summary lists: Python 3.

Does Mat Defect Energy Dft access the network?

SKILL.md names 1 domain. As links in the text: github.com. This is read from the text; nothing was executed.

Is Mat Defect Energy Dft safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Mat Defect Energy Dft use?

Mat Defect Energy Dft is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Mat Defect Energy Dft use?

About 1.6k tokens (SKILL.md is roughly 6.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Mat Defect Energy Dft?

Skills that share tags, products or a category with Mat Defect Energy Dft: Pymatgen (zLanqing/codex-claude-academic-skills, 4.6k stars), Chemgraph (argonne-lcf/ChemGraph, 162 stars), Run Fluent Autoclave (Cai-aa/CAE-Agent-Hub, 998 stars) and Pymatgen (K-Dense-AI/scientific-agent-skills, 48k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Mat Defect Energy Dft?

learningmatter-mit (a GitHub organization) maintains it in learningmatter-mit/AtomisticSkills, which has 176 GitHub stars. The repository holds 129 skills in this directory. The repository was last updated on October 7, 2026.

Source: learningmatter-mit/AtomisticSkills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.