Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion crates/konnect-core/src/tools/sch_batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ pub fn tools() -> Vec<ToolDef> {
tool!(
"batch_connect_to_net",
"Connect multiple component pins to a named net by adding net labels at each pin \
endpoint. Single file read → all labels inserted → single file write.",
endpoint. Single file read → all labels inserted → single file write. \
Labels are sheet-local: a sheet instanced N times gets N independent nets. \
Use add_power_symbol or a global_label for a rail shared by every instance, and \
only a local label for one that must stay per-instance — power symbols and \
global labels are one net across all sheets and instances.",
json!({
"type": "object",
"properties": {
Expand Down
5 changes: 4 additions & 1 deletion crates/konnect-core/src/tools/sch_wiring.rs
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,10 @@ pub fn tools() -> Vec<ToolDef> {
tool!(
"connect_to_net",
"Connect a pin to a named net by adding a short wire stub and a net label. \
Name the pin with reference + pin_number, or give its coordinates directly.",
Name the pin with reference + pin_number, or give its coordinates directly. \
The label is sheet-local: a sheet instanced N times gets N independent nets. \
A rail shared by every instance needs add_power_symbol or a global_label, \
which are one net across all sheets and instances.",
json!({
"type": "object",
"properties": {
Expand Down
14 changes: 13 additions & 1 deletion crates/konnect/assets/skills/kicad-schematic/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,17 @@ connect_to_net(schematic, reference, pin_number, net)
- Placing a label by hand with `add_schematic_net_label` instead? Take its
rotation from `orientation_degrees` in `get_schematic_pin_locations`, or the
text reads back across the symbol's pin names.
- These labels are sheet-local. In a sheet placed more than once, each instance
gets its own independent copy of the net — right for per-instance signals,
wrong for a rail every instance must share. A shared rail takes
`add_power_symbol` or `add_schematic_net_label` with
`label_type: global_label`; both are one net across all sheets and instances.

### add_power_symbol

Use for all power connections, in preference to labelling a pin with the rail name.
The one exception is a rail that must stay separate per instance of a repeated
sheet — see below.

```
add_power_symbol(schematic, power_net, x, y, rotation?)
Expand All @@ -175,6 +182,11 @@ add_power_symbol(schematic, power_net, x, y, rotation?)
- A power pin landing mid-segment on a wire gets its junction dot
automatically, in either order: symbol onto an existing wire, or a wire
routed across an already-placed symbol.
- Power symbols are global: every `+5V` symbol on every sheet, and in every
instance of a sheet, joins one `+5V` net. A rail that must stay separate per
instance of a repeated sheet (each node's own 5V, say) takes a local net
label via `connect_to_net` instead — `power:+5V` there shorts all the
instances' rails together.

---

Expand Down Expand Up @@ -303,7 +315,7 @@ production-ready claim.
3. **Always verify after changes** — run validation tools after placing and wiring
4. **Use the grid** — all placements on 1.27mm grid
5. **Search before placing** — use `search_symbols` to confirm lib_id exists
6. **Power symbols for power** — use `add_power_symbol` for rails, not net labels
6. **Power symbols for power** — use `add_power_symbol` for rails, not net labels; the exception is a rail that must stay separate per instance of a repeated sheet, which takes a local label because power symbols are global
7. **Net labels for named signals** — keeps schematics readable
8. **Save frequently** — call `save_project` after major operations
9. **Load toolsets first** — check `get_active_toolsets()` and load what you need before starting
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@
| Hierarchical label (`hierarchical_label`) | Sheet boundary | Interface pins on hierarchical sheet symbols |
| Power symbol | Global | Power rails (+3V3, GND, VCC) |

In a sheet placed more than once, a net label is a separate net in each
instance, while a global label or power symbol is one net across every sheet
and instance. A rail shared by all instances therefore needs a power symbol or
global label; a rail private to each instance needs a net label — `power:+5V`
inside a repeated sheet ties every instance's 5V together.

## Spacing Guidelines

- Components: minimum 5.08mm (4 grid units) between component bodies
Expand Down
Loading