本文へ移動
cccskills
無料GitHub で公開

cpp-project-setup

Modern C++ project setup: CMake/CMakePresets, vcpkg, Ninja, VS Code/clangd, GoogleTest, clang-format/tidy, Doxygen, CI, macOS/Linux/Windows. Use for bootstrapping or modernizing host-side C++ apps and libraries; prefer embedded-project-setup for MCU firmware and cross-debug flows.

インストール方法を見る

含まれるファイル(10)

  • SKILL.md5.4 KB
  • agents/openai.yaml359 B
  • assets/CMakeLists.txt928 B
  • assets/CMakePresets.json6.6 KB
  • assets/extensions.json157 B
  • assets/settings.json260 B
  • assets/vcpkg.json92 B
  • evals/evals.json3.2 KB
  • references/cpp-project-blueprint.md6.0 KB
  • scripts/scaffold_cpp_project.py30.4 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Modern C++ Project Setup

Overview

Create or modernize a C++ project around a reproducible toolchain:

Git -> GitHub -> VS Code -> CMakePresets + vcpkg -> Ninja -> compiler -> tests/lint/docs

Prefer project-local, repeatable setup over global machine assumptions. First classify the user's working directory and host platform, then either generate a greenfield scaffold or patch the existing project without erasing its current pipeline.

Workflow

  1. Determine the user's working directory and whether a project already exists.

    • Check the user-provided path or current working directory before writing files.
    • Treat the directory as an existing project if it already has source files, CMakeLists.txt, build scripts, package metadata, editor config, CI, docs, or a git history.
    • For existing work, inventory the full development pipeline before editing: build system, dependency manager, compiler and standard, presets/tasks/scripts, tests, format/lint/static analysis, docs, debugger/editor integration, CI, packaging/install rules, and generated artifacts.
    • For greenfield work, default to an app plus reusable library target, C++20, Ninja, vcpkg manifest mode, GoogleTest, clang-format, clang-tidy, Doxygen, and VS Code settings.
    • If the request is about MCU firmware, OpenOCD, linker scripts, startup code, arm-none-eabi, or Cortex-Debug, switch to embedded-project-setup.
  2. Detect the user's host development environment.

    • Determine OS and architecture: macOS/Linux/Windows plus arm64 or x64. Use local commands such as uname -s, uname -m, sysctl -n machdep.cpu.brand_string, or PowerShell/.NET runtime information where appropriate.
    • Select a host profile: macos-arm64, macos-x64, linux-x64, linux-arm64, windows-x64, or windows-arm64.
    • If the agent is running somewhere other than the user's real development machine, ask for the user's OS/architecture instead of assuming the sandbox matches their workstation.
  3. Generate or update the project.

    • For greenfield scaffolding, run from this skill directory:
python3 scripts/scaffold_cpp_project.py \
  --name my_app \
  --out /path/to/workspace/my_app \
  --host-platform macos-arm64
  • The scaffold script renders reusable standard configuration from assets/ for CMake, CMake presets, vcpkg, and VS Code. Update those assets when the shared project standard changes; update the Python script when generation logic, arguments, or dynamic source files change.
  • For existing projects, use references/cpp-project-blueprint.md as a checklist and adapt to the repository's current style instead of replacing unrelated files.
  • Omit --host-platform only when generating on the same machine where the project will be developed; the script will auto-detect that host.
  1. Keep the toolchain contract explicit.

    • Use CMakePresets.json for configure/build profiles.
    • Use vcpkg manifest mode through vcpkg.json.
    • Use host-specific vcpkg triplets such as arm64-osx, x64-osx, x64-linux, arm64-linux, x64-windows, and arm64-windows.
    • Use Ninja as the generator unless the user or platform requires otherwise.
    • Use Clang on macOS, GCC on Linux, and MSVC on Windows by default.
  2. Wire editor support.

    • Recommend VS Code extensions: CMake Tools, clangd, CodeLLDB for macOS/Linux, and Microsoft C/C++ debugging support for Windows.
    • Disable competing IntelliSense when clangd is responsible for semantic analysis.
    • Make compile_commands.json available through CMake configure output and point clangd at the active preset's build directory.
    • Add launch configurations for the generated executable on macOS/Linux and Windows when creating a cross-platform scaffold.
  3. Add quality gates.

    • Add GoogleTest tests with ctest.
    • Add .clang-format and .clang-tidy.
    • Add a Doxygen configuration path, but do not require docs generation for a normal build.
    • Add CI only when requested or when the project setup task includes GitHub/GitHub Actions.

Validation

Run the strongest available validation for the target machine:

cmake --list-presets
bash scripts/bootstrap_vcpkg.sh
cmake --preset macos-arm64-debug
cmake --build --preset macos-arm64-debug
ctest --test-dir build/macos-arm64-debug --output-on-failure
bash scripts/format.sh --check
cmake --preset macos-arm64-tidy
cmake --build --preset macos-arm64-tidy
cmake --build --preset macos-arm64-debug --target docs

Adjust preset names for the selected host profile. On Windows, use pwsh scripts/bootstrap_vcpkg.ps1 and pwsh scripts/format.ps1 -Check. If vcpkg, compilers, or Doxygen are unavailable, report exactly what was skipped and why.

References

  • Read references/cpp-project-blueprint.md when choosing project layout, presets, dependency policy, editor settings, tests, formatting, linting, docs, or CI details.
  • Read the scaffold script before changing its generated files or adding new options.
  • Read assets/ before changing standard generated configuration files; treat those files as templates and keep project-specific values behind @PLACEHOLDER@ variables.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Embedded firmware setup: STM32, ESP32, AVR, RP2040, Nordic nRF, Zephyr/RTOS, vendor SDKs, CMake/CMakePresets, VS Code/clangd, cross toolchains, flash/debug, Docker/CI. Use for MCU scaffolds, existing firmware modernization, BSPs, linker/startup files, SDK package selection, and embedded CI; prefer cpp-project-setup for host-side C++.

日本語の概要は準備中です。原文の説明を表示しています。

Victory-7291/project-scaffold-setup-skills82026年7月24日 更新

FastAPI service setup: app/main.py, API routers, pydantic-settings, lifespan/app.state services, middleware, health checks, pytest/TestClient, Uvicorn, Gunicorn/uvicorn-worker, Docker/Compose. Use for scaffolding or modernizing Python API services; skip for Flask/Django-only, frontend-only, non-Python APIs, or Supabase-specific work.

日本語の概要は準備中です。原文の説明を表示しています。

Victory-7291/project-scaffold-setup-skills82026年7月24日 更新

Create 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.

日本語の概要は準備中です。原文の説明を表示しています。

Victory-7291/project-scaffold-setup-skills82026年7月24日 更新

Victory-7291 のスキルをすべて見る

このスキルの問題を報告する