Agent skill

Keil

by zhinkgit in zhinkgit/embeddedskills

Keil MDK 工程构建工具,用于扫描 .uvprojx/.uvproj/.uvmpw 工程、枚举 Target、执行 build/rebuild/clean 并解析构建日志,返回可供 jlink/openocd 复用的产物路径。

MITAuto-check passed

Install Keil

skills CLI
$ npx skills add zhinkgit/embeddedskills --skill keil -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install zhinkgit/embeddedskills keil --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/zhinkgit/embeddedskills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/keil .claude/skills/keil && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
keil
GitHub stars
733
Token cost
~883 tokens
SKILL.md length
176 words
Files
7 (incl. scripts, references)
Skills in repo
11
Repo updated
First seen
Licence
MIT

At a glance

Keil MDK 工程构建工具,用于扫描 .uvprojx/.uvproj/.uvmpw 工程、枚举 Target、执行 build/rebuild/clean 并解析构建日志,返回可供 jlink/openocd 复用的产物路径。

  • Works in 5 steps: CLI 显式参数 → 环境级配置(skill/config.json) → 工程级配置(.embeddedskills/config.json) → …
  • SKILL.md covers 配置, 子命令, 执行流程 and 脚本调用, plus 3 more sections
  • Runs Python scripts from its folder; calls python

What it does

Keil is an agent skill from zhinkgit/embeddedskills. Keil MDK 工程构建工具,用于扫描 .uvprojx/.uvproj/.uvmpw 工程、枚举 Target、执行 build/rebuild/clean 并解析构建日志,返回可供 jlink/openocd 复用的产物路径。 flash 子命令仅作为兼容入口保留。当用户提到 Keil、MDK、uVision、UV4、 Target 枚举、编译、重建、清理、烧录、下载固件、flash 时自动触发,也兼容 /keil 显式调用。 即使用户只是说"编译一下"或"烧录到板子上",只要上下文涉及嵌入式 Keil 工程就应触发此 skill。

Its SKILL.md is about 880 tokens, which your agent loads only when the skill is triggered. The skill folder holds 8 other files, including scripts and reference files (for example `README.md`, `config.example.json` and `references/compiler-notes.md`).

The repository describes itself as: An open-source collection of embedded development and debugging skills for Claude Code, Copilot, TRAE, and other AI coding assistants that support the Skill protocol. Once… The licence is MIT.

Example prompts

  • “烧录到板子上”
  • “/keil”

Requirements

  • Python 3

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

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

What it can do on your machine

Read from SKILL.md and the folder at commit 536c1f9. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 3 files in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Keil loads about 883 tokens when it runs, and up to ~1.3k if it reads all its reference files. Until then it costs about 69 tokens; SKILL.md has 176 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~69
When it runs · the whole SKILL.md, loaded when a task matches
~883
With references · SKILL.md plus every file in references/, read only if the agent opens them
~1.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from zhinkgit/embeddedskills at commit 536c1f9, republished under its MIT licence (© zhinkgit). 176 words, ~883 tokens.

