Skip to main content

What It Does

DRC Import lets you load a .kicad_dru (KiCad Design Rule) file from any manufacturer and apply their constraints to your project. Name the manufacturer when you import, and the AI uses those constraints for all subsequent design checks — trace widths, clearances, via sizes, and more are enforced in real time. This bridges the gap between generic DRC (which only catches obvious violations) and manufacturer-specific DRC (which catches the issues that actually cause fab failures). A board that passes generic DRC but violates your fab’s minimum annular ring is a board that fails at the factory.

How to Import

From the Desktop App

Ask the AI in the chat panel:
Load PCBWay 4-layer DRC rules
Or import a specific file:
Import DRC rules from ./constraints/jlcpcb-4layer.kicad_dru
The AI will:
  1. Parse the .kicad_dru file
  2. Apply the constraints to your project
  3. Re-run DRC and report any new violations
  4. Record the manufacturer target in your .trace/rules.md for future sessions

From the DRC Rule Editor

  1. Open Inspect → DRC Rule Editor
  2. Click Import Rules (or drag-and-drop a .kicad_dru file)
  3. Name the manufacturer source in the dialog
  4. Review the imported constraints in the editor panels
  5. Save with Ctrl+S

From the CLI

buildwithtrace agent "Import DRC rules from jlcpcb-4layer.kicad_dru for JLCPCB" -p ./my-board/

What Gets Imported

A .kicad_dru file can contain any combination of:
Constraint TypeExamples
ClearanceCopper-to-copper, copper-to-edge, drill-to-copper
Track widthMinimum, optimum, maximum per net class
Via sizeDrill diameter, annular ring, pad size
Differential pairCoupling gap, impedance-derived width
SilkscreenMinimum text height, stroke width
CourtyardComponent-to-component spacing
Hole sizeMinimum drill, maximum aspect ratio
Custom expressionsAdvanced conditional rules

How Constraints Flow Into TraceRules

When you import a DRC file and name the manufacturer, the AI records this in your .trace/rules.md:
## Manufacturer
- DRC source: jlcpcb-4layer.kicad_dru (imported 2026-06-05)
- Fab: JLCPCB
- Process: 4-layer, 1oz copper
- Min trace/space: 0.09mm/0.09mm
- Min via drill: 0.2mm
- Min annular ring: 0.13mm
This means the AI remembers your manufacturer constraints across sessions — it doesn’t just apply them once during import. Every subsequent design change is validated against these limits.

Manufacturer Presets

Trace ships with built-in presets for common manufacturers. Ask the AI to load one:
CommandManufacturer
”Load PCBWay 4-layer rules”PCBWay standard 4-layer
”Load PCBWay 2-layer rules”PCBWay standard 2-layer
”Load JLCPCB rules”JLCPCB standard process
”Load Pikkolo rules”Pikkolo Assembly (Denver)
“Load OSH Park rules”OSH Park (after dark, 4-layer)
Don’t see your manufacturer? Any .kicad_dru file works. Ask your fab house for their KiCad DRC file, or export one from their online DRC tool.

Workflow: Import → Design → Validate

1

Import constraints

Load your manufacturer’s .kicad_dru file or ask the AI to apply a preset.
2

Design with confidence

The AI enforces imported constraints in real time. As it places components and routes traces, it respects your fab’s minimums automatically.
3

Run DRC before ordering

A final DRC pass (Ctrl+Shift+D) catches any remaining violations. The Design Review runs this automatically before manufacturing submission.
4

Iterate on violations

Ask the AI to fix violations: “Fix all clearance violations” or “Widen traces that are below minimum.”

Overriding Imported Rules

Imported rules can be overridden in two ways:
  1. Edit in the DRC Rule Editor — Open Inspect → DRC Rule Editor and modify specific values
  2. Override in TraceRules — Add a line to .trace/rules.md that takes precedence:
## Routing Conventions
- Override: Allow 4mil trace/space on BGA escape (manufacturer approved)
The AI treats TraceRules overrides as intentional engineering decisions and won’t flag the overridden constraint as a violation.
Be careful overriding manufacturer constraints. A rule exists because the fab can’t reliably produce features below that limit. Only override when you have explicit written approval from your manufacturer for an exception.

Creating a .kicad_dru for Your Manufacturer

If your manufacturer doesn’t provide a .kicad_dru file directly, you can create one from their capability table:
(version 1)

(rule "Minimum Clearance"
  (constraint clearance (min 0.1mm))
)

(rule "Minimum Track Width"
  (constraint track_width (min 0.09mm))
)

(rule "Minimum Via Drill"
  (constraint hole_size (min 0.2mm))
)

(rule "Minimum Via Annular Ring"
  (constraint annular_width (min 0.13mm))
)

(rule "Minimum Drill to Copper"
  (constraint hole_clearance (min 0.254mm))
)

(rule "Board Edge Clearance"
  (constraint edge_clearance (min 0.3mm))
)
Save this as my-manufacturer.kicad_dru and import it into Trace.

DRC Categories You Can Ignore

When importing rules, you can tell the AI to suppress certain categories in your TraceRules:
## DRC Ignore
- Ignore: silkscreen overlap (cosmetic only for prototype)
- Ignore: courtyard clearance on test points
- Ignore: unconnected pin on J1 pin 5 (no-connect by design)
The AI will skip these categories during automated checks but will still flag them as “Info” in a full Design Review if you run one manually.