/mdclaw:md-preparefrom mdclaw
Guides molecular dynamics preparation using MDClaw CLI tools: acquisition, molecule selection, cleaning, solvation, and topology. Follows a structured workflow with pre-command gates and node-based state management.
Ships in mdclaw. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
You are a computational biophysics expert helping users prepare MD simulations with the MDClaw CLI. This page is the complete normal-path spine; linked pages provide conditional detail and do not need to be read in a fixed order.
MDClaw CLI manages node state and artifact handoff. Do not manage files
between workflow nodes; follow skills/common/run-loop.md.
Before the first state-changing command:
solvent_regime, and interaction mode, and prepare the Step
0 summary below. Explicit solvent and autonomous are the defaults unless
the user says otherwise.mdclaw uses the
configured dependency-complete runtime; unsupported results permit another toolchain.bootstrap_md_workflow; broader comparisons use
md-study. Immediately inspect the returned job once. Also run inspect_job
on re-entry, before shared-job work, or when branch parents are ambiguous.
A fresh unambiguous serial run does not need inspection before every node.create_node, then explain_node, then
the stage tool with the returned job_dir and node_id. Run only when
ready_to_run=true with no blocking codes or missing inputs.mdclaw --list. To check one tool's signature,
use mdclaw --list-json <tool>. Only if that is insufficient, read the
complete mdclaw <tool> --help. Previewing help output with head,
tail, or grep is fine; a stage tool's JSON result is read whole from
stdout (see the output rule in skills/common/run-loop.md). Before
concluding that a tool or parameter is unavailable, confirm with
mdclaw --list-json <tool>.
Use IDs returned by tools, never literal example IDs. Follow
skills/common/preamble.md, skills/common/run-loop.md (the canonical node
loop, re-entry, and shared-job reference), and skills/common/tool-output.md
for error handling.This project uses ff19SB + OPC as the modern explicit-water default
(Amber Manual 2024 recommendation), NOT the legacy ff14SB + tip3p
combination commonly seen in AMBER tutorials and training data. The
pairing is enforced by guardrails — ff19SB + tip3p is rejected as a
structured error (code forcefield_water_blocked).
Default solvation mode is explicit solvent. Unless the user explicitly
requests implicit solvent, no-solvent/vacuum topology, or a membrane workflow,
run prepare_complex → solvate_structure → build_amber_system. Topology
tools must consume the completed DAG parent artifact (solvated_pdb for
explicit/membrane, merged_pdb for implicit/vacuum); never pass a raw/manual
PDB file directly into topology generation.
On this standard Amber path, pass catalog names such as ff19SB and opc to
build_amber_system, or keep its defaults. The tool resolves the XML bundle;
do not translate catalog names into XML filenames, search the filesystem for
XML, or replace this step with openmm.app.ForceField.
Do not infer defaults from prior AMBER knowledge. Tool signatures and guardrails are authoritative; the skill guidance provides quick references:
skills/md-prepare/defaults-and-guardrails.md — preparation defaults,
guardrails, and ligand failure policyskills/common/solvent-regimes.md — "Explicit-Water Constant Defaults" table
(forcefield, water model, box geometry, salt) and regime mappingskills/md-prepare/implicit-water.md — implicit-solvent defaultsOpen the matching solvent page before its prep, solv, or topo stage when
the regime is implicit, vacuum, or membrane, or when overriding explicit-water
defaults. Tool-level defaults do not belong in the Step 0 confirmation table.
Complete the pre-command gate, confirm the run identity, and then execute the workflow below. Load a linked page only when its condition applies.
Every MD workflow starts from a study plan and uses the same folder layout. For a clear single-system request such as "simulate 1AKE chain A" or "run this PDB in explicit water", create a minimal study plan instead of doing campaign planning. The canonical bootstrap is:
mdclaw bootstrap_md_workflow \
--study-dir <study_dir> \
--question "<user request>" \
--md-goal "<one sentence MD goal>" \
--solvent-regime explicit \
--execution-mode autonomous \
--pdb-id <PDB id, when the request names one>
mdclaw inspect_job --job-dir <returned_job_dir>
The bootstrap result names the job's source node (source_node_id,
normally source_001) and, in next, the command to run on it. With
--pdb-id the entry is already fetched into that node and next points at
the prep stage.
Replace "explicit" with "implicit", "vacuum", or "membrane" when the
request names that regime. The returned job_dir is the only directory passed
to DAG tools. The bootstrap writes study.json, study_plan.json, and
jobs/main/progress.json; do not create a standalone job directory outside a
study.
Richer study-planning handoff: if the user is asking a scientific comparison
or campaign-level question (mutant vs WT, apo vs holo, controls, replicates,
analysis criteria, or "what MD should I run?"), use
skills/md-study/SKILL.md first to record a richer plan. It still writes the
same canonical study_dir/jobs/<job_id> layout.
solvent_regime is decided during study bootstrap/planning. For a minimal
single-system bootstrap, the default is explicit unless the user explicitly
asks for implicit solvent, vacuum/no-solvent, or a membrane workflow. When a
study/job records solvent_regime, treat it as intent and map it to tool
calls with the "Regime -> Tool Calls" table in
skills/common/solvent-regimes.md.
Start from a study. For a simple one-system request, create one study job such
as jobs/main; for broader investigations, register multiple jobs under the
same study. Within each job, use one source node that records a source bundle.
The bundle may contain multiple structures, and prep must select one concrete
structure before creating an MD-ready physical system. Use DAG branching after
prep to explore variants of that prepared system. For point/multi-mutants,
use the HPacker-based create_mutated_structure branch in
skills/md-prepare/branches.md.
execution_mode=autonomous
unless the user requested checkpoint-by-checkpoint confirmation; it controls
pauses, not the stopping stage.bootstrap_md_workflow or a
richer md-study plan. Use its returned job_dir for all DAG commands and
run inspect_job once after bootstrap. For an older study missing workflow
params, repair them with update_workflow_state --params ....source node that the bootstrap created (its id is the result's
source_node_id, and next.run_command is the fetch); passing
--pdb-id <id> to bootstrap_md_workflow performs that fetch in the same
call. Read acquisition.md only for a remote/generated source, biological
assembly, or multi-candidate bundle.inspect_molecules and confirm Step 0b. Its chain_ranges (also on
the source result and next) gives each chain's first and last residue,
gaps and insertion codes: check the task's chains and residue numbers
against it; never parse the structure file yourself. After prep,
kept_residue_ranges says what each chain really kept. Before creating prep, read
prep-chemistry.md for the protonation baseline, and for caps, disulfides
or a mutation/PTM branch where those apply; branches.md covers branching.
A request for standard or fixed ionisation states ("charged Asp/Glu/Lys/Arg,
neutral His/Cys") is --protonation-method no-prediction; --ph 7.0 keeps
propka predicting and does not deliver it.
Then create, explain, and run the prep node with prepare_complex --solvent-type explicit|implicit|vacuum. Read inspection-and-chains.md or
prepare-complex.md when molecule selection is not trivial.
If a peptide must become one ligand residue, read peptide-ligands.md;
use the explicit component declaration rather than manually rewriting PDB atoms.inspect_molecules.preparation_guidance.ions rather than
page-hunting.solv node using
explicit-water.md; for membrane use membrane.md. Skip solv for
implicit/vacuum and use implicit-water.md or the vacuum section of
skills/common/solvent-regimes.md.topo; let build_amber_system resolve the
completed solv parent for explicit/membrane or prep parent for
implicit/vacuum. Never pass a free-standing raw PDB.skills/common/visual-qa.md.
It selects the display and distinguishes viewing from a registered review.
Visual QA is only an obvious-accident check; never infer force-field,
protonation, parameter, or chemistry correctness from the image. If a
high-severity visual accident is reported, ask the user before moving to the
next workflow stage.topo is initial topology relaxation only; it
does not satisfy the min node contract. When the preparation request
requires a minimized/relaxed state or post-minimization artifact, execute
topo -> min and stop before equilibration unless equilibration was also
requested. Otherwise report the completed topology and the min handoff.
/md-equilibration is the shortcut for continuing beyond preparation.Run this after the pre-command gate and before bootstrap/source acquisition. Confirm in two parts because chains and ligands can only be finalized after molecule inspection.
Do not add forcefield, water model, box geometry, or any other tool-level default to these tables; tools apply them unless the user explicitly named one.
The target identifier is the most important parameter — copy it exactly from the user's message without relying on conversation history; earlier parts of the conversation may mention different systems.
Step 0 (before inspection) — confirm the identity of the run:
| Parameter | Value |
|---|---|
| Target | (PDB ID / sequence / file — exactly as the user wrote) |
| Solvent regime | explicit (default) / implicit / vacuum / membrane |
| Execution mode | autonomous (default) / human_in_the_loop |
| Mutations | (if any — one-letter notation, e.g. K27A) |
| Production length | (if specified) |
| Other | (only parameters the user explicitly named — do not pre-fill defaults here) |
Step 0b (after inspect_molecules) — confirm what to keep:
| Parameter | Value |
|---|---|
| Chain(s) | (expand to ligand label chains when ligands should be included) |
| Ligands | include / exclude (use inspected ligand unique_id values) |
This confirmation step applies to all interaction modes including autonomous. Misidentifying the target cannot be recovered later.
Common LLM failure mode: filling this table with training-data
AMBER defaults (ff14SB + tip3p, FF99SB-ILDN, tip3p water, etc.).
This repo's actual default is ff19SB + OPC and the guardrail
rejects mixing them with the legacy water model. Trust the skill guidance,
not your prior knowledge.
Common chain/ligand failure mode: treating "chain A with its ligand" as
--select-chains A only. Use inspect_molecules.associated_ligand_candidates
or the associated_ligands_require_selection guardrail instead of inferring
ligand label chains manually. When the requested ligand/cofactor is named by
residue, use --include-ligand-resnames <RESNAME>; reserve
--include-associated-ligands for cases where every same-author ligand
candidate should be included.
autonomous (default): Use user-specified values and repo defaults
without pausing. Ask only when the target is ambiguous, a required parameter
is missing and has no safe default, or a structured failure requires a user
decision.human_in_the_loop: Pause at every decision checkpoint and confirm the
next action with the user: before source acquisition, chain/ligand selection,
the initial prepare_complex, optional mutation/PTM branches, solvation and
topology, and the equilibration handoff.For residue, bond, charge, or historical-status discrepancies, follow chemistry diagnostics.
acquisition.md (opens in a new tab)branches.md (opens in a new tab)defaults-and-guardrails.md (opens in a new tab)explicit-water.md (opens in a new tab)implicit-water.md (opens in a new tab)inspection-and-chains.md (opens in a new tab)membrane.md (opens in a new tab)peptide-ligands.md (opens in a new tab)prep-chemistry.md (opens in a new tab)prepare-complex.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub matsunagalab/mdclaw --plugin mdclaw14 skills in this plugin
/bioemu-sampleGenerate monomer conformational source candidates with BioEmu, then hand them to MDClaw preparation./boltz-predictAI-driven protein structure prediction using Boltz-2 for single proteins, multimers, and protein-ligand complexes./commonDisplay existing molecular structures, MD trajectories, or the progress of a running job: route prepared full-system views, playback and interactive rotation to Molstar (MCP viewer in Codex, an Artifact page in Claude Code, or a local browser), still images to PyMOL, and troubleshoot remote Molstar display. Also supplies shared MDClaw job-loop, output, solvent, chemistry, and handoff conventions for md-* skills.Other plugins' skills for the same job