Agent skill

Mat Ionic Substitution

by learningmatter-mit in learningmatter-mit/AtomisticSkills

Discover new crystal structures by data-mined ionic substitution — propose candidates from existing structures (forward) or find potential structures for a target composition (reverse).

MITAuto-check passedResearch & Science

Install Mat Ionic Substitution

skills CLI
$ npx skills add learningmatter-mit/AtomisticSkills --skill mat-ionic-substitution -a claude-code

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

GitHub CLI
$ gh skill install learningmatter-mit/AtomisticSkills mat-ionic-substitution --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-ionic-substitution .claude/skills/mat-ionic-substitution && 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-ionic-substitution
GitHub stars
175
Token cost
~1.4k tokens
SKILL.md length
550 words
Files
18 (incl. scripts)
Skills in repo
129
Repo updated
First seen
Licence
MIT

At a glance

Discover new crystal structures by data-mined ionic substitution — propose candidates from existing structures (forward) or find potential structures for a target composition (reverse).

  • Works in 2 steps: Forward (propose): Given an existing… → Reverse (find): Given a target…
  • Tasks that involve Physical and earth sciences
  • SKILL.md covers Goal, Instructions, Examples and Constraints, plus 1 more section
  • Runs Python scripts from its folder; needs MP_API_KEY

What it does

Mat Ionic Substitution is an agent skill from learningmatter-mit/AtomisticSkills. Discover new crystal structures by data-mined ionic substitution — propose candidates from existing structures (forward) or find potential structures for a target composition (reverse).

Its SKILL.md is about 1.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 21 other files, including scripts (for example `examples/Li2ZrCl6_reverse/README.md`, `examples/Li2ZrCl6_reverse/structure_manifest.json` and `examples/NaCoO2_forward/README.md`).

It sits in Research & Science, covering Physical and earth sciences. 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

Example prompts

  • “/mat-ionic-substitution”

Requirements

  • Python 3
  • A credential in MP_API_KEY

Workflow steps

2 steps, taken from the first numbered list in SKILL.md.

  1. Forward (propose): Given an existing structure, propose all high-probability ion-substituted variants. E.g., input NaCoO₂ → get LiCoO₂…
  2. Reverse (find): Given a target composition, find all known crystal structures that can be ion-substituted to create it, plus direct…

What it can do on your machine

Read from SKILL.md and the folder at commit 7f2d86d. 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 1 file in scripts/ (Python, from the files we listed), 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):

    • doi.org
    • github.com

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

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • MP_API_KEY

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

Context cost

Mat Ionic Substitution loads about 1.4k tokens when it runs. Until then it costs about 52 tokens; SKILL.md has 550 words of instructions outside code blocks.

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

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 7f2d86d, republished under its MIT licence (© learningmatter-mit). 550 words, ~1,389 tokens.

