@m-velikov/cpp-quick-start-mcp 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +156 -0
  3. package/build/index.d.ts +3 -0
  4. package/build/index.d.ts.map +1 -0
  5. package/build/index.js +146 -0
  6. package/build/index.js.map +1 -0
  7. package/data/best-practices-bazel/SKILL.md +28 -0
  8. package/data/best-practices-cmake/SKILL.md +39 -0
  9. package/data/best-practices-code-review/SKILL.md +34 -0
  10. package/data/best-practices-conan/SKILL.md +28 -0
  11. package/data/best-practices-cpp/SKILL.md +38 -0
  12. package/data/best-practices-gtest/SKILL.md +30 -0
  13. package/data/best-practices-meson/SKILL.md +34 -0
  14. package/data/best-practices-refactoring/SKILL.md +28 -0
  15. package/data/best-practices-vcpkg/SKILL.md +27 -0
  16. package/data/meta-quickstart/SKILL.md +104 -0
  17. package/data/scaffold-agents/SKILL.md +68 -0
  18. package/data/scaffold-base-configs/SKILL.md +71 -0
  19. package/data/scaffold-bazel/SKILL.md +65 -0
  20. package/data/scaffold-clang-tidy/SKILL.md +37 -0
  21. package/data/scaffold-cmake/SKILL.md +50 -0
  22. package/data/scaffold-cmake-presets/SKILL.md +114 -0
  23. package/data/scaffold-code-quality/SKILL.md +58 -0
  24. package/data/scaffold-conan/SKILL.md +46 -0
  25. package/data/scaffold-doctest/SKILL.md +50 -0
  26. package/data/scaffold-github-actions/SKILL.md +29 -0
  27. package/data/scaffold-gitlab-ci/SKILL.md +30 -0
  28. package/data/scaffold-gtest/SKILL.md +53 -0
  29. package/data/scaffold-make/SKILL.md +62 -0
  30. package/data/scaffold-meson/SKILL.md +49 -0
  31. package/data/scaffold-pitchfork-layout/SKILL.md +60 -0
  32. package/data/scaffold-pre-commit/SKILL.md +33 -0
  33. package/data/scaffold-vcpkg/SKILL.md +50 -0
  34. package/package.json +59 -0
