Project And Design API

KiCadProject

Rationale

Project-level tools need stable access to `.kicad_pro` text variables, variants, and JSON persistence without depending on raw dictionaries.

Purpose

Wrap project JSON with typed helpers for text variables, variant lookup, serialization, and future project metadata.

Test Requirements

Tests must cover JSON construction, text-variable get/set/remove behavior, variant iteration, file writing, and reload.

Working Definition

A project facade is public when callers can handle common project metadata without direct raw-JSON mutation.

KiCadDesign

Rationale

Higher-level tools need a design aggregate that can load related project, schematic, and board documents and expose them through one query surface.

Purpose

Aggregate project, schematic, and board objects; dispatch from common file suffixes; expose document queries; and provide design-level IR and JSON entrypoints.

Test Requirements

Tests must cover file dispatch, aggregate object queries, schematic mutators, design JSON output, and PCB IR delegation.

Working Definition

A design facade is public when CLI and application tools can work from one loaded design object rather than coordinating independent file models.