# Gaussian Esp Vmd

> Generate electron-density and electrostatic-potential (ESP) cube files from Gaussian formatted checkpoint (.fch) files with Multiwfn; optionally render ESP images in VMD and calculate ESP statistics. Use for Gaussian FCH ESP analysis.

- **Type:** Skill
- **Install:** `agentstack add skill-nanhuai-x-gaussian-molecule-workflow-gaussian-esp-vmd`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [Nanhuai-X](https://agentstack.voostack.com/s/nanhuai-x)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [Nanhuai-X](https://github.com/Nanhuai-X)
- **Source:** https://github.com/Nanhuai-X/gaussian-molecule-workflow/tree/main/skills/gaussian-esp-vmd

## Install

```sh
agentstack add skill-nanhuai-x-gaussian-molecule-workflow-gaussian-esp-vmd
```

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

## About

# Gaussian ESP with Multiwfn and VMD

Use this skill for one or more `.fch` files when the requested deliverables include density/ESP cubes, ESP surface statistics, or ESP images.

## Preconditions

- Input layout: `fch/.fch`; output root: `output//`.
- Locate Multiwfn in this order: valid `MULTIWFN_BIN`, `Multiwfn` on `PATH`, then a location explicitly supplied by the user. Do not assume a local install path.
- For images, locate VMD in the same way using `VMD_BIN`; Pillow is required to convert TGA to PNG.
- Preflight each dependency before the stage that needs it. Preserve existing final outputs unless the user explicitly requests overwrite.

## Per-molecule workflow

Run the bundled entry point from the recipient's analysis folder (which contains `fch/`):

```powershell
python /scripts/run_esp.py --input fch --output output --render
```

The skill carries its own Multiwfn and VMD templates; do not use this repository's root `scripts/` folder.

1. Create an isolated temporary working directory and `output//`; copy or reference only `fch/.fch` there. Log Multiwfn to `output//multiwfn_esp.log`.
2. In Multiwfn, use the established ESP isosurface input to export both `density.cub` and `totesp.cub`. Return to the main menu and quit cleanly; do not rely on EOF to end the program.
3. Verify that both temporary cubes are newly created, then move them to:

   - `_density.cub`
   - `_ESP.cub`

4. Use Multiwfn's surface-analysis function to calculate ESP statistics and the electron-density-isosurface extents. Save `_esp_stats.txt` and `_dimensions.txt`. State the selected isovalue in the data file.
5. Only if graphics are requested and VMD/Pillow are available: render `_ESP.cub` headlessly to a temporary `_ESP.tga`, passing the measured ESP surface minimum and maximum from step 4 as VMD's color scale; convert it to `_ESP.png`, verify the PNG, and remove the temporary TGA. Never silently use a fixed ESP color range.

## Required checks

- Stop if Multiwfn exits unsuccessfully or either cube is absent; never continue with old files or suppress the error. Multiwfn 3.8 Windows builds can report a post-analysis Fortran return code 59 after printing `Surface analysis finished!`; accept that code only when the ESP extrema and all three dimensions were parsed and the log contains that completion marker.
- Do not claim that this skill produces HOMO/LUMO energies; those belong to `$gaussian-frontier-orbitals`.
- Report a concise summary per molecule: 2 cube files, optional 1 PNG, 2 ESP/dimension TXT files, and the VMD render log when graphics are requested.

## Failure handling

- Missing Multiwfn: ask for `MULTIWFN_BIN` or an installation location.
- Missing VMD/Pillow: keep valid cubes and TXT files, report that only the optional graphics stage was skipped.
- Missing or invalid ESP surface extrema: keep the cubes and statistics, skip the ESP image, and report that the color scale could not be determined.
- Long analyses: write logs to disk and report progress only per completed molecule rather than streaming verbose Multiwfn output.

## Source & license

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

- **Author:** [Nanhuai-X](https://github.com/Nanhuai-X)
- **Source:** [Nanhuai-X/gaussian-molecule-workflow](https://github.com/Nanhuai-X/gaussian-molecule-workflow)
- **License:** MIT

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-nanhuai-x-gaussian-molecule-workflow-gaussian-esp-vmd
- Seller: https://agentstack.voostack.com/s/nanhuai-x
- 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%.
