svd-ai-lab/sim-plugin-comsol/comsol
Claude Code and agent skill by svd-ai-lab/sim-plugin-comsol
- community
Checking that the SKILL.md file is still in the repository.
Use when the user asks Codex, Claude Code, ChatGPT-style coding agents, or another AI agent to build, inspect, run, debug, or revise COMSOL Multiphysics / COMSOL Desktop models. Choose the simplest real COMSOL control path for the task: saved `.mph` inspection, local COMSOL documentation, direct COMSOL executables (`comsolbatch`, `comsolcompile`, `comsolmphserver`, `comsol.exe mphclient`), or the sim COMSOL runtime when structured live introspection, shared Desktop collaboration, checkpointing, or plugin diagnostics are useful. Do not use for generic COMSOL theory.
Install
npx vskill@latest install svd-ai-lab/sim-plugin-comsol/comsolSKILL.md
comsol-sim
This file is the COMSOL Multiphysics agent workflow index. Its job is to help an agent choose and execute the most reliable real COMSOL control path for the task: saved .mph inspection, local COMSOL documentation, direct COMSOL executables, a server-backed Java API session, or the sim COMSOL runtime when that adds useful structure.
This skill is self-contained for COMSOL work. Do not require a separate skill checkout or an external sim-cli skill. Use this file for COMSOL workflow routing, and load the plugin-bundled references below only when the task needs them.
COMSOL-specific layered content
Choose the control path from the task and the current COMSOL state. Identify whether you have a saved .mph, a standalone Desktop, an mphclient connected to comsolmphserver, an external comsolmphserver, or no running session. Then pick the smallest path that can produce real evidence.
| Path | Use it for | Evidence to collect | |
|---|---|---|---|
saved .mph inspection | Offline summaries, archive diffs, parameters, physics tags, mesh/solution metadata, and artifact review without starting COMSOL. | inspect_mph(path), MphArchive, or mph_diff output. | |
| local COMSOL docs | Unknown physics feature names, module capability, property names, examples, and API terms before writing code. | sim-comsol-doc search / retrieve hits from the installed COMSOL help tree. | |
direct comsolbatch -inputfile | Running a saved model headlessly, stripping solutions with -norun, regression/CI/fan-out over .mph files, and one-shot saved-model output artifacts. | output .mph, -batchlog, shell exit status, and extracted KPIs/artifacts. | |
comsolcompile + comsolbatch | Settled Java recipes that build, solve, and extract KPIs in a fresh COMSOL process. | compiled class, batch log/stdout KPI lines, output .mph or exported data. | |
comsolmphserver / Java API | Stateful model exploration, live property/tag probing, incremental mutation, debugging, and API work where the agent needs to ask the live model questions. | model tags/properties, run/build results, saved checkpoints, and explicit model identity. | |
| sim runtime / shared Desktop | The same server-backed Java API work when the plugin's structured inspect/exec/checkpoint tools or managed visible Model Builder collaboration are useful. | session.health, comsol.model.identity, last.result, live binding checks, checkpoints. |
If the user already has a comsolmphserver plus comsol.exe mphclient -host ... -port ... Desktop open with the target model loaded, attach the agent without launching another Desktop client:
Then verify model tags and binding through session.health/ModelUtil.tags(). Use visual_mode=shared-desktop only when the plugin should launch or manage the visible Desktop client.
For the comsolcompile path, Java code needs chain-style model.X("tag").Y("tag2")... calls. There is no public Component, Geometry, HeatTransfer, etc. type; writing Component comp = ... gets cannot be resolved to a type from comsolcompile. Read `base/reference/java_batch_patterns.md` before writing a batch .java.
Choosing between live session and batch
These are not either/or - they compose. The natural arc is explore live -> solidify -> graduate to batch:
- Explore live. Use local docs, saved
.mphinspection, or a
server-backed Java API session to discover model shape, tags, properties, and module behavior.
- Solidify. Once the workflow is settled and known-good, capture it as a
batch .java file (comsolcompile + comsolbatch) or, for a saved model, a comsolbatch -inputfile run.
- Graduate to batch. Run the captured recipe headless for
reproducible/CI/fan-out execution — fresh process each run, no session-state drift, no comsolmphserver lifecycle, parallelizable across cases.
Quick test: if you still need to ask the live model questions, stay in a session. If you are executing a recipe you already trust, run it as batch.
For the sim runtime, use uv run sim check comsol when sim-cli is available, then uv run sim connect --solver comsol, then inspect session.health. Missing sim-cli is not evidence that COMSOL is missing: fall back to COMSOL_ROOT, sim-comsol-doc where, COMSOL launcher/default path probes, or the user-provided install path before reporting that COMSOL is not installed. When the user wants to watch the live Model Builder while the agent builds or solves, use:
Confirm ui_capabilities.model_builder_live: true, active_model_tag, and live_model_binding.ok: true before treating the GUI as synchronized with agent edits. The returned session.versions payload tells you which COMSOL-specific subfolders to load. Require version_source: active_runtime before using release-specific notes; another COMSOL installation detected on the host is not evidence about this session:
There is no sdk/ overlay because all supported COMSOL versions pin a single mph line (1.2.x). Load the smallest reference needed for the chosen path: usually base/ plus the active solver/<slug>/ notes only when version specific behavior matters.
base/ — references to load when relevant
| Path | What's there | |
|---|---|---|
base/workflows/block_with_hole/ | Steady-state thermal of a heated block with a cylindrical hole. 6 numbered Python steps (00_create_geometry.py … 05_plot_temperature.py). The smallest plugin-owned smoke/reference workflow for this driver. | |
base/workflows/model_review_loop.md | Checkpoint loop for live/incremental geometry, materials, physics, mesh, study, and results work. | |
base/workflows/debug_failed_exec.md | Failure and divergence triage: preserve the first causal error, inspect live state, separate singular/setup/mesh/nonlinear causes, then retry one hypothesis at a time. | |
base/reference/runtime_introspection.md | Live-session inspection contract: preferred uv run sim inspect targets, compatibility rules, partial results, and raw Java fallbacks. | |
base/reference/java_api_patterns.md | Stable Java API probing patterns: tags first, properties before set, selection checks, and version-safe try/except snippets. | |
base/reference/java_batch_patterns.md | Read before writing .java for comsolcompile: chain-style calls, anti-patterns that fail to compile, source-property toggles (<prop>_src), study/sol skeleton, KPI extraction via stdout, error triage. | |
base/reference/mph_file_format.md | .mph is a ZIP archive — internal layout, the three nodeType variants (compact/solved/preview), the Global Parameter T="33" contract, and the stdlib mph_inspect reader. Read this when you need to introspect a .mph without spinning up comsolmphserver. | |
base/reference/offline_postprocessing_exports.md | Optional pattern for COMSOL-free/Python postprocessing after a solve. Use when the user asks for reusable result artifacts, full-domain VTU field exports, CSV tables, or postprocessing without keeping COMSOL open. |
Larger engineering examples do not live in this plugin skill. Keep this plugin-owned content focused on the driver protocol, live introspection, debug loops, and the smallest smoke/reference workflow.
Each numbered step is a self-contained snippet for the sim runtime after uv run sim connect --solver comsol. This workflow is incremental and inspect-after-each-step, so a live session is the right path for it. Once a model build is settled, the batch path is the better choice for re-running it — see the decision table above.
Before running a new or complex workflow, read `base/reference/runtime_introspection.md` and `base/workflows/model_review_loop.md`. For failed snippets, switch immediately to `base/workflows/debug_failed_exec.md` instead of guessing another full script.
solver/<active_solver_layer>/ — release specifics
Empty stubs by default; per-release deltas land here as discovered.
solver/6.4/notes.md— currentsolver/6.2/notes.mdsolver/6.1/notes.mdsolver/6.0/notes.md
doc-search/ — local documentation lookup
When a physics feature name, API method, or module capability is unknown, choose the cheapest evidence source that can answer the question. Local docs are often the right first probe for names, modules, examples, and API terms:
For an already-loaded model or a failed live step, inspect the current model state:
The COMSOL driver may not expose every inspect target on older plugin builds. If an inspect target is unavailable, use the raw Java fallback patterns in `base/reference/java_api_patterns.md`.
doc-search runs in pure CPython: no live COMSOL session, no sim runtime, and no JVM. It scans the installed COMSOL HTML help on disk.
One-time setup on any host that has COMSOL installed:
(No index build step — each query scans the doc tree in parallel; typical latency is 1–3 s on a local SSD.)
Tips for good queries:
- Use 2–3 keywords, not questions. COMSOL search is keyword-matched.
- Filter by
--module battery/--heat/--cfd/--plasmato bias
toward a module's plugin folder (matched as a substring of the com.comsol.help.* name).
- Progressive broadening: if
"C-rate battery"returns nothing, try
"discharge rate", then "battery performance".
- For API / coding questions, filter
--module programmingor
--module api. Plugin names follow com.comsol.help.* — inspect a few results and adjust.
To read the full text of a hit:
See doc-search/README.md for discovery details and the install-root override (--comsol-root) if auto-detection fails.
Application Gallery: local vs. web
The local index also covers the Application Gallery content for every module the user has installed — those plugins are named com.comsol.help.models.* (e.g. com.comsol.help.models.battery.li_battery_1d). Filter with --module models to scope a search to example-model docs:
For models that belong to modules not installed on the user's host (or for browsing by image/category), point the user at <https://www.comsol.com/models>. Don't scrape it from the skill — just link.
MPH file introspection (stdlib path — no JVM)
For "what's in this .mph?" queries — parameters, physics tags, nodeType, mesh/solution sizes — prefer the stdlib reader over a live JVM:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingsrc/sim_plugin_comsol/_skills/comsol/SKILL.md
Popularity
- Repository stars
- 68
- Repository forks
- 12
- 7-day trend score
- 21
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/svd-ai-lab/sim-plugin-comsol/comsol)