cpp-class
Skill1 starsChanged 3 days agoMITView on GitHub
Generate C++ (C++20) .hpp/.cpp files and class architectures in Tsukini's style (Xartania header, indented include guards, INCLUDE/CLASS sections, Pre-Function/Function/Operator/Constructor/Destructor blocks, libutils attributes or standard [[...]]), with empty bodies only (never the logic), then register the .cpp in the CMakeLists.txt. Also creates the main.cpp entry point in the same style. Use whenever the user asks to create, scaffold or add a C++ class, a main / entry point, interface (I*), abstract class (A*), template, struct/Type or Define header, module or set of .hpp/.cpp files.
In this repository70 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- ask-at-endSkill
- clarifySkill
- continue-workSkill
- exportSkill
- full-permissionSkill
- ideationSkill
- interactive-questionsSkill
- onboardSkill
- pauseSkill
- presentationSkill
- rtkSkill
- setup-contextSkill
- write-like-meSkill
- audit-bugsSkill
- audit-depsSkill
- audit-qualitySkill
- audit-securitySkill
- benchmarkSkill
- cmake-styleSkill
- cpp-commentsSkill
- cpp-projectSkill
- cpp-styleSkill
- better-explain-docSkill
- better-html-docSkill
- better-html-styleSkill
- better-protocol-docSkill
- docs-updateSkill
- explain-docSkill
- html-docSkill
- html-styleSkill
- protocol-docSkill
- readme-styleSkill
- reportSkill
- wiki-styleSkill
- ci-cdSkill
- git-commitSkill
- git-conventionsSkill
- pre-commitSkill
- legal-checkSkill
- legal-setupSkill
- licenseSkill
- libutils-exceptionSkill
- libutils-installSkill
- libutils-setupSkill
- libutilsSkill
- python-classSkill
- python-commentsSkill
- python-projectSkill
- python-styleSkill
- auditSkill
- cppSkill
- devSkill
- docSkill
- gitSkill
- legalSkill
- pythonSkill
- setup-projectSkill
- styleSkill
- setup-studioSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 4 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
Read before writing the first file:
- Very specific: line 56
Default: include/<root>/<section>/X.hpp and src/<root>/<section>/X.cpp.
- Distinctive: line 63
Always ask the header question, in French, and add in the same call any missing info from step 1 (name, module, kind, namespace when …
- Very specific: line 65
Xartania (Recommandé): default XARTANIA banner.
- Distinctive: line 68
Aucun header: no header at all.
- Distinctive: line 70
Ask it once per request, even when many files are generated.
- Very specific: line 92
Start from the matching template, replace the placeholders: {{HEADER}} header output, {{GUARD}} upper-cased name without separators, …
- Very specific: line 105
Remove every section with nothing linked to it (class blocks // --- X --- //, file sections /* DEFINE */, /* PROTOTYPE */..., empty …
- Very specific: line 128
When xstyle is installed (command -v xstyle): xstyle --rtk <created files> (always --rtk: compact output made for the assistant), xstyle …
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
C++ files in Tsukini's style
<name> (a skill) = the folder of that skill: ~/.claude/skills/<name> (setup.sh) or ${CLAUDE_SKILL_DIR}/../../*/<name> (plugin of the marketplace).
Read before writing the first file:
reference/layout.md: file/class layout, header, includes, attributes, empty bodies rule;- the
cpp-styleskill (SKILL_DIR/../cpp-style/SKILL.md): naming, formatting, spacing; - the
cpp-commentsskill (SKILL_DIR/../cpp-comments/SKILL.md): comments. The files ofexamples/(real libutils code) are the ground truth for the layout.SKILL_DIRbelow = the directory of this file.
libutils freshness
First, once per conversation: the freshness check of the libutils skill (bash <libutils skill>/scripts/check.sh,
section "Freshness check" of libutils/SKILL.md). Outdated -> reuse the answer already given in this conversation,
else ask once (continue / update the installed libutils with libutils-install / the project's requirement with
libutils-setup / the skills reference) and remember it.
Architecture only: never write the content/logic of a function. Every body is
/* Nothing */(+ the minimalreturn {};when non-void), even if the user describes the behavior: it goes in a trailing comment of the declaration. The user writes the logic. Allowed:= default/= delete/= 0, init lists forwarding the parameters, one-member accessors, a public wrapper forwarding to itsname_implementation. Details inreference/layout.md.
1. Understand the request
- Name(s), module/folder, kind of each file:
kind files template class X.hpp+X.cpptemplates/class.hpp,templates/class.cpptemplate / header-only X.hpptemplates/template.hppinterface IX.hpptemplates/interface.hppabstract AX.hpp(+AX.cppif it has Pre-Functions)templates/abstract.hpptypes XType.hpptemplates/type.hppdefines / enums XDefine.hpptemplates/define.hppfamily / umbrella X.hpp(includes the family, no namespace)templates/family.hppentry point src/<root>/main.cpp+ the core class (Coreor the project class)templates/main.cpp(main-std.cppinstdmode) - Entry point (new project, or when asked for a
main):src/<root>/main.cppfromtemplates/main.cpp(the same in context-forge, virtual-os, cpp_project_template): it only creates the core class, callsinit(argc, argv)thenrun(), catchesutils::exception::IException(Exitcode ->OK, otherwise printformated()and returnKO) thenstd::exception(printwhat(), returnKO), and returnscore.exit()(return OK;when the core class has noexit). Signature_cold int main(int argc, char* argv[])(never_nodiscard, neverconst char*argv: not a standardmainform). This wiring is the only body written by the skill. Create the core class with it if it doesn't exist:void init(int argc, const char *const argv[]);,void run(void);,int exit(void) const;as Pre-Functions with empty bodies. Registermain.cppfirst inSRC, under# Entry(cmake_add.py ... --group Entry).stdmode:templates/main-std.cpp(std::exception,EXIT_FAILURE). - An "architecture" (ex: "a socket with an interface, an abstract and a TCP impl") = several of the above,
chained
IX->AX: public IX->X: public AX. - Project layout: find the project root (closest
CMakeLists.txt) and follow the existing tree. Default:include/<root>/<section>/X.hppandsrc/<root>/<section>/X.cpp. - Namespaces: apply the "Namespaces" section of
reference/layout.md(root = project name, one level per section folder, grouping folders skipped, a familyI/A/implfolder stays in the parent namespace, internals in a nested namespace, family umbrella headertemplates/family.hpp). Write the planned treeinclude/<path>/X.hpp -> namespacebefore generating.
2. Ask (one AskUserQuestion call, before writing anything)
Always ask the header question, in French, and add in the same call any missing info from step 1 (name, module, kind, namespace when ambiguous). Header question:
- Xartania (Recommandé): default
XARTANIAbanner. - Nom personnalisé: banner with another name (the user types it with "Other", or ask it right after).
- Sans bandeau: header box (Edition / File Name / File Description) without the ascii banner.
- Aucun header: no header at all.
Ask it once per request, even when many files are generated.
3. Detect the attributes mode
bash SKILL_DIR/scripts/detect_libutils.sh <project_root>internal-> libutils macros, Attribute include relative in headers.libutils-> libutils macros, everything from libutils through#include <utils/utils.hpp>(never a libutils header one by one, except the onesutils.hppdoes not give like the observers; see "libutils includes" inreference/layout.md).std-> standard[[...]]attributes (mapping table incpp-style), no Attribute include. Same logic for errors: libutils exceptions only ininternal/libutilsmode. Any attribute (alignment_alignas(std::hardware_destructive_interference_size)included) follows the lookup order ofcpp-style"Attributes": libutils default macros, then the ones really available in the project / system (bash SKILL_DIR/scripts/list_attributes.sh <project_root>), then only the standard[[...]]form.
4. Generate each file
- Header (skip if "Aucun header"):
python3 SKILL_DIR/scripts/header.py --file X.hpp --banner xartania|none|"<NAME>" --desc "<one line>".hpp: a real one-line description..cpp: omit--desc(default sentence) unless asked. - Start from the matching template, replace the placeholders:
{{HEADER}}header output,{{GUARD}}upper-cased name without separators,{{NAMESPACE}},{{CLASS}}/{{NAME}},{{UTILS_SECTIONS}}(libutilsmode: one#define _Sectionline per libutils section used by the file, indented like the includes in a header, table inreference/layout.md"libutils includes"; removed ininternal/stdmode),{{UTILS_INCLUDE}}(with its delimiters:<utils/utils.hpp>inlibutilsmode,"../attribute/Attribute.hpp"relative ininternalmode),{{UTILS_INCLUDE_ROOT}}(.cpp:<utils/utils.hpp>, or"utils/attribute/Attribute.hpp"ininternalmode),{{HPP_INCLUDE_ROOT}}(path frominclude/),{{KIND}}(group label of the implementations in a family header). The template members/methods are placeholders: replace them by the real API asked by the user (keep the block order and comments style), remove the include lines that become unused, and keep the include comments aligned. - In
stdmode, convert every macro (_hot->[[gnu::hot]], ...) and drop the Attribute include. - Bodies: always empty (
/* Nothing */+ minimal return), never logic, see the rule at the top; an empty constructor / destructor / operator defined in its class on one line:Name(...): _a{a} { /* Nothing */ }; // comment(:glued to the)). - Remove every section with nothing linked to it (class blocks
// --- X --- //, file sections/* DEFINE */,/* PROTOTYPE */..., empty visibilities and/* group */labels): the template blocks are not mandatory, only the ones holding a declaration are kept. - Short functions (getters, setters, accessors,
name_forwarders, any single-statement body) go in theFunctionblock of the.hppwithinlineafter the attributes, not in the .cpp, when it can help the compiler inline them (not onvirtualmethods). Rules inreference/layout.md. - Private / protected / internal functions are named
<name>(<Name>)*_(camelCase + trailing_:allocate_,computeHash_), public methods plain camelCase (cpp-stylenaming table).
5. Register the sources in CMake
For each new .cpp:
python3 SKILL_DIR/scripts/cmake_add.py <project_root>/CMakeLists.txt src/<path>/X.cppIt inserts the file next to the files of the same folder (or in a new ## Module (sub-part: x) block),
does nothing if already listed or if sources are collected with file(GLOB ...). Exit code 2 = no
source list found: add it by hand in the right add_executable/add_library/target_sources.
6. Check
- Syntax check every new
.cpp(and header-only.hpp) when a compiler is available:clang++ -std=c++20 -Wall -Wextra -Wno-unused-parameter -fsyntax-only -I<project_root>/include <file>(g++as fallback). Fix every error/warning caused by the generated code (the unused parameters of the empty bodies are expected, never silence them in the code). - When
xstyleis installed (command -v xstyle):xstyle --rtk <created files>(always--rtk: compact output made for the assistant),xstyle --rtk --fix [CODES] <files>for the fixable ones; what it can't see (logic in a body,inline, names ending with_) is still checked by hand below. - Re-read the files against
reference/layout.mdandcpp-style(braces,(void),this->,;after one-liners, one-liner bodies aligned tight (longest signature + 1 space), aligned include comments, section separators, guard name, namespace comments) and check that no body contains logic, that no section separator is left empty and that the short non-virtual functions areinlinein the header, and that every non-public function ends with_. - Report the created files, the attribute mode used and the CMake change.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

