<div align="center">
<img src="assets/laser-skills-glass-hero.jpg" alt="Concept art: RGB evidence paths crossing etched glass shards and a glowing tessellation" width="1800">
<h1>Laser Skills</h1>
<p><strong>Turn briefs and artwork into measured, reviewable laser job packages.</strong></p>
<p>Codex skills + deterministic Python tooling · SVG, DXF, and raster · LightBurn-safe handoff</p>
[](https://github.com/jl-codes/laser-skills/actions/workflows/test.yml)
[](pyproject.toml)
[](skills/lightburn-job/SKILL.md)
[](benchmarks/cases.yaml)
[Start a job](#quick-start) · [Explore use cases](#start-with-a-real-job) · [Understand the workflow](#one-workflow-many-kinds-of-work) · [Run benchmarks](#objective-benchmarks)
</div>
<p align="center"><em>Measure the beam. Preserve the artwork. Prove the handoff.</em></p>
`laser-skills` accepts fabrication briefs, raster artwork, SVG, and DXF. It keeps design intent separate from machine settings, proves the facts software can prove, and fails closed when physical evidence is missing. LightBurn is the first CAM adapter—not the project boundary.
> [!IMPORTANT]
> This project never starts or fires a laser, guesses production settings, writes undocumented `.lbrn2` internals, or treats nominal wattage as calibration evidence. Included machine profiles are intentionally incomplete.
| Software proves | The operator supplies | This project never does |
| --- | --- | --- |
| Dimensions, topology, raster integrity, mappings, and declared evidence | Machine/material identity, measured calibration, focus, ventilation, and supervised setup | Start or fire hardware, invent recipes, or hide unresolved blockers |
## Quick start
### Use as Codex skills
Ask Codex's built-in skill installer: `Install the skills from github.com/jl-codes/laser-skills`. Then start with a brief that includes intended size, stock, and output—for example:
> Use laser-design to create a reviewable 120 × 80 mm grayscale glass etch from my portrait. Preserve the source image and tell me what physical evidence is still missing.
Codex should clarify consequential unknowns, create inspectable job files, and stop at a non-firing handoff.
### Use the CLI directly
```bash
git clone https://github.com/jl-codes/laser-skills.git
cd laser-skills
python3.12 -m venv .venv
. .venv/bin/activate
python -m pip install -e '.[dev,trace,preview]'
laser init jobs/first-job
laser build jobs/first-job
laser preflight jobs/first-job
```
That produces a safe, design-only job with normalized artwork and review artifacts. The first preflight is expected to report blockers because no measured machine/material evidence exists yet; that is a successful fail-closed result, not an installation error.
## Start with a real job
These are starting points, not a fixed menu. Mix operations, inputs, and deliverables to match the work in front of you.
| Starting brief | Typical path | What the package proves |
| --- | --- | --- |
| **Grayscale glass portrait** | Preserve raster → inspect tones and DPI → prepare image handoff | Exact physical size, immutable source art, tonal diagnostics, and explicit image settings |
| **Mixed-operation plaque** | Inspect/trace logo → map fill, score, holes, and outer cut → preview | Trace score, closed contours, exact layer mapping, and engrave-before-cut order |
| **Press-fit organizer** | Use measured stock → calibrate kerf/fit → compensate → preflight | Dimensions, slots and tabs, measured fit evidence, and inner-before-outer cuts |
| **CAD/DXF fixture** | Generate/import ordinary DXF → normalize → assign operations | Unit scale, topology, duplicate paths, explicit intent, and review artifacts |
Other natural extensions include signage, stencils, control panels, packaging prototypes, registration jigs, line-art engravings, perforated parts, calibration coupons, tiled/pass-through work, and mixed raster/vector jobs. The same evidence loop applies without hard-coding a product category.
## One workflow, many kinds of work
<img src="assets/laser-skills-hero.svg" alt="A diagram of the Laser Skills evidence loop from design through objective scoring and safe LightBurn handoff" width="1200">
The review loop revises one named decision at a time. Production preflight branches through measured calibration before any LightBurn handoff becomes eligible.
```bash
laser inspect artwork/input.svg --report jobs/panel/geometry.json
laser build jobs/panel
laser preflight jobs/panel
laser calibrate kerf --output-dir calibration/kerf
laser lightburn handoff jobs/panel --output-dir jobs/panel/handoff
```
The handoff remains blocked until the selected machine, material, and recipes contain compatible measured evidence.
## What gets validated
| Layer | Evidence produced |
| --- | --- |
| **Design** | Explicit dimensions, stock, operations, assumptions, and immutable source art |
| **Grayscale** | Levels, range, percentiles, clipping, entropy, contrast, and effective physical DPI |
| **Trace** | Multiple candidates ranked by IoU, precision, recall, F1, and pixel accuracy |
| **Geometry** | Exact millimeter bounds, topology, selectors, duplicate paths, and open contours |
| **Process** | Machine, material, calibration, recipe confidence, kerf, fit, and depth evidence |
| **LightBurn** | Exact-scale imports using the official C00–C29 RGB palette and operator-reviewed settings |
| **Safety** | Adversarial fail-closed review, non-firing UDP allowlist, Preview, framing, and supervision gates |
## Five focused skills
| Skill | Use it for |
| --- | --- |
| [`laser-design`](skills/laser-design/SKILL.md) | Turning a fabrication brief into nominal geometry and `design.yaml` |
| [`laser-vector`](skills/laser-vector/SKILL.md) | Inspecting, preserving, normalizing, tracing, or scoring raster/SVG/DXF artwork |
| [`laser-calibrate`](skills/laser-calibrate/SKILL.md) | Generating coupons and recording measured calibration evidence |
| [`laser-preflight`](skills/laser-preflight/SKILL.md) | Finding geometry, process, evidence, and safety blockers |
| [`lightburn-job`](skills/lightburn-job/SKILL.md) | Producing exact-scale, palette-correct, non-firing LightBurn handoffs |
Standalone launchers bundle the `laserpy` runtime but use the active Python environment for third-party packages:
```bash
.venv/bin/python skills/laser-vector/scripts/laser-vector --help
```
## Grayscale without guesswork
Continuous-tone photographs stay raster unless vectorization is explicitly requested. Inspection uses a luminance review copy and reports objective tonal facts without modifying the original. LightBurn handoff preserves raster bytes and physical dimensions.
```bash
laser inspect artwork/photo.png --json
laser preflight jobs/photo-etch
laser lightburn handoff jobs/photo-etch --output-dir jobs/photo-etch/handoff
```
Review `gray_levels`, `dynamic_range`, `p01`, `p99`, clipping ratios, entropy, contrast, and effective DPI. These measurements detect weak input; they do not predict a physical engraving result. An eligible recipe must still provide image mode, line interval/DPI, scan direction, overscan, speed, and power.
## Objective benchmarks
The benchmark runner generates deterministic fixtures, exercises the real raster handoff and OpenCV trace path, and fails when a declared metric regresses.
The catalog contains four executable objective image/trace benchmarks and twelve contract cases covered by the broader E2E/adversarial suite. Reports publish declared, objective, executed, and contract counts separately; an objective case without an executor is a hard failure, never a silent skip.
| Case | CI gate |
| --- | --- |
| Grayscale diagnostics | ≥250 levels, ≥250 range, ≥7.9-bit entropy, ≥250 effective DPI |
| Low-contrast detection | ≤50 range and <20 luminance standard deviation |
| Raster roundtrip | Byte-identical, zero MAE, histogram intersection 1.0 |
| Silhouette trace | ≥0.92 IoU, ≥0.95 F1, ≥0.96 pixel accuracy |
```bash
python scripts/run-benchmarks.py
```
The report is written to `build/test-reports/benchmark-report.json`. CI also embeds it in the deterministic common test artifact beside `adversarial-review.json` and the SHA-256 manifest.
## Explore without contaminating a job
Open [`playground/index.html`](playground/index.html), copy `playground/idea-template/` into an ignored `playground/ideas/<name>/` directory, and keep alternatives isolated. Delete the directory to undo the experiment. Playground work never implies production readiness.
<details>
<summary><strong>Visual identity study</strong> — generated with the repository's reference ASCII workflow</summary>
```text
_ _ ___ ___ ___ ___ _ _____ _ _ ___
| | /_\ / __| __| _ \ / __| |/ /_ _| | | | / __|
| |__ / _ \\__ \ _|| / \__ \ ' < | || |__| |__\__ \
|____/_/ \_\___/___|_|_\ |___/_|\_\___|____|____|___/
.......,... .. .
...,,............,,........ .. .., .
.............,.............,:,....,:,,,,,,:. .. ,...,....
.......................,.......,:,,,::;:,..;,....,;. .,...,.,,, ..
. ....................................,.,::;::,,,,...,,:..;,.,:,....:,.,,,.. ...
............,,,,,,,,,,,:::,::,::::,,,,,,,i;:,,,,,,,,..,..,,,;:;,..,::;:..........
...........................,,,,,:::::1i;;;;;;i1i:,,.,;;tt:,,,::,,,:::,.......,.
...................................,,;:,,,,,,,,,:;i:,:11:,,.::,....,,..,,..,.
.........................,:,,,,,,,,,,,,,,,::;1;::::::;:::,,:::,,..::.......,.......
...........................,:,,::,,.,,,,:..:..,..:........,. ....
.........,:,,,,,,,,,::::::::;1i,.....,,,.. .,,...,,.,,.....,,.....
............................................,:,..,,,::,,,......,.......,:,,,:,...
..................,,::1;:,.......,,,...,:.....,,:itti1,..
.. . .......,,,,,,,,,::::::,,,..,;,..........:;;:,:....,:::;ii;;;:.
```
The complete generated study is in [`assets/laser-glass-tessellation.txt`](assets/laser-glass-tessellation.txt); the reusable wordmark is in [`assets/laser-skills-wordmark.txt`](assets/laser-skills-wordmark.txt). Generation details and licensing are recorded in [`assets/README.md`](assets/README.md).
</details>
## From software proof to physical setup
Copy `.example.yaml` profiles to untracked `.yaml` files. Before production, record the exact LightBurn device, bed and origins, controller/firmware, lens/nozzle/focus, air/exhaust/bed, safe configured ranges, real material batch and measured thickness, and calibration results. Generic internet charts are not production recipes.
Network commands are dry-run by default. The only supported UDP actions are ping, status, exact-device selection, load, and import. Actual traffic requires `--execute`; start, fire, force-load, and close commands are unreachable.
## Validate the repository
```bash
ruff check .
mypy packages/laserpy/src/laserpy
python scripts/run-benchmarks.py
pytest --cov=laserpy --cov-fail-under=85 --cov-report=term-missing
python scripts/validate-skills.py
python scripts/bundle-skills.py --check
python scripts/build-common-test-artifact.py
```
The common artifact executes inspect → normalize → build → preflight → preview → trace → adversarial review → objective benchmarks → manifest verification. CI regenerates and uploads it on every build alongside JUnit, coverage, and benchmark reports.
## CAD interoperability
[`earthtojake/text-to-cad`](https://github.com/earthtojake/text-to-cad) remains an optional generic geometry provider. Use its CAD/DXF skills for geometry beyond lightweight 2D primitives, export ordinary DXF, then return to `laser-preflight`. Laser-, LightBurn-, machine-, material-, and recipe-specific behavior stays here.
## Contributing
Keep nominal source separate from derived artifacts, add executable acceptance tests for behavior changes, rebuild bundled runtimes with `python scripts/bundle-skills.py`, and preserve every safety invariant in [`AGENTS.md`](AGENTS.md). See [`CONTRIBUTING.md`](CONTRIBUTING.md) for the local workflow.