Use when you have a written implementation plan to execute in a separate session with review checkpoints
npx skills add TaoELi/MaxwellLink --skill "mxl-core"
Install specific skill from multi-skill repository
# Description
This skill should be used when users need the canonical MaxwellLink workflow, including socket vs embedded coupling, units/time handling, and MPI/HPC invariants.
# SKILL.md
name: mxl-core
description: This skill should be used when users need the canonical MaxwellLink workflow, including socket vs embedded coupling, units/time handling, and MPI/HPC invariants.
MaxwellLink core workflow
Enforce invariants
- Create new runnable inputs only under
projects/YYYY-MM-DD-NAME/. - Keep runs reproducible by storing parameters in a
config.json(or similar) and avoiding hard-coded absolute paths. - Never pass both
hub=...anddriver=...tomaxwelllink.Molecule; provide exactly one.
Choose coupling mode
- Use embedded mode when the driver can run in the same Python process:
- Construct molecules with
Molecule(driver="<id>", driver_kwargs={...}). - Use socket mode when drivers must run as separate processes or nodes:
- Construct a
SocketHub(...), passhub=hubinto eachMolecule(...), and launch onemxl_driver --model <id> ...per molecule. - If local socket runs fail with MPI/network permission errors, prefer embedded mode (
Molecule(driver="...", ...)) on local machines and reserve socket mode for SLURM/HPC. - For local socket mode, you can disable MPI auto-init with
MPI4PY_RC_INITIALIZE=0and ensure loopback NIC usage (use127.0.0.1; set site-specific NIC selection env vars if MPI/OFI tries a non-loopback interface).
Handle units/time
- For Meep: set
time_units_fsonMeepSimulation(...)and keep it consistent when interpreting driver times. - For SingleMode/LaserDriven: work directly in atomic units and set
dt_auexplicitly.
Handle MPI and multi-process execution
- Launch socket drivers only once (rank 0) under MPI; rely on MaxwellLink broadcasts for other ranks.
- Set generous
timeoutfor HPC and tunelatencyto match driver cost. - If attaching many molecules, consider
store_additional_data=Falsefor most molecules to limit memory usage; keep itTrueonly for the molecules you intend to export/plot.
Validate before running
- Use
skills/mxl-project-scaffold/scripts/mxl_validate_project.pyto sanity-checkconfig.jsonand required files. - When debugging behavior, compare to patterns in
tests/anddocs/source/usage.rst.
References
- Solver choice:
skills/mxl-core/references/solver_quickref.md - Driver choice:
skills/mxl-core/references/driver_quickref.md
# Supported AI Coding Agents
This skill is compatible with the SKILL.md standard and works with all major AI coding agents:
Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.