firmware-scaffold

firmware-scaffold is a skill for Claude Code from Jinchen-Yang/diansai-skill. It costs 120 tokens per session (1,050 once invoked), scanned A, original, MIT.

A tool for generating the starting structure of control firmware for MSPM0 or STM32 hardware, with optional K230 vision communication. Firmware is the software that runs directly on a device or microcontroller.

In plain words
What is it for?
Use it to scaffold a firmware project with application, middleware, driver, board-support, contract, and test files. It helps set up motor, encoder, IMU, display, UART, PID, scheduler, state-machine, VOFA, and protocol components based on the project’s pin and communication definitions.
Why use it?
It gives the project a consistent four-layer structure, scheduling approach, state machine, PID control, communication, and test layout. Hardware setup and control values still need human checking and tuning.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is contracts/protocol.h # 从 ../../contracts/ 复制或软链(K230 收帧, 勿手改).

Good fit Use it to scaffold a firmware project with application, middleware, driver, board-support, contract, and test files. It helps set up motor, encoder, IMU, display, UART, PID, scheduler, state-machine, VOFA, and protocol components based on the project’s pin and communication definitions.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/Jinchen-Yang/diansai-skill
agentmods
npx agentmods add skills/jinchen-yang/diansai-skill/firmware-scaffold

Made for: Claude Code.

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 firmware-scaffold

