/pixcell:optimize-to-specfrom PixCell
Retunes a parametric HOMI photonic device to meet a performance spec (e.g., MZI FSR) on a target layer stack by reasoning from physics and driving a measure-only evaluator.
Ships in PixCell. 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.
None: SKILL.md is the whole skill.
Spec-driven retuning of a parametric device for a target layer stack. This is the capability that makes HOMI a cross-PDK tool: the recreation step produced parametric primitives, so meeting a spec on any stack is an optimization problem — and you are the optimizer. The evaluator measures; you decide every move and say why before measuring.
Requires: a device script satisfying the parametric contract (below), a spec JSON, and a stack JSON. Never call Tidy3D cloud — the evaluator is local-only.
Engine invocation. If the homi CLI is already on PATH (repo checkout or
installed package), run the evaluator with that environment's python directly.
Otherwise invoke through the plugin's engine resolver, which finds or bootstraps
the PixCell Python engine: "${CLAUDE_PLUGIN_ROOT}/bin/pixcell-engine" python -m homi.spec_optimization ….
Stacks. Stack JSONs ship with the engine — list them from
homi.paths.stacks_dir() (e.g. soi220.json, sin400.json, tfln400.json):
"${CLAUDE_PLUGIN_ROOT}/bin/pixcell-engine" python -c "from homi import paths; [print(p) for p in sorted(paths.stacks_dir().glob('*.json'))]"
Use one of these, or a user-supplied stack JSON of the same shape.
| Problem | Owner | Tool |
|---|---|---|
| Topology / structure (what the device IS) | you, by reasoning | primitives, draw-to-gds |
| Continuous geometry fidelity vs an image | JEE | homi.jee_integration / jee.core.GDSOptimizer |
| Physics retargeting vs a spec | you, reasoning from physics | homi.spec_optimization (measure-only) |
Do NOT hand-roll grid sweeps for continuous polish — that is JEE's job and it does it better (Nelder-Mead/CMA-ES, footprint penalty, bookkeeping). Your job in THIS skill is the physics loop: derive the governing relation, predict, measure, correct.
name = value assignments (JEE-substitutable).delta_length, µm).gf.Path objects; on every run the script writes
lengths.json next to its GDS: {"arms": {...}, "delta_length_um": ...},
computed from the paths — never hand-entered."${CLAUDE_PLUGIN_ROOT}/bin/pixcell-engine" python -c "from homi.spec_optimization import verify_knob_response as v; print(v('<script>', width_um=<wg_width>))"
— pass width_um = the script's actual waveguide width, or the area check
will misjudge (the expected growth is width x delta).single_mode_width_um; respect
min_feature_um. These come from the stack JSON, not from optimization."${CLAUDE_PLUGIN_ROOT}/bin/pixcell-engine" python -m homi.spec_optimization eval --script S --stack <stack.json> --spec spec.json
→ FSR, n_eff, n_g, measured ΔL, verdict.FSR = λ² / (n_g · ΔL) → required ΔL* = λ² / (n_g · FSR_target).
State the ΔL you will set and the FSR you predict it produces.optimization_log.json:
{iter, delta_length_requested_um, delta_length_measured_um, n_eff, n_g, fsr_nm, rel_error, reasoning, predicted_fsr_nm_next} — honest, including
misses.rel_error <= tolerance or 6 calls. An honest failure beats a
fudged pass. Expect convergence in 1–2 calls when the knob is clean
(validated 2026-07-02: 1/1/1 and 2/2/2 across three stacks): solve the stack's
modes FIRST and precompute ΔL* = λ²/(n_g·FSR_target) — the relation is
exactly inverse-linear, so the first shot lands within grid-snap error, and
one correction step (ΔL_new = ΔL_old · FSR_measured / FSR_target) covers
any measured-vs-requested gap.run_jee_optimization's parameter discovery reads function signatures
(Weber analyzer) and returns "No tunable parameters" for module-level
tunables. Drive jee.core.GDSOptimizer directly with explicit
param_names/bounds/baseline + homi.jee_integration._create_parametric_factory.wg_width.create_simulation_from_component places source/monitor at the bbox
VERTICAL CENTER and records a SINGLE frequency — right for straight-through
workbench devices, wrong for folded/asymmetric layouts and useless for
fringe spectra. Reposition the ports onto the measured bus (take a geometric
slice of the GDS) and set broadband monitor frequencies + an explicit
run_time covering the folded optical path. A flat spectrum at ~10%
transmission means the source missed the waveguide.{"device": "mzi",
"target": {"metric": "fsr_nm", "value": 8.0, "tolerance_rel": 0.02},
"wavelength_um": 1.55, "mode": "TE0"}
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub qpg-mit/pixcell --plugin pixcell8 skills in this plugin
/exploreGenerate the device workbench — the marimo instrument over a verified parametric device (mask on a light table, live knobs, live IoU fidelity, provenance, handoffs)./extractExtract photonic device images from research papers — PDF processing, image scoring, B&W conversion, and footprint extraction/generateGenerate GDS from a device image — the Phase-A agent recreate loop (write→verify→refine against calibrated IoU) by default; Michaelangelo multi-seed exploration behind --baseline/homiFull paper-to-GDS pipeline — extracts photonic devices from research papers and generates fabrication-ready GDS files/migrateMigrate a GDS design to a target foundry PDK — layer mapping, conversion, and DRC validation/optimizeFine-tune GDS parameters using JEE optimizer — SSE minimization to match target device geometryOther plugins' skills for the same job