LumericalFDTD

LumericalFDTD is a skill for Claude Code, Codex from Lex669/LumericalFDTD-skill. It costs 152 tokens per session (3,938 once invoked), scanned A, original, MIT.

An automation guide for Ansys Lumerical FDTD, a program that models how light and electromagnetic waves behave. It covers building an optical model, running the simulation, analyzing results, creating charts, and checking whether the results meet requirements.

In plain words
What is it for?
Use it for complete photonics projects involving structures such as waveguides, gratings, metasurfaces, diffraction devices, and other optical designs.
Why use it?
It organizes the full simulation process and can diagnose and retry common errors. This helps avoid stopping after creating a model without actually running or checking it.

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
Any agent
npx skills add Lex669/LumericalFDTD-skill --skill lumericalfdtd
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

README.md
[![agentmods](https://agentmods.dev/badge/skills/lex669/lumericalfdtd-skill/lumericalfdtd.svg)](https://agentmods.dev/skills/lex669/lumericalfdtd-skill/lumericalfdtd)
Your own site
<a href="https://agentmods.dev/skills/lex669/lumericalfdtd-skill/lumericalfdtd"><img src="https://agentmods.dev/badge/skills/lex669/lumericalfdtd-skill/lumericalfdtd.svg" alt="Measured on agentmods" height="20"></a>
Per session 152 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,938 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.00152 $0.03938
Opus 5 $0.00076 $0.01969
Sonnet 5 $0.00030 $0.00788
Haiku 4.5 $0.00015 $0.00394

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

Security

Grade A, and why

LumericalFDTD 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.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/template.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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/SKILL.md · 290 lines

How it starts

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

Lumerical FDTD 全流程仿真

核心工作流(必须严格按顺序执行,不可跳过)

每次处理完整 FDTD 任务时严格遵循以下三阶段流水线。创建文件只是准备阶段,运行仿真才是核心工作。

阶段 A:准备与建模

  1. 理解需求 — 确认器件结构(几何参数、材料)、光源(波长范围、偏振)、监视器要求、验收条件
  2. 环境探测(本会话首次时)— 定位 Lumerical Python 解释器路径
  3. 编写 *_sim.py — 生成仿真脚本,包含结构构建、光源、监视器、fdtd.run()、数据保存

仅需建模不跑仿真 → 改用 LumericalFDTD-modeling skill

阶段 B:执行仿真(不可跳过,不可省略)

  1. 运行仿真脚本 — 用 Bash 工具调用 Lumerical Python 解释器执行 *_sim.py
  2. 检查输出 — 确认 .fsp.npz 文件已生成,检查日志无致命错误
  3. 如遇错误 — 读取 references/common-errors.md,修复脚本,回到步骤 4。最多重试 5 次,超过则向用户报告所有尝试过的修复及错误,请求人工介入
  4. 编写并运行 *_analysis.py — 读取 .npz 数据,计算指标,绘图保存 .png

仅需分析已有数据 → 改用 LumericalFDTD-analysis skill

阶段 C:验收

  1. 验证结果 — 检查 .png 图表是否满足验收条件(透射率、模式分布、衍射环等),不满足则调整 *_sim.py 参数回到步骤 4
  2. 更新 REPORT.md — 记录仿真参数、结果摘要、图表说明

错误处理循环(含最大重试上限)

重试次数 = 0
最大重试 = 5

while 仿真未成功 and 重试次数 < 最大重试:
    运行 sim.py
    if 报错:
        读取 references/common-errors.md
        根据错误类型定位解决方案
        修复脚本
        重试次数 += 1
        log(f"第 {重试次数}/{最大重试} 次重试...")
    else:
        检查 .npz 存在 → 成功,跳出循环
        检查 .fsp 存在 → 成功,跳出循环

if 重试次数 >= 最大重试:
    向用户报告:
    - "自动修复已达 {最大重试} 次上限,需人工介入"
    - 列出每次尝试的错误信息和对应修复
    - 建议可能的排查方向

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

绝对禁止:无限循环重试。5 次上限后必须 escalate 给用户。

完成定义 (Definition of Done)

以下文件必须全部存在才算任务完成,缺一不可:

  • fsp/*.fsp — 仿真项目文件
  • data/*.npz — 仿真结果数据
  • pic/*.png — 结果图表
  • *_sim.py — 仿真脚本
  • *_analysis.py — 分析脚本

关键原则:只创建 .py 文件不算完成任务。必须用 Bash 工具执行脚本、等待仿真跑完、生成 .npz.png 输出。每个错误都是修正 skill 知识的机会。

环境适配(首次对话必须执行)

1. 探测操作系统

通过 sys.platform 或环境变量判断:

  • Windows: 路径含盘符,反斜杠分隔,Python 解释器为 python.exe
  • Linux: 路径以 / 开头,正斜杠分隔,Python 解释器为 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

Read the full file on GitHub · 290 lines

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 · 290 lines · 152 tokens per session scan A 8f77b5409ab0

Subscribe to this mod's changes

LumericalFDTD is a skill published in the GitHub repository Lex669/LumericalFDTD-skill (23 stars, last pushed 15d ago), licensed MIT. It adds 152 tokens to every session and 3,938 once invoked, about $0.0008 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