README.md
[![agentmods](https://agentmods.dev/badge/skills/jinchen-yang/diansai-skill/firmware-scaffold/github.svg)](https://agentmods.dev/skills/jinchen-yang/diansai-skill/firmware-scaffold)
Your own site
<a href="https://agentmods.dev/skills/jinchen-yang/diansai-skill/firmware-scaffold"><img src="https://agentmods.dev/badge/skills/jinchen-yang/diansai-skill/firmware-scaffold/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for firmware-scaffold

Your own site · 80×15
<a href="https://agentmods.dev/skills/jinchen-yang/diansai-skill/firmware-scaffold"><img src="https://agentmods.dev/badge/skills/jinchen-yang/diansai-skill/firmware-scaffold.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 120 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,050 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00120 $0.01050
Opus 5 $0.00060 $0.00525
Sonnet 5 $0.00024 $0.00210
Haiku 4.5 $0.00012 $0.00105

Measured 12d ago against content hash bb8210c87d1b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

firmware-scaffold 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 12d ago.

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.

.claude/skills/firmware-scaffold/SKILL.md · 40 lines

What it actually says

firmware-scaffold —— 固件骨架(流水线 ⑦,控制 lane)

lane: 控制(DeepSeek/GLM 擅长代码) · : 编译 + 外设 init 人工核对

复用 KB kb/08-软件架构与调试工程化.md4 层架构 + 裸机时间片调度 + FSM + VOFA别另发明。控制参数(PID/阈值)一律占位待整定。

前置

design/solution.mdcontracts/pinmap.yaml(pinmux PASS 过)、contracts/protocol.h(已生成)。

生成结构(写到 firmware/

firmware/
  README.md            # 编译/烧录说明(指向 env/control.md),分层纪律
  app/    app_mission.c # FSM 跑流程(取药→巡线→识别→送达→返航→停)
          app_track.c   # 循迹决策(灰度质心/K230偏差 → 外环PID)
  middleware/ pid.{c,h} scheduler.{c,h} filter.{c,h} fsm.{c,h} vofa.{c,h}   # 与芯片无关, 可主机编译
  driver/ motor.{c,h} encoder.{c,h} imu.{c,h} k230_uart.{c,h} oled.{c,h}    # 调 DriverLib, 据 pinmap
  bsp/    pinmap.md     # 由 pinmap.yaml 导出的引脚配置表(导入 SysConfig 用)
          ti_msp_dl_config.placeholder  # 提示用 SysConfig 生成
  contracts/protocol.h  # 从 ../../contracts/ 复制或软链(K230 收帧, 勿手改)
  tests/  host_test.c   # 主机可编译: 验 pid + scheduler + protocol 往返

步骤

  1. 中间件(可移植、可主机编译,先写实)pid.c(位置式+增量式,抗积分饱和)、scheduler.c(KB08 时间片表)、fsm.cvofa.c(JustFloat)。这些不依赖 MCU,必须能 cc 过并跑通单测。
  2. 驱动层(据 pinmap 出桩)motor.c(PWM+方向, 引脚取自 pinmap 的 motor* 信号)、encoder.c(QEI)、k230_uart.c(用 protocol.hproto_parse_byte)、imu.coled.c。调 DriverLib 处标 // TODO: SysConfig/DriverLib
  3. 应用层app_mission.c 用 KB08 的 FSM 模板(状态/事件分离),app_track.c 外环 PID。
  4. bsp/pinmap.md:把 contracts/pinmap.yaml 转成"引脚-功能-外设"表,供用户在 SysConfig 里照配(生成 .syscfg 需在 CCS 内做,这里出配置清单)。
  5. 协议:复制 contracts/protocol.hfirmware/contracts/(或软链),K230 收帧只用它。
  6. 主机自测tests/host_test.c 编译运行,验 PID 阶跃、调度器节拍、protocol 往返。
  7. README 写清编译/烧录(指 env/control.md);提醒用户逐项核对外设 init(时钟树/PWM 频率/ADC 采样/中断优先级)对照参考手册;所有 PID 增益/阈值是占位,须在真车整定

异构模型友好

中间件/驱动是纯代码活,DeepSeek/GLM lane 可跑;正确性交编译 + host_test。控制环时序与电机安全逻辑(限流/急停)建议人写人审。

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. 12d ago First seen · 40 lines · 120 tokens per session scan A bb8210c87d1b

Subscribe to this mod's changes

firmware-scaffold is a skill published in the GitHub repository Jinchen-Yang/diansai-skill (9 stars, last pushed 1mo ago), licensed MIT. It adds 120 tokens to every session and 1,050 once invoked, about $0.0006 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-31.

Related

Other skills, from other repositories

mspm0-ccs

Tool-neutral CLI agent rules for TI MSPM0 development with Code Composer Studio, Keil/uVision, CMake/GCC/OpenOCD, SysConfig, and DriverLib. Use when an agent needs to inspect or modify MSPM0 projects, edit .syscfg configuration, avoid generated SysConfig/build files, use DriverLib APIs, validate SysConfig output…

mc3545dada/mspm0-skill · 101 tokens

mspm0-skill

Tool-neutral CLI agent rules for TI MSPM0 development with SysConfig, DriverLib, CCS, Keil/uVision, CMake/GCC/OpenOCD, and supported board references. Use when an agent needs to inspect or modify MSPM0 projects, validate SysConfig output, package examples, or work on NUEDC embedded firmware.

Ibook000/mspm0-skill · 76 tokens

llama-cpp

Runs LLM inference on CPU, Apple Silicon, and consumer GPUs without NVIDIA hardware. Use for edge deployment, M1/M2/M3 Macs, AMD/Intel GPUs, or when CUDA is unavailable. Supports GGUF quantization (1.5-8 bit) for reduced memory and 4-10× speedup vs PyTorch on CPU.

davila7/claude-code-templates · 76 tokens

iot-expert

Expert-level IoT systems, embedded devices, edge computing, and IoT protocols. Use when the user mentions embedded, edge computing, MQTT, sensors, or firmware, or when the task involves IoT Architecture, IoT Protocols, Embedded Systems, or Device Design.

personamanagmentlayer/pcl · 59 tokens

embedded-debugging

Debug embedded firmware on real hardware through the jlink-mcp server — crashes, hangs, peripheral misconfiguration, silent devices. Covers loading ELF symbols for source-level backtraces, supplying an SVD for named peripheral fields, and the halt/read/resume discipline. Use whenever debugging a microcontroller over a…

Klievan/jlink-mcp · 77 tokens

iot-skills

Use when developing with Raspberry Pi Pico (RP2040) for GPIO, I2C, Wi-Fi, MQTT, or sensor integration using MicroPython. Index of 1 skill: KE3036 Keyes Pico learning kit.

znlgis/opengis-skills · 50 tokens