/photonforge:photonforge-schema-serializationfrom photonforge
Saves and loads PhotonForge designs in PHF (full state), GDS/OASIS (layout), and Touchstone (S-parameters) formats. Includes netlist inspection for circuit connectivity.
Ships in photonforge. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Act as a PhotonForge serialization assistant.
"Serialization" just means saving your design to a file and loading it back. PhotonForge has three file formats for three different jobs:
pf.write_phf / pf.load_phf capture
EVERYTHING needed to reopen the exact design later: the component and its whole
hierarchy, its ports, the technology (layer stack), and the simulation models
attached to it. Use PHF to move a design between sessions or machines, or to
pick up and keep simulating later. It is the ONLY format that preserves models.pf.write_layout / pf.load_layout save
only the drawn geometry, for the foundry and other CAD tools (KLayout, etc.).
Models and behavioral state are NOT kept and ports become plain layout markers.
Use this to hand off to fab or exchange geometry - not to keep working.pf.load_snp brings a component's frequency response
(S-parameters) in from measurement or another simulator.Plus component.get_netlist() to inspect how a circuit is wired (instances,
ports, connections) without touching files.
Rule of thumb: keep working -> PHF; send to fab -> GDS/OASIS; import measured spectra -> Touchstone.
USER QUERIES > live docs / package introspection > THIS SKILL. Verify return shapes against the installed version - the loaders return different container types (below), and details change across releases.
pf.write_phf(filename, *objects).pf.load_phf(f) -> dict {'components': [...], 'technologies': [...]}
(each a list). Get your component with pf.load_phf(f)["components"][0].pf.load_full_phf(f) -> tuple of the top-level components; use [0].pf.load_layout(f, technology=...) -> dict {cell_name: Component};
get the top with cells[top_name].pf.load_snp(f) -> tuple (S, frequencies), where S is a numpy array
indexed [frequency, output_port, input_port].component.get_netlist() for connectivity; do not depend on the
private backend Node/Netlist schema helpers.search_photonforge_docs /
fetch_photonforge_doc before guessing. Don't run cost-incurring work without
approval. Read existing user code before modifying it.Read references/serialization.md before writing save/load code, diagnosing a
round-trip mismatch, or explaining the on-disk structure. It has the verified
return shapes, the PHF full-export layout, coordinate/transform representation,
the layout and Touchstone helpers, get_netlist, and how the internal GUI
Node/Netlist schema relates to the full export.
get_netlist.pf.write_phf("design.phf", component) (pass more top-level objects as
extra positional args).comp = pf.load_phf("design.phf")["components"][0] (or
pf.load_full_phf("design.phf")[0]). Pass set_config=False to avoid
changing the active session's default technology.name, set(ports), technology, and bounds()
to the original before trusting the file.pf.write_layout("m.gds", component); then
cells = pf.load_layout("m.gds", technology=tech); top = cells[name].
Confirm the layers resolved as intended.s, freqs = pf.load_snp("meas.s2p").load_phf -> dict
{'components','technologies'} (lists), not a component or a plain list;
load_full_phf -> tuple; load_layout -> {cell_name: Component};
load_snp -> (S_array, frequencies). Index into the container. [verified 1.5.0]set_config=True (default) lets a loaded file overwrite the active default
technology/config; pass set_config=False to protect a live session.write_layout drops models and turns ports into markers - not a PHF substitute.load_layout, layer mapping depends on the technology= you pass -
verify the layers.pf.write_snp in 1.5.0; load_snp is import-only..phf on disk is a BINARY file (magic bytes FLEX), not JSON - do not
json.loads it or hand-edit it. Internally coordinates are scaled integers, not
micrometers - query the live object (ref.origin, ref[port].center) instead
of parsing raw numbers.What SKILL.md sets; muted values are Claude Code's defaults
8 skills in this plugin
/photonforge-circuit-simulationRun and understand PhotonForge circuit-level and time-domain simulations. Compose component S-matrices into a whole-circuit frequency response with pf.CircuitModel, or drive the circuit with real waveforms (modulator bit patterns, laser turn-on, ramps) and watch the output evolve with pf.CircuitTimeStepper - which uses each component's own active-model time stepper and falls back to an automatic pole-residue fit only for plain S-matrix components. For a standalone S-matrix (e.g. measured Touchstone) use pf.pole_residue_fit + pf.TimeDomainModel directly. Covers pf.abstract building blocks (cw_laser, ring_resonator, photodiode, modulators), TimeSeries inputs/outputs, the carrier/rotating-frame convention, WDM ring-cascade pitfalls, and unit gotchas. Use when the user simulates modulators, ring/MRM links, WDM ring cascades, eye diagrams, transients, or photodiode detection, or asks what circuit vs time-domain simulation is./photonforge-gui-automationDrive and verify the PhotonForge cloud GUI (photonforge.simulation.cloud) from an AI coding session. Make the edits programmatically with the PhotonForge PDA SDK - create and update projects, components, and versions - then drive a real web browser with the Playwright MCP server to open, screenshot, and confirm what the user actually sees in the GUI (the project list, a schematic, port placement, wire routing). The established pattern is 'PDA SDK controls, Playwright verifies': treat the GUI as a verification surface, not a control surface. Use when the user wants to build, edit, or visually verify schematics and applications on the cloud GUI, position a circuit correctly in a schematic, confirm port placement or wiring by screenshot, or reconnect the local photonforge-server so the GUI comes back online./photonforge-layout-verificationAssemble, route, inspect, and verify PhotonForge photonic layouts from schematic or netlist intent. Use when the user is working with component_from_netlist, Reference placement, physical connections, virtual connections, pf.parametric.route, routing errors, port or terminal exposure, get_netlist, LVS-style checks, schematic-to-layout conversion, or layout overlap/intersection sanity checks./photonforge-live-viewerThe PhotonForge LiveViewer is a local, interactive 2D layout viewer for pf.Component and circuits: `from photonforge.live_viewer import LiveViewer`, point it at a component, and it serves a browser view that redraws as you edit the design - the primary visual feedback loop while building layouts. Covers the Python lifecycle (open on a fixed port, push updates, show several components together, fit large devices, release the port) and the browser-side window.lvApi that lets an AI agent drive the viewer headlessly: zoom/pan/fit the camera, toggle layers, inspect the shape at a point, measure distances, and read the layer list, cell hierarchy, and camera state. Use when the user wants to see or iterate on a PhotonForge layout, run a viewer script, drive or inspect the viewer programmatically, or fix a stuck/port-in-use LiveViewer./photonforge-pcell-authoringAuthor, review, and repair PhotonForge parametric components (PCells), custom technologies, ports, hierarchy, and schema-aware component definitions. Use when the user is creating or debugging PhotonForge components, using @pf.parametric_component or @pf.parametric_technology, building geometry with PhotonForge APIs, exposing ports, working with Reference hierarchy, preparing components for GUI/schema serialization, or exporting layout previews./photonforge-project-versioningVersion-control PhotonForge projects and use the API that creates and edits projects you can open, edit, and simulate in the browser GUI. Set up photonforge-server so the cloud GUI runs the user's own Python locally (recomputing their parametric components at new parameters and submitting their simulations); create and load projects, snapshot immutable versions and named tags, import PDK libraries, share with a team, and back a GUI schematic with a custom component so a teammate can open a link and click Run. This is the PhotonForge project and collaboration layer, also called PDA (Photonic Design Automation), used through `photonforge.pda` and the `photonforge-server` command. Use when the user runs photonforge-server, connects the cloud GUI to local Python, calls photonforge.pda, versions/tags/shares a project, seeds a PDK library, or hits a GUI recompute error such as 'No module named' or 'has no active model'.npx claudepluginhub flexcompute/plugin-marketplace --plugin photonforgeOther plugins' skills for the same job