Install the "mat-magnetic-density" agent skill from https://github.com/learningmatter-mit/AtomisticSkills/tree/main/skills/mat-magnetic-density into .claude/skills/mat-magnetic-density/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mat-magnetic-density", then confirm the skill loads.
Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
Type this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
skills CLI
$ npx skills add learningmatter-mit/AtomisticSkills --skill mat-magnetic-density -a codex
Project install goes to .agents/skills/; add -g for ~/.codex/skills/.
Install the "mat-magnetic-density" agent skill from https://github.com/learningmatter-mit/AtomisticSkills/tree/main/skills/mat-magnetic-density into .agents/skills/mat-magnetic-density/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mat-magnetic-density", then confirm the skill loads.
Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
skills CLI
$ npx skills add learningmatter-mit/AtomisticSkills --skill mat-magnetic-density -a cursor
Project install goes to .agents/skills/; add -g for ~/.cursor/skills/.
Install the "mat-magnetic-density" agent skill from https://github.com/learningmatter-mit/AtomisticSkills/tree/main/skills/mat-magnetic-density into .cursor/skills/mat-magnetic-density/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mat-magnetic-density", then confirm the skill loads.
Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
skills CLI
$ npx skills add learningmatter-mit/AtomisticSkills --skill mat-magnetic-density -a gemini-cli
Project install goes to .agents/skills/; add -g for ~/.gemini/skills/.
Install the "mat-magnetic-density" agent skill from https://github.com/learningmatter-mit/AtomisticSkills/tree/main/skills/mat-magnetic-density into .gemini/skills/mat-magnetic-density/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mat-magnetic-density", then confirm the skill loads.
Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
Installs for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
skills CLI
$ npx skills add learningmatter-mit/AtomisticSkills --skill mat-magnetic-density -a github-copilot
Project install goes to .agents/skills/; add -g for ~/.copilot/skills/.
Install the "mat-magnetic-density" agent skill from https://github.com/learningmatter-mit/AtomisticSkills/tree/main/skills/mat-magnetic-density into .github/skills/mat-magnetic-density/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mat-magnetic-density", then confirm the skill loads.
GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
skills CLI
$ npx skills add learningmatter-mit/AtomisticSkills --skill mat-magnetic-density -a opencode
OpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
Install the "mat-magnetic-density" agent skill from https://github.com/learningmatter-mit/AtomisticSkills/tree/main/skills/mat-magnetic-density into .opencode/skills/mat-magnetic-density/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mat-magnetic-density", then confirm the skill loads.
OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
Facts
Skill name
mat-magnetic-density
GitHub stars
176
Token cost
~2.7k tokens
SKILL.md length
979 words
Files
8 (incl. scripts)
Skills in repo
129
Repo updated
First seen
Licence
MIT
At a glance
Calculate magnetic moments and spin density from spin-polarized DFT calculations using VASP.
Works in 7 steps: Structure Preparation → Run Spin-Polarized DFT Calculation → Monitor Job Status → …
SKILL.md covers Goal, Instructions, Examples and Functional Selection Guide, plus 2 more sections
Runs Python scripts from its folder
What it does
Mat Magnetic Density is an agent skill from learningmatter-mit/AtomisticSkills. Calculate magnetic moments and spin density from spin-polarized DFT calculations using VASP.
Its SKILL.md is about 2.7k tokens, which your agent loads only when the skill is triggered. The skill folder holds 9 other files, including scripts (for example `examples/Fe_example.md`, `examples/Fe_moments.json` and `examples/README.md`).
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.
Example prompts
“/mat-magnetic-density”
Requirements
Python 3
Workflow steps
7 steps, taken from the step headings in SKILL.md.
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 3 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):
doi.org
vasp.at
pymatgen.org
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 Magnetic Density loads about 2.7k tokens when it runs. Until then it costs about 28 tokens; SKILL.md has 979 words of instructions outside code blocks.
Always· name and description, kept in context so the agent knows when to use it
~28
When it runs· the whole SKILL.md, loaded when a task matches
~2.7k
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.
Download SKILL.mdSave it as .claude/skills/mat-magnetic-density/SKILL.md (or your agent's skills folder). This skill also uses 7 other files; get the full folder from GitHub.
name
mat-magnetic-density
description
Calculate magnetic moments and spin density from spin-polarized DFT calculations using VASP.
metadata.category
materials
metadata.venv
cpu
Magnetic Density
<!-- mcp-tools-note -->
[!NOTE]
Steps written server.tool are MCP tool calls: atomate2.run_atomate2_vasp_calculation is the run_atomate2_vasp_calculation
tool of the atomate2 server (mcp__atomate2__run_atomate2_vasp_calculation, or
mcp__plugin_atomistic-skills_atomate2__run_atomate2_vasp_calculation 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 atomate2 run_atomate2_vasp_calculation key=value get_atomate2_job_status key=value
${CLAUDE_SKILL_DIR}/../../venv/run cpu python -m src.mcp_server.cli base search_materials_project_by_formula key=value
Goal
To calculate the magnetic moments and optionally extract the spin density ($\rho_{\text{spin}}$) of magnetic materials using spin-polarized DFT calculations. This skill enables the characterization of magnetic ordering, local magnetic moments on individual atoms, and spatial distribution of spin density.
Instructions
1. Structure Preparation
Obtain or prepare the structure of the magnetic material you want to study. You can:
Query from Materials Project using the base MCP tools (recommended - already DFT-optimized)
Load from a local CIF/POSCAR file
Use a previously relaxed structure
Note on relaxation: For magnetic moment calculations, relaxation is optional if using high-quality experimental or Materials Project structures. Magnetic moments are relatively insensitive to small structural variations. However, relaxation is recommended for:
New/hypothetical structures
Surfaces, interfaces, or defects
Systems where you need accurate total energies (not just magnetic moments)
Strongly correlated oxides with significant magnetic-structural coupling
2. Run Spin-Polarized DFT Calculation
Use the atomate2 MCP tool to run a spin-polarized static calculation. The mp preset (MPStaticSet) automatically enables spin polarization and applies appropriate settings for magnetic systems.
python
atomate2.run_atomate2_vasp_calculation(
structures_path="structure.cif", # Path to your structure file
output_dir="magnetic_calc", # Directory to save results
preset_type="mp", # MPStaticSet with PBE (includes spin polarization)
calculation_type="static", # Static calculation
)
Important - Functional Selection:
For metallic ferromagnets (Fe, Co, Ni): Use mp preset (MPStaticSet with PBE). PBE provides excellent accuracy for magnetic moments (typically within ~2% of experimental values)[1].
For strongly correlated oxides (NiO, CoO, FeO): Use mp preset (see Example 2 below). MPStaticSet automatically applies appropriate GGA+U corrections for transition metal oxides. Standard PBE fails to predict the correct insulating antiferromagnetic ground state and severely underestimates band gaps[3]. Note: +U corrections improve electronic structure but do not guarantee better magnetic moments (e.g., GGA+U may overestimate for NiO or underestimate for CoO due to missing orbital contributions)[4].
Avoid r2SCAN for metallic ferromagnets: r2SCAN significantly overestimates magnetic moments in itinerant ferromagnets like Fe (by ~24% compared to experimental values)[2].
References:
[1] PBE underestimates Fe magnetization by only 1.8%: Zhang et al., Phys. Rev. Materials6, 013801 (2022). DOI: 10.1103/PhysRevMaterials.6.013801
[2] r2SCAN and SCAN overestimate Fe magnetization by 24% and 17% respectively: ibid.
[3] PBE+U opens band gaps and corrects ground state in transition metal oxides: Kulik, J. Chem. Phys.142, 240901 (2015). DOI: 10.1063/1.4922693
[4] CoO magnetic moments: PBE+U underestimates due to missing orbital contributions: Radi et al., Z. Naturforsch. A70, 789 (2015). DOI: 10.1515/zna-2015-0216
See the "Functional Selection Guide" section below for detailed recommendations.
3. Monitor Job Status
After submitting the calculation, monitor its progress:
python
atomate2.get_atomate2_job_status(
job_id="<job_id_from_step_2>" # Job ID returned from step 2
)
4. Extract Magnetic Moments
Once the calculation is complete, retrieve the results to extract magnetic moments:
python
atomate2.get_atomate2_results_by_id(
job_ids=["<job_id>"], # List of job IDs
save_to_file="magnetic_results.json" # Save results to file
)
The results will include:
Total magnetization: Net magnetic moment of the unit cell
Site magnetic moments: Magnetic moment on each atom
Energy: Total energy of the magnetic configuration
5. Parse and Analyze Results
Use the provided script to parse the magnetic moments from the results:
bash
${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/scripts/parse_magnetic_moments.py magnetic_results.json --output magnetic_analysis.json
This script will:
Extract site-resolved magnetic moments
Calculate the total magnetization
Identify the magnetic ordering pattern
Generate a summary report
6. Extract Spin Density (Optional)
For detailed analysis of spin density distribution, use the spin density extraction script:
bash
${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/scripts/extract_spin_density.py <output_dir> --output spin_density.json
This requires access to the CHGCAR file from the VASP calculation and will:
Read the spin density from CHGCAR
Calculate integrated spin moments
Optionally generate 3D visualization data
Show full SKILL.md (395 more words)Show less
7. Visualize Magnetic Ordering (Optional)
Visualize the magnetic ordering by creating a structure with magnetic moment vectors:
bash
${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/scripts/visualize_magnetic_structure.py structure.cif magnetic_analysis.json --output magnetic_structure.png
Examples
Example 1: Calculate magnetic moments for bulk Fe
python
# Step 1: Get Fe structure from Materials Project
base.search_materials_project_by_formula(
formula="Fe",
save_to_file="Fe_mp.cif"
)
# Step 2: Run spin-polarized static calculation
atomate2.run_atomate2_vasp_calculation(
structures_path="Fe_mp.cif",
output_dir="Fe_magnetic",
preset_type="mp", # MPStaticSet with PBE
calculation_type="static",
execution_mode="remote"
)
# Step 3: After completion, retrieve results
atomate2.get_atomate2_results_by_id(
job_ids=["<job_id>"],
save_to_file="Fe_magnetic_results.json"
)
bash
# Step 4: Parse magnetic moments
${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/scripts/parse_magnetic_moments.py Fe_magnetic_results.json --output Fe_moments.json
Example 2: NiO with automatic GGA+U
python
# For transition metal oxides like NiO, use 'mp' preset
# MPStaticSet automatically applies appropriate U parameters (e.g., U=6.2 eV for Ni in oxides)
# This ensures correct insulating antiferromagnetic ground state
atomate2.run_atomate2_vasp_calculation(
structures_path="NiO.cif",
output_dir="NiO_magnetic",
preset_type="mp", # MPStaticSet automatically handles +U for transition metal oxides
calculation_type="static",
execution_mode="remote"
)
Functional Selection Guide
Choosing the right exchange-correlation functional is critical for accurate magnetic property calculations:
For Metallic Ferromagnets (Fe, Co, Ni, etc.)
Recommended: PBE (use preset_type="mp" for MPStaticSet)
PBE underestimates magnetic moments by only ~1.8% for Fe
Provides excellent agreement with experimental spin magnetization
Computational efficiency superior to meta-GGA functionals
Do NOT use: r2SCAN overestimates by ~24% for Fe
Example: Bulk Fe experimental value = 2.2 μB/atom
PBE prediction: ~2.15 μB/atom (2% error) ✓
r2SCAN prediction: ~2.73 μB/atom (24% error) ✗
For Transition Metal Oxides and Strongly Correlated Systems
Recommended: PBE with automatic +U (use preset_type="mp" - MPStaticSet handles this automatically)
When to use PBE+U:
Localized d-electrons: Systems where d-electrons exhibit strong correlation (NiO, CoO, Fe₂O₃)
Band gap issues: Standard PBE underestimates band gaps significantly
Magnetic ground states: PBE gives incorrect magnetic ordering or underestimates moments
Redox chemistry: Systems involving oxidation state changes
U parameter selection:
U values are material-dependent and typically calibrated against experimental band gaps or magnetic moments
Common values: U = 3-5 eV for 3d transition metals in oxides
Underestimates band gaps and magnetic exchange interactions
May predict incorrect magnetic ground states
Constraints
Spin Polarization: The mp preset (MPStaticSet) automatically enables spin polarization (ISPIN=2) for magnetic systems. MAGMOM values are also automatically initialized (default 0.6 per magnetic atom).
Initial Magnetic Moments: For complex magnetic ordering (e.g., antiferromagnetic), you should provide initial MAGMOM values through the config parameter to help convergence.
Environment: The parsing scripts require the cpu environment with pymatgen installed.
Remote Execution: DFT calculations are computationally expensive and should typically be run on remote clusters using execution_mode="remote".
CHGCAR Access: Extracting spin density requires access to the CHGCAR file, which may not be automatically retrieved. You may need to manually download it from the remote execution directory.
Convergence: Magnetic systems can be challenging to converge. If calculations fail to converge, try:
Mat Magnetic Density 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 Magnetic Density compared with similar skills
Skill
Stars
Used in
Tokens
Auto-check
Licence
Repo updated
Mat Magnetic Density this skilllearningmatter-mit/AtomisticSkills
Walks through building MCP servers in Python or TypeScript that expose tools, resources and prompts to Claude, with templates, registration and testing.
Explains how to bundle Model Context Protocol servers in a Claude Code plugin, covering config files, stdio, SSE, HTTP and WebSocket server types, and authentication.
Required groundwork before any use_figma call: the rules and reference files for running JavaScript in a Figma file through the Plugin API without common failures.
Define a docking search box (center coordinates + box dimensions in Angstroms) from a co-crystal ligand, binding-site residues, or a saved JSON specification.
Calculate magnetic moments and spin density from spin-polarized DFT calculations using VASP. Mat Magnetic Density is an agent skill from learningmatter-mit/AtomisticSkills. Calculate magnetic moments and spin density from spin-polarized DFT calculations using VASP.
How do I install Mat Magnetic Density in Claude Code?
Run `npx skills add learningmatter-mit/AtomisticSkills --skill mat-magnetic-density -a claude-code`. Or copy the skill folder (skills/mat-magnetic-density in learningmatter-mit/AtomisticSkills) into .claude/skills/mat-magnetic-density in your project. Claude Code loads it when a task matches its description.
How do I install Mat Magnetic Density in Codex?
Run `npx skills add learningmatter-mit/AtomisticSkills --skill mat-magnetic-density -a codex`. Or copy the skill folder (skills/mat-magnetic-density in learningmatter-mit/AtomisticSkills) into .agents/skills/mat-magnetic-density in your project. Codex loads it when a task matches its description.
Can I use Mat Magnetic Density 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-magnetic-density -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-magnetic-density, .gemini/skills/mat-magnetic-density, .github/skills/mat-magnetic-density and .opencode/skills/mat-magnetic-density in your project.
What does Mat Magnetic Density need to run?
Going by SKILL.md and its folder, Mat Magnetic Density needs Python for the scripts in its folder. Our summary lists: Python 3.
Does Mat Magnetic Density access the network?
SKILL.md names 4 domains. As links in the text: doi.org, vasp.at, pymatgen.org and github.com. This is read from the text; nothing was executed.
Is Mat Magnetic Density 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 Magnetic Density use?
Mat Magnetic Density 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 Magnetic Density use?
About 2.7k tokens (SKILL.md is roughly 11k 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 Magnetic Density?
Skills that share tags, products or a category with Mat Magnetic Density: MCP Server Builder (anthropics/skills, 180k stars), MCP Server Builder (shareAI-lab/learn-claude-code, 78k stars), MCP Integration for Plugins (anthropics/claude-plugins-official, 38k stars) and Figma use_figma Plugin API Rules (warpdotdev/warp, 65k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
Who maintains Mat Magnetic Density?
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.