@@ -0,0 +1,104 @@
1
+ ---
2
+ name: meta-quickstart
3
+ description: Interviews the user about their preferred C++ stack and generates the specific project scaffolding skills.
4
+ ---
5
+
6
+ # Meta-Scaffold Skill
7
+
8
+ This is a Level 2 "Meta-Skill". Its purpose is not to write C++ code directly, but to generate the _actual_ scaffolding skills (e.g., `scaffold-project`, `build-project`) tailored to the user's specific tooling choices.
9
+
10
+ ## Workflow
11
+
12
+ When invoked, follow these steps exactly:
13
+
14
+ ### Step 1: Pre-flight Project Scan
15
+
16
+ Before doing anything, YOU MUST list the contents of the current working directory to determine if it is empty or already contains a project (e.g., presence of `CMakeLists.txt`, `src/`, `Makefile`, etc.).
17
+
18
+ If the directory is essentially **EMPTY**, proceed to **Mode A: New Project Interview**.
19
+ If the directory **CONTAINS AN EXISTING PROJECT**, proceed to **Mode B: Add Components**.
20
+
21
+ ---
22
+
23
+ ### Mode A: New Project Interview
24
+
25
+ Ask the user to select their preferences for the following categories.
26
+ **CRITICAL**: You MUST use your interactive multiple-choice question tool (e.g., `ask_question`) to present these questions to the user in a strict multiple-choice format. Always ensure the user has a free-form text input option to provide custom answers (write-ins).
27
+
28
+ 1. **C++ Standard Version**: (e.g., C++11, C++14, C++17, C++20, C++23)
29
+ 2. **Build System**: (e.g., CMake, Bazel, Meson, Makefiles)
30
+ 3. **Dependency Management**: (e.g., FetchContent, vcpkg, Conan, system packages)
31
+ - **CRITICAL**: Do NOT ask contradicting questions. Adapt your questions dynamically based on previous answers. For example, if the user chooses Conan for Dependency Management, do NOT ask them about vcpkg for Project Packaging in the next question unless they explicitly request both.
32
+ 4. **Project Packaging**: (e.g., Conan conanfile.py, vcpkg manifest, None)
33
+ 5. **Testing Framework**: (e.g., GTest, Catch2, doctest, Boost.Test)
34
+ 6. **Code Quality**: (e.g., clang-tidy, pre-commit hooks, custom build targets)
35
+ 7. **CI Provider**: (e.g., GitHub Actions, GitLab CI, None)
36
+ 8. **Coding Style**: (e.g., Google, LLVM, Mozilla, WebKit, Custom)
37
+ 9. **Target Platforms**: (e.g., Desktop vs. Mobile, Windows vs Linux, Android vs macOS).
38
+ 10. **Directory Layout**: (e.g., Standard Pitchfork [src/, include/, tests/], Flat Layout, or Custom). **CRITICAL**: Suggest Pitchfork directory layout based on the user's answers for Target Platforms.
39
+ 11. **Naming Conventions**: Preferred standards for types, values, namespaces, file names, and file extensions (e.g., `.cpp`/`.hpp` vs `.cc`/`.h`).
40
+ 12. **Libraries and Tools**: explicitly ask the user: "What libraries or executable tools do you want to build in this project?"
41
+
42
+ - **CRITICAL**: You must prompt the user repeatedly (e.g., "Are there any other libraries or tools?") until the user explicitly says "no more targets for now".
43
+
44
+ Wait for the user's responses. Only proceed to **Step 2 (Implementation Plan)** when all 12 questions are answered AND the user indicates they have no more targets to add.
45
+
46
+ ---
47
+
48
+ ### Mode B: Existing Project (Add Components or Modernize)
49
+
50
+ If the project already exists, **DO NOT** conduct the full Mode A interview.
51
+
52
+ 1. **Convention Scanning**: You MUST read the existing build files (e.g., `CMakeLists.txt`, `Makefile`) and a few source files to automatically infer the build system, package manager, directory layout, naming conventions, and code formatting style. Auto-detect whatever is possible.
53
+ 2. **Path Selection**: Ask the user: _"I see this is an existing project. Would you like to **1. Add new components** (libraries/executables), or **2. Modernize the codebase and augment it for agentic development**?"_
54
+
55
+ **If the user chooses Path 1 (Add Components):** 3. **Component Interview**: Ask the user what new components to add, prompting repeatedly until they say "no more targets for now". 4. **Target Platforms**: Ask about support for major target platforms (e.g., Desktop vs. Mobile, Windows vs Linux, Android vs macOS). 5. **Layout Conformity Check**: Evaluate if adding these new components causes the project to violate its inferred directory layout conventions.
56
+
57
+ - If it violates conventions or if the target platforms suggest a more robust layout, suggest a layout refactoring (e.g., migrating to Pitchfork layout).
58
+
59
+ 6. Proceed to **Step 2 (Implementation Plan)**.
60
+
61
+ **If the user chooses Path 2 (Modernize & Augment):** 3. **Missing Tooling Interview**: Based on the auto-detected conventions, identify missing modern tooling (e.g., `.clang-format`, `.clang-tidy`, `.pre-commit-config.yaml`, testing frameworks, CI/CD). Ask the user which of these missing tools they would like to integrate. 4. **Build System Evaluation**: Evaluate the existing build system. Do NOT suggest migrating it to a completely different build system (e.g., do not migrate Makefiles to CMake). Instead, suggest improvements for the existing build system (e.g., modernizing legacy CMake to target-based CMake, or optimizing Makefiles). 5. **Target Platforms**: Ask the user about support for major target platforms (e.g., Desktop vs. Mobile, Windows vs Linux, Android vs macOS). Suggest migrating to the Pitchfork directory layout based on their answers if the current layout is insufficient. 6. Proceed to **Step 2 (Implementation Plan)**.
62
+
63
+ ---
64
+
65
+ ### Step 2: Implementation Plan
66
+
67
+ Based on the chosen Mode and the user's answers, create a formal implementation plan.
68
+
69
+ **If you are in Mode A (New Project):**
70
+ Your plan must outline the exact file templates and commands needed to bootstrap the cross-platform C++ project using the chosen stack.
71
+
72
+ - Prefer splitting build system files per artifact (e.g., using `add_subdirectory` or `subdir()`) instead of creating a single top-level monolithic build file.
73
+ - Explicitly plan to run `git init` in the project directory if a Git repository is not already initialized, and to create or rename the initial branch to `main` (e.g. `git branch -M main`).
74
+ - Plan to generate a fresh `README.md` specifically describing the user's new C++ project. This `README.md` MUST include a `## Configure and Build` section containing the exact CLI commands required to configure and build the project based on the user's chosen stack (e.g., `cmake -B build -S .` or `conan install . --build=missing`).
75
+ - Plan to read the `scaffold-agents` skill from the MCP knowledge base and use it to generate an `AGENTS.md` file in the user's project root.
76
+
77
+ **If you are in Mode B (Existing Project - Add Components):**
78
+ Your plan must detail how you will create the new target folders adhering strictly to the inferred layout conventions, and how you will safely _append_ the new targets to the existing build files (do NOT overwrite existing files).
79
+ If a layout refactoring was agreed upon, include that in the plan before adding the new components.
80
+
81
+ **If you are in Mode B (Existing Project - Modernize):**
82
+ Your plan must include:
83
+
84
+ - Generating an `AGENTS.md` file using the `scaffold-agents` skill.
85
+ - Safely introducing the requested code quality tools (e.g., `.clang-format`, `.clang-tidy`).
86
+ - Applying the agreed-upon build system improvements directly to the existing build files.
87
+ - Implementing any layout refactoring if agreed upon.
88
+
89
+ **Workspace Skills Generation (All Modes)**:
90
+ In ALL plans, you must include the creation of customized permanent workspace SKILL files. These must be written directly into the project's workspace using an agent-agnostic directory like `.agents/skills/` or `skills/` so that any AI working in the project immediately knows how to operate it. **CRITICAL**: Do NOT use agent-specific directories like `.gemini` or `.claude`.
91
+ The workspace skills to create are:
92
+
93
+ 1. `skills/configure-project/SKILL.md`: Exact instructions and CLI commands for fetching dependencies, installing them, and configuring the project (e.g., `conan install` or `vcpkg install` followed by `cmake -B build`).
94
+ 2. `skills/build-project/SKILL.md`: Exact instructions and CLI commands for building the project (e.g., `cmake --build build -j`).
95
+ 3. **Component Best Practices**: For each of the components and tools used in the project (e.g., CMake, vcpkg, GTest), create a dedicated skill containing best practices and usage instructions tailored to this specific project.
96
+ 4. **Refactoring Best Practices**: Create a skill (e.g., `skills/best-practices-refactoring/SKILL.md`) detailing how to safely refactor code within the project's layout and test constraints.
97
+ 5. **Code Review Best Practices**: Create a skill (e.g., `skills/best-practices-code-review/SKILL.md`) containing guidelines for reviewing code to ensure compliance with the project's chosen formatting, style, and CI requirements.
98
+ 6. **C++ Core Guidelines Best Practices**: Create a skill (e.g., `skills/best-practices-cpp/SKILL.md`) establishing fundamental C++ guidelines based on the [C++ Core Guidelines](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md).
99
+
100
+ Wait for the user's explicit approval on the implementation plan before proceeding to Execution.
101
+
102
+ ### Step 3: Execution
103
+
104
+ Once the user approves the implementation plan, proceed to directly execute it. Implement the code, initialize git, create the workspace skills, and verify the build as outlined in your plan.
@@ -0,0 +1,68 @@
1
+ ---
2
+ name: scaffold-agents
3
+ description: Instructs the AI on the multi-agent topology to use for complex C++ projects.
4
+ ---
5
+
6
+ # Agent Topology Skill
7
+
8
+ This skill defines how AI agents should coordinate when working on this C++ project.
9
+
10
+ ## Guidelines
11
+
12
+ Embed the following guidelines into an `AGENTS.md` file in the project root so other agents understand the architecture.
13
+
14
+ ### `AGENTS.md`
15
+
16
+ ```markdown
17
+ # Agent Configuration and Guidelines
18
+
19
+ You are an AI assistant operating within a C++ Agentic template repository. Your behavior must adhere to the following directives.
20
+
21
+ ## Agent Topology & Roles
22
+
23
+ This repository is designed to be operated by a multi-agent system. When working on larger tasks, define and invoke the following specialized subagents to distribute the workload:
24
+
25
+ 1. **Lead Orchestrator Agent (You)**:
26
+
27
+ - **Role**: High-level planning, user communication, and task delegation.
28
+ - **Responsibilities**: Breaks down user requests into tasks and delegates them to specialized subagents using the `invoke_subagent` and `send_message` tools.
29
+
30
+ 2. **C++ Coder Agent**:
31
+
32
+ - **Role**: Core implementation and logic design.
33
+ - **Responsibilities**: Writes the actual C++ headers and source files. Enforces the configured coding style and ensures code compiles flawlessly with the configured C++ standard.
34
+
35
+ 3. **QA / Tester Agent**:
36
+
37
+ - **Role**: Quality assurance and test coverage.
38
+ - **Responsibilities**: Writes test cases using the configured testing framework. Continuously runs the configured test command to verify correctness and reports back to the Lead Agent.
39
+
40
+ 4. **Build System Agent**:
41
+ - **Role**: Managing build configurations and cross-platform support.
42
+ - **Responsibilities**: Updates the project's build system files, manages dependencies according to the configured package manager, and ensures cross-platform settings (like export macros) are correctly maintained.
43
+
44
+ ## Code Style & Tooling
45
+
46
+ Once the project is scaffolded, enforce the following:
47
+
48
+ - Follow the coding style configured in `.clang-format`. (Note: Choosing a Google or LLVM coding style does NOT override naming conventions; the user's explicit naming convention decisions always take precedence.)
49
+ - Ensure all C++ files use LF line endings (as per `.gitattributes`).
50
+ - Never commit code that fails `.clang-tidy` checks.
51
+
52
+ ## Naming Conventions
53
+
54
+ - Adhere strictly to the naming conventions established in the project (e.g., camelCase vs snake_case, file extensions like `.cpp` vs `.cc`).
55
+ - **CRITICAL RULE**: You may ONLY deviate from the established naming convention if absolutely required by a project dependency (for example, if a specific testing framework explicitly insists that test files must end in `_test`).
56
+
57
+ ## Build System & Testing
58
+
59
+ - Adhere strictly to the project's configured build system and testing framework.
60
+ - Use the local workspace skills (e.g., `build-project` and `test-project`) to compile and test the code.
61
+ - Do not write custom shell scripts for building unless explicitly instructed to do so by the user's stack configuration.
62
+ - **Out-of-Source Builds**: A build process must not modify the source directory. The source directory can be modified by the user and agents, but not by build scripts. A `build` or similar subdirectory in the source tree is allowed for this purpose. When you identify a directory serving this purpose, check if it is present in `.gitignore` and add it if missing (subject to follow-up user review). If modification to the source directory by build scripts appears unavoidable, ask the user for an exception. Try to limit the affected source files (for example, allow just for a few machine-generated files that are infrequently updated).
63
+
64
+ ## Security & Privacy
65
+
66
+ - **NEVER** upload anything on the internet to prevent IP, trade secret, or other leaks.
67
+ - This rule is absolute unless under explicit instructions from the developer, in which case an implementation plan is mandatory.
68
+ ```
@@ -0,0 +1,71 @@
1
+ ---
2
+ name: scaffold-base-configs
3
+ description: Generates essential base repository files like .gitignore and .gitattributes.
4
+ ---
5
+
6
+ # Base Configurations Skill
7
+
8
+ This skill provides the standard foundational files for any new C++ repository.
9
+
10
+ ## Instructions
11
+
12
+ Always generate these files at the root of the project to ensure proper Git behavior.
13
+
14
+ ### 1. `.gitignore`
15
+
16
+ Create a file named `.gitignore` with the following exact content:
17
+
18
+ ```gitignore
19
+ # CMake
20
+ build/
21
+ CMakeCache.txt
22
+ CMakeFiles/
23
+ CMakeScripts/
24
+ Testing/
25
+ Makefile
26
+ cmake_install.cmake
27
+ install_manifest.txt
28
+ compile_commands.json
29
+
30
+ # IDEs
31
+ .idea/
32
+ .vscode/
33
+ *.swp
34
+ *.swo
35
+
36
+ # OS
37
+ .DS_Store
38
+ Thumbs.db
39
+
40
+ ```
41
+
42
+ ### 2. `.gitattributes`
43
+
44
+ Create a file named `.gitattributes` with the following exact content:
45
+
46
+ ```gitattributes
47
+ # Auto detect text files and perform LF normalization
48
+ * text=auto
49
+
50
+ # Ensure bash scripts always use LF
51
+ *.sh text eol=lf
52
+
53
+ # C++ Source Code
54
+ *.cpp text diff=cpp
55
+ *.hpp text diff=cpp
56
+ *.c text diff=cpp
57
+ *.h text diff=cpp
58
+
59
+ # Build files
60
+ CMakeLists.txt text
61
+ *.cmake text
62
+ ```
63
+
64
+ ### 3. `.clangd`
65
+
66
+ Create a file named `.clangd` at the project root with the following exact content to ensure seamless IDE support if the build system generates a `compile_commands.json` file:
67
+
68
+ ```yaml
69
+ CompileFlags:
70
+ CompilationDatabase: build
71
+ ```
@@ -0,0 +1,65 @@
1
+ ---
2
+ name: scaffold-bazel
3
+ description: Generates Bazel build files (WORKSPACE/BUILD) for configuring a C++ project.
4
+ ---
5
+
6
+ # Bazel Scaffolding Skill
7
+
8
+ This skill instructs the agent on how to scaffold Bazel build files for a C++ project.
9
+
10
+ ## Requirements
11
+
12
+ When the user specifies Bazel for the Build System, the agent MUST generate a root `MODULE.bazel` file (as Bzlmod is the default in Bazel 7+) and `BUILD` or `BUILD.bazel` files in the necessary directories.
13
+
14
+ ## Instructions
15
+
16
+ 1. **Root File**: Create a `MODULE.bazel` file in the project root to mark it as a Bazel workspace and define dependencies using `bazel_dep`.
17
+ 2. **Targets and Modularity**: Use `cc_library` and `cc_binary` rules to define the libraries and executable tools requested by the user.
18
+ - Separate rules into individual `BUILD` files inside their respective source directories.
19
+ 3. **Libraries**:
20
+ ```starlark
21
+ # src/my_lib/BUILD
22
+ cc_library(
23
+ name = "my_lib",
24
+ srcs = ["my_lib.cc"],
25
+ hdrs = ["my_lib.h"],
26
+ includes = ["."], # or strip_include_prefix
27
+ visibility = ["//visibility:public"],
28
+ )
29
+ ```
30
+ 4. **Executables**:
31
+ ```starlark
32
+ # src/my_app/BUILD
33
+ cc_binary(
34
+ name = "my_app",
35
+ srcs = ["main.cc"],
36
+ deps = ["//src/my_lib:my_lib"],
37
+ )
38
+ ```
39
+ 5. **Testing**:
40
+ - For `cc_test` targets, depend on the testing framework.
41
+ ```starlark
42
+ cc_test(
43
+ name = "my_lib_test",
44
+ srcs = ["my_lib_test.cc"],
45
+ deps = [
46
+ "//src/my_lib:my_lib",
47
+ "@googletest//:gtest_main", # Example if using gtest via bazel_dep in MODULE.bazel
48
+ ],
49
+ )
50
+ ```
51
+
52
+ ## Build Skills Generation
53
+
54
+ If Bazel is the build system, the agent MUST generate a `skills/build-project/SKILL.md` in the new project.
55
+ The generated skill must instruct agents to build the project using:
56
+
57
+ ```bash
58
+ bazel build //...
59
+ ```
60
+
61
+ And to run tests:
62
+
63
+ ```bash
64
+ bazel test //...
65
+ ```
@@ -0,0 +1,37 @@
1
+ ---
2
+ name: scaffold-clang-tidy
3
+ description: Generates .clang-tidy configuration for C++ projects.
4
+ ---
5
+
6
+ # Clang-Tidy Scaffolding Skill
7
+
8
+ This skill instructs the agent on how to scaffold a `.clang-tidy` configuration file for a C++ project.
9
+
10
+ ## Requirements
11
+
12
+ When the user specifies Clang-Tidy for Code Quality, the agent MUST generate a `.clang-tidy` file in the root of the project.
13
+
14
+ ## Instructions
15
+
16
+ 1. **Configuration File**: Create a `.clang-tidy` file with a robust set of default checks.
17
+
18
+ - **CRITICAL**: For `Checks`, ensure you disable `bugprone-easily-swappable-parameters` (e.g., add `-bugprone-easily-swappable-parameters`).
19
+ - **CRITICAL**: If the chosen coding convention does not require braces around single statement if/for/while/etc bodies, you MUST also disable `readability-braces-around-statements` (e.g., add `-readability-braces-around-statements`).
20
+
21
+ ```yaml
22
+ Checks: "-*,readability-*,modernize-*,performance-*,bugprone-*,cppcoreguidelines-*,-bugprone-easily-swappable-parameters"
23
+ WarningsAsErrors: ""
24
+ HeaderFilterRegex: ".*"
25
+ AnalyzeTemporaryDtors: false
26
+ FormatStyle: "file"
27
+ CheckOptions:
28
+ - key: readability-identifier-naming.ClassCase
29
+ value: CamelCase
30
+ - key: readability-identifier-naming.VariableCase
31
+ value: camelBack
32
+ ```
33
+
34
+ 2. **Build System Integration**: If CMake is used, instruct the agent to enable clang-tidy integration by adding `CXX_CLANG_TIDY` properties to targets, or globally:
35
+ ```cmake
36
+ set(CMAKE_CXX_CLANG_TIDY "clang-tidy")
37
+ ```
@@ -0,0 +1,50 @@
1
+ ---
2
+ name: scaffold-cmake
3
+ description: Generates modern CMakeLists.txt files for configuring a C++ project.
4
+ ---
5
+
6
+ # CMake Scaffolding Skill
7
+
8
+ This skill instructs the agent on how to scaffold modern `CMakeLists.txt` files for the C++ project.
9
+
10
+ ## Requirements
11
+
12
+ When the user specifies CMake for the Build System, the agent MUST generate a root `CMakeLists.txt` and any necessary subdirectory `CMakeLists.txt` files (e.g., in `src/` or `tests/`).
13
+
14
+ ## Instructions for `CMakeLists.txt`
15
+
16
+ **If generating a NEW project (Mode A):**
17
+ The root `CMakeLists.txt` must be written using Modern CMake (target-based) principles:
18
+
19
+ 1. **Minimum Required Version**: Start with `cmake_minimum_required(VERSION 3.20)` (or higher).
20
+ 2. **Project Definition**: `project(ProjectName VERSION 0.1.0 LANGUAGES CXX)`
21
+ 3. **C++ Standard**: Enforce the C++ standard strictly via target properties (e.g., `target_compile_features(<target> PUBLIC cxx_std_20)`). Avoid using global variables like `CMAKE_CXX_STANDARD`.
22
+ 4. **Targets and Modularity**: The agent MUST iterate over the libraries and tools requested by the user during the meta-quickstart interview.
23
+ - **CRITICAL RULE**: Do NOT create a single monolithic top-level `CMakeLists.txt` that defines every target. Instead, you MUST split the build files per artifact. The root `CMakeLists.txt` should simply use `add_subdirectory(...)` for each target, and the actual `add_library(<target_name>)` or `add_executable(<target_name>)` commands MUST be placed inside individual `CMakeLists.txt` files residing in their respective target source directories.
24
+ - Avoid global state functions like `include_directories()`.
25
+ 5. **Target Properties**: Apply properties to _each_ target specifically. Use `target_include_directories(<target_name> ...)`, `target_compile_features(<target_name> ...)`, and `target_link_libraries(<target_name> ...)`.
26
+ - If an executable tool depends on a library built in the same project, link them together! (e.g., `target_link_libraries(app_cli PRIVATE core_lib)`).
27
+ 6. **Package Management Integration**:
28
+ - If Conan is used, link against Conan-provided targets (e.g., `find_package(ZLIB REQUIRED)`, `target_link_libraries(my_target PRIVATE ZLIB::ZLIB)`).
29
+ - If vcpkg is used, do the same. Provide a note that `CMAKE_TOOLCHAIN_FILE` must be passed during the configure step.
30
+ 7. **Testing**: If a testing framework is chosen, `enable_testing()` and use `add_subdirectory(tests)` (or similar) to include test targets. Use `FetchContent` to download the testing framework (e.g., GTest, Catch2) if a package manager isn't handling it.
31
+ 8. **Compilation Database**: You MUST add `set(CMAKE_EXPORT_COMPILE_COMMANDS ON)` near the top of the file. Furthermore, if the user requested a multi-configuration generator (where build files are placed in subdirectories like `build/Debug/` or `build/Release/`), you MUST generate a configure-time rule (e.g., using `file(CREATE_LINK ...)`) to symlink the nested `compile_commands.json` back to the root of the `build/` directory so the `.clangd` configuration can always find it without modification.
32
+
33
+ **If adding components to an EXISTING project (Mode B):**
34
+
35
+ 1. **DO NOT OVERWRITE**: You MUST NOT overwrite the existing `CMakeLists.txt`.
36
+ 2. **Safe Appending**: Append the new `add_library(<target_name>)` or `add_executable(<target_name>)` definitions safely to the bottom of the file, or inside the appropriate conditional blocks if they exist.
37
+ 3. **Respect Conventions**: If the existing `CMakeLists.txt` uses `lowercase()` or `UPPERCASE()` CMake commands, match that style exactly. Do not change global properties.
38
+
39
+ ## Build Skills Generation
40
+
41
+ If CMake is the build system, the agent MUST generate a `skills/build-project/SKILL.md` in the new project.
42
+ The generated skill must instruct agents to build the project using:
43
+
44
+ ```bash
45
+ cmake --build build -j
46
+ ```
47
+
48
+ ## Workflow Integration
49
+
50
+ This skill is utilized by the `meta-quickstart` skill when the user selects CMake as their build system.
@@ -0,0 +1,114 @@
1
+ ---
2
+ name: scaffold-cmake-presets
3
+ description: Generates a CMakePresets.json file to standardize CMake configuration and build commands.
4
+ ---
5
+
6
+ # CMake Presets Scaffolding Skill
7
+
8
+ This skill instructs the agent on how to scaffold a `CMakePresets.json` file to establish a standardized, hallucination-free build process.
9
+
10
+ ## Requirements
11
+
12
+ When the user specifies CMake as their Build System, the agent MUST generate a `CMakePresets.json` file in the project root. This ensures that build commands are simple (e.g., `cmake --preset dev`) and consistent across platforms and environments.
13
+
14
+ ## Instructions for `CMakePresets.json`
15
+
16
+ The file MUST be a valid JSON matching the CMake Presets version 3 (or higher) specification.
17
+
18
+ ### 1. Configure Presets
19
+
20
+ Define your configuration presets.
21
+
22
+ - **Hidden Base Preset**: Create a hidden preset (e.g., `default-base` with `"hidden": true`) that defines common properties:
23
+ - Generator (default to `"Ninja"` unless requested otherwise).
24
+ - Common cache variables (e.g., `"CMAKE_EXPORT_COMPILE_COMMANDS": "YES"`).
25
+ - **User-Facing Presets**: Create user-facing presets (e.g., `dev` and `release`) that inherit from the base preset.
26
+ - Set the `"binaryDir"` cleanly (e.g., `"${sourceDir}/build/${presetName}"`).
27
+ - Set `"CMAKE_BUILD_TYPE"` appropriately (Debug for dev, Release for release).
28
+
29
+ ### 2. Conan Integration (CRITICAL)
30
+
31
+ If the project uses **Conan 2.x** for dependency management:
32
+
33
+ - Do NOT hardcode `CMAKE_TOOLCHAIN_FILE` paths manually.
34
+ - Your user-facing presets (e.g., `dev`) MUST **inherit** from the Conan-generated presets (e.g., `"conan-debug"` or `"conan-release"`).
35
+ ```json
36
+ {
37
+ "name": "dev",
38
+ "inherits": ["conan-debug", "default-base"],
39
+ "cacheVariables": {
40
+ "CMAKE_BUILD_TYPE": "Debug"
41
+ }
42
+ }
43
+ ```
44
+ - **Order of Operations Warning**: Instruct the user or subagents that when Conan is used alongside CMake presets, they MUST run `conan install .` (often with build profile arguments) **before** running `cmake --preset dev`. Otherwise, CMake will crash because the inherited Conan preset doesn't exist yet.
45
+
46
+ ### 3. vcpkg Integration
47
+
48
+ If the project uses **vcpkg** (and not Conan), explicitly define the `CMAKE_TOOLCHAIN_FILE` in the base preset's cache variables. E.g.:
49
+
50
+ - `"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"`
51
+
52
+ ### 4. Multi-Package Manager Support (Conan AND vcpkg)
53
+
54
+ If a project supports _both_ package managers to give developers a choice, do NOT attempt to chain them together. Instead, generate separate, distinct user-facing presets for each:
55
+
56
+ - **`dev-conan`**: Inherits from the Conan-generated preset (e.g., `"inherits": ["default-base", "conan-debug"]`).
57
+ - **`dev-vcpkg`**: Inherits from the base preset but explicitly defines the vcpkg toolchain variable:
58
+ ```json
59
+ "cacheVariables": {
60
+ "CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
61
+ }
62
+ ```
63
+ This allows developers to simply run `cmake --preset dev-conan` or `cmake --preset dev-vcpkg` depending on their preferred package manager.
64
+
65
+ ### 5. Build and Test Presets
66
+
67
+ - Create `buildPresets` that correspond to your configure presets (e.g., a `dev` build preset that references the `dev` configure preset).
68
+ - If a testing framework is used, create `testPresets` that run CTest against the configured build directory.
69
+
70
+ ## Build Skills Generation
71
+
72
+ If CMake Presets are scaffolded, update the project's build instructions to use the simple preset commands:
73
+
74
+ ```bash
75
+ cmake --preset dev
76
+ cmake --build --preset dev
77
+ ```
78
+
79
+ ## Example `CMakePresets.json` Structure
80
+
81
+ ```json
82
+ {
83
+ "version": 3,
84
+ "cmakeMinimumRequired": {
85
+ "major": 3,
86
+ "minor": 23,
87
+ "patch": 0
88
+ },
89
+ "configurePresets": [
90
+ {
91
+ "name": "default-base",
92
+ "hidden": true,
93
+ "generator": "Ninja",
94
+ "binaryDir": "${sourceDir}/build/${presetName}",
95
+ "cacheVariables": {
96
+ "CMAKE_EXPORT_COMPILE_COMMANDS": "YES"
97
+ }
98
+ },
99
+ {
100
+ "name": "dev",
101
+ "inherits": "default-base",
102
+ "cacheVariables": {
103
+ "CMAKE_BUILD_TYPE": "Debug"
104
+ }
105
+ }
106
+ ],
107
+ "buildPresets": [
108
+ {
109
+ "name": "dev",
110
+ "configurePreset": "dev"
111
+ }
112
+ ]
113
+ }
114
+ ```
@@ -0,0 +1,58 @@
1
+ ---
2
+ name: scaffold-code-quality
3
+ description: Generates code quality configurations including .clang-format, .clang-tidy, and pre-commit hooks.
4
+ ---
5
+
6
+ # Code Quality Skill
7
+
8
+ This skill instructs the agent on how to scaffold code quality tooling for the C++ project.
9
+
10
+ ## Requirements
11
+
12
+ When the user specifies Code Quality Enforcement (like pre-commit hooks, formatting, linting), generate the following files in the project root.
13
+
14
+ ### 1. `.clang-format`
15
+
16
+ Create a file named `.clang-format` with the following exact content:
17
+
18
+ ```yaml
19
+ # The coding style is ultimately decided by the users.
20
+ # Update the BasedOnStyle or define your custom rules below.
21
+ BasedOnStyle: LLVM
22
+ Standard: c++20
23
+ ColumnLimit: 100
24
+ IndentWidth: 4
25
+ TabWidth: 4
26
+ UseTab: Never
27
+ ```
28
+
29
+ ### 2. `.clang-tidy`
30
+
31
+ Create a file named `.clang-tidy` with the following exact content:
32
+
33
+ ```yaml
34
+ Checks: "-*,readability-*,bugprone-*,performance-*,modernize-*,clang-analyzer-*,cppcoreguidelines-*,-cppcoreguidelines-pro-bounds-pointer-arithmetic,-cppcoreguidelines-pro-bounds-constant-array-index"
35
+ WarningsAsErrors: ""
36
+ HeaderFilterRegex: ""
37
+ AnalyzeTemporaryDtors: false
38
+ FormatStyle: none
39
+ ```
40
+
41
+ ### 3. `.pre-commit-config.yaml`
42
+
43
+ Create a file named `.pre-commit-config.yaml` with the following exact content:
44
+
45
+ ```yaml
46
+ repos:
47
+ - repo: https://github.com/pre-commit/pre-commit-hooks
48
+ rev: v4.6.0
49
+ hooks:
50
+ - id: trailing-whitespace
51
+ - id: end-of-file-fixer
52
+ - id: check-yaml
53
+ - repo: https://github.com/pre-commit/mirrors-clang-format
54
+ rev: v18.1.5
55
+ hooks:
56
+ - id: clang-format
57
+ types_or: [c++, c]
58
+ ```
@@ -0,0 +1,46 @@
1
+ ---
2
+ name: scaffold-conan
3
+ description: Generates a conanfile.py for configuring packaging and dependency management with Conan 2.x.
4
+ ---
5
+
6
+ # Conan Packaging Skill
7
+
8
+ This skill instructs the agent on how to scaffold a Conan 2.x packaging manifest (`conanfile.py`) for the C++ project.
9
+
10
+ ## Requirements
11
+
12
+ When the user specifies Conan for Project Packaging, the agent MUST generate a `conanfile.py` in the root of the project.
13
+
14
+ ## Instructions for `conanfile.py`
15
+
16
+ The `conanfile.py` must define a class inheriting from `ConanFile` and include the following:
17
+
18
+ 1. **Metadata**: `name`, `version`, `license`, `author`, `url`, and `description`.
19
+ 2. **Settings**: Standard settings `os`, `compiler`, `build_type`, `arch`.
20
+ 3. **Options**: Typically `shared=True/False` and `fPIC=True/False`.
21
+ 4. **Tool Requires**: E.g., `cmake/[>=3.24]`.
22
+ 5. **Requirements**: Implement the `requirements()` method using `self.requires("package/version")`.
23
+ 6. **Layout**: Implement the `layout()` method calling `cmake_layout(self)` to use Conan 2.x's robust default generated layout.
24
+ 7. **Generate**: Implement the `generate()` method using `CMakeDeps` and `CMakeToolchain`.
25
+ 8. **Build**: Implement the `build()` method using `CMake(self).configure()` and `build()`.
26
+ 9. **Package**: Implement the `package()` method using `CMake(self).install()`.
27
+ 10. **Package Info**: Implement `package_info()` to define `self.cpp_info.libs = ["<library_name>"]` and `self.cpp_info.set_property("cmake_target_name", "PkgName::LibName")` to ensure modern CMake integration.
28
+
29
+ ## Configure Skills Generation
30
+
31
+ If Conan is used, the agent MUST instruct that the generated `skills/configure-project/SKILL.md` inside the new project contains the exact Conan configuration commands, for example:
32
+
33
+ ```bash
34
+ conan profile detect --force
35
+ conan install . --output-folder=build --build=missing
36
+ ```
37
+
38
+ And if CMake is used with Conan, the `configure-project` skill must document how to pass the Conan toolchain to CMake:
39
+
40
+ ```bash
41
+ cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=build/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release
42
+ ```
43
+
44
+ ## Workflow Integration
45
+
46
+ This skill is utilized by the `meta-quickstart` skill when the user selects Conan for Project Packaging.
@@ -0,0 +1,50 @@
1
+ ---
2
+ name: scaffold-doctest
3
+ description: Generates boilerplate for Doctest framework integration.
4
+ ---
5
+
6
+ # Doctest Scaffolding Skill
7
+
8
+ This skill instructs the agent on how to scaffold Doctest for a C++ project.
9
+
10
+ ## Requirements
11
+
12
+ When the user specifies Doctest for their Testing Framework, you MUST generate the necessary boilerplate to integrate it. Doctest is typically used as a single-header library, which makes it very fast and easy to integrate.
13
+
14
+ ## Instructions for CMake
15
+
16
+ If the Build System is CMake:
17
+
18
+ 1. **Fetching Doctest**: Use `FetchContent` to download Doctest (if no package manager is handling it):
19
+ ```cmake
20
+ include(FetchContent)
21
+ FetchContent_Declare(
22
+ doctest
23
+ GIT_REPOSITORY https://github.com/doctest/doctest
24
+ GIT_TAG v2.4.11
25
+ )
26
+ FetchContent_MakeAvailable(doctest)
27
+ ```
28
+ 2. **Linking**: Link test executables against `doctest::doctest`.
29
+ ```cmake
30
+ add_executable(my_test test_main.cpp)
31
+ target_link_libraries(my_test PRIVATE doctest::doctest my_library)
32
+ ```
33
+ 3. **Test Registration**: To register tests with CTest, use `add_test()`.
34
+ ```cmake
35
+ add_test(NAME my_test COMMAND my_test)
36
+ ```
37
+
38
+ ## Instructions for Source Files
39
+
40
+ Generate a basic test file `test_main.cpp`. For doctest, exactly one file must define `DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN`.
41
+
42
+ ```cpp
43
+ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
44
+ #include <doctest/doctest.h>
45
+
46
+ TEST_CASE("ExampleTest") {
47
+ CHECK(1 == 1);
48
+ REQUIRE(true);
49
+ }
50
+ ```