Agent skill

Mat Xrd Refinement

by learningmatter-mit in learningmatter-mit/AtomisticSkills

Perform Rietveld refinement from experimental XRD patterns using DARA (BGMN).

MITAuto-check passed

Install Mat Xrd Refinement

skills CLI
$ npx skills add learningmatter-mit/AtomisticSkills --skill mat-xrd-refinement -a claude-code

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

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

At a glance

Perform Rietveld refinement from experimental XRD patterns using DARA (BGMN).

  • Works in 2 steps: Prepare XRD data (.xy format) → Run refinement (refine.py)
  • SKILL.md covers Goal, Requirements, Scripts and Instructions, plus 4 more sections

What it does

Mat Xrd Refinement is an agent skill from learningmatter-mit/AtomisticSkills. Perform Rietveld refinement from experimental XRD patterns using DARA (BGMN).

Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. The skill folder holds 33 other files, including scripts (for example `examples/CaNi(PO3)4_800_240_Ca(OH)2_(NH4)2HPO4_NiO/README.md`, `examples/CaNi(PO3)4_800_240_Ca(OH)2_(NH4)2HPO4_NiO/refinement_results/CaNi(PO3)4_800_240_Ca(OH)2_(NH4)2HPO4_NiO/refinement_result.json` and `examples/LiFePO4/LiFePO4_xrd.json`).

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-xrd-refinement”

Requirements

  • Python 3

Workflow steps

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

  1. Prepare XRD data (.xy format)
  2. Run refinement (refine.py)

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/, 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):

    • cedergrouphub.github.io
    • 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 Xrd Refinement loads about 1.8k tokens when it runs. Until then it costs about 24 tokens; SKILL.md has 659 words of instructions outside code blocks.

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

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). 659 words, ~1,824 tokens.

