These rules apply to the whole repository. Start with the
documentation index, then read the
development workflow and
current architecture before structural changes.
The index routes database, backend, frontend, MCP, feature and testing work to
their current contracts. Migration notes are historical context, not API rules.
Changes under modern/ also follow its AGENTS.md.
ProjectEditor owns project transactions and undo; MeasurementDraft owns
record draft history. Domain handlers must not create competing histories,
commit independently or bypass rollback. Previews must leave data, identities,
revision, clipboard and history unchanged.App.vue, ProjectViews.vue, project.py or service.py. Do not
split files into arbitrary numbered parts or introduce mixins that hide state.
Small forwarding methods may preserve an existing service API.modern, Vue, Tauri or UI-only dependencies. Prefer top-level
imports; document lazy imports needed for cycles or startup cost.any confined to documented third-party adapters.eval or
exec. Use the bounded numeric parsers. The template loader may compile
trusted installed modules, selected by validated names inside its directory.This repository follows the more explanatory comment style of FreeCAD-HVAC.
Step 1: validate the selection. Explain constraints,
invariants and workarounds as well as the process flow.Format files changed by the task; do not reformat unrelated files. Use UTF-8,
spaces, LF newlines and a final newline, as set in .editorconfig.
Use the checked-in pyproject.toml, matching FreeCAD-HVAC:
line-length = 120
[format]
skip-magic-trailing-comma = true
[lint]
select = ["E302", "E303", "I"]
[lint.isort]
split-on-trailing-comma = false
Run Ruff’s selected lint fixes and formatter on changed Python files, then check
both. Preview is enabled for E302/E303. Use four-space indentation and keep
imports grouped; do not compress compound statements onto one line. New or
substantially rewritten error handlers catch expected exceptions; broad catches
are reserved for rollback/cleanup or protocol boundaries and must re-raise or
report the error. Never add bare except: handlers.
Use stable rustfmt with modern/src-tauri/rustfmt.toml: 120-column target,
four spaces, edition 2021. Use normal blocks rather than compressed statements.
Propagate recoverable errors with Result; avoid new unwrap/expect in request
handling. Run cargo fmt, tests and Clippy for native changes. Document ownership,
platform-specific workarounds and process/thread cleanup with short comments.
Use the pinned Prettier and modern/.prettierrc.json: 120-column target, two
spaces, double quotes, semicolons and trailing commas where supported. Use the
Vue/HTML parser’s whitespace rules; do not manually wrap meaningful inline text.
Keep template markup readable, semantic and accessible. Use logical CSS
properties and existing tokens; shared tokens belong in theme.css, shared
styles in style.css, and isolated component styles may be scoped. Avoid
appending duplicate selectors to override an earlier rule when that rule can
be edited directly. Keep cascade order intact during CSS refactors.
requirements-dev.txt into .venv and run npm ci --prefix modern..venv/Scripts/python tools/check_quality.py --fix, then the same command
without --fix. On POSIX use .venv/bin/python. The script includes staged,
unstaged and untracked source files; use --base <ref> for a whole branch.
Formatting is incremental because untouched legacy files predate these rules.cargo test --locked and
cargo clippy --locked --all-targets -- -D warnings in modern/src-tauri.
Build the Python sidecar first if Tauri needs its external binary.docs/architecture/ or docs/features/
synchronized with behavior and link it from the index.
Link to canonical contracts instead of copying schemas, tool lists or commands.docs/migration/.
Do not present old tool counts, branches, test totals or completed plans as
current instructions. Preserve old entry points and referenced section anchors
when moving a document.tools/check_docs.py and
git diff --check; app tests are needed only when behavior/code changes.
Use the testing guide for the complete verification matrix.Do not change these rules without explicit user instruction. An uncovered case is a reason to flag it, not to silently expand the rules.