Using BMO with AI assistants
BMO ships an agent skill: a folder of instructions, API references and runnable example scripts that teaches AI coding assistants such as Claude Code how to write BMO simulations. It covers units and coordinate conventions, the choice of beam model, all component constructors, detector readout, rendering and common pitfalls.
Installation
The skill is part of the package, in the skills/beamletoptics folder of the installed package directory. Copy the version that matches your installed BMO into your project with
using BeamletOptics
BeamletOptics.install_agent_skill() # -> ./.claude/skills/beamletopticsFor a personal installation that applies to all projects, pass the user-level skill directory:
BeamletOptics.install_agent_skill(joinpath(homedir(), ".claude", "skills"))Run the command again after Pkg.update to keep the skill in sync with the package version.
BeamletOptics.install_agent_skill Function
install_agent_skill(dest = joinpath(pwd(), ".claude", "skills"))Copies the agent skill that ships with the installed BeamletOptics version into joinpath(dest, "beamletoptics") and returns that path. The skill teaches AI coding assistants (e.g. Claude Code) how to write BeamletOptics simulations.
The default dest is the project-level skill directory of Claude Code in the current working directory. Use e.g. joinpath(homedir(), ".claude", "skills") for a personal installation.
An existing beamletoptics skill in dest is replaced, so calling this function again after Pkg.update keeps the skill in sync with the installed package version. Local edits to the copy are lost.
File permissions
Pkg installs packages read-only. The files are written anew instead of copied with their permissions, so that the copy can be edited and replaced later.
Developing BMO with an assistant
The skill describes how to use BMO. To change the package itself with an assistant, see Developing BMO with an assistant on the Contributing page.