Download SKILL.mdSave it as .claude/skills/mat-xrd-refinement/SKILL.md (or your agent's skills folder). This skill also uses 26 other files; get the full folder from GitHub.
name
mat-xrd-refinement
description
Perform Rietveld refinement from experimental XRD patterns using DARA (BGMN).
metadata.category
materials
metadata.venv
cpu

Rietveld Refinement

Goal

Perform quantitative Rietveld refinement of powder X-ray diffraction (XRD) patterns using DARA (Data-driven Automated Rietveld Analysis) with BGMN. Use when you have an experimental (or theoretical) pattern in .xy format and candidate phase CIFs.

Requirements

  • Environment: cpu (it includes dara-xrd and pymatgen; venv/run creates it on first use).
  • PNG export uses kaleido, which needs Chrome or Chromium (on x86_64, plotly_get_chrome installs one).
  • BGMN: DARA uses BGMN; ensure it is installed. On HPC without network, set --bgmn_dir or DARA_BGMN_DIR to a local BGMN directory.

Scripts

ScriptPurpose
scripts/refine.pyRun Rietveld refinement with known phases; writes plots and summary under refinement_results/.
scripts/convert_xrd_to_xy.pyConvert XRD from JSON (xrd-spectrum) or DIF to .xy for DARA.
scripts/dara_utils.pyHelpers (e.g. load_xrd_file); used by other scripts.

Instructions

1. Prepare XRD data (.xy format)

Two columns (2θ and intensity), space-separated. Options:

  • From xrd-spectrum JSON: use convert_xrd_to_xy.py with --input_file your_xrd.json. Output is written next to the input as your_xrd.xy.
  • From experimental DIF: use convert_xrd_to_xy.py with --input_file your_data.txt (or .dif). Format is auto-detected if the file contains a header with 2-THETA and INTENSITY.
bash
# From JSON (e.g. xrd-spectrum output)
${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/scripts/convert_xrd_to_xy.py --input_file path/to/xrd.json

# From DIF
${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/scripts/convert_xrd_to_xy.py --input_file path/to/scan.txt

Convert arguments:

  • --input_file: Path to JSON or DIF file.
  • --format: auto (default), json, or dif to force format.
2. Run refinement (refine.py)

Refinement uses DARA’s do_refinement_no_saving (no BGMN working files left on disk). Output is written to refinement_results/ under the same directory as the XRD file (no --output_dir argument).

Refine arguments:

  • --xrd_data: (Required.) Path to the .xy pattern. Quote the path in the shell if it contains parentheses or spaces, e.g. --xrd_data "./path/with(Chem).xy".
  • --cifs: (Optional.) List of CIF paths. If omitted, CIFs are auto-discovered: first from a cifs/ subfolder next to the XRD file, then from the XRD directory. Example layout: examples/LiFePO4/LiFePO4_xrd.xy and examples/LiFePO4/cifs/LiFePO4.cif, Li3PO4.cif.
  • --instrument_profile: Default Aeris-fds-Pixcel1d-Medipix3.
  • --phase_params: Path to a JSON file with phase refinement parameters (e.g. lattice_range, b1, k1, gewicht). See DARA tutorial.
  • --refinement_params: Path to JSON for refinement options (e.g. wmin, wmax).
  • --bgmn_dir: Local BGMN directory (avoids download). Or set DARA_BGMN_DIR.
  • --quiet: Suppress progress output.

Normalized intensity: If the pattern’s maximum intensity is < 10, the script scales intensities to ~1000 before refinement so Rwp is comparable to the DARA tutorial; the applied scale is printed and stored in refinement_result.json as intensity_scale_applied.

Output files (refine.py)

All under <xrd_directory>/refinement_results/<stem>/ (e.g. refinement_results/LiFePO4/):

FileDescription
refinement_result.jsonRwp, instrument_profile, phase_params, refinement_params, phases (lattice, gewicht), paths to plots and peak_data, optional intensity_scale_applied.
<stem>_refinement.htmlInteractive Plotly refinement plot (observed, calculated, difference).
<stem>_refinement.pngStatic plot (requires kaleido).
<stem>_peak_data.csvSimulated peaks (2θ, intensity, h, k, l, phase, etc.).

No BGMN working files (.str, .par, .lst, etc.) are saved; DARA runs in a temporary directory.

Show full SKILL.md (233 more words)Show less

Examples

Example 1: LiFePO4 (CIFs in cifs/ subfolder)

Layout: examples/LiFePO4/LiFePO4_xrd.xy and examples/LiFePO4/cifs/LiFePO4.cif, Li3PO4.cif. No --cifs needed.

bash
${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/scripts/refine.py \
  --xrd_data ${CLAUDE_SKILL_DIR}/examples/LiFePO4/LiFePO4_xrd.xy

Results: examples/LiFePO4/refinement_results/LiFePO4/ (refinement_result.json, HTML/PNG, peak_data CSV).

Example 2: CaNi(PO3)4 (path with parentheses — must quote)
bash
# Quote the path because of (PO3), (OH), (NH4).
${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/scripts/refine.py \
  --xrd_data "${CLAUDE_SKILL_DIR}/examples/CaNi(PO3)4_800_240_Ca(OH)2_(NH4)2HPO4_NiO/CaNi(PO3)4_800_240_Ca(OH)2_(NH4)2HPO4_NiO.xy"

CIFs are taken from examples/CaNi(PO3)4_.../cifs/ (NiO_225_sym.cif, CaNi(PO3)4_15_sym.cif). Results under that example’s refinement_results/.

Example 3: Explicit CIFs and optional parameters
bash
${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/scripts/refine.py \
  --xrd_data pattern.xy \
  --cifs phase1.cif phase2.cif \
  --phase_params phase_params.json \
  --refinement_params refinement_params.json
Standalone Plotting (plot.py)

If you want to adjust the visualization (e.g. dimensions, font sizes, legend position) without re-running the heavy DARA refinement process, you can use the standalone plot.py script. This script reads the *_curve_data.csv exported by refine.py.

bash
${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/scripts/plot.py \
  --data_dir refinement_results/my_pattern \
  --output refinement_results/my_pattern/reformatted_plot

You can independently edit plot.py directly to adjust any of the matplotlib/plotly formatting rules.

Constraints

  • BGMN: Must be installed and on PATH, or provide --bgmn_dir / DARA_BGMN_DIR on restricted networks.
  • Paths: In the shell, quote any path that contains ( ) or spaces.
  • Rwp: Good fits often < 15%. High Rwp with a good-looking plot can occur if the pattern is normalized (low intensity); the script auto-scales in that case. You can also try --phase_params (e.g. lattice_range, b1, k1, gewicht) per the DARA tutorial.
  • Instrument profile: Default is Aeris-fds-Pixcel1d-Medipix3; change with --instrument_profile if needed for your diffractometer.
  • mat-xrd-digitizer:
    • Use this skill to digitize an image or screenshot of an XRD plot into an .xy file if you do not have raw experimental data.
  • mat-xrd-calculator:
    • Calculate theoretical XRD patterns from crystal structures.
  • foundation-potentials:
    • Relax structures before XRD for better agreement with experiment.

Author: Nofit Segal Contact: GitHub @nofitsegal

© 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 26 other files (scripts) in skills/mat-xrd-refinement of learningmatter-mit/AtomisticSkills.

  • SKILL.md
  • examples/CaNi(PO3)4_800_240_Ca(OH)2_(NH4)2HPO4_NiO/CaNi(PO3)4_800_240_Ca(OH)2_(NH4)2HPO4_NiO.xy
  • examples/CaNi(PO3)4_800_240_Ca(OH)2_(NH4)2HPO4_NiO/README.md
  • examples/CaNi(PO3)4_800_240_Ca(OH)2_(NH4)2HPO4_NiO/cifs/CaNi(PO3)4_15_sym.cif
  • examples/CaNi(PO3)4_800_240_Ca(OH)2_(NH4)2HPO4_NiO/cifs/NiO_225_sym.cif
  • examples/CaNi(PO3)4_800_240_Ca(OH)2_(NH4)2HPO4_NiO/refinement_results/CaNi(PO3)4_800_240_Ca(OH)2_(NH4)2HPO4_NiO/CaNi(PO3)4_800_240_Ca(OH)2_(NH4)2HPO4_NiO_curve_data.csv
  • examples/CaNi(PO3)4_800_240_Ca(OH)2_(NH4)2HPO4_NiO/refinement_results/CaNi(PO3)4_800_240_Ca(OH)2_(NH4)2HPO4_NiO/CaNi(PO3)4_800_240_Ca(OH)2_(NH4)2HPO4_NiO_peak_data.csv
  • examples/CaNi(PO3)4_800_240_Ca(OH)2_(NH4)2HPO4_NiO/refinement_results/CaNi(PO3)4_800_240_Ca(OH)2_(NH4)2HPO4_NiO/CaNi(PO3)4_800_240_Ca(OH)2_(NH4)2HPO4_NiO_refinement.png
  • examples/CaNi(PO3)4_800_240_Ca(OH)2_(NH4)2HPO4_NiO/refinement_results/CaNi(PO3)4_800_240_Ca(OH)2_(NH4)2HPO4_NiO/CaNi(PO3)4_800_240_Ca(OH)2_(NH4)2HPO4_NiO_refinement.svg
  • examples/CaNi(PO3)4_800_240_Ca(OH)2_(NH4)2HPO4_NiO/refinement_results/CaNi(PO3)4_800_240_Ca(OH)2_(NH4)2HPO4_NiO/refinement_result.json
  • examples/LiFePO4/LiFePO4_xrd.json
  • examples/LiFePO4/LiFePO4_xrd.xy
  • examples/LiFePO4/README.md
  • examples/LiFePO4/cifs/Li3PO4.cif
  • … and 13 more

Open the folder on GitHubat commit 7f2d86d

Compare with similar skills

Mat Xrd Refinement 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 Xrd Refinement compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Mat Xrd Refinement this skilllearningmatter-mit/AtomisticSkills175—~1.8kAutomated safety check: PassMIT
React Performanceaffaan-m/ECC274k1 repos~4.5kAutomated safety check: PassMIT
Performance Profileralirezarezvani/claude-skills28k—~684Automated safety check: PassMIT
Agent Performance Optimizerruvnet/ruflo74k2 repos~3.6kAutomated safety check: PassMIT
Handsontable Performance Testinghandsontable/handsontable22k—~3.4kAutomated safety check: PassCustom licence
Performance Managementsickn33/agentic-awesome-skills47k1 repos~4.1kAutomated safety check: PassMIT

Similar skills

  • React Performance

    affaan-m/ECC

    React and Next.js performance optimization patterns adapted from Vercel Engineering's React Best Practices (https://github.com/vercel-labs/agent-skills).

    274k GitHub starsUsed in 1 repo~4.5k tokens
    DevelopmentAuto-check passed
  • Performance Profiler

    alirezarezvani/claude-skills

    Systematic performance profiling for Node.js, Python, and Go applications.

    28k GitHub stars~684 tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Agent skill for performance-optimizer - invoke with $agent-performance-optimizer

    74k GitHub starsUsed in 2 repos~3.6k tokens
    Auto-check passed
  • Handsontable Performance Testing

    handsontable/handsontable

    Guide to Handsontable's performance-tests package: Playwright scenarios measured through CDP traces and compared against golden baselines taken from the develop branch.

    22k GitHub stars~3.4k tokensUpdated today
    Testing & QAAuto-check passed
  • Performance Management

    sickn33/agentic-awesome-skills

    Performance review register: review type, period, employee and reviewer, KPI, OKR and behaviour scores, overall rating, PIP and promotion flags, development plan.

    47k GitHub starsUsed in 1 repo~4.1k tokens
    Business, Finance & HRAuto-check passed
  • Performance

    udecode/plate

    Review performance lanes with GitHub-scale tactics not owned by Vercel React rules: cohort segmentation, repeated-unit budgets, interaction-level INP, memory tagging, degradation contracts, browser…

    17k GitHub stars~2.6k tokensUpdated today
    Auto-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 Xrd Refinement

What does Mat Xrd Refinement do?

Perform Rietveld refinement from experimental XRD patterns using DARA (BGMN). Mat Xrd Refinement is an agent skill from learningmatter-mit/AtomisticSkills. Perform Rietveld refinement from experimental XRD patterns using DARA (BGMN).

How do I install Mat Xrd Refinement in Claude Code?

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

How do I install Mat Xrd Refinement in Codex?

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

Can I use Mat Xrd Refinement 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-xrd-refinement -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-xrd-refinement, .gemini/skills/mat-xrd-refinement, .github/skills/mat-xrd-refinement and .opencode/skills/mat-xrd-refinement in your project.

What does Mat Xrd Refinement need to run?

SKILL.md names no scripts, command-line tools or credentials: Mat Xrd Refinement is instructions for the agent only. Our summary lists: Python 3.

Does Mat Xrd Refinement access the network?

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

Is Mat Xrd Refinement 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 Xrd Refinement use?

Mat Xrd Refinement 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 Xrd Refinement use?

About 1.8k tokens (SKILL.md is roughly 7.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 Xrd Refinement?

Skills that share tags, products or a category with Mat Xrd Refinement: React Performance (affaan-m/ECC, 274k stars), Performance Profiler (alirezarezvani/claude-skills, 28k stars), Agent Performance Optimizer (ruvnet/ruflo, 74k stars) and Handsontable Performance Testing (handsontable/handsontable, 22k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Mat Xrd Refinement?

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.