with one click
repo-conventions
// Repository layout and naming conventions. Use to find or place files.
// Repository layout and naming conventions. Use to find or place files.
Default response behavior for AI coding agents: professional, factual, neutral tone with calibrated critical evaluation. Baseline for every task — implementation, code review, debugging, planning, research, evaluation, Q&A.
Design and review guidelines for this SDL3 Pong codebase: frame-loop constraints, testable layering, and design patterns. Use when designing new features, populating the ISSUES.md, implementing a task, reviewing a diff or branch, or when the user asks for an architecture or standards check.
Standard end-to-end workflow for working on a task in this repository: branch naming, implement + tests + style, self-review, commit, `docs/ISSUES.md` cleanup, push the branch, and open a PR with `gh`. Use when starting work on an entry from `docs/ISSUES.md` (or, when one is filed, a GitHub issue).
Format and verify C/C++ source style with clang-format.
Run the unit-test suite. Use to run, filter, or disable tests.
Build the project. Use to build, compile, test, or run the project.
| name | repo-conventions |
| description | Repository layout and naming conventions. Use to find or place files. |
| Path | Contents |
|---|---|
src/ | C++ application source. New types live in src/<TypeName>.{h,cpp} directly under src/, or under src/<area>/ once an area grows several related files. |
tests/ | doctest unit tests. One file per area, CamelCase: tests/<TypeName>Test.cpp. The doctest entry point is tests/main.cpp. |
scripts/ | Thin build/test wrappers (build.{ps1,sh,cmd}, test.{ps1,sh,cmd}). |
docs/ | Long-form documentation: ROADMAP.md, ISSUES.md. |
.github/ | CI workflows (.github/workflows/build.yml) and other GitHub config. |
.claude/ | Agent skills under .claude/skills/<skill-name>/SKILL.md. |
CMakeLists.txt | Top-level build definition. The test target is wired up from tests/CMakeLists.txt. |
.editorconfig, .clang-format | Style sources of truth (see the format skill). |
Paddle, Ball, Score): create src/<TypeName>.h and src/<TypeName>.cpp directly under src/. If an area grows enough to need a folder (several related files), promote it to src/<area>/ with the same CamelCase rule for individual files.PONG_SRC variable in the top-level CMakeLists.txt. Use the existing ${CMAKE_CURRENT_SOURCE_DIR}/src/<TypeName>.cpp form so the variable can be consumed from tests/CMakeLists.txt unchanged. Both pong-sdl3-cpp and pong-sdl3-cpp-tests read this single list, so adding a file means editing exactly one place. Entry-point sources (src/main.cpp, tests/main.cpp) stay off the list because each binary supplies its own.target_link_libraries, target_compile_options, Windows DLL-copy steps) are intentionally duplicated between the two targets. Keep the two blocks visually parallel so a reviewer can spot drift in one glance; promote to a helper macro only if they grow.tests/<TypeName>Test.cpp. Append it to tests/CMakeLists.txt so it is compiled into pong-sdl3-cpp-tests; doctest_discover_tests() will register every TEST_CASE automatically. Test sources can #include "<TypeName>.h" directly because both targets carry src/ on their include path.Application lives in Application.h (header) and Application.cpp (implementation). Files that contain no class or struct (entry points, free-function modules) keep their conventional lowercase name; the most common case is main.cpp..h; implementation extension is .cpp.Test suffix: tests for Application go into tests/ApplicationTest.cpp. The doctest entry point stays at tests/main.cpp.pong-sdl3-cpp, pong-sdl3-cpp-tests).TextRenderer.h exposes TextRenderer::drawText, TextRenderer::drawTextCentered, etc.; PlayfieldLayout.h exposes PlayfieldLayout::ball; the constants in Playfield.h live in Playfield::. New modules of this shape (PaddleMotion::stepCenterY, PaddleMotion::clampCenterY) follow the same pattern. The namespace lets function names drop the redundant module prefix (stepCenterY rather than stepPaddleCenterY) and makes the call site self-documenting about which header to include.Paddle.h ships struct Paddle plus the free helpers makePaddle and toFRect; Score.h ships struct Score plus setScore; both stay outside any namespace. The reason is mechanical — a struct Paddle and a namespace Paddle cannot coexist — and conceptual: the helpers belong to the struct's API surface, so the struct name already disambiguates them at the call site. The same applies to class-dominant headers (RandomSourceMt19937).Use American English spelling throughout the project: identifier names, parameter names, code comments, doctest case names, commit messages, PR descriptions, docs/, README.md, and skill files. The same convention applies to agent-to-user communication in chat and PR reviews so the in-repo wording and the conversation around it stay aligned.
Quick reference for the spellings most likely to drift in this codebase:
| Use | Not |
|---|---|
color | colour |
center / centered / centering / centers | centre / centred / centring / centres |
behavior | behaviour |
gray | grey |
modeled / modeling | modelled / modelling |
-ize / -ization endings (optimize, recognize, realize, analyze, emphasize, organize, categorize) | -ise / -isation |
license (both noun and verb) | licence (UK noun) |
defense, meter, theater, honor, favor, labor, neighbor | defence, metre, theatre, honour, favour, labour, neighbour |
judgment | judgement |
The convention is enforced by review, not tooling. When introducing a new identifier or rewriting a comment block, prefer the American spelling from the start rather than relying on a follow-up rename. Pre-existing identifiers that still use British spelling should be renamed in their own focused commit (covering the definition and every call site together) so reviewers can read the rename in isolation.
format skill) and run clang-format -i on touched files so reflow stays consistent."will be revisited by the Paddle-controls milestone"), generic C++ admonitions that apply everywhere ("do not hard-code these outside this header"), parentheticals that re-state the surrounding context ("Static-playfield tuning constants" inside Playfield.h), and (see foo.cpp) cross-references the reader can grep for in two seconds. Keep the comment if it explains this choice or invariant; cut it if it just states a general best practice.// Returns the elapsed time in seconds above double secondsBetween(...) is noise — the signature already says it.Use the wrappers, never hand-rolled cmake/ctest invocations, unless the wrappers are unavailable:
scripts\build.ps1 (Windows) or ./scripts/build.sh (Linux/macOS) — see the build skill.scripts\test.ps1 or ./scripts/test.sh — see the test skill.clang-format -i … / clang-format --dry-run --Werror … — see the format skill.docs/ROADMAP.md.docs/ISSUES.md.README.md.