@private/CLAUDE.md
The import above is the maintainers' optional private instructions
(private/ is git-ignored; without it the import does nothing).
MitCad is an MIT-licensed parametric desktop CAD application (Rust model, C++ OCCT facade, Qt UI). Read docs/architecture.md and docs/development.md before larger changes.
- Everything in English: code, comments, UI texts, docs, commit messages.
- Follow the code conventions
(SPDX line in every new file, C++17 warning-free on MSVC
/W4and GCC-Wall -Wextra -Wpedanticand AppleClang, Windows, Linux and macOS, metric defaults) and the licence policy. - Use the terms of docs/naming.md: MitCad, not Mitcad; component, not part; user-facing text names controls as the UI shows them (the Assemble group, not ASSEMBLE).
- Never commit real
.f3ddesigns, FreeCAD documents or other third-party models; corpus tests read them fromMITCAD_F3D_CORPUSandMITCAD_FCSTD_CORPUS. - Build and test only in the isolated environments (WSL distro, Windows
VM, macOS VM), never on the host; mirror the tree with
tools/dev-env/sync-to-*.sh. Use a login shell in the distro (bash -lc,bash -l -s) and keep intermediate files out of/tmp. - Never start the application visibly on the desktop. Linux UI tests run
on a hidden Xvfb display (
tools/ui-*-test.sh), Windows UI tests are the ctestsapp.ui-windows*, macOS onesapp.ui-macos*in the macOS VM. - Before a commit or a merge into dev, features or main (the branches:
docs/development.md): a scoped check on the machine's
own platform only, never on another platform's environment: on a Linux
machine
tools/check-all.shin its default, scoped mode (the check script), on a Windows machine the warning-free build and the affected ctests in its Windows environment, on a Mac its build and the affected ctests. An occasional miss is accepted: every platform is checked in full by the release build (check-all.sh --full, the Windows build with the fullctest, and on macOStools/release-check-macos.sh: build, no AppKit, the fullctest, the package).
core/modelhas no OCCT dependency: geometry goes through theKerneltrait (core/model-base/src/kernel.rs); model tests use a mock kernel.- Rust first for new code of our own: logic we write ourselves goes in Rust rather than new C++ when Rust does it well. What OCCT already does (fillets and blends, booleans, sweeps, exact intersections) is called, not reimplemented in Rust, and existing C++ is not rewritten just because it is C++ (code conventions).
- The app talks to the model only through JSON commands and queries (commands.md); UI commands are declarative definitions (app/COMMANDS.md).
- Platform code: macOS uses the shared Qt UI only (owner 6.11.2026,
macos-shared-qt.md): the AppKit frontend
(
MITCAD_MACOS_NATIVE_UI) is not built until native UI work resumes.#ifdef Q_OS_MACOSis for behaviour the system or keyboard needs (the GL context, the Metal render service, menu roles, the Settings window, system keys, Backspace, trackpad), not for presentation; the 0.48 macOS presentation is underMITCAD_MAC_UI(built only withMITCAD_MACOS_SHARED_QT_UI=OFF, for comparison). New UI is shared Qt on every platform. AppKit code stays inapp/platform/macos/, behind the public interfaces inapp/platform/(MacChromeand the rest, with stubs). The Qt layout is chosen at run time (chromeStyle(): Floating by default everywhere since mitcad#429, Docked by the preference or--chrome=docked); Docked must keep working everywhere. - Face and edge references are topological names (
F2:side(c1[c4,c2]),E{…|…}) carried through OCCT's history. - Geometry operations must not modify their input shapes.
Parallel changes often add to the same lists. Keep each addition one contiguous block, appended at the end:
core/model/src/features/mod.rs:pub mod,pub useand one line infeature_types!.core/model-base/src/kernel.rs: newKernelmethods with a defaultErr(Unsupported), grouped under a comment naming the family.core/ffi/src/kernel/mod.rs,core/CMakeLists.txt(FILESandtarget_sourcesofmitcad_bridge),geometry/CMakeLists.txt: one block per family; new families in new files.core/model-api/src/commands.mdand README sections: a section of your own.tools/dev-env/versions.sh: tool pins shared bysetup-user.shandsetup-macos.sh(setup-windows.ps1mirrors them by hand).
Tests register themselves, in files of their own, and edit no shared list
(adding a test):
a Windows UI test in cmake/ui-tests/windows/<test>.cmake, a macOS one in
cmake/ui-tests/macos/<test>.cmake, an app.unit test file with
MITCAD_UNIT_TEST(<entry point>); and its sources in
app/tests/unit/<file>.cmake. Branches do not refresh
app/translations/*.ts; that is done once at the merge.