Download SKILL.mdSave it as .claude/skills/keil/SKILL.md (or your agent's skills folder). This skill also uses 6 other files; get the full folder from GitHub.
name
keil
description
Keil MDK 工程构建工具,用于扫描 .uvprojx/.uvproj/.uvmpw 工程、枚举 Target、执行 build/rebuild/clean 并解析构建日志,返回可供 jlink/openocd 复用的产物路径。 flash 子命令仅作为兼容入口保留。当用户提到 Keil、MDK、uVision、UV4、 Target 枚举、编译、重建、清理、烧录、下载固件、flash 时自动触发,也兼容 /keil 显式调用。 即使用户只是说"编译一下"或"烧录到板子上",只要上下文涉及嵌入式 Keil 工程就应触发此 skill。
argument-hint
[scan|targets|build|rebuild|clean|flash] ...

Keil MDK 工程构建

本 skill 提供 Keil MDK 工程的发现、Target 枚举、构建、重建、清理能力,并返回可供 jlink/openocd 继续使用的固件产物路径。flash 仅作为兼容入口保留。

配置

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

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

json
{
  "uv4_exe": "C:\\Keil_v5\\UV4\\UV4.exe",
  "operation_mode": 1
}
  • uv4_exe:UV4.exe 完整路径(必填)
  • operation_mode:1 直接执行 / 2 输出风险摘要但不阻塞 / 3 执行前确认
工程级配置(workspace/.embeddedskills/config.json)

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

json
{
  "keil": {
    "project": "",
    "target": "",
    "log_dir": ".embeddedskills/build"
  }
}
  • project:默认工程路径(相对 workspace),构建成功后会自动更新
  • target:默认 Target 名称,构建成功后会自动更新
  • log_dir:构建日志输出目录,默认 .embeddedskills/build
参数解析优先级

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

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

子命令

子命令用途风险
scan搜索当前目录下的 .uvprojx/.uvproj/.uvmpw 工程低
targets枚举工程中的 Target低
build增量编译中
rebuild全量重建中
clean清理工程高
flash通过 Keil 烧录固件(兼容入口,优先建议使用 jlink/openocd)高

执行流程

  1. 读取 config.json,确认 uv4_exe 路径有效
  2. 未指定子命令时默认执行 scan
  3. 未提供工程路径时先执行 scan 搜索工程
  4. 同时发现多个工程或多个 Target 时,列出选项让用户选择,绝不自动猜测
  5. build/rebuild/clean 按 operation_mode 决定是否需要确认
  6. build/rebuild 成功后,尽量从工程配置中解析 flash_file / debug_file 等产物路径
  7. flash 仅在最近一次构建成功时允许执行
  8. 所有构建命令输出到日志文件后解析,返回结构化结果

脚本调用

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

keil_project.py — 工程扫描与 Target 枚举
bash
# 扫描工程
python <skill-dir>/scripts/keil_project.py scan --root <搜索目录> --json

# 枚举 Target
python <skill-dir>/scripts/keil_project.py targets --project <工程路径> --json
keil_build.py — 构建 / 重建 / 清理 / 烧录
bash
python <skill-dir>/scripts/keil_build.py <build|rebuild|clean|flash> \
  --uv4 <UV4路径> \
  --project <工程路径> \
  --target <TargetName> \
  --log-dir <日志目录> \
  --json

rebuild 额外支持 --clean-first 使用 -cr 而非 -r。

输出格式

所有脚本以 JSON 格式返回,基础字段为 status(ok/error)、action、summary、details,并可能附带 context、artifacts、metrics、state、next_actions、timing。

成功示例:

json
{
  "status": "ok",
  "action": "build",
  "summary": "build 成功,errors=0 warnings=2",
  "details": {
    "project": "project.uvprojx",
    "target": "Debug",
    "log_file": ".build/project-Debug-build.log",
    "flash_file": "Objects/project.hex",
    "debug_file": "Objects/project.axf"
  },
  "metrics": { "errors": 0, "warnings": 2, "flash_bytes": 32768, "ram_bytes": 8192 }
}

错误示例:

json
{
  "status": "error",
  "action": "flash",
  "error": { "code": "build_not_clean", "message": "最近一次构建存在错误,禁止继续烧录" }
}

核心规则

  • 不修改工程配置文件(.uvprojx / .uvproj / .uvmpw / .uvoptx)
  • .uvproj(旧版 MDK4 工程)与 .uvprojx 共用同一套 XML 结构(Target/TargetOption/TargetCommonOption),产物解析、Target 枚举、扫描均已支持两种后缀
  • 不自动猜测工程路径或 Target,有歧义时必须询问用户
  • 参数解析优先级详见上方"参数解析优先级"章节
  • 构建成功后优先使用返回的 flash_file / debug_file 与 jlink/openocd 串联
  • flash 前必须确认最近一次构建成功(errors == 0)
  • clean 不在自动流程中隐式执行
  • 构建失败时优先展示首个错误和日志文件路径
  • 结果回显中始终包含工程名、Target 名、日志路径;若识别到产物路径也要回显

参考

遇到编译器相关问题时可查阅 references/compiler-notes.md。

© zhinkgit, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 6 other files (scripts, references) in keil of zhinkgit/embeddedskills.

  • SKILL.md
  • README.md
  • config.example.json
  • references/compiler-notes.md
  • scripts/keil_build.py
  • scripts/keil_project.py
  • scripts/keil_runtime.py

Open the folder on GitHubat commit 536c1f9

Compare with similar skills

Keil next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Keil compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Keil this skillzhinkgit/embeddedskills733—~883Automated safety check: PassMIT
KeilTansuo2021/ADtoKeil188—~1.2kAutomated safety check: PassGPL-3.0
Build KeilLeoKemp223/embed-ai-tool984—~619Automated safety check: PassNone
Flash KeilLeoKemp223/embed-ai-tool984—~459Automated safety check: PassNone
Embedded Firmware From HardwareTansuo2021/ADtoKeil188—~1.5kAutomated safety check: PassGPL-3.0
Mspm0 Ccsmc3545dada/mspm0-skill374—~4.5kAutomated safety check: PassMIT

Similar skills

  • Keil

    Tansuo2021/ADtoKeil

    Keil MDK/uVision build skill for embedded projects. An agent skill from Tansuo2021/ADtoKeil.

    188 GitHub stars~1.2k tokensUpdated 4 mo ago
    Auto-check passed
  • Build Keil

    LeoKemp223/embed-ai-tool

    当需要通过 Keil MDK 命令行编译嵌入式工程,调用自带脚本解析工程文件、执行构建并定位固件产物时使用. An agent skill from LeoKemp223/embed-ai-tool.

    984 GitHub stars~619 tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Flash Keil

    LeoKemp223/embed-ai-tool

    当需要通过 Keil MDK 内置调试器烧录固件到目标板时使用,利用工程中已配置的调试器和 Flash 算法执行下载. An agent skill from LeoKemp223/embed-ai-tool.

    984 GitHub stars~459 tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Build and review maintainable embedded MCU firmware from schematic, PCB, netlist, pin-map, BOM, Keil/C51/MDK projects, vendor demo code, or hardware debug evidence.

    188 GitHub stars~1.5k tokensUpdated 4 mo ago
    DevelopmentAuto-check passed
  • Mspm0 Ccs

    mc3545dada/mspm0-skill

    Tool-neutral CLI agent rules for TI MSPM0 development with Code Composer Studio, Keil/uVision, CMake/GCC/OpenOCD, SysConfig, and DriverLib.

    374 GitHub stars~4.5k tokensUpdated 2 mo ago
    Agent WorkflowsAuto-check passed
  • Eide

    zhinkgit/embeddedskills

    EIDE (Embedded IDE) 工程构建工具,用于扫描 .eide/eide.yml 工程、枚举构建 配置 (ConfigName)、执行 build/rebuild/clean 并解析构建日志,返回可供 jlink/openocd 复用的产物路径。当用户提到 EIDE、Embedded IDE、eide.yml、 unifybuilder、VS Code EIDE…

    733 GitHub stars~1.2k tokensUpdated 1 mo ago
    Auto-check passed

More from zhinkgit/embeddedskills

All 11 skills in this repo
  • Can

    zhinkgit/embeddedskills

    嵌入式 CAN / CAN-FD 调试工具,用于扫描接口、监控报文、发送测试帧、记录日志、数据库文件解码和总线统计. An agent skill from zhinkgit/embeddedskills.

    733 GitHub stars~1k tokensUpdated 1 mo ago
    Auto-check passed
  • Jlink

    zhinkgit/embeddedskills

    J-Link 下载与在线调试工具,用于探测设备、烧录固件、读写内存、查看寄存器、复位目标、读取 RTT/SWO 日志, 以及在线调试(暂停/恢复/单步/断点运行/调用栈/变量查看)。

    733 GitHub stars~2k tokensUpdated 1 mo ago
    Auto-check passed
  • Openocd

    zhinkgit/embeddedskills

    OpenOCD 下载与调试工具,用于探针探测、固件烧录、Flash 擦除、GDB Server 启动、目标复位控制、 Telnet 在线调试(halt/resume/step/寄存器/内存/断点)、GDB 源码级调试,以及 Semihosting/ITM 输出捕获和底层查询。

    733 GitHub stars~2.7k tokensUpdated 1 mo ago
    Auto-check passed
  • Serial

    zhinkgit/embeddedskills

    嵌入式串口调试工具,用于扫描串口、实时监控、发送数据、记录日志和 Hex 查看. An agent skill from zhinkgit/embeddedskills.

    733 GitHub stars~1.4k tokensUpdated 1 mo ago
    Auto-check passed
  • Gcc

    zhinkgit/embeddedskills

    GCC 嵌入式工程构建工具(CMake + arm-none-eabi-gcc),用于扫描 CMake 型嵌入式工程、 列出预设、配置、编译、重建、清理和分析 ELF 大小。当用户提到 GCC、arm-none-eabi、 CMake 嵌入式编译、Ninja 构建、ELF 大小分析、arm-gcc、交叉编译、cmake --build、 cmake --preset 时自动触发,也兼容…

    733 GitHub stars~993 tokensUpdated 1 mo ago
    Auto-check passed
  • Probe Rs

    zhinkgit/embeddedskills

    probe-rs 下载与调试工具,用于探针发现、固件烧录、复位、内存读写、GDB Server 调试和 RTT 日志读取。

    733 GitHub stars~767 tokensUpdated 1 mo ago
    Auto-check passed

Questions about Keil

What does Keil do?

Keil MDK 工程构建工具,用于扫描 .uvprojx/.uvproj/.uvmpw 工程、枚举 Target、执行 build/rebuild/clean 并解析构建日志,返回可供 jlink/openocd 复用的产物路径。. Keil is an agent skill from zhinkgit/embeddedskills.

How do I install Keil in Claude Code?

Run `npx skills add zhinkgit/embeddedskills --skill keil -a claude-code`. Or copy the skill folder (keil in zhinkgit/embeddedskills) into .claude/skills/keil in your project. Claude Code loads it when a task matches its description.

How do I install Keil in Codex?

Run `npx skills add zhinkgit/embeddedskills --skill keil -a codex`. Or copy the skill folder (keil in zhinkgit/embeddedskills) into .agents/skills/keil in your project. Codex loads it when a task matches its description.

Can I use Keil in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add zhinkgit/embeddedskills --skill keil -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/keil, .gemini/skills/keil, .github/skills/keil and .opencode/skills/keil in your project.

What does Keil need to run?

Going by SKILL.md and its folder, Keil needs Python for the scripts in its folder and the command-line tools its instructions call (python). Our summary lists: Python 3.

Does Keil access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Keil safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Keil use?

Keil is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Keil use?

About 883 tokens (SKILL.md is roughly 3.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 369 tokens, read only when the agent opens those files.

What are the alternatives to Keil?

Skills that share tags, products or a category with Keil: Keil (Tansuo2021/ADtoKeil, 188 stars), Build Keil (LeoKemp223/embed-ai-tool, 984 stars), Flash Keil (LeoKemp223/embed-ai-tool, 984 stars) and Embedded Firmware From Hardware (Tansuo2021/ADtoKeil, 188 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Keil?

zhinkgit (a GitHub user) maintains it in zhinkgit/embeddedskills, which has 733 GitHub stars. The repository holds 11 skills in this directory. The repository was last updated on September 3, 2026.

Source: zhinkgit/embeddedskills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.