Sight is a C++20 surgical image guidance and healthcare toolkit based on an object/service architecture. Objects and services communicate through signals and slots, and applications and components are described with XML.
- Write code and comments in English.
- Use four spaces for indentation; never use tabs.
- Use
snake_casefor variables, functions, and class names. - Class data members use
m_followed by snake_case, e.g.m_image_size. - Keep lines at or below 120 characters.
- Use
#pragma oncefor header guards. - Keep includes minimal and follow the existing
.clang-tidyconfiguration. - Use namespaces matching the repository tree.
app/: XML applicationsconfig/: shared XML configurationsexample/: elaborate exampleslib/: shared librariesmodule/: dynamically loadable modules and most servicestutorial/: progressive tutorialsutil/: standalone executables
Unit tests live below the target's test/ut directory and use Doctest.
Use the following order for build and test work:
- If the project has no configured build, ask the user to configure it once with the CMake Tools extension. Do not silently choose a preset, compiler, or build type for the initial configuration.
- Inspect the active CMake Tools configuration before building: selected project, configure preset (if any), build directory, generator, and build type. Use the selected configuration rather than assuming one.
- Before running a data-dependent test, look for
FWTEST_DATA_DIRin the selected project's.vscode/launch.jsonand relevant CMake Tools test or debug settings. Do not print or commit the value. - If it is not configured, ask the user to provide
FWTEST_DATA_DIRfor the selected repository. Each repository has its own data directory; never reuse a value from another repository without confirmation. - During development, build only the affected target and run only the relevant CTest test or test pattern. At the end of the change, run the broader or complete test suite when practical.
- Validate with the relevant build, tests, and lint checks when available. Report checks that ran separately from environment blockers.
The repository-specific data path and the username are machine-specific. Never
guess them or hard-code them into committed project files. Prefer CMake Tools
or direct cmake --build and ctest commands using the active configuration.
Never delete a build directory to make a test pass.
For service tests, instantiate services through the factory, monitor their input/inout data or signals, stop them before removal, and remove every service they create. Test observable behaviour rather than protected member variables.
For service-specific creation and testing guidance, use the repository skill
at .agents/skills/sight-service/SKILL.md.
For filling an existing GitLab merge request, use the repository skill at
.agents/skills/fill-mr/SKILL.md. It must resolve repository roots from the
current workspace and must not contain machine-specific paths or user data.
For creating a GitLab issue from a project template, use the repository skill
at .agents/skills/create-issue/SKILL.md. It must resolve the project
from the current workspace and require confirmation before remote creation.
Useful documentation: