TsukiNi22/ai-utils / skills/cpp/cpp-project
cpp-project
UnverifiedSet up a new C++20 project in Tsukini's way with the setup.sh of the cpp_project_template repository (TsukiNi22/cpp_project_template) - name / core class renaming, kind of project (binary, static .a or shared .so library, header-only; RPM/DEB/Arch packages of every variant, Windows MinGW-w64 build and packages), libutils v4 or not, exception codes, GTest tests, the CI/CD workflows of the template (dispatch, unit tests, build, packages, GitHub release from the CHANGELOG, docs) and the optional gh-pages branch (signed packages repository + docs), install script, README/CHANGELOG/docs written by the template, xstyle pre-commit hook - using the other skills (cmake-style, cpp-class, libutils-exception, readme-style, git-conventions, ci-cd, html-doc). Use whenever the user wants to create, bootstrap, initialize or scaffold a new C++ project or repository.
New C++ project
<name> (a skill) = the folder of that skill: ~/.claude/skills/<name> (setup.sh) or ${CLAUDE_SKILL_DIR}/../../*/<name> (plugin of the marketplace).
The base is always cpp_project_template and its own setup.sh (local clone
~/personal_delivery/cpp/cpp_project_template, otherwise https://github.com/TsukiNi22/cpp_project_template.git): it
renames, adapts the copy to the kind, writes the README, the CHANGELOG, the docs and the gh-pages branch. This skill
drives it without git actions, then completes what it does not do (libutils freshness, no-libutils, .gitignore, the
custom CI/CD, the checks). Skill synced with the template at d3fd2a1 (2026-10-30: the packages setup.sh only registers the mirror, --install installs; before: Arch Linux packages, xstyle pre-commit hook, setup workflow fixes; before: Windows build, one CMake for
every kind, SRC / SRC_SHARED, workflows dispatch / unit-tests / build / build-packages / release / docs, gh-pages,
install.sh, CHANGELOG written by setup.sh, libutils >= 4.1.0): when its HEAD is newer
(git -C <clone> log --oneline 7fa7c9f..HEAD, and origin/main after a git fetch), read its README (Quick Setup,
Generated project, Workflows/Release) and its setup.sh --help before relying on the steps below.
The other skills, each loaded when its step comes: cmake-style (CMake), cpp-class (classes, header question, main),
libutils-exception (codes), readme-style, git-conventions (CHANGELOG, commits, branches), ci-cd, html-doc.
SKILL_DIR = 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. The template needs libutils 4.1.0 at least
(set(LIBUTILS_VERSION 4.1.0): the Windows packages mingw64-libutils*); older installed -> libutils-install.
1. Ask (one AskUserQuestion call, French)
Name and core class (PascalCase) are usually in the request: ask in plain text if missing. Both are C++
identifiers ([A-Za-z_][A-Za-z0-9_]*: my_project, never my-project), neither a C++ keyword nor std / utils,
nor testing / Test (GoogleTest): the script refuses them, ask another name.
- Type de projet:
Binaire (Recommandé)·Bibliothèque (.a / .so + headers)·Header-only. For a library, ask after: static.a(default) or shared.so(<NAME>_SHARED_LIB=ON). A binary that also ships its library and headers:<NAME>_PACKAGE_LIB=ON+<NAME>_PACKAGE_DEV=ON(step 3). - Publication (GitHub repository only):
Sans gh-pages (Recommandé)(the packages stay artifacts of the runs) ·Branche gh-pages(signed RPM/DEB/Arch repository + the docs onhttps://<owner>.github.io/<repo>/, needs the GPG secrets and GitHub Pages). - CI/CD (GitHub only, see section 5):
Workflows du template (Recommandé)·Personnalisée (ci-cd)·Aucune. - libutils:
Oui (Recommandé)·Non. - Extras (multiSelect):
Dépôt GitHub (git init + gh)·Doc HTML (html-doc, au-delà du placeholder)·Classes / modules en plus (cpp-class). Plus the header banner question ofcpp-class(once, reused for every generated file). The Windows build and the unit tests come with the template (nothing to ask): only say it.
2. Generate
bash SKILL_DIR/scripts/new_project.sh <dir> <name> <Core> --kind binary|library|header-only \
--gh-pages|--no-gh-pages [--repo <owner/repo>] [--no-libutils]
It copies the committed files of the local clone (git archive HEAD, never its work in progress) or clones the
repository, runs the template's setup.sh in <dir> with every choice given (no question, never --push), then
removes the exception generation for --no-libutils and fills the .gitignore block (section 6). <dir> is created;
an existing one may only hold a .git, a LICENSE or hidden files. --repo: the GitHub owner/repo (default: the
origin remote of <dir>, else TsukiNi22/<name>), written in the CMake, the workflows, the docs, the packages
repository. What setup.sh does (template README, Quick Setup):
- renames
template-><name>,TEMPLATE_-><NAME>_,Core-><Core>,CORE_H-><CORE>_H(whole words, files, folders, sources, CMake, workflows, scripts,Doxyfile), the header dates set to today; - the kind:
<NAME>_KINDof the CMake, thePACKAGE_BIN/PACKAGE_LIB/PACKAGE_DEVofbuild.ymlandbuild-packages.yml;library: nomain.cpp;header-only: nosrc/, the class defined in its header, its test rewritten; - writes
README.md(dependencies, packages, setup, usage, workflows),CHANGELOG.md(first entry## v1.0.0 - <date>, thegit-conventionsformat read by the release workflow) anddocs/(technical page placeholder + the project graph); - gh-pages: the packages setup script as root
setup.sh(frominstall.sh: mirror + GPG key only,--installto also install the package,--pre,--windows,--no-sudo), keepsdocs.ymland the publication job,git init -b mainwhen needed and creates thegh-pagesbranch (seed<name>.repo,RPM-GPG-KEY-tsukini,Sync Packages (CD),docs/) without touching the working tree nor committingmain; without:install.shanddocs.ymlremoved.
3. Adapt (rules of cmake-style)
The generated CMakeLists.txt is final for the three kinds: options at the top (<NAME>_KIND, <NAME>_PACKAGE_BIN,
<NAME>_PACKAGE_LIB, <NAME>_PACKAGE_DEV, <NAME>_SHARED_LIB, <NAME>_STABLE_RELEASE, BUILD_TESTS), libutils,
exception header, release / install_release / package_release targets, CPack (RPM/DEB + Arch .pkg.tar.zst, -op / -db / -as
variants, -dev, global package, mingw64- packages for Windows). Never replace it by the cmake-style templates.
- Sources:
SRC= the executable only (main.cpp),SRC_SHARED= the executable and the library (<Core>-init.cpp,<Core>.cpp, every new module). A new.cppgoes in one of them (cpp-class,cmake_add.py);get_unregistered_fileslists the missing ones. - Package options changed (a binary shipping its library:
<NAME>_PACKAGE_LIB=ON, the executable linked on<name>_lib): updatePACKAGE_BIN/PACKAGE_LIB/PACKAGE_DEVof.github/workflows/build.ymlandbuild-packages.ymlthe same way. - Without libutils (
--no-libutils):main.cppfromcpp-class/templates/main-std.cpp,<Core>-init.cppreduced to an emptyinit, removefind_package(utils ...),utils::utils, the exception blocks andinclude/exceptionfrom the CMake andtests/CMakeLists.txt, thelibutils-devrequirement of the packages (cmake-style); attributes instdmode (cpp-class). The workflows' containers still work (libutils unused). - New classes / modules asked with the project:
cpp-class(empty bodies,SRC_SHAREDregistration). - Windows (always there): cross compiled from Linux with the template's toolchain
cmake -S . -B build-windows -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain/mingw-w64.cmake -DCMAKE_BUILD_TYPE=Optimized(needsmingw64-gcc-c++ mingw64-libutils,libutils-install windows),<name>.exeat the root,mingw64-<name>*packages withpackage_release, no-asvariant. Portable code only: system calls throughutils::platform::,<windows.h>before<utils/utils.hpp>,#if UTILS_WINDOWSfor what differs (rules oflibutils, Platforms).
4. Exceptions & tests
- Exceptions (libutils only):
cmake/config/exceptions/global.json+cmake/scripts/+ the CMake block come with the template; replace the example codes by the project ones withlibutils-exception. A library exposing its own codes installs the generated header (seelibutils-exception), otherwise theInternalCodeof libutils. - Tests:
tests/CMakeLists.txt+tests/<name>/<Core>.cppcome with the template (-DBUILD_TESTS=ON,unit_testsat the root, linked on<name>_libor built fromSRC_SHARED, GTest fetched from the sources when cross compiling, run underwinebyctest). More tests:cpp-tests.
5. CI/CD
The template's workflows are kept as generated when the project is a GitHub repository (git remote -v shows
github.com, or the Dépôt GitHub extra was chosen):
| Workflow | What |
|---|---|
dispatch.yml | every push on main / tag v* (not *.md / *.txt / docs/ only): decides what runs from the ref / message |
unit-tests.yml | always first: Linux (unit-tests image) and Windows (mingw64-unit-tests, under wine) |
build.yml | build check only (Linux ci, Windows mingw64-ci) when no packages are built |
build-packages.yml | RPM/DEB/Arch (+ mingw64-*), checked against PACKAGE_*; gh-pages: signed and published (5 last -pre kept) |
release.yml | the GitHub release of a tag from its CHANGELOG.md section (## vX.Y.Z - date / ## [vX.Y.Z-pre] - date) |
docs.yml (gh-pages) | docs/ copied on gh-pages at each push changing it |
- Triggers (
git-conventions):[build]in a commit or a tagvX.Y.Z-<suffix>= pre-release packages (-pre), a tagvX.Y.Z= stable packages + GitHub release (its CHANGELOG section must exist),[ignore]= no CI,[release]= the commentednotify-downstreamjob (arepository_dispatchexample). Personnalisée: theci-cdskill (load it) on top of these files (style check with xstyle, coverage...): it edits them, never rewrites them from scratch.Aucune: remove.github/workflows/. Without GitHub: no workflow, say it.- To tell the user (never created / pushed without an explicit request): repository variable
RUNNER(gh variable set RUNNER --body <runner>), the containersghcr.io/tsukini22/ci,unit-tests,mingw64-ci,mingw64-unit-tests,package,git; gh-pages: secretsGPG_PRIVATE_KEY(base64),GPG_KEY_ID,GPG_PASSPHRASE, GitHub Pages ongh-pages(gh api -X POST repos/<owner>/<repo>/pages -f 'source[branch]=gh-pages' -f 'source[path]=/'),git push origin gh-pages;DOWNSTREAM_REPO_TOKENonly when the downstream job is enabled.
6. .gitignore of the produced files
After the CMake is final (and after every change of targets/outputs):
python3 SKILL_DIR/scripts/update_gitignore.py <dir>
It reads the CMake (and its add_subdirectory) and keeps a managed block in .gitignore with what the build writes
in the sources: executables written at the root (/<name>, /<name>.exe, /unit_tests), plugins/libraries written in
the sources (/plugins/rules/*.so...), generated files (exception header, configure_file outputs), packages
(*.rpm, *.deb, _CPack_Packages/ when CPack is used) and /build*; lines already ignored (even by a global
*.so) are not repeated, the block is regenerated at each run. Other custom outputs (data files, logs, generated
assets of the project): add them under the block in a ## <Name> group like the existing ones.
7. Docs & repository
- README and CHANGELOG are written by
setup.sh: complete them (readme-style: what the project does, its usage), keep the CHANGELOG format (git-conventions, the release workflow reads it).docs/index.htmlis a "coming soon" placeholder: the real page withhtml-docwhen chosen;docs/graph.htmlrefreshes itself from the repository. - Pre-commit hook:
setup.shcopies.githooks/pre-commit(xstyle; lighter settings:SCOPE=staged,FAIL_ON=major,WARN_ON=minor), runsgit init -b mainwhen needed and setscore.hooksPath .githooks(a new clone:git config core.hooksPath .githooks). Skip once:git commit --no-verify/XSTYLE_HOOK=0; without xstyle it only warns. Thepre-commitskill changes its options. Mention it to the user: the first commit of the project goes through it. - Repository only on request:
git init -b main(already done bysetup.sh: hook),gh repo create <owner>/<name> --public --source . --remote origin, first commitchore: setup c++20 project from cpp_project_template(git-conventions, no AI attribution); team project ->devbranch + protection ofmain(git-conventions).
8. Check
make(orcmake -S . -B build && cmake --build build), run the binary (./<name> --help),-DBUILD_TESTS=ON+ctest,cmake --build build --target get_unregistered_files(no unregistered.cpp).- Windows: the toolchain build above, then
WINEPATH=/usr/x86_64-w64-mingw32/sys-root/mingw/bin wine ./<name>.exe --help. - Library:
cmake --install build --prefix <tmp>thenfind_package(<name>)from a tiny consumer. git status --ignored --shortafter a build: every produced file is ignored, no source is.- No placeholder left:
grep -rnwE 'template|Core|TEMPLATE_' --exclude-dir=.git --exclude-dir=build .(thedocs/graph andinclude/utils/aside); workflows valid (python3 <ci-cd>/scripts/check_workflows.py .github/workflows/*.yml). - Report: created tree, kind, gh-pages or not, CI/CD and what the user still has to configure (variable, secrets,
Pages, the push of
gh-pages).
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 318k | Updated | Claude CodeCodex | Unverified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 318k | Updated | Claude CodeCodex | Unverified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 318k | Updated | Claude CodeCodex | Unverified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |