Skip to content

Commit da5f440

Browse files
authored
Add doxygen comment guidance to AGENTS.md (#13112)
This adds a Doxygen Comments section to AGENTS.md describing the conventions agents should follow when documenting code with doxygen style comments.
1 parent 7e9aa23 commit da5f440

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

AGENTS.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,38 @@ SMDebug(dbg_ctl, "Processing request for URL: %s", url);
308308
- UPPER_CASE for macros and constants: `HTTP_SM_SET_DEFAULT_HANDLER`
309309
- Private member variables have the `m_` prefix.
310310

311+
**Doxygen Comments:**
312+
313+
When adding doxygen comments:
314+
315+
- `@brief` is assumed for the first sentence, so give a brief summary right
316+
after `/** ` without using `@brief`.
317+
- In the description of classes, functions, and member variables, convey the
318+
responsibility of the item being described (its role and intent), not just
319+
what the code obviously does.
320+
- Use `@a <name>` to reference a function argument by name in prose
321+
(e.g. "If @a size is zero..."). Use `@c <text>` for inline code or
322+
constants (e.g. `@c true`, `@c NULL`, `@c MyEnum::VALUE`).
323+
- Use `@ref`, `@see`, or `@sa` to cross-reference related types or functions
324+
when that helps convey how items interact.
325+
- Use `@param` with `[in]`, `[out]`, or `[in,out]` to indicate the
326+
parameter's direction, followed by a description of its meaning.
327+
- Use `@return` to describe the semantics of the returned value. Don't
328+
restate the type; that is obvious from the signature and rendered docs.
329+
- Use `@note` for non-obvious caveats and `@warning` for hazards (e.g. lock
330+
ordering, lifetime, or threading constraints).
331+
- Use `@code` ... `@endcode` for embedded usage examples.
332+
- For templates, document type parameters with `@tparam`.
333+
334+
Conventions specific to this codebase:
335+
336+
- Every new header file should start with a `/** @file` block (see existing
337+
headers in `include/` for the standard license/section layout).
338+
- Prefer trailing briefs for data members and enumerators, e.g.
339+
`int max_conns{0}; ///< Maximum concurrent connections.`
340+
- Use single-line `///` briefs for short function or type docs where a full
341+
`/** ... */` block would be overkill.
342+
311343
**Modern C++ Patterns (Preferred):**
312344
```cpp
313345
// GOOD - Modern C++20

0 commit comments

Comments
 (0)