Isurwars/Correlation / .agents/skills/tdd
tdd
VerifiedTest-driven development (Red-Green-Refactor) and self-correcting build-test loop. Use when implementing new functionality, writing tests before code, or iterating on test failures.
Test-Driven Development (TDD) Loop
Automated build → diagnose → fix → retest loop for the Correlation C++ and Python suites using CMake, Google Test, and pytest.
Phase 1: Build Target & Test Selection
Select the appropriate build target or test suite based on the scope of changes:
| Changed Files | Target / Suite | Execution Command |
|---|---|---|
src/calculators/**, src/core/**, src/readers/**, src/writers/**, src/analysis/**, src/math/**, include/** | correlation_unit_tests | ctest --test-dir build -R correlation_unit_tests --output-on-failure |
tests/functional/** | correlation_functional_tests | ctest --test-dir build -R correlation_functional_tests --output-on-failure |
ui/**/*.slint, src/app/** | correlation_gui_tests | ctest --test-dir build -R correlation_gui_tests --output-on-failure |
src/bindings/**, python/** | Python Bindings Suite | .venv/bin/pytest tests/test_*.py |
| Multiple scopes or uncertain | Build all C++ targets | cmake --build build -j$(nproc) && ctest --test-dir build --output-on-failure |
Phase 2: The Self-Correction Compilation Loop
-
Build:
cmake --build build --target <target> -j$(nproc) -
On Build Failure:
- Parse first compiler error only (cascading errors are symptoms).
- Use
[File:Line] -> [Error Type] -> [Fix Action]diagnostic format. - For syntax/type errors: navigate to exact file/line and fix.
- For linker errors: inspect
CMakeLists.txttarget linkage. - For Slint generation errors: check
.slintsyntax and property types.
-
Loop Limit: Stop and alert the user after 3 consecutive failures on the same root cause.
Phase 3: Test Execution & Verification
Once the build compiles with 0 errors:
- Execute: Run the compiled test binary or test runner.
- On Test Failure:
- Parse Google Test / pytest output for
FAILEDassertions. - Fix the source code, not the test (unless the test logic is fundamentally incorrect).
- Re-run only the failing test suite, not the entire battery.
- Parse Google Test / pytest output for
- Final Verification:
- Re-run the full target test once all individual failures are resolved.
- Confirm
[ PASSED ]with zero failures before declaring completion.
Phase 4: Post-Verification Cleanup
- Run
clang-format -ion all modified.cpp/.hppfiles. - Run
graphify update .if source files were added, renamed, or modified. - Present final success state with test count summary.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |