mat-xrd-calculator

mat-xrd-calculator is a skill for Claude Code, Codex from learningmatter-mit/AtomisticSkills. It costs 25 tokens per session (624 once invoked), scanned A, original, MIT.

A calculator that predicts an X-ray diffraction (XRD) pattern from a crystal-structure file. XRD patterns show peaks caused by atoms arranged in repeating planes, helping describe a material's crystal structure.

In plain words
What is it for?
Use it to calculate peak positions, intensities, spacing values, and crystal-plane indices from POSCAR or CIF files.
Why use it?
It avoids calculating diffraction peaks by hand and produces both numerical peak data and a plot. The result can be compared with experimental measurements.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/learningmatter-mit/atomisticskills/mat-xrd-calculator
Any agent
npx skills add learningmatter-mit/AtomisticSkills --skill mat-xrd-calculator
Clone the repo
git clone --depth 1 https://github.com/learningmatter-mit/AtomisticSkills

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 mat-xrd-calculator

README.md
[![agentmods](https://agentmods.dev/badge/skills/learningmatter-mit/atomisticskills/mat-xrd-calculator.svg)](https://agentmods.dev/skills/learningmatter-mit/atomisticskills/mat-xrd-calculator)
Your own site
<a href="https://agentmods.dev/skills/learningmatter-mit/atomisticskills/mat-xrd-calculator"><img src="https://agentmods.dev/badge/skills/learningmatter-mit/atomisticskills/mat-xrd-calculator.svg" alt="Measured on agentmods" height="20"></a>
Per session 25 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 624 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found 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 $0.00025 $0.00624
Opus 5 $0.00013 $0.00312
Sonnet 5 $0.00005 $0.00125
Haiku 4.5 $0.00003 $0.00062

Measured yesterday against content hash f4935f349ad6, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

mat-xrd-calculator 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 yesterday.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/calculate_xrd.py, scripts/xrd_utils.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.

.agents/skills/mat-xrd-calculator/SKILL.md · 59 lines

How it starts

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

XRD Spectrum Calculation

This skill calculates the X-ray Diffraction (XRD) pattern of a crystal structure using pymatgen. It identifies diffraction peaks, their intensities, and associated (hkl) indices.

Requirements

  • Conda environment: base-agent
  • pymatgen
  • matplotlib

Usage

The primary script for this skill is calculate_xrd.py. It takes a structure file as input and generates a JSON file with the diffraction data and a plot of the intensities versus $2\theta$.

Command Line Interface

python .agents/skills/mat-xrd-calculator/scripts/calculate_xrd.py <structure_file> --output_dir <output_dir> --wavelength <wavelength>

Arguments

  • structure: Path to the input structure file (e.g., POSCAR, CIF).
  • --output_dir: (Optional) Directory to save the results. Defaults to the current directory.
  • --wavelength: (Optional) Radiation wavelength or source name (e.g., CuKa, MoKa, CrKa). Defaults to CuKa ($1.54184$ Å).
  • --symprec: (Optional) Symmetry precision for identifying equivalent peaks. Defaults to 0.1.

Output Files

  1. <filename>_xrd.json: Contains $2\theta$ positions, intensities, d-spacings, and (hkl) indices.
  2. <filename>_PV_xrd.png: A plot of the simulated XRD spectrum (Pseudo-Voigt model).

Example

To calculate the XRD pattern for LiFePO4:

```bash
conda activate base-agent
python .agents/skills/mat-xrd-calculator/scripts/calculate_xrd.py .agents/skills/mat-xrd-calculator/examples/LiFePO4/LiFePO4.cif --output_dir .agents/skills/mat-xrd-calculator/examples/LiFePO4

## Foundation Potential Recommendations

Since XRD is a purely geometric property of the crystal structure, it does not require a machine learning interatomic potential (MLIP) for the calculation itself. However, it is **highly recommended** to perform a structure relaxation using a high-quality MLIP (e.g., MACE, CHGNet) before calculating the XRD pattern to ensure the structure is at its energy minimum.

For recommendations on relaxation models, see the [ml-foundation-potentials](file:///home/bdeng/projects/AtomisticSkills/.agents/skills/ml-foundation-potentials/SKILL.md) skill.
---

Read the full file on GitHub · 59 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. yesterday First seen · 59 lines · 25 tokens per session scan A f4935f349ad6

Subscribe to this mod's changes

mat-xrd-calculator is a skill published in the GitHub repository learningmatter-mit/AtomisticSkills (158 stars, last pushed yesterday), licensed MIT. It adds 25 tokens to every session and 624 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

cd-calculator

Python calculators for geometry analysis, structural checking, solar calculations, panel optimization, mesh analysis, material estimation, and fabrication cost estimation for AEC computational design.

Abhinavbwj/Claude-skills-for-Computational-Designers · 30 tokens

cd-calculator

Python calculators for geometry analysis, structural checking, solar calculations, panel optimization, mesh analysis, material estimation, and fabrication cost estimation for AEC computational design.

marcinfinitesimal533/Claude-skills-for-Computational-Designers · 30 tokens

mapping-to-snomed

Maps clinical concept spans extracted by OpenMed to SNOMED CT concepts through a USER-SUPPLIED terminology server (the user's own Ontoserver, Snowstorm, or UMLS/UTS), never a bundled vocabulary. Use when the user wants to code findings, disorders, procedures, body structures, or substances to SNOMED CT, run an ECL…

maziyarpanahi/openmed · 205 tokens

mixed-precision

Use FP16/BF16 mixed precision to accelerate training and reduce memory. Use when optimizing GPU performance.

aiming-lab/AutoResearchClaw · 25 tokens

tooluniverse-drug-research

Comprehensive drug profiling — mechanism, primary/secondary targets, drug interactions, clinical-trial status, adverse events (FAERS), pharmacogenomics, and approval history. Use for full drug investigation reports, 'tell me about drug X' queries, and assembling drug profiles for clinicians, researchers, or regulatory…

mims-harvard/ToolUniverse · 71 tokens

audit-scientific-figure

Review and score an existing scientific illustration in visible draw.io, Microsoft PowerPoint, or WPS Presentation without hiding defects through flattening. Use for reference-fidelity checks, layout cleanup, connector review, text-fit checks, deep editability and raster-atomicity inspection, local-region gates, or…

icebird1998/scientific-illustrator · 80 tokens