cpp-stylelisted
Install: claude install-skill TsukiNi22/ai-utils
# Tsukini C++ coding style
Extracted from the recent libutils code (C++20, clang++, `-W -Wall -Wextra -Wpedantic -Wshadow`).
When editing an existing file, its local style wins over this document.
File/class layout (header, sections, blocks): the `cpp-class` skill. Comments: the `cpp-comments` skill.
## Naming
| Element | Style | Examples |
|---|---|---|
| class / struct / enum / alias | PascalCase | `IdHandler`, `ParsedUsage`, `ParsedUsages` |
| interface / abstract | `I` / `A` prefix | `ISocket`, `ASocket` -> `TCPSocket` |
| method | camelCase, verb first | `setPayloadSeparator`, `getFd`, `hasRecvOverload`, `resetUsages` |
| private / protected / internal function (wrapper impl included) | `<name>(<Name>)*_`: camelCase + trailing `_` | `allocate_`, `cancel_`, `computeHash_`, `readChunkHeader_` |
| free tool function | snake_case | `is_ip`, `resolve_hostname`, `rotate_point_3D` |
| hook / callback function | camelCase | `defaultHelpHook`, `defaultInt32ParsingHook` |
| member | `_camelCase` | `_usedIds`, `_helpHook`, `_fd` |
| local variable / parameter | camelCase (bool included), short names fine in small scopes (`i`, `j`, `f`, `it`, `e`, `s`) | `alreadyFailed`, `equalFound`, `argOrigin` |
| special bool parameter (a mode / switch with a default value) | snake_case, **only** for these | `const bool safe_mode = true`, `const bool ignore_case = false`, `failsafe` |
| macro / define | UPPER_SNAKE | `SOCKET_CHUNK_SIZE`, `OVERFLOW_LIMIT` |
| attribute macro (libutils) | `_lowe