1. Habit
  2. Skills
  3. CMake skill
mohitmishra786 · 2K installs

CMake skill
Runs by itself, pull request opened.

Green C++ builds in every config.

Install the CMake skill and make it a habit: follow https://gethabit.dev/skills/mohitmishra786/cmake.md

  1. 1Copy
  2. 2Paste into Claude Code, Codex or Cursor
  3. 3It runs by itself

2K installs265 starsMIT licenceSource on GitHub ↗

CMake

by mohitmishra786 · 2K installs

The skill

Cmake is a skill for C and C++ developers who write modern target-first CMakeLists.txt files: out-of-source builds, generators, dependencies with find_package and FetchContent, sanitizers, cross-compilation and presets.

Only when you ask.

The habit

Green C++ builds in every config.

↻ Runs by itselfpull request opened

How the habit works.
You don't have to.

Three questionsWhen does it start? How does it check its work? What does it remember?

One run, step by step.
Then it stops.

Stop ruleStops after one pull request per run, with one retry.

  1. 01

    Review CMake changes

    Check changed CMakeLists.txt files use target_* commands with PUBLIC, PRIVATE or INTERFACE.

  2. 02

    Configure release

    Run cmake --preset release.

  3. 03

    Build release

    Run cmake --build --preset release.

  4. 04

    Build with ASan

    Configure with -DENABLE_ASAN=ON into build-asan and build it.

  5. 05

    Map errors

    Match failures to the skill's common errors table and log the fix.

What it may do.
Nothing more.

Safe by defaultIt writes only in its own folder and asks you before anything goes out.

Is it for you?
Use it when it fits.

Quick checkRead both lists. If the left one sounds like you, the CMake skill helps.

Use it when

  • ✓ You write a CMakeLists.txt
  • ✓ CMake cannot find a package
  • ✓ You enable sanitizers

Skip it when

  • – You use another build system
  • – You need Ninja internals

Questions

CMake skill, answered.

Why out-of-source builds?

The skill always uses cmake -S . -B build to keep sources clean.

Which minimum version?

The skill uses cmake_minimum_required(VERSION 3.20).

How do I install the CMake skill?

Copy the prompt at the top into your agent. It installs the skill from mohitmishra786/low-level-dev-skills and sets up the habit. Or run npx skills add mohitmishra786/low-level-dev-skills --skill cmake.

Is the CMake skill free?

Yes. It is published under MIT. Habit is free too.

CMake. Now as a habit.

Install the CMake skill and make it a habit: follow https://gethabit.dev/skills/mohitmishra786/cmake.md

  • Free
  • No account
  • Undo in one line

All mohitmishra786 skills →More code skills →

Works in

  • Claude Code
  • Codex
  • Cursor
  • ChatGPT
  • Claude app

Made by mohitmishra786, published under MIT. Habit links to the original and never changes it. Is this your skill?

Copying didn't work here. Select the line and copy it by hand.