gcc

A build tool for embedded CMake projects using arm-none-eabi-gcc, a compiler that turns code into firmware for ARM microcontrollers. It supports CMake presets, which are saved build configurations.

In plain words
What is it for?
Use it to scan projects, list presets, configure, compile, rebuild, clean, and inspect the size of the resulting ELF firmware file.
Why use it?
It gathers project and preset information, runs the build steps, and reports compiler results without requiring each command to be assembled manually.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/zhinkgit/embeddedskills/gcc
Any agent
npx skills add zhinkgit/embeddedskills --skill gcc
Clone the repo
git clone --depth 1 https://github.com/zhinkgit/embeddedskills

Made for: Claude Code, Codex.

Per session 162 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,760 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00162 $0.01760
Opus 5 $0.00081 $0.00880
Sonnet 5 $0.00032 $0.00352
Haiku 4.5 $0.00016 $0.00176

Measured 3d ago against content hash d8908c80113c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

gcc scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

The scan reads SKILL.md. This mod also ships 4 executable files (scripts/gcc_build.py, scripts/gcc_project.py, scripts/gcc_runtime.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

gcc/SKILL.md · 166 lines

How it starts

The opening of the file, as written. The whole thing — 166 lines — stays where its author put it; the contents beside it link to each section on GitHub.

GCC 嵌入式工程构建

本 skill 提供基于 CMake + arm-none-eabi-gcc 的嵌入式工程发现、preset 枚举、配置生成、增量编译、全量重建、清理和 ELF 大小分析能力。

范围说明:当前仅支持 CMake 型 GCC 嵌入式工程,不覆盖纯 Makefile 工程。

配置

环境级配置(skill/config.json)

skill 目录下的 config.json 包含环境级配置,首次使用前确认 cmake_exe 路径正确:

{
  "cmake_exe": "cmake",
  "toolchain_prefix": "arm-none-eabi-",
  "toolchain_path": "",
  "operation_mode": 1
}
  • cmake_exe:cmake 可执行文件路径,默认从 PATH 查找
  • toolchain_prefix:工具链前缀,默认 arm-none-eabi-,用于定位 size 等工具
  • toolchain_path:工具链 bin 目录,为空时从 PATH 查找
  • operation_mode1 直接执行 / 2 输出风险摘要但不阻塞 / 3 执行前确认

工程级配置(workspace/.embeddedskills/config.json)

工程级共享配置统一保存在工作区的 .embeddedskills/config.json 中:

{
  "gcc": {
    "project": "",
    "preset": "",
    "log_dir": ".embeddedskills/build"
  }
}
  • project:默认工程路径(相对 workspace),构建成功后会自动更新
  • preset:默认 CMake preset 名称,构建成功后会自动更新
  • log_dir:构建日志输出目录,默认 .embeddedskills/build

参数解析优先级

参数解析顺序(从高到低):

  1. CLI 显式参数
  2. 环境级配置(skill/config.json)
  3. 工程级配置(.embeddedskills/config.json)
  4. state.json(上次构建记录)
  5. 搜索/询问

冲突解决规则:同一参数存在多个来源时,以序号最小的来源为准;高序号来源仅在低序号来源未提供该参数时生效。例如:CLI 已指定 --preset Debug,则忽略 state.json 中记录的上次 preset。

子命令

子命令 用途 风险
scan 搜索当前目录下的 CMake 嵌入式工程
presets 列出 CMakePresets.json 中的 configure/build preset
configure 执行 cmake --preset 生成构建系统
build 增量编译 cmake --build
rebuild 清理后全量重建
clean 清理构建目录
size 分析 ELF 文件大小(text/data/bss 和内存使用)

执行流程

  1. 读取 config.json,确认 cmake_exe 路径有效
  2. 未提供有效子命令时默认执行 scan
  3. 未提供工程路径时先执行 scan 搜索工程
  4. 发现多个工程或多个 preset 时列出选项让用户选择,绝不自动猜测
  5. configure/build/rebuild/cleanoperation_mode 决定是否需要确认
  6. build 前自动检测是否已 configure,未配置时提示先执行 configure
  7. build/rebuild 成功后返回 elf_file,供 jlink/openocd 继续使用
  8. size 默认分析最近一次构建产物的 .elf 文件

脚本调用

skill 目录下有三个 Python 脚本,使用标准库实现,无额外依赖。

gcc_project.py — 工程扫描与 preset 枚举

# 扫描工程
python <skill-dir>/scripts/gcc_project.py scan --root <搜索目录> --json

# 列出 preset
python <skill-dir>/scripts/gcc_project.py presets --project <工程目录> --json

Read the full file on GitHub · 166 lines

Files

What ships with it

6 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 166 lines · 162 tokens per session scan A d8908c80113c

Subscribe to this mod's changes

gcc is a skill published in the GitHub repository zhinkgit/embeddedskills (610 stars, last pushed 13d ago), licensed MIT. It adds 162 tokens to every session and 1,760 once invoked, about $0.0008 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

ros2-microros

Skill "ros2-microros" from Leehyunbin0131/claude-ros2-skills, covering micro-ros instructions (ubuntu 24.04 lts & ros 2 jazzy), 1. architecture, 2. documentation entry points, 3. key concepts & patterns and a. embedded client node setup (rclc in c).

Leehyunbin0131/claude-ros2-skills · 29 tokens

Embedded C/C++ rules for MCU, STM32, HAL, interrupts, DMA, memory constraints, a

Embedded C/C++ rules for MCU, STM32, HAL, interrupts, DMA, memory constraints, and hardware-focused testing.

AmariahAK/atlarix-skills · 21 tokens

platform-port

Guide porting FastLED to new MCU platforms, including int.h types, clockless drivers, SPI implementations, and platform detection. Use when adding support for a new microcontroller family or board.

FastLED/FastLED · 42 tokens

tilelang-ascend-tile-api

TileLang-Ascend 新增 Ascend 专属 T.tile.xxx 小 API 的端到端开发流程。用户要求新增、封装、暴露、实现或测试 ascendtile.py 中的 T.tile API / Ascend tile primitive 时必须使用本 skill,尤其适用于需要同时打通 Python 前端、C++ lowering/codegen、Ascend C helper、文档和 CI 测试的任务。.

tile-ai/tilelang-ascend · 96 tokens

cpu-optimization-arm

ARM CPU 架构性能优化技巧、NEON SIMD 向量化、数值稳定性和调试策略.

mindspore-ai/akg · 30 tokens

pull_style_cutedsl_megakernel

This tree vendors the kernel team's SM90 FP8 MegaMoE drop — a fork of the same kernel repo that kernelsrc/cutedslmegamoe vendors (Bangyu's SM100 tree). The SM90 work (Vincent's hoppermegamoe branch) moved the shared runtime forward, so this tree duplicates common/, src/, and moenvfp4swapab/ at its own revision instead…

flashinfer-ai/flashinfer · 0 tokens