Follow these code style and documentation rules exactly.
- File-Level Documentation
- Each header/source should have a top Doxygen file block:
/** \file * \brief * * \ingroup */ - the group for a file is usually xxxxxx_files, which is a subgroup of xxxxxx.
- do not include the \author tag
- Include Guards and Includes
- Match existing project include-guard naming convention.
- Keep include ordering consistent with project style.
- Do not introduce new include style unless project already uses it.
- Function Declaration Documentation
- Every public or otherwise Doxygen-discoverable function declaration must have a brief
///summary. - Add a short
/** ... */details block only when needed. - Document every parameter inline at declaration site using:
type name /**< [in] description */
- Apply to normal methods, constructors, slots, and signals.
- Keep return-value docs where project uses them.
- Document file-local and other deliberately hidden implementation helpers in the same concise prose style, but use
ordinary
//and/* ... */comments so they do not enter the generated API documentation.
- Member Variable Documentation
- Document non-trivial class members with
///. - Describe role/ownership/state, not just type.
- Naming and Structure
- Use project member naming convention (e.g.
m_prefix). - Keep declaration ordering/grouping stable:
- public/protected/private
- slots/signals grouped consistently.
- Leave a blank line between declarations for readability.
- Header vs Source Placement
- Keep non-trivial definitions out of headers.
- Move implementations to
.cppunless intentionally inline.
- Editing Discipline
- Preserve existing behavior unless explicitly requested.
- When renaming members/APIs, update all dependent call sites.
- Keep changes minimal and scoped.
- Formatting and Verification
- Run
clang-formaton touched files. - Ensure docs and naming are consistent after formatting.
- Report any places where project style is ambiguous before making assumptions.
- Doxygen Named Section Ordering
- For classes that expose configuration via member data + accessors, keep named sections split into:
... - Datafor protected/private member state...(without- Data) for public access functions
- Place the
... - Datasection before the corresponding public accessor section.
- Header Declaration Parameter Docs
- In headers, prefer inline parameter documentation on declarations (
type name /**< ... */) rather than separate\paramlists, unless there is a specific reason to deviate.
- PR Prompt Attribution
- At the top of PR descriptions, include an explicit attribution line when work was performed with Codex.
- Preferred format:
This work was performed by GPT-5.3-Codex in response to the prompt: "...".
- Include the primary user prompt verbatim (or a faithful condensed version if it is extremely long).
- Unit Test Documentation
- Use Catch2
TEST_CASEfor every top-level test. Do not add or retainSCENARIOorSCENARIO_METHODdeclarations. - Add a brief Doxygen block immediately before every Catch2
TEST_CASE, which matches the TEST_CASE name exactly. This is so that the brief matches the Catch2 test name to run it. - Use \ingroup to place this TEST_CASE under the appropriate unit testing group
- Example:
/// Test error_t boolean operators and functions /** * \ingroup error_error_unit_tests */ TEST_CASE( "Test error_t boolean operators and functions", "[error::error]" ) - When additional explanation is needed, in the main documentation block State the behavior being verified and identify the real production API under test.
- Let Doxygen discover real calls in the test body so the test appears in each production API's
Referenced bylist. - Do not use
\testor prose-only\refcommands to manufacture test-to-API links. - Keep Catch2 assertion macros lexically inside the
TEST_CASEorSECTIONbody; do not placeREQUIRE,CHECK, or related assertions in helper or wrapper functions. - Helpers may prepare inputs and compute comparisons, but return named values to the test body for local assertion. Prefer numeric actual/error and expected/tolerance members over a single opaque boolean so Catch2 reports useful expanded values.
- Use
CAPTUREorINFOat the local assertion site to identify loop parameters, backend choices, and other case context.
- Preserve Doxygen Links Through Test Harnesses
- Preserve Doxygen links to the real production APIs when test fixtures, wrappers, namespaces, macros, or private-access techniques prevent automatic symbol linking.
- Add explicit Doxygen-only code references to the production symbols inside the relevant test body when direct calls are otherwise hidden.
- Guard reference-only code with
#ifdef __DOXY_ONLY__so it need not compile, and use raw calls or member references that Doxygen can add to the production symbol'sReferenced bylist. - Hide harness-only helpers from generated documentation with
\condand\endcondwhen they would dominate or obscure production API links. - Disable
clang-formataround non-compiling Doxygen-only reference blocks when necessary.
- Function Argument Ordering
- For functions that write caller-owned results, place output-only arguments before the semantic inputs.
- This keeps call sites analogous to
y = f(x), with the value being written on the left and the inputs on the right. - Reusable workspaces and other stateful input/output support objects may follow the semantic inputs when that keeps the numerical call readable and matches the surrounding API family.
- Preserve required ordering for language operators, callbacks, overrides, and external or compatibility-constrained APIs.
When you finish:
- Summarize what changed.
- List affected files.
- Note any follow-up items or potential edge cases.