Skip to content

Add almond-harness-studio: wire harness drawings from JSON - #1

Merged
shawnpatel merged 18 commits into
mainfrom
pewter-llama
Jul 14, 2026
Merged

shawnpatel merged 18 commits into
mainfrom
pewter-llama

Conversation

@shawnpatel

@shawnpatel shawnpatel commented Jul 14, 2026 •

Copy link
Copy Markdown
Member

Summary

  • New monorepo implementing a local-first wire harness drawing tool: author harnesses as *.harness.json, preview live in the browser, export manufacturer-ready vector PDFs with auto-derived BOM, wire list, and title block.
  • packages/core: JSON schema + validation, node-segment graph model, auto tree layout, SVG renderer, BOM/wire-list builders.
  • packages/app: live-preview viewer themed to the Almond design system (dark charcoal, lime accent, Inter/Geist), with zoom/pan, validation errors, drag-and-drop, File System Access live reload, and PDF/SVG/print export.
  • packages/cli: validate, headless export (vector PDF via pdfkit), and dev server with SSE live reload.
  • Agent integration: skill/SKILL.md (Claude/Cursor skill), AGENTS.md, schema reference, and a branched-harness example.

Test plan

  • npm install && npm run build && npm run typecheck
  • npm run check:examples
  • npm run dev — verify the example renders, live-reload on save, and PDF/SVG export downloads
  • node packages/cli/dist/index.js export examples/branched-battery-pigtail.harness.json -o /tmp/demo.pdf and inspect the PDF

shawnpatel and others added 18 commits July 13, 2026 17:58
… viewer, CLI, and agent skill

Monorepo with core (schema, validation, layout, SVG renderer, BOM/wire
list), app (dark-themed live-preview viewer matching the Almond design
system, with PDF/SVG export and File System Access live reload), and cli
(validate, headless PDF export, dev server). Includes agent skill docs
(skill/SKILL.md, AGENTS.md) and example harnesses including the
ALM-1233 XT30(2+2) drawing.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Center the schematic on the full sheet (falling back to the BOM-free
region only on collision), draw twist marks as antiphase crossing waves
in the pair's actual wire colors, and align terminal symbols to the box
centerline so incoming wires meet the lug lead exactly.

Co-authored-by: Cursor <cursoragent@cursor.com>
Connectors, terminals, and accessories now reference real distributor
parts ({vendor, number}); free-form mpn/description fields are gone.
New `parts fetch` CLI resolves refs against vendor APIs (LCSC keyless,
Mouser API key, Digi-Key OAuth) and embeds MPN, description, photo,
price, and stock in the harness file. Drawings render product photos
and a sourced BOM; the viewer gains an API-keys dialog and a fetch
button backed by a dev-server proxy.

Co-authored-by: Cursor <cursoragent@cursor.com>
…, CSV export

Diode/resistor nodes with correct schematic symbols (cathodeTowards for
band direction), quick-connect male/female terminal styles, multicore
cable groups with foil/braid shield rendering, jumper (loopback) wires
drawn as arcs with zero length, connector crimp contacts (BOM qty =
wired cavities) and hardware, and a `tables` CLI command exporting the
wiring table and BOM as CSV. Ships a relay-coil pigtail example with
fetched LCSC parts exercising all of it.

Co-authored-by: Cursor <cursoragent@cursor.com>
Twisted pairs now weave as actual crossing strands along the shared run
(antiphase quadratic waves around the group centerline) instead of a
white patch stamped over the wires. Multicore cables draw a real jacket
tube the cores run inside, with braid/foil shield rims as patterns,
shown only where the cable runs by itself. Wire corners get quadratic
fillets, group callouts use halo text instead of masking rectangles,
and product photos move off the schematic into a framed parts gallery
panel in the top-left of the sheet.

Co-authored-by: Cursor <cursoragent@cursor.com>
…bands

Table and connector pin dividers are now uniformly black instead of
mixed grays. Segment callouts offset perpendicular to the run with halo
text and paint above the wires, so labels on angled runs stay readable.
Bare bundle runs draw the wires alone — the background band only
appears for actual coverings (heatshrink, braid, loom, wrap).

Co-authored-by: Cursor <cursoragent@cursor.com>
Tables, the title block, and connector pin tables now draw fills first,
each divider exactly once at one grid weight, and a single outer border,
eliminating the doubled strokes and mixed line thicknesses.

Co-authored-by: Cursor <cursoragent@cursor.com>
showDirectoryPicker (Chrome/Edge) lists every *.harness.json in a
chosen local folder in the sidebar, live-watches the selected file, and
rescans the folder for added/removed files. Dropping a folder onto the
window opens it the same way.

Co-authored-by: Cursor <cursoragent@cursor.com>
Folder mode now takes precedence over the server file list, with a
back link to return to the server folder, so a local folder can be
opened regardless of how the viewer is running.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
The static build imports examples/*.harness.json at build time and
lists them as demos in the sidebar when no dev server is present,
auto-rendering the first one so the hosted viewer opens to a drawing
instead of an empty state.

Co-authored-by: Cursor <cursoragent@cursor.com>
…er-driven

Co-authored-by: Cursor <cursoragent@cursor.com>
vercel.json builds the workspaces and serves packages/app/dist. The
viewer is fully static (demos bundled, keys in localStorage), so no
env vars or functions are required.

Co-authored-by: Cursor <cursoragent@cursor.com>
Bundles now start a short distance off connector faces, and each wire
exits its pin row with a straight horizontal stub before bending toward
the bundle, so every pin's wire color is visible at the connector.

Co-authored-by: Cursor <cursoragent@cursor.com>
Rename the CLI package to the unscoped almond-harness-studio name the
skill's npx commands expect, add repository metadata and publishConfig,
point the middleware export at dist, restrict the dev file listing to
*.harness.json, add a GitHub Actions CI workflow, and document the npm
release procedure. Verified the packed tarballs install cleanly and the
CLI validates, exports PDF, and serves the viewer from that install.

Co-authored-by: Cursor <cursoragent@cursor.com>
The renderer's palette is now a theme table (light/dark) behind a
renderHarnessSvg theme option. The viewer renders both variants and
shows the one matching prefers-color-scheme, while PDF/SVG download,
print, and the CLI always use the light manufacturing drawing. Dark
mode outlines near-black wires the way light mode outlines white ones.

Co-authored-by: Cursor <cursoragent@cursor.com>
@shawnpatel
shawnpatel merged commit 86f966c into main Jul 14, 2026
1 check passed
@shawnpatel
shawnpatel deleted the pewter-llama branch July 14, 2026 03:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant