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.
git clone --depth 1 https://github.com/Jinchen-Yang/diansai-skillnpx agentmods add skills/jinchen-yang/diansai-skill/firmware-scaffoldWrote 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.
[](https://agentmods.dev/skills/jinchen-yang/diansai-skill/firmware-scaffold)<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.
<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>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.
| Model | Per session | Once 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 |
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.
What it actually says
firmware-scaffold —— 固件骨架(流水线 ⑦,控制 lane)
lane: 控制(DeepSeek/GLM 擅长代码) · 门: 编译 + 外设 init 人工核对
复用 KB kb/08-软件架构与调试工程化.md 的 4 层架构 + 裸机时间片调度 + FSM + VOFA,别另发明。控制参数(PID/阈值)一律占位待整定。
前置
design/solution.md、contracts/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 往返
步骤
- 中间件(可移植、可主机编译,先写实):
pid.c(位置式+增量式,抗积分饱和)、scheduler.c(KB08 时间片表)、fsm.c、vofa.c(JustFloat)。这些不依赖 MCU,必须能cc过并跑通单测。 - 驱动层(据 pinmap 出桩):
motor.c(PWM+方向, 引脚取自 pinmap 的 motor* 信号)、encoder.c(QEI)、k230_uart.c(用protocol.h的proto_parse_byte)、imu.c、oled.c。调 DriverLib 处标// TODO: SysConfig/DriverLib。 - 应用层:
app_mission.c用 KB08 的 FSM 模板(状态/事件分离),app_track.c外环 PID。 - bsp/pinmap.md:把
contracts/pinmap.yaml转成"引脚-功能-外设"表,供用户在 SysConfig 里照配(生成 .syscfg 需在 CCS 内做,这里出配置清单)。 - 协议:复制
contracts/protocol.h到firmware/contracts/(或软链),K230 收帧只用它。 - 主机自测:
tests/host_test.c编译运行,验 PID 阶跃、调度器节拍、protocol 往返。 - 门:
README写清编译/烧录(指 env/control.md);提醒用户逐项核对外设 init(时钟树/PWM 频率/ADC 采样/中断优先级)对照参考手册;所有 PID 增益/阈值是占位,须在真车整定。
异构模型友好
中间件/驱动是纯代码活,DeepSeek/GLM lane 可跑;正确性交编译 + host_test。控制环时序与电机安全逻辑(限流/急停)建议人写人审。
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.
- 12d ago First seen · 40 lines · 120 tokens per session scan A bb8210c87d1b
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.
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…
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.
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.
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.
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…
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.