crystal-diffusion

crystal-diffusion is a skill for Claude Code, Codex from SFETNI/Deep-Matter-Chem-Skills. It costs 5 tokens per session (7,450 once invoked), scanned A, original, MIT.

A method for proposing new three-dimensional arrangements of atoms in crystals. It uses generative models trained on databases of inorganic crystal structures to suggest structures from a composition, a space group, or desired properties.

In plain words
What is it for?
Use it to create candidate crystal structures for materials discovery, suggest hypothetical structures for a chemical formula, or expand training data with plausible synthetic crystals.
Why use it?
It helps explore possible materials that are not already listed in a database. Crystal generation must account for repeating unit cells and the way atoms wrap across their boundaries.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to create candidate crystal structures for materials discovery, suggest hypothetical structures for a chemical formula, or expand training data with plausible synthetic crystals.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/sfetni/deep-matter-chem-skills/crystal-diffusion
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.

Any agent
npx skills add SFETNI/Deep-Matter-Chem-Skills --skill crystal-diffusion
Clone the repo
git clone --depth 1 https://github.com/SFETNI/Deep-Matter-Chem-Skills

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 crystal-diffusion

README.md
[![agentmods](https://agentmods.dev/badge/skills/sfetni/deep-matter-chem-skills/crystal-diffusion/github.svg)](https://agentmods.dev/skills/sfetni/deep-matter-chem-skills/crystal-diffusion)
Your own site
<a href="https://agentmods.dev/skills/sfetni/deep-matter-chem-skills/crystal-diffusion"><img src="https://agentmods.dev/badge/skills/sfetni/deep-matter-chem-skills/crystal-diffusion/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for crystal-diffusion

Your own site · 80×15
<a href="https://agentmods.dev/skills/sfetni/deep-matter-chem-skills/crystal-diffusion"><img src="https://agentmods.dev/badge/skills/sfetni/deep-matter-chem-skills/crystal-diffusion.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 5 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 7,450 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00005 $0.07450
Opus 5 $0.00003 $0.03725
Sonnet 5 $0.00001 $0.01490
Haiku 4.5 $0.00001 $0.00745

Measured 11d ago against content hash 7fa89cdc6733, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

crystal-diffusion 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 11d ago.

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.

skills/generative-matter/crystal-diffusion/SKILL.md · 467 lines

How it starts

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

Crystal Diffusion

Description

This skill covers de novo crystal structure generation using score-based diffusion and flow-matching generative models, including MatterGen (Microsoft Research), DiffCSP (Jiao et al.), and CDVAE (Xie et al.). These models learn the distribution of stable inorganic crystals from crystallographic databases and sample novel structures either unconditionally or conditioned on chemical composition, space group, or target properties. Invoke this skill when generating crystal structure candidates for materials discovery, when proposing hypothetical structures for a given formula, or when augmenting structural training sets with plausible synthetic crystals.

Domain Context

Crystal structure generation differs fundamentally from molecular generation because of three structural features that must be respected throughout the diffusion process:

  • Periodic boundary conditions: Atom positions are fractional coordinates on a 3D torus [0, 1)³. A diffusion process operating on fractional coordinates must handle wraparound: coordinates 0.02 and 0.98 are separated by only 0.04 in fractional units, not 0.96. Naive Euclidean diffusion in fractional space destroys this periodicity.
  • Lattice degrees of freedom: A crystal is fully specified by the 3×3 lattice matrix L (or equivalently the six scalars a, b, c, α, β, γ) together with the fractional coordinates and atom types. The lattice determines the physical scale and shape of the unit cell. Diffusion models must jointly denoise both the lattice and the atomic positions, and the parameterization of L affects equivariance properties.
  • Discrete atom types: Element identities are discrete categorical variables. Most models represent them as continuous embeddings during diffusion and decode to discrete types at generation time, but the discretization step introduces additional approximation.

Physical concepts that determine model validity:

  • SE(3)-equivariance: Crystal properties (energy, forces) are invariant under rotations and translations of the crystal. The generative model's score network or velocity field must be equivariant under these operations. Models based on MACE, NequIP, or e3nn backbones provide exact equivariance; models based on standard graph convolutions with distance-based features provide approximate invariance. [EXPERT REVIEW NEEDED: degree to which equivariance matters for generation quality vs. only for property prediction]
  • Score matching and denoising diffusion: Score-based models learn the score function ∇_x log p_t(x) at each noise level t. At generation time, Langevin dynamics or an ODE/SDE solver follows the learned score backwards from noise to the data distribution. The score must be learned on the correct metric for each degree of freedom (Euclidean for fractional coordinates, SO(3)-like for the lattice, categorical for atom types).
  • Flow matching: Learns a time-dependent velocity field v(x, t) that transports a simple prior (Gaussian noise) to the data distribution via an ODE. Flow matching on Riemannian manifolds (RFM) handles the non-Euclidean geometry of the lattice matrix and fractional coordinate torus more naturally than score matching. FlowMM and related models use this approach.
  • Thermodynamic plausibility vs. stability: A generated structure that passes geometric validity checks (no overlapping atoms, reasonable bond lengths, charge balance) is not guaranteed to be thermodynamically stable. Stability requires DFT total-energy evaluation and comparison to competing phases on the convex hull. Pre-screening with a universal MLP (MACE-MP-0, CHGNet, M3GNet) is fast enough to apply to all generated structures before committing DFT compute.
  • Composition space: Some models (CDVAE, DiffCSP) are conditioned on a fixed composition (the number and type of each element) provided by the user. Others (MatterGen) can generate composition jointly or condition on element-level properties. Composition-conditioned generation is more targeted for materials discovery but requires specifying a plausible composition.
  • Crystal validity metrics: The community evaluates generative models using: (1) validity — fraction of generated structures passing geometric checks; (2) uniqueness — fraction that are structurally distinct from each other; (3) novelty — fraction not present in the training database; (4) FCD (Fréchet Crystal Distance) — distributional similarity between generated and reference structures in an embedding space; (5) match rate — fraction of generated structures that match DFT-relaxed experimental structures (for CSP benchmarks).

Read the full file on GitHub · 467 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. 11d ago First seen · 467 lines · 5 tokens per session scan A 7fa89cdc6733

Subscribe to this mod's changes

crystal-diffusion is a skill published in the GitHub repository SFETNI/Deep-Matter-Chem-Skills (6 stars, last pushed 1mo ago), licensed MIT. It adds 5 tokens to every session and 7,450 once invoked, about $0.0000 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-08-31.

Related

Other skills, from other repositories

primekg

Query the Precision Medicine Knowledge Graph (PrimeKG) for multiscale biological relationships across genes and proteins, drugs, diseases, phenotypes, pathways, biological processes, exposures and anatomy. Use this skill to search entities by name, pull direct neighbours and their evidence types, summarise the local…

K-Dense-AI/drug-discovery-agent-skills · 121 tokens

fragment-based-count-matrix-generation

Use when you have a backed AnnData object containing processed fragment data (stored in .obsm['fragmentpaired'] or .

HolobiomicsLab/asb-skill-collections · 33 tokens

methylbase-object-handling

Use when after reading in per-sample methylation call files with methRead() and obtaining methylRawList objects, but before calculating differential methylation or performing annotation.

HolobiomicsLab/asb-skill-collections · 40 tokens

motif-annotation-correlation-analysis

Use when you have a chromVARDeviations object with multiple annotation sets (such as JASPAR motifs and kmers) and need to determine which annotation pairs are redundant (high correlation) versus synergistic (high synergy z-scores).

HolobiomicsLab/asb-skill-collections · 57 tokens

motif-database-query-and-matching

Use when you have a set of differentially accessible peaks (output from differential accessibility testing, e.g., tl.

HolobiomicsLab/asb-skill-collections · 32 tokens

motif-enrichment-statistical-testing

Use when after identifying a set of differentially accessible peaks (via tl.difftest or equivalent), when you need to infer which transcription factors may regulate the observed chromatin state changes.

HolobiomicsLab/asb-skill-collections · 44 tokens