Add almond-harness-studio: wire harness drawings from JSON - #1
Merged
Merged
Conversation
… 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
*.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, headlessexport(vector PDF via pdfkit), anddevserver with SSE live reload.skill/SKILL.md(Claude/Cursor skill),AGENTS.md, schema reference, and a branched-harness example.Test plan
npm install && npm run build && npm run typechecknpm run check:examplesnpm run dev— verify the example renders, live-reload on save, and PDF/SVG export downloadsnode packages/cli/dist/index.js export examples/branched-battery-pigtail.harness.json -o /tmp/demo.pdfand inspect the PDF