diff --git a/.pi/README.md b/.agents/README.md similarity index 86% rename from .pi/README.md rename to .agents/README.md index 4f42b6b..25f33f6 100644 --- a/.pi/README.md +++ b/.agents/README.md @@ -12,7 +12,7 @@ Project-level skills loaded by Pi on-demand. ## Installation -Skills are auto-discovered by Pi from `.pi/skills/`. No extra setup +Skills are auto-discovered by Pi from `.agents/skills/`. No extra setup required. To install this project's skills into another project: @@ -31,10 +31,10 @@ Pi auto-discovers `skills/` directories from installed packages. ## Adding a New Skill -Place a `SKILL.md` inside a directory under `.pi/skills/`: +Place a `SKILL.md` inside a directory under `.agents/skills/`: ``` -.pi/skills/ +.agents/skills/ my-skill/ SKILL.md ``` diff --git a/.pi/skills/cmake/SKILL.md b/.agents/skills/cmake/SKILL.md similarity index 78% rename from .pi/skills/cmake/SKILL.md rename to .agents/skills/cmake/SKILL.md index 19e7e91..43eea04 100644 --- a/.pi/skills/cmake/SKILL.md +++ b/.agents/skills/cmake/SKILL.md @@ -1,12 +1,19 @@ --- name: cmake -description: CMake build configuration for projects scaffolded from the ctdd - template. Use when adding modules, adding dependencies, configuring coverage - or sanitizers, or understanding the build system. +description: CMake build configuration for C and C++ projects started from + the ctdd template. Use when adding modules or dependencies, or configuring + builds, coverage, and sanitizers. --- # CMake Skill +This repository is a starter template, not an application whose sample +modules define required features. Its checked-in targets are C examples +using C23. When adding C++ targets, use `.cpp` sources and select the +project's C++ standard explicitly (for example, `cxx_std_23`). Unity can +be used by C++ tests. CMock is for C-compatible interfaces, not C++ class +mocking. + > Replace `/` with the project source directory (e.g. `ctdd/`, `src/`). > Replace `` with the module name (e.g. `counter`, `timer`). @@ -24,8 +31,8 @@ description: CMake build configuration for projects scaffolded from the ctdd ## Adding a Module -Modules live in `/` as static libraries. Register them in -`/CMakeLists.txt`: +Modules live in `/` as static libraries. The current example is C; +register C modules in `/CMakeLists.txt`: ```cmake add_library(_ .c) @@ -33,6 +40,19 @@ target_include_directories(_ PUBLIC "${CMAKE_SOURCE_DIR}") target_compile_features(_ PRIVATE c_std_23) ``` +For a C++ module, use a `.cpp` source and select the standard used by the +derived project: + +```cmake +add_library(_ .cpp) +target_include_directories(_ PUBLIC "${CMAKE_SOURCE_DIR}") +target_compile_features(_ PRIVATE cxx_std_23) +``` + +Replace `cxx_std_23` if the project uses a different C++ standard. Likewise, +choose `.c`/`c_std_23` or `.cpp`/`cxx_std_23` for the application's entry +point and test sources. + Link into `main` in the root `CMakeLists.txt`: ```cmake @@ -122,6 +142,9 @@ target_compile_definitions( PRIVATE ${BASE_DEFINITIONS}) ## CMock Mock Generation +CMock generates mocks for C-compatible interfaces. Do not pass C++ class +headers to this helper; use a suitable fake or mocking tool for C++ APIs. + `tests/CMakeLists.txt` provides a `cmock_generate_mock` helper function: ```cmake diff --git a/.pi/skills/git/SKILL.md b/.agents/skills/git/SKILL.md similarity index 57% rename from .pi/skills/git/SKILL.md rename to .agents/skills/git/SKILL.md index 5b105e1..373e870 100644 --- a/.pi/skills/git/SKILL.md +++ b/.agents/skills/git/SKILL.md @@ -1,32 +1,63 @@ --- name: git -description: Git workflow for the ctdd template project. Use when committing - changes, creating tags for releases, or following the branching and commit - message conventions. +description: Git workflow for the ctdd C/C++ starter template. Use when + committing template or example changes, creating release tags, or following + the branching and commit message conventions. --- # Git Skill +This repository is a reusable starter template for C and C++ projects. +Treat its checked-in code as examples demonstrating the build and test +setup, not as a required application API. Template releases should keep +the starter structure and Unity/CMock workflows useful to derived projects. + ## Commit Messages -Follow [Conventional Commits](https://www.conventionalcommits.org/) with the -50/72 rule. +Follow [Conventional Commits v1.0.0][cc] with the 50/72 rule. + +[cc]: https://www.conventionalcommits.org/en/v1.0.0/ ### Format ``` -: +[optional scope][!]: -