LumericalFDTD-simulation

LumericalFDTD-simulation is a skill for Claude Code, Codex from Lex669/LumericalFDTD-skill. It costs 94 tokens per session (1,341 once invoked), scanned A, original, MIT.

A skill for executing Ansys Lumerical FDTD simulation scripts, fixing errors through repeated attempts, and extracting result data. FDTD is a computer method for simulating how electromagnetic waves behave.

In plain words
What is it for?
Use it to run `*_sim.py` or compatible modeling scripts, debug common simulation failures, and produce `.fsp` project files and `.npz` result files.
Why use it?
It handles the execution stage after a simulation script has been created, including locating the Lumerical Python interpreter and checking that the expected files were produced.

Skill for Claude CodeCodex

Part of the LumericalFDTD plugin — 5 skills, 4 commands shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/lex669/lumericalfdtd-skill/lumericalfdtd-simulation
Any agent
npx skills add Lex669/LumericalFDTD-skill --skill lumericalfdtd-simulation
Clone the repo
git clone --depth 1 https://github.com/Lex669/LumericalFDTD-skill

Made for: Claude Code, Codex.

Or install LumericalFDTD, the plugin that ships this one along with the rest of its 5 skills, 4 commands.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for LumericalFDTD-simulation

README.md
[![agentmods](https://agentmods.dev/badge/skills/lex669/lumericalfdtd-skill/lumericalfdtd-simulation.svg)](https://agentmods.dev/skills/lex669/lumericalfdtd-skill/lumericalfdtd-simulation)
Your own site
<a href="https://agentmods.dev/skills/lex669/lumericalfdtd-skill/lumericalfdtd-simulation"><img src="https://agentmods.dev/badge/skills/lex669/lumericalfdtd-skill/lumericalfdtd-simulation.svg" alt="Measured on agentmods" height="20"></a>
Per session 94 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,341 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00094 $0.01341
Opus 5 $0.00047 $0.00671
Sonnet 5 $0.00019 $0.00268
Haiku 4.5 $0.00009 $0.00134

Measured 5d ago against content hash 57c3d31882cf, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

LumericalFDTD-simulation scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/LumericalFDTD-simulation/SKILL.md · 143 lines

How it starts

The opening of the file, as written. The whole thing — 143 lines — stays where its author put it; the contents beside it link to each section on GitHub.

FDTD 仿真执行器

职责范围

本 skill 仅负责仿真执行阶段:环境探测、运行仿真、错误修复、结果提取。输出 .fsp.npz 文件。

不负责:结构建模(→ LumericalFDTD-modeling)、数据分析与绘图(→ LumericalFDTD-analysis)、端到端全流程(→ LumericalFDTD)。

前置条件

仿真脚本 *_sim.py(或 *_model.py 加上 fdtd.run()fdtd.save() 调用)必须已存在。若不存在,先使用建模 skill。

环境探测(本会话首次执行)

1. 探测操作系统

  • Windows: python.exe,路径含盘符,反斜杠分隔
  • Linux: pythonpython3,正斜杠分隔

2. 定位 Lumerical Python 解释器

按以下优先级尝试:

Windows 常见路径:

C:\Apps\ANSYS Inc\v252\Lumerical\python\python.exe
C:\Program Files\ANSYS Inc\v252\Lumerical\python\python.exe
C:\Program Files\Lumerical\v252\python\python.exe

Linux 常见路径:

/opt/ansys_inc/v252/Lumerical/python/python
/opt/lumerical/v252/python/python
/usr/local/lumerical/v252/python/python

若所有默认路径都不存在,向用户询问实际安装路径和版本号。

3. 调用方式

PowerShell(路径含空格时用 & 操作符):

& '{PYTHON_PATH}' 'script.py'

Bash / Git Bash& 不支持,直接调用):

'path/to/python.exe' 'script.py'

仿真执行

执行步骤

# 步骤 1:运行仿真脚本(耗时最长)
bash: & 'PYTHON_PATH' 'path/to/project_sim.py'

# 步骤 2:确认输出
bash: ls path/to/project/data/
# 预期:results.npz 等文件

# 步骤 3:检查日志
bash: cat path/to/project/fsp/*_p0.log
# 确认无致命错误

超时设置

仿真规模 timeout
简单 2D 300,000ms (5 分钟)
中等 3D 1,200,000ms (20 分钟)
大型参数扫描 6,000,000ms (100 分钟)

错误处理循环(最多 5 次重试)

重试次数 = 0
while 仿真未成功 and 重试次数 < 5:
    运行 sim.py
    if 报错:
        读取 ../LumericalFDTD/references/common-errors.md
        根据错误类型定位解决方案
        修复脚本
        重试次数 += 1
    else:
        检查 .npz 存在 → 继续
        检查 .fsp 存在 → 继续

if 重试次数 >= 5:
    向用户报告:自动修复已达上限,需人工介入
    列出所有尝试过的修复及对应错误信息

绝对禁止:创建完 .py 文件后直接告诉用户"脚本已创建,请自行运行"。必须亲自执行。

结果提取

仿真成功后提取关键数据:

# 在 with 块内提取
E = fdtd.getresult("monitor_name", "E")       # 电场
Ex = fdtd.getresult("monitor_name", "Ex")     # x 分量
T = fdtd.getresult("monitor_name", "T")       # 透射率

# 保存为 .npz
np.savez(os.path.join(data_dir, "results.npz"),
         E=E, Ex=Ex, T=T,
         x=x, y=y, z=z,
         wavelengths=wavelengths,
         metadata={...})

Read the full file on GitHub · 143 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 143 lines · 94 tokens per session scan A 57c3d31882cf

Subscribe to this mod's changes

LumericalFDTD-simulation is a skill published in the GitHub repository Lex669/LumericalFDTD-skill (23 stars, last pushed 15d ago), licensed MIT. It adds 94 tokens to every session and 1,341 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

instrument-data-to-allotrope

Convert laboratory instrument output files (PDF, CSV, Excel, TXT) to Allotrope Simple Model (ASM) JSON format or flattened 2D CSV. Use this skill when scientists need to standardize instrument data for LIMS systems, data lakes, or downstream analysis. Supports auto-detection of instrument types. Outputs include full…

anthropics/knowledge-work-plugins · 123 tokens

exploratory-data-analysis

Perform bounded, local exploratory analysis of explicitly supported scientific files. Use for redacted CSV/TSV/JSON profiles; optional NumPy, HDF5, FASTA/FASTQ, and basic image metadata inspection; missingness/leakage audits; outlier and transformation sensitivity; and rigorous EDA report scaffolds. Other domain…

K-Dense-AI/scientific-agent-skills · 83 tokens

matlab

Build, review, migrate, and safely plan MATLAB or GNU Octave numerical workflows, including arrays, tabular/time data, tests, projects, graphics, MAT files, and explicit Python interoperability.

K-Dense-AI/scientific-agent-skills · 42 tokens

phylogenetics

Build and analyze phylogenetic trees using MAFFT (multiple alignment), IQ-TREE 2 (maximum likelihood), and FastTree (fast NJ/ML). Visualize with ETE3 or FigTree. For evolutionary analysis, microbial genomics, viral phylodynamics, protein family analysis, and molecular clock studies.

K-Dense-AI/scientific-agent-skills · 68 tokens

research-engineer

An uncompromising Academic Research Engineer. Operates with absolute scientific rigor, objective criticism, and zero flair. Focuses on theoretical correctness, formal verification, and optimal implementation across any required technology.

davila7/claude-code-templates · 43 tokens

mapping-to-snomed

Maps clinical concept spans extracted by OpenMed to SNOMED CT concepts through a USER-SUPPLIED terminology server (the user's own Ontoserver, Snowstorm, or UMLS/UTS), never a bundled vocabulary. Use when the user wants to code findings, disorders, procedures, body structures, or substances to SNOMED CT, run an ECL…

maziyarpanahi/openmed · 205 tokens