@@ -12,11 +12,14 @@ Baseline shape:
1212- Out-of-tree builds are the default workflow
1313- Repo-owned code should stay portable, local-first, and easy to validate
1414- One small library target plus one CLI target form the default example shape
15- - Deterministic ` CTest ` , ` clang-tidy ` , Doxygen, release-hygiene, and Valgrind
16- lanes are part of the maintained contract
15+ - Deterministic ` CTest ` , ` clang-tidy ` , ` clang-format ` , ` cppcheck ` , Doxygen,
16+ release-hygiene, Valgrind, and coverage lanes are part of the maintained
17+ contract
1718- Qt/Clazy provide the example UI stack, not the baseline assumption
1819- Public docs are generated from repo-owned headers and ` docs/mainpage.md `
1920- Feature plans live under ` upcoming_features/ ` as tracked Markdown files only
21+ (see ` upcoming_features/TEMPLATE.md ` for the expected format)
22+ - CMake presets provide named configurations for common workflows
2023
2124Repository principles:
2225
@@ -31,20 +34,33 @@ Repository principles:
3134## Key Paths
3235
3336- ` src/ ` : repo-owned library and CLI code
34- - ` tests/ ` : deterministic example tests and test registration
37+ - ` tests/ ` : deterministic example tests, test registration, and ` frame_test.h `
38+ micro-framework
3539- ` docs/ ` : Doxygen config and API-focused main page
3640- ` scripts/ ` : hygiene, release, and diagnostics helpers
3741- ` contrib/ ` : optional service/desktop integration examples
3842- ` cmake/ ` : reusable analyzer helper scripts
3943- ` .agents/skills/ ` : project-local agent overlays and merged skills
4044- ` .github/workflows/ ` : generic CI and release workflow templates
45+ - ` benchmarks/ ` : optional chrono-based micro-benchmarks and ` frame_bench.h `
46+ harness
4147- ` upcoming_features/ ` : forward-looking implementation plans
4248
4349## Build And Validation
4450
4551Read ` README.md ` first before changing build, setup, or release behavior.
4652
47- Use an out-of-tree build:
53+ Prefer CMake presets for common workflows:
54+
55+ ``` bash
56+ cmake --preset dev
57+ cmake --build build/dev -j" $( nproc) "
58+ ```
59+
60+ Available presets: ` dev ` (debug + sanitizers), ` release ` (optimized + LTO),
61+ ` ci ` (matches GitHub Actions), ` coverage ` (gcov instrumentation).
62+
63+ Manual out-of-tree build (when presets are unavailable):
4864
4965``` bash
5066BUILD_DIR=" $( mktemp -d /tmp/cpp-frame-build-XXXXXX) "
@@ -54,7 +70,7 @@ cmake --build "$BUILD_DIR" -j"$(nproc)"
5470
5571If ` ninja-build ` is unavailable, omit ` -G Ninja ` .
5672
57- Optional sanitizer lane:
73+ Optional sanitizer lane (included in the ` dev ` preset) :
5874
5975``` bash
6076cmake -S . -B " $BUILD_DIR " -G Ninja \
@@ -74,7 +90,9 @@ Use the smallest validation set that proves the change, then extend as needed:
7490- ` cmake --build "$BUILD_DIR" --target clang-tidy `
7591- ` cmake --build "$BUILD_DIR" --target clazy ` when the project uses the
7692 example Qt-based UI stack and the tool is available
77- - ` cmake --build "$BUILD_DIR" --target lint `
93+ - ` cmake --build "$BUILD_DIR" --target format-check `
94+ - ` cmake --build "$BUILD_DIR" --target lint ` (includes clang-tidy and cppcheck
95+ when available)
7896- ` cmake --build "$BUILD_DIR" --target docs `
7997- ` bash scripts/run-valgrind.sh "$BUILD_DIR" `
8098- ` bash scripts/check-release-hygiene.sh `
@@ -86,9 +104,55 @@ INSTALL_DIR="$(mktemp -d /tmp/cpp-frame-install-XXXXXX)"
86104cmake --install " $BUILD_DIR " --prefix " $INSTALL_DIR "
87105```
88106
107+ ## Formatting
108+
109+ Run ` cmake --build "$BUILD_DIR" --target format ` before committing to keep
110+ source files consistently formatted. CI enforces ` format-check ` and will reject
111+ unformatted code. The ` .clang-format ` config at the repo root defines the
112+ canonical style.
113+
114+ ## Coverage
115+
116+ Build with the ` coverage ` preset and run the ` coverage ` target:
117+
118+ ``` bash
119+ cmake --preset coverage
120+ cmake --build build/coverage
121+ cmake --build build/coverage --target coverage
122+ ```
123+
124+ This runs tests and collects coverage via ` gcovr ` . HTML output lands in
125+ ` build/coverage/coverage/ ` . New code should maintain or improve line coverage.
126+
127+ ## Benchmarks
128+
129+ Build with ` -DFRAME_ENABLE_BENCHMARKS=ON ` and run manually:
130+
131+ ``` bash
132+ cmake --build " $BUILD_DIR " --target example_bench
133+ " $BUILD_DIR /benchmarks/example_bench"
134+ ```
135+
136+ Add benchmarks for hot paths, algorithms, and performance-sensitive code.
137+ Use ` FRAME_BENCHMARK(name, iterations) ` from ` benchmarks/frame_bench.h ` .
138+
139+ ## Project Setup
140+
141+ When adapting this frame for a new project, use the init script:
142+
143+ ``` bash
144+ ./scripts/init-project.sh --name " Your Project Name" # dry-run
145+ ./scripts/init-project.sh --name " Your Project Name" --apply
146+ ```
147+
148+ This renames all placeholder targets, namespaces, prefixes, and filenames.
149+
89150## Testing Rules
90151
91152- Keep repo-owned tests deterministic and headless under ` CTest `
153+ - Use the ` frame_test.h ` micro-framework: ` FRAME_TEST(name) ` for registration,
154+ ` FRAME_EXPECT_EQ ` , ` FRAME_EXPECT_TRUE ` , ` FRAME_EXPECT_FALSE ` ,
155+ ` FRAME_EXPECT_THROWS ` for assertions, ` FRAME_RUN_TESTS() ` in main
92156- Keep ` WHAT/HOW/WHY ` commentary near the start of real test bodies; the repo
93157 scripts enforce that contract
94158- Prefer pure helper seams and injected fakes over environment-heavy tests
0 commit comments