# Gromacs

> Use when setting up and running biomolecular MD simulations with GROMACS. Generate topologies, write MDP input files, execute simulations, and perform basic analysis.

- **Type:** Skill
- **Install:** `agentstack add skill-wugroup-xjtlu-cc-skills-zhenghaowu-group-gromacs`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [WuGroup-XJTLU](https://agentstack.voostack.com/s/wugroup-xjtlu)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** Apache-2.0
- **Upstream author:** [WuGroup-XJTLU](https://github.com/WuGroup-XJTLU)
- **Source:** https://github.com/WuGroup-XJTLU/cc-skills-ZhenghaoWu-Group/tree/main/plugins/gromacs/skills/gromacs

## Install

```sh
agentstack add skill-wugroup-xjtlu-cc-skills-zhenghaowu-group-gromacs
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# GROMACS - Molecular Dynamics Simulation

## Overview

GROMACS is a high-performance engine for biomolecular MD simulations, including proteins, lipids, and nucleic acids in explicit solvent.

## When to Use GROMACS vs. Other Tools

| Scenario | Recommended Tool | Why |
|---|---|---|
| Biomolecular systems (proteins, membranes, DNA) in explicit solvent | **GROMACS** | Optimized force fields, extensive biophysical analysis tools |
| Materials, coarse-grained, or reactive MD | **LAMMPS** | Flexible potentials, ReaxFF, granular/CG support |
| Quick structure conversion or small test calculations | **ASE** | Lightweight Python interface, many calculators |

**Key rule:** Use GROMACS when the system is biomolecular and you need production-quality explicit-solvent MD with thermodynamic analysis.

## Requirements

GROMACS must be installed and `gmx` must be available in your PATH.

## Core Capabilities

### 1. Write MDP Files

Generate standard MDP files for common protocols.

```bash
python scripts/write_mdp.py em minimization.mdp
python scripts/write_mdp.py nvt equilibration.mdp
python scripts/write_mdp.py npt production.mdp
```

### 2. Run Simulations

Prepare and run simulations.

```bash
python scripts/run_simulation.py --mdp production.mdp --gro system.gro --top system.top --o run.tpr --run
```

### 3. Run Analysis

Compute RMSD, RMSF, and RDF.

```bash
python scripts/run_analysis.py --xtc traj.xtc --gro system.gro --task rmsd --o rmsd.xvg
```

## Anti-Patterns (Do Not Do These)

- **Do not skip energy minimization before equilibration.** Bad contacts cause immediate crashes or LINCS failures.
- **Do not start NPT production without NVT equilibration first.** Temperature coupling must stabilize before pressure coupling is turned on.
- **Do not use a time step larger than 2 fs without constraints.** Unconstrained bonds to hydrogen require dt <= 1 fs.
- **Do not ignore LINCS warnings.** They indicate an unstable integrator or a poor starting structure.
- **Do not run analysis on raw trajectories without considering periodic boundary conditions (PBC).** Molecules may appear broken across box boundaries.

## Best Practices

- Always minimize before equilibration.
- Run NVT first, then NPT, then production.
- Use `dt = 0.002` with bond constraints (e.g., `constraints = h-bonds`).
- Use PME for long-range electrostatics in biomolecular systems.
- Write coordinates every 5–10 ps (`nstxout = 5000` at 2 fs/step) to balance disk usage and analysis resolution.
- Set `gen_seed` for reproducibility when generating velocities.
- **For questions about the latest GROMACS features, new MDP options, or version-specific syntax changes, use `WebFetch` on https://manual.gromacs.org/current/ before answering.**

## Common Errors and Fixes

| Error / Symptom | Likely Cause | Fix |
|---|---|---|
| `grompp` fails with "atomtype not found" | Missing force-field parameters or wrong topology path | Check `*.itp` includes and force-field selection |
| `mdrun` crashes with LINCS warnings | Too-large time step or poorly minimized structure | Reduce `dt`, increase `nsteps` in EM, or check clashes |
| Energy or temperature drift | Cutoffs too short, missing constraints, or integration errors | Increase `rcoulomb`/`rvdw`, verify constraints, reduce `dt` |
| Analysis shows broken molecules | PBC not handled | Use `gmx trjconv -center -pbc mol` before analysis |
| Fatal error: number of coordinates does not match | Atom count mismatch between `.gro` and `.top` | Reconcile topology with structure (e.g., missing water or ions) |

## References

- **Official Documentation**: https://manual.gromacs.org/current/
- **Tutorials**: https://tutorials.gromacs.org/
- **GitHub**: https://gitlab.com/gromacs/gromacs

## Getting Live Information

If the user asks about recently added features, new options, or version-specific syntax changes, use `WebFetch` on the official documentation at https://manual.gromacs.org/current/ before answering.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [WuGroup-XJTLU](https://github.com/WuGroup-XJTLU)
- **Source:** [WuGroup-XJTLU/cc-skills-ZhenghaoWu-Group](https://github.com/WuGroup-XJTLU/cc-skills-ZhenghaoWu-Group)
- **License:** Apache-2.0

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-wugroup-xjtlu-cc-skills-zhenghaowu-group-gromacs
- Seller: https://agentstack.voostack.com/s/wugroup-xjtlu
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
