Build cmake

From LeoKemp223/embed-ai-tool · View interactive version

Build cmake is an AI agent skill from the GitHub repository LeoKemp223/embed-ai-tool. 当需要配置或构建基于 CMake 的嵌入式固件工程,调用自带脚本执行构建并定位固件产物时使用。

How to use this skill

Skill file

构建 CMake 工程

适用场景

必要输入

自动探测

执行步骤

  1. 先阅读 references/usage.md,确认本次是执行构建、环境探测、列出预设,还是仅扫描产物。
  2. 直接运行目标动作即可——脚本启动时会自动复用工程根目录 .em_skill.json 中上次成功构建的源码目录、构建目录、预设、目标和产物信息(显式参数优先)。仅当需要断言缓存必须存在时才加 --resume --profile default。
  3. 若无缓存或用户要求重新探测,脚本自动回退到 --detect、--list-presets 或手动参数探索。
  4. 若存在 CMakePresets.json,使用 --list-presets 列出预设,再用 --preset <name> 构建。
  5. 若无预设,使用 --source、--build-dir、--generator、--build-type、--toolchain 手动配置构建。
  6. 读取脚本输出的构建结果和产物扫描报告,重点关注首选产物(ELF > HEX > BIN)和失败分类。
  7. 成功构建后脚本会自动更新工程根目录 .em_skill.json 的 skill_profiles.build-cmake.default;将构建目录、产物路径、产物类型和生成器信息同步到 Project Profile,并在需要时交给下游 skill。

失败分流

平台说明

输出约定

交接关系

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.