Start with VISION.md, AGENTS.md, ATTRIBUTION.md and deny.toml. They define the product, source boundaries, architecture and dependency policy. The MVP milestone and acceptance checklist identify the first shareable release; the broader workflow index includes later features that are not MVP gates.
The documentation map provides reading paths for users, contributors and agents, with current format references separated from broader design plans and verification history.
Use Rust 1.95 or later with Cargo, rustfmt and Clippy, a platform linker and a graphical session for the desktop app. These commands run from the repository root unless noted:
rustup component add rustfmt clippy
cargo build --locked -p pcbcraft -p pcbcraft-cli
cargo run --locked -p pcbcraftFor the browser, install the WebAssembly target and Trunk. CI currently uses Trunk 0.21.14; keep its version consistent with the workflow when updating these instructions.
rustup target add wasm32-unknown-unknown
cargo install --locked trunk --version 0.21.14
cd apps/pcbcraft-web
trunk serve --lockedVisit http://127.0.0.1:8781. trunk build --release from the same directory
produces dist/web at the repository root. Return to the repository root for
the remaining commands. A successful Rust WebAssembly check
alone does not verify the packaged web assets or browser interaction. Use the
quickstart to exercise the real app with an existing fixture.
If Trunk reports invalid value '1' for '--no-color', the shell has supplied
NO_COLOR=1 where Trunk 0.21.14 expects a boolean. Launch it with
NO_COLOR=true trunk serve --locked in that environment.
| Area | Responsibility |
|---|---|
crates/engine |
Project model, validation, commands, immutable snapshots and undo/redo; no UI |
crates/app |
Desktop/browser composition, canvas tools, preferences and project-file lifecycle |
crates/chrome |
Shared colors, sizes, icons, menus, cards and other presentation primitives |
crates/geometry |
Solid bodies and STEP exchange behind a kernel-neutral API; the only crate that links the solid kernel |
crates/units |
Shared physical quantity/unit definitions, exact decimal parsing/display, and geometry length conversion/edit formatting |
crates/mcp |
Tool discovery and dispatch over the engine; a restricted live adapter and a separate headless session |
crates/craft-control |
Bounded framing and authenticated local transport |
crates/storage |
Native folder/archive I/O and publication; encoding/decoding is in the engine |
apps/ |
Thin desktop, CLI and web launchers |
libraries/basic-components |
Original, revisioned symbol definitions embedded in both builds |
An authored edit belongs in the engine and is called by the GUI through the same command path MCP uses. Adding a catalog command exposes it to headless discovery; the live adapter has an explicit allowlist, so a new command is not automatically available in an open window. View-only actions must leave electrical revision, dirty state, saved bytes and document undo unchanged. The board workspace plan describes how these ownership boundaries extend to multiple views.
Use the native storage contract before changing saved data and the symbol format guide before changing library definitions. Preserve stable IDs/order, no-op saves and migrations from every supported old format. Generate fixtures through shared commands and the production encoder instead of hand-editing project documents. To generate an original fixture set, use a destination that does not already exist:
cargo run --locked -p pcbcraft-engine --example storage_fixtures -- /tmp/pcbcraft-fixtures-newFor changes affecting routing/checking, geometry queries, connectivity, live MCP edits or editor interaction/rendering performance, use the performance-testing guide before implementation. Its runner-selection table links the CPU, native/browser rendered and process-resource commands, saved workloads and comparison tools. Collect matched before/after evidence for the affected paths and include the raw reports, environment, correctness results and any regressions in the PR; the coverage record explains existing observations and measurement limits.
Routine CI verifies the harness and saved reports with short tests. Full rendered baselines, allocation profiles and endurance runs need a separate qualification scope and stopping condition under the bounded verification rule. Unrelated or documentation-only changes do not need fresh performance baselines.
Before starting work on an issue, read its discussion and check
open PRs for an existing
implementation. If it is available, leave a claimed comment on the issue
before you begin. For part of a larger issue, state the scope you are claiming.
Link your PR in the issue when it is ready for review.
The first person to claim a scope gets merge priority: once their PR meets the project's review and verification requirements, it is the contribution we will merge for that scope. Finishing a competing PR sooner does not take that priority away. If someone has already claimed the work, coordinate with them in the issue before starting a separate implementation; agree on collaboration or a distinct scope instead.
A claim does not waive review requirements or reserve an issue indefinitely. If the contribution has unresolved problems and its author is not responding to requests for fixes or a progress update, a maintainer may release the claim and accept another contribution. Maintainers should record that decision in the issue before someone else takes over. If you stop working on a claimed issue, leave a comment releasing it so someone else can pick it up.
Check the issue discussion, open PRs
and any shared local worktrees before starting. A branch name or uncommitted work
may reveal an active task even when no PR exists. Use your own topic branch or
worktree from current origin/main; preserve other people's working files. Keep
a broad parent issue open when delivering only one of its slices.
When opening an issue, follow the label policy: use
an existing classification label and relevant area labels, then verify the result.
With the CLI, pass labels through gh issue create --label; inspect the current
catalog with gh label list. Contributors without label permissions can describe
the affected area in the issue so a maintainer can classify it.
Follow the composition and module-boundary rules: assemble features from reusable modules with explicit state ownership and narrow interfaces, reuse shared behavior, and keep domain computation separate from presentation and I/O. Scope existing-code extractions to the behavior being changed.
Production Rust must not use unsafe, unwrap, expect, panic! or placeholder
branches. Add /// documentation for public APIs and changed functions with
branching logic, explaining input constraints, errors and state changes. Put
styling in chrome and keep filesystem/transport work away from the editor loop.
For shared state, I/O or concurrency changes, follow AGENTS.md's separate
failure-path review after ordinary checks, including cancellation, stale work,
shutdown and partial failures.
The project is MIT OR Apache-2.0. Do not read or adapt KiCad or other GPL EDA implementation code, headers, patches, tests, source-derived fixtures or annotated-source pages, including forks and mirrors. Published manuals/format specifications and black-box observation are permitted. Qualify libraries and assets separately, retain notices, and record permitted adaptations with source, revision, license and changes in ATTRIBUTION.md. Unknown provenance stays out pending clarification; this contribution guide does not lift existing source exposure pauses.
Validate documentation links locally without network access:
python -B scripts/check-markdown-links.py
python -B -m unittest discover -s scripts -p 'test_markdown_links.py'The check covers README.md, CONTRIBUTING.md and docs/**/*.md. Supported destinations include inline Markdown links and images, full/collapsed/shortcut references, angle-bracket destinations and HTML href/src attributes. Fenced/inline code, external URLs, repository-root-relative URLs and fragment-only links are ignored. Query strings and fragments are stripped for file-existence checks; heading anchor names and external link availability are not validated. Missing local targets are reported with the source file's repository-relative path, using forward slashes on every platform, and its line number.
Apply the bounded verification rule: choose checks that answer a specific question about the change, and stop when the required checks pass and no unresolved correctness or acceptance question requires more work.
For documentation-only changes, review wording and formatting, verify local links and check any changed commands or examples. Prose and link edits do not require Rust builds, Clippy, workspace tests or fresh performance baselines. Changes to build configuration, generated sources or executable examples need the checks appropriate to their effects, even when they accompany documentation.
During code development, use affected-crate checks and focused regressions for the behavior or failure path being changed. Verify the affected native/browser behavior when platform interaction changes; a passing check on one target does not establish behavior on another.
For shared changes that need full workspace verification before submission, run the following checks once after the coherent change is complete. During development, use affected-crate checks and focused regressions. Reuse results for unchanged code; after further edits, repeat affected checks and broaden them when shared behavior or a concrete failure warrants it:
cargo fmt --all --check
cargo clippy --locked --profile ci --workspace --all-targets -- -D warnings
cargo test --locked --profile ci --workspace
cargo check --locked --profile ci -p pcbcraft-web --target wasm32-unknown-unknownThe ci profile keeps debug assertions and overflow checks, uses line-table debug
information for workspace code and optimizes dependencies. It leaves ordinary
development/debugger builds unchanged. Continuous integration
describes the PR stages, Windows coverage, cache ownership and optional runner
labels. Draft PRs skip CI. Ordinary code PR pushes receive repository checks and
a quick compile; after review, approved-for-ci enables affected native packages
and their dependents. Passing selected checks report success without an approval
error. Windows, browser packaging, WASI, doctests and the opt-in harness are
deferred to main, merge groups, nightly and manual runs. Manifest/lockfile changes
still select dependency checks on PRs. Because this repository has no merge queue,
a green PR does not establish full platform qualification before merge.
The test suite includes loopback transport tests, so a sandbox that forbids local sockets cannot run the complete suite. Report that limitation rather than silently skipping those tests. For code or dependency changes, match CI's dependency check when cargo-deny is available:
cargo install --locked cargo-deny --version 0.20.2
cargo deny --locked check licenses sources bansIf the tool is unavailable, say so in the PR and state whether dependencies changed; CI still runs its license/source/ban checks. The current allowed licenses are defined in deny.toml, not by an assumption that a crate is generally reusable.
UI tests in crates/app/src/tests.rs drive the real app with egui_kittest clicks
and keys through its accessibility tree. Add a focused regression when it covers
a meaningful interaction or failure path. For a visual change, also render and
inspect the actual app at relevant sizes/themes. When following PCBcraft Next,
read the qualified reference code and compare screenshots at the same scale.
Temporary rendering modules, dependency features and generated screenshots must
not accidentally enter the implementation diff. Native window behavior needs
native-window verification in addition to headless UI tests.
Update the quickstart and capability table when user-visible behavior changes. Verify documentation commands and local links, and distinguish an automated smoke test from an independent person's onboarding run. Describe the concrete behavior, issue scope, tests, visual evidence and remaining limits in the PR. For the failure-path review, separate cases exercised by tests from those checked by reading the code. Keep the PR small enough to assess on its own; the repository's rules do not grant an agent permission to publish or merge without the task owner's authorization.