keil

keil is a skill for Claude Code, Codex from zhinkgit/embeddedskills. It costs 166 tokens per session (1,634 once invoked), scanned A, original, MIT.

An automation tool for Keil MDK projects, the Windows development environment commonly used to build embedded firmware. It finds project files and targets, then runs builds, full rebuilds, or cleans while reading the build logs.

In plain words
What is it for?
Use it to find Keil projects, list their build targets, compile or rebuild firmware, clean build files, and inspect build results. Its flash command is retained for compatibility.
Why use it?
It removes the need to open uVision and repeat project-selection and build steps by hand. It also reports the firmware output path for later use with J-Link or OpenOCD.

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/keil
Any agent
npx skills add zhinkgit/embeddedskills --skill keil
Clone the repo
git clone --depth 1 https://github.com/zhinkgit/embeddedskills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for keil

README.md
[![agentmods](https://agentmods.dev/badge/skills/zhinkgit/embeddedskills/keil.svg)](https://agentmods.dev/skills/zhinkgit/embeddedskills/keil)
Your own site
<a href="https://agentmods.dev/skills/zhinkgit/embeddedskills/keil"><img src="https://agentmods.dev/badge/skills/zhinkgit/embeddedskills/keil.svg" alt="Measured on agentmods" height="20"></a>
Per session 166 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,634 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.00166 $0.01634
Opus 5 $0.00083 $0.00817
Sonnet 5 $0.00033 $0.00327
Haiku 4.5 $0.00017 $0.00163

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

Security

Grade A, and why

keil 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 4d ago.

The scan reads SKILL.md. This mod also ships 3 executable files (scripts/keil_build.py, scripts/keil_project.py, scripts/keil_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.

keil/SKILL.md · 153 lines

How it starts

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

Keil MDK 工程构建

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

配置

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

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

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

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

工程级共享配置统一保存在工作区的 .embeddedskills/config.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/cleanoperation_mode 决定是否需要确认
  6. build/rebuild 成功后,尽量从工程配置中解析 flash_file / debug_file 等产物路径
  7. flash 仅在最近一次构建成功时允许执行
  8. 所有构建命令输出到日志文件后解析,返回结构化结果

脚本调用

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

keil_project.py — 工程扫描与 Target 枚举

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

# 枚举 Target
python <skill-dir>/scripts/keil_project.py targets --project <工程路径> --json

keil_build.py — 构建 / 重建 / 清理 / 烧录

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)、actionsummarydetails,并可能附带 contextartifactsmetricsstatenext_actionstiming

Read the full file on GitHub · 153 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. 4d ago First seen · 153 lines · 166 tokens per session scan A 15be2ef497bf

Subscribe to this mod's changes

keil is a skill published in the GitHub repository zhinkgit/embeddedskills (620 stars, last pushed today), licensed MIT. It adds 166 tokens to every session and 1,634 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

browser-qa

Use when you need lightweight browser QA for a web page, local HTML file, or app: inspect console errors, broken assets, keyboard/focus behavior, viewport readability, and publish evidence-backed findings JSON through a local HTML report viewer.

liatrio-labs/ai-prompts · 51 tokens

mastra-api

Interact with Mastra development server API for debugging agents, viewing conversation threads, listing/inspecting tools and workflows, accessing observability data, and managing Mastra resources. Use when working with Mastra agents and need to inspect runtime state, debug agent errors, view thread history, see…

liatrio-labs/ai-prompts · 80 tokens

create-mermaid-diagrams

Create, validate, and repair Mermaid diagrams for technical documentation with a deterministic CLI feedback loop. Use when an AI needs to create Mermaid diagrams, improve Mermaid diagram quality, validate Mermaid fences in markdown, diagnose Mermaid rendering failures, or fix Mermaid syntax and formatting issues.

liatrio-labs/ai-prompts · 58 tokens

create-pull-request

Generate a reviewer-ready pull request or merge request title and description from branch changes. Use when a user asks to draft PR/MR content, summarize branch deltas against a base branch, or optionally create the PR with gh/glab after approval.

liatrio-labs/ai-prompts · 54 tokens

tilt-dev

Manage local development environments with Tilt. Use when working with projects that run services via Tilt (indicated by presence of Tiltfile), including checking service status, viewing logs, troubleshooting connectivity issues, or managing the Tilt stack. Essential for projects using Tiltfile with localresource for…

liatrio-labs/ai-prompts · 68 tokens

uv-usage

Provides concise guidance for using uv (Python package manager), including project workflows, pip-compatible commands, Python version management, and PEP 723 inline script dependencies. Use when users mention uv, uv run, inline dependencies, PEP 723, or Python dependency/project management.

liatrio-labs/ai-prompts · 59 tokens