Download SKILL.mdSave it as .claude/skills/mat-ionic-substitution/SKILL.md (or your agent's skills folder). This skill also uses 17 other files; get the full folder from GitHub.
name
mat-ionic-substitution
description
Discover new crystal structures by data-mined ionic substitution — propose candidates from existing structures (forward) or find potential structures for a target composition (reverse).
metadata.category
materials
metadata.venv
cpu

Ionic Substitution

Goal

To discover new crystal structures using data-mined ionic substitution (Hautier et al. 2011). Two modes:

  1. Forward (propose): Given an existing structure, propose all high-probability ion-substituted variants. E.g., input NaCoO₂ → get LiCoO₂, KCoO₂, NaNiO₂, etc.
  2. Reverse (find): Given a target composition, find all known crystal structures that can be ion-substituted to create it, plus direct matches from Materials Project.

The substitution probability model is trained on the ICSD (Inorganic Crystal Structure Database) and captures empirical chemical rules about which ions commonly substitute for each other.

[!TIP] After generating candidate structures, relax them with an MLIP and compute their stability (E_hull) to prioritize the most thermodynamically viable candidates.

Instructions

Mode 1: Forward — Propose substitutions from a structure
  1. Prepare a source structure (CIF or POSCAR). Ensure it is an ordered structure.

  2. Run the forward proposal script:

    bash
    ${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/scripts/propose_substitutions.py \
        --structure source.cif \
        --threshold 0.001 \
        --output_dir proposed_substitutions/

    The script will:

    • Auto-decorate the structure with oxidation states (if not already present)
    • Enumerate all charge-balanced ionic substitutions above the threshold
    • Handle single-ion, double-ion, and multi-ion swaps
    • Save each substituted structure as a CIF file
    • Generate a substitution_manifest.json with substitution maps and probabilities
  3. Review and filter results: Higher probability → more likely to be stable. Relax top candidates with an MLIP.

Mode 2: Reverse — Find structures for a target composition
  1. Run the reverse search script:

    bash
    ${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/scripts/find_structures_for_composition.py \
        --composition LiCl \
        --threshold 0.001 \
        --output_dir structures_for_LiCl/

    The script will:

    • Step A: Query Materials Project for existing structures with the target formula
    • Step B: Use SubstitutionPredictor to find precursor compositions whose ions map to the target
    • Step C: Fetch precursor structures from MP and apply the substitutions
    • Save all candidate CIF files and a structure_manifest.json with full provenance
  2. Interpret results: Each candidate includes:

    • Source: "materials_project" (direct match) or "substitution" (derived)
    • Substitution map: e.g., {Na+→Li+} and probability
    • Precursor MP material ID for traceability
Show full SKILL.md (258 more words)Show less
Mode 3: Manual Targeted Substitution via MCP

If you already know the exact substitution you want to make on a specific structure, you can immediately generate the new structure using the base MCP server's modify_structure tool:

  • modify_structure tool: Maps an existing element to a new element or fraction.
    • Example 1 (Full replacement): substitution_dict_json='{"Na": "Li"}' (Replaces all Na with Li)
    • Example 2 (Partial/Alloying): substitution_dict_json='{"Na": {"Li": 0.5, "Na": 0.5}}' (Creates a 50/50 random mixture)

Examples

Example 1: Discover new Li-ion cathode from NaCoO₂
bash
${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/scripts/propose_substitutions.py \
    --structure NaCoO2.cif \
    --threshold 0.001 \
    --output_dir NaCoO2_substitutions/

Expected output includes: LiCoO₂, KCoO₂, NaNiO₂, NaMnO₂, LiNiO₂, etc.

Example 2: Find all crystal structures for LiCl
bash
${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/scripts/find_structures_for_composition.py \
    --composition LiCl \
    --output_dir LiCl_structures/

Expected output includes: LiCl from MP + NaCl(Na→Li), KCl(K→Li), NaBr(Na→Li, Br→Cl), etc.

Constraints

  • Oxidation States: The probability model requires oxidation-state-decorated structures. The scripts auto-decorate using pymatgen's AutoOxiStateDecorationTransformation, but exotic compositions may fail.
  • Charge Balance: Only charge-balanced substitutions are returned. This is enforced automatically.
  • Threshold: Default 0.001. Lower values (e.g., 0.0001) find more candidates but include less probable substitutions. Higher values (e.g., 0.01) give fewer, more confident results.
  • MP API Key: The reverse script requires MP_API_KEY environment variable to query Materials Project.
  • Structure Count: The number of species in the structure determines the combinatorial space. Structures with 2–3 unique species work best; structures with 5+ species may produce very large result sets.
  • Relaxation: Generated structures are not relaxed. Always relax with an MLIP before drawing conclusions about stability.

References

  • Hautier, G., Fischer, C., Ehrlacher, V., Jain, A., & Ceder, G. (2011). Data Mined Ionic Substitutions for the Discovery of New Compounds. Inorganic Chemistry, 50(2), 656–663. DOI: 10.1021/ic102031h

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 17 other files (scripts) in skills/mat-ionic-substitution of learningmatter-mit/AtomisticSkills.

  • SKILL.md
  • examples/Li2ZrCl6_reverse/000_Li2ZrCl6_from_Li2ZrF6_mp-542219.cif
  • examples/Li2ZrCl6_reverse/001_Li2ZrCl6_from_Li2ZrF6_mp-556176.cif
  • examples/Li2ZrCl6_reverse/002_Li2ZrCl6_from_Li2ZrF6_mp-4002.cif
  • examples/Li2ZrCl6_reverse/003_Li2ZrCl6_from_Rb2ZrCl6_mp-27831.cif
  • examples/Li2ZrCl6_reverse/004_Li2ZrCl6_from_Na2ZrF6_mp-27307.cif
  • examples/Li2ZrCl6_reverse/README.md
  • examples/Li2ZrCl6_reverse/structure_manifest.json
  • examples/NaCoO2_forward/000_NaFeO2.cif
  • examples/NaCoO2_forward/001_NaScO2.cif
  • examples/NaCoO2_forward/002_NaCrO2.cif
  • examples/NaCoO2_forward/003_NaAlO2.cif
  • examples/NaCoO2_forward/004_NaMnO2.cif
  • examples/NaCoO2_forward/016_LiCoO2.cif
  • examples/NaCoO2_forward/README.md
  • examples/NaCoO2_forward/substitution_manifest.json
  • scripts/find_structures_for_composition.py
  • … and 1 more

Open the folder on GitHubat commit 7f2d86d

Compare with similar skills

Mat Ionic Substitution 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 Ionic Substitution compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Mat Ionic Substitution this skilllearningmatter-mit/AtomisticSkills175—~1.4kAutomated safety check: PassMIT
AstropyzLanqing/codex-claude-academic-skills4.6k14 repos~2.9kAutomated safety check: PassBSD-3-Clause
PymatgenzLanqing/codex-claude-academic-skills4.6k12 repos~5kAutomated safety check: PassMIT
Cantera Ignition DelayK-Dense-AI/scientific-agent-skills48k1 repos~2.2kAutomated safety check: PassMIT
Weathertrpc-group/trpc-agent-go1.8k8 repos~591Automated safety check: PassApache-2.0
Pymol VisualizationChatMol/ChatMol372—~1.2kAutomated safety check: PassMIT

Similar skills

  • Astropy

    zLanqing/codex-claude-academic-skills

    Comprehensive Python library for astronomy and astrophysics.

    4.6k GitHub starsUsed in 14 repos~2.9k tokens
    Research & ScienceAuto-check passed
  • 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
  • Cantera Ignition Delay

    K-Dense-AI/scientific-agent-skills

    Runs Cantera constant-volume or constant-pressure ignition simulations and reports temperature-based ignition delay with mechanism provenance and checks.

    48k GitHub starsUsed in 1 repo~2.2k tokens
    Research & ScienceAuto-check passed
  • Weather

    trpc-group/trpc-agent-go

    Get current weather and forecasts via wttr.in or Open-Meteo.

    1.8k GitHub starsUsed in 8 repos~591 tokens
    Research & ScienceAuto-check passed
  • Pymol Visualization

    ChatMol/ChatMol

    Generate publication-quality molecular visualization images using PyMOL.

    372 GitHub stars~1.2k tokensUpdated 6 mo ago
    Research & ScienceAuto-check passed
  • Review

    Muuuun/luxas

    Write domain-authentic review articles that synthesize rather than stack.

    1.2k GitHub stars~2.1k tokensUpdated 1 mo ago
    Research & ScienceAuto-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.

    175 GitHub stars~2.9k tokensUpdated yesterday
    Auto-check passed
  • Drug Complex System Builder

    learningmatter-mit/AtomisticSkills

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

    175 GitHub stars~2k tokensUpdated yesterday
    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).

    175 GitHub stars~4k tokensUpdated yesterday
    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.

    175 GitHub stars~2.5k tokensUpdated yesterday
    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.

    175 GitHub stars~1.3k tokensUpdated yesterday
    Auto-check passed
  • Chem DB Mof

    learningmatter-mit/AtomisticSkills

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

    175 GitHub stars~1.9k tokensUpdated yesterday
    Auto-check passed

Questions about Mat Ionic Substitution

What does Mat Ionic Substitution do?

Discover new crystal structures by data-mined ionic substitution — propose candidates from existing structures (forward) or find potential structures for a target composition (reverse). Mat Ionic Substitution is an agent skill from learningmatter-mit/AtomisticSkills. Discover new crystal structures by data-mined ionic substitution — propose candidates from existing structures (forward) or find potential structures for a target composition (reverse).

When should I use Mat Ionic Substitution?

Mat Ionic Substitution fits situations like: tasks that involve Physical and earth sciences.

How do I install Mat Ionic Substitution in Claude Code?

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

How do I install Mat Ionic Substitution in Codex?

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

Can I use Mat Ionic Substitution 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-ionic-substitution -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-ionic-substitution, .gemini/skills/mat-ionic-substitution, .github/skills/mat-ionic-substitution and .opencode/skills/mat-ionic-substitution in your project.

What does Mat Ionic Substitution need to run?

Going by SKILL.md and its folder, Mat Ionic Substitution needs Python for the scripts in its folder and credentials named MP_API_KEY. Our summary lists: Python 3; A credential in MP_API_KEY.

Does Mat Ionic Substitution access the network?

SKILL.md names 2 domains. As links in the text: doi.org and github.com. This is read from the text; nothing was executed.

Is Mat Ionic Substitution 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 Ionic Substitution use?

Mat Ionic Substitution 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 Ionic Substitution use?

About 1.4k tokens (SKILL.md is roughly 5.6k 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 Ionic Substitution?

Skills that share tags, products or a category with Mat Ionic Substitution: Astropy (zLanqing/codex-claude-academic-skills, 4.6k stars), Pymatgen (zLanqing/codex-claude-academic-skills, 4.6k stars), Cantera Ignition Delay (K-Dense-AI/scientific-agent-skills, 48k stars) and Weather (trpc-group/trpc-agent-go, 1.8k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Mat Ionic Substitution?

learningmatter-mit (a GitHub organization) maintains it in learningmatter-mit/AtomisticSkills, which has 175 GitHub stars. The repository holds 129 skills in this directory. The repository was last updated on October 6, 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.