Wire Lang Authoring Skill
Use this skill to help people author Wire Lang source. Wire Lang is a textual
language for describing electronic schematics and rendering them as readable SVG
diagrams.
First Move For Authoring
- Identify the circuit the user wants to describe.
- Choose component instances and stable instance IDs.
- Connect terminals through named nets or
connect statements.
- Add title, description, annotations, and render hints only when useful.
- Check the source with
wire check when the CLI is available.
Read the focused reference files as needed:
references/concept-map.md for the authoring concept graph.
references/source-format.md for syntax and statement shapes.
references/component-library.md for standard components, terminals, and
properties.
references/style-guide.md for source-writing conventions.
references/examples.md for good and bad examples.
references/boundaries.md when a user asks for simulation, PCB layout,
breadboard layout, BOMs, custom symbols, or browser/editor integrations.
Validate And Render
Use the wire CLI instead of hand-validating whenever the user's environment
can run it:
npm i -D wire-lang
npx wire check path/to/circuit.wire
npx wire render path/to/circuit.wire --out path/to/circuit.svg
npx wire watch path/to/circuit.wire --out path/to/circuit.svg
For a one-off run without adding a package to the project, invoke the wire
binary from the wire-lang package:
npx -p wire-lang wire check path/to/circuit.wire
npx -p wire-lang wire render path/to/circuit.wire --out path/to/circuit.svg
- Use
wire check as the real implementation of checking the source against
MVP syntax and the component library.
- Use
wire render <file>.wire --out <file>.svg as the canonical author-to-SVG
artifact step.
- Use
wire watch <file>.wire --out <file>.svg while iterating.
- Add
--json to wire check, wire render, or wire watch when
machine-readable diagnostics are useful.
- For Markdown or MDX, default to
@wire-lang/browser and initialize it after
HTML is ready. For ahead-of-time rendering, use @wire-lang/markdown with
{ mode: "static" }. See references/markdown.md for setup. On hosts without
either integration, run wire render and embed the generated .svg.
- Do not claim that source was checked or rendered unless the command actually
ran. If the CLI is unavailable, say the source is not tool-validated and give
the exact command to run.
Authoring Rules
- Start every MVP source with
schematic.
- Use
.wire source to describe logical schematics, not breadboards, PCB
layouts, physical routing, or simulations.
- Declare component instances with
component ID Type ....
- Use canonical component names and terminal names from the standard library.
- Use named nets for important or reused electrical nodes such as
VCC, 5V,
3V3, GND, SDA, or SCL.
- Use
connect for simple anonymous connections.
- Treat power nets as normal nets; they do not create hidden connections.
- Use
annotation for visible explanatory text. Use // only for source
comments.
- Use render hints for layout guidance, not electrical meaning.
- Do not invent unsupported syntax. If Wire Lang cannot express the user's
request in the MVP, say so and offer the closest valid source.
Default Output
When asked to create Wire Lang source, return a complete .wire block:
schematic
title "..."
description "..."
component ...
net ...
connect ...
After the block, include a short note only for important assumptions, such as
component choices or unsupported requested behavior.
When the user asks for an image or SVG artifact, include the wire render
command to produce it. If you ran the command successfully, include the output
path; otherwise, state that rendering has not been tool-verified.
Common Corrections
- "Draw a wire from X to Y" usually means create a
connect statement or named
net; do not encode visual paths.
- "Show this note in the diagram" means use
annotation, not //.
- "Ground everything" still requires explicit
GND net connections.
- "Make this vertical" is a render hint, not a component property.
- "Arduino board" is outside the MVP standard library; model it as a local
module-style component if needed.
- "Chip with numbered pins" is the
IC type: pins=[1:VCC@left, 2:GND@left, 3:OUT@right]. Connect pins by name.
- "Leave this pin unused / N.C." is a
no-connect TERMINAL statement, not a
floating net.
- "Mark the 3V3 rail" can use a
PowerFlag name=3V3; it is a visual flag, not a
hidden global net.
- Crossings without a junction are left simply overlapping by default; "draw a
hop where lines cross" is
render crossings=hop.
Keep This Skill Current
When the Wire Lang syntax, examples, standard component library, or MVP authoring
rules change, update this skill and the focused reference files.
Before finishing an authoring response, check:
- The source starts with
schematic.
- Component types and terminal names exist in the standard library or in a local
component definition.
- Power nets are explicitly connected.
- Visible explanatory text uses
annotation, not //.
- Render hints do not carry electrical meaning.
- Unsupported requests are called out with the closest valid MVP expression.
1---2name: wire-lang3description: Create, revise, and explain Wire Lang .wire schematic source. Use when writing electronic schematics, converting circuit descriptions into Wire Lang, fixing Wire Lang syntax, or giving good and bad examples of Wire Lang authoring.4license: MIT5---67# Wire Lang Authoring Skill89Use this skill to help people author Wire Lang source. Wire Lang is a textual10language for describing electronic schematics and rendering them as readable SVG11diagrams.1213## First Move For Authoring14151. Identify the circuit the user wants to describe.162. Choose component instances and stable instance IDs.173. Connect terminals through named nets or `connect` statements.184. Add title, description, annotations, and render hints only when useful.195. Check the source with `wire check` when the CLI is available.2021Read the focused reference files as needed:2223- `references/concept-map.md` for the authoring concept graph.24- `references/source-format.md` for syntax and statement shapes.25- `references/component-library.md` for standard components, terminals, and26 properties.27- `references/style-guide.md` for source-writing conventions.28- `references/examples.md` for good and bad examples.29- `references/boundaries.md` when a user asks for simulation, PCB layout,30 breadboard layout, BOMs, custom symbols, or browser/editor integrations.3132## Validate And Render3334Use the `wire` CLI instead of hand-validating whenever the user's environment35can run it:3637```bash38npm i -D wire-lang39npx wire check path/to/circuit.wire40npx wire render path/to/circuit.wire --out path/to/circuit.svg41npx wire watch path/to/circuit.wire --out path/to/circuit.svg42```4344For a one-off run without adding a package to the project, invoke the `wire`45binary from the `wire-lang` package:4647```bash48npx -p wire-lang wire check path/to/circuit.wire49npx -p wire-lang wire render path/to/circuit.wire --out path/to/circuit.svg50```5152- Use `wire check` as the real implementation of checking the source against53 MVP syntax and the component library.54- Use `wire render <file>.wire --out <file>.svg` as the canonical author-to-SVG55 artifact step.56- Use `wire watch <file>.wire --out <file>.svg` while iterating.57- Add `--json` to `wire check`, `wire render`, or `wire watch` when58 machine-readable diagnostics are useful.59- For Markdown or MDX, default to `@wire-lang/browser` and initialize it after60 HTML is ready. For ahead-of-time rendering, use `@wire-lang/markdown` with61 `{ mode: "static" }`. See `references/markdown.md` for setup. On hosts without62 either integration, run `wire render` and embed the generated `.svg`.63- Do not claim that source was checked or rendered unless the command actually64 ran. If the CLI is unavailable, say the source is not tool-validated and give65 the exact command to run.6667## Authoring Rules6869- Start every MVP source with `schematic`.70- Use `.wire` source to describe logical schematics, not breadboards, PCB71 layouts, physical routing, or simulations.72- Declare component instances with `component ID Type ...`.73- Use canonical component names and terminal names from the standard library.74- Use named nets for important or reused electrical nodes such as `VCC`, `5V`,75 `3V3`, `GND`, `SDA`, or `SCL`.76- Use `connect` for simple anonymous connections.77- Treat power nets as normal nets; they do not create hidden connections.78- Use `annotation` for visible explanatory text. Use `//` only for source79 comments.80- Use render hints for layout guidance, not electrical meaning.81- Do not invent unsupported syntax. If Wire Lang cannot express the user's82 request in the MVP, say so and offer the closest valid source.8384## Default Output8586When asked to create Wire Lang source, return a complete `.wire` block:8788```wire89schematic90 title "..."91 description "..."9293 component ...9495 net ...96 connect ...97```9899After the block, include a short note only for important assumptions, such as100component choices or unsupported requested behavior.101102When the user asks for an image or SVG artifact, include the `wire render`103command to produce it. If you ran the command successfully, include the output104path; otherwise, state that rendering has not been tool-verified.105106## Common Corrections107108- "Draw a wire from X to Y" usually means create a `connect` statement or named109 `net`; do not encode visual paths.110- "Show this note in the diagram" means use `annotation`, not `//`.111- "Ground everything" still requires explicit `GND` net connections.112- "Make this vertical" is a render hint, not a component property.113- "Arduino board" is outside the MVP standard library; model it as a local114 module-style component if needed.115- "Chip with numbered pins" is the `IC` type: `pins=[1:VCC@left, 2:GND@left,1163:OUT@right]`. Connect pins by name.117- "Leave this pin unused / N.C." is a `no-connect TERMINAL` statement, not a118 floating net.119- "Mark the 3V3 rail" can use a `PowerFlag name=3V3`; it is a visual flag, not a120 hidden global net.121- Crossings without a junction are left simply overlapping by default; "draw a122 hop where lines cross" is `render crossings=hop`.123124## Keep This Skill Current125126When the Wire Lang syntax, examples, standard component library, or MVP authoring127rules change, update this skill and the focused reference files.128129Before finishing an authoring response, check:130131- The source starts with `schematic`.132- Component types and terminal names exist in the standard library or in a local133 component definition.134- Power nets are explicitly connected.135- Visible explanatory text uses `annotation`, not `//`.136- Render hints do not carry electrical meaning.137- Unsupported requests are called out with the closest valid MVP expression.