Borrowing it
Nothing to install: this file belongs to h666zhang/vscode-cube-mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/h666zhang/vscode-cube-mcp/master/AGENTS.mdgit clone --depth 1 https://github.com/h666zhang/vscode-cube-mcpWrote 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/instructions/h666zhang/vscode-cube-mcp/agents-md)<a href="https://agentmods.dev/instructions/h666zhang/vscode-cube-mcp/agents-md"><img src="https://agentmods.dev/badge/instructions/h666zhang/vscode-cube-mcp/agents-md/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/instructions/h666zhang/vscode-cube-mcp/agents-md"><img src="https://agentmods.dev/badge/instructions/h666zhang/vscode-cube-mcp/agents-md.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.01606 | $0.01606 |
| Opus 5.5 | $0.00642 | $0.00642 |
| Sonnet 5.5 | $0.00321 | $0.00321 |
| Haiku 4.5 | $0.00161 | $0.00161 |
Grade A, and why
vscode-cube-mcp AGENTS.md 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 22d 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.
How it starts
The opening of the file, as written. The whole thing — 70 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Vscode_cube_mcp — AGENTS.md(项目约定,agent 必读)
本目录是 Vscode_cube_mcp:封装 STM32CubeMX 命令行(-q) 的 MCP server。
能力边界(最高优先)
- 只做配置层:
.ioc工程配置 + HAL 骨架生成(引脚 / 外设 / 时钟 / 工具链),不做应用层。 - 不生成、不修改、不负责业务代码(LED 闪烁、OLED 显示、传感器驱动、中断处理逻辑等)—— 用户在生成后的工程里自己写。
- 给本工具提需求 / 加功能,同样到骨架为止。
接入后的路径
- 先调
cubemx_help—— 工具清单、可用模板、各外设写法与已知坑都在那里; 不要凭经验猜 set 命令语法。 - 常规顺序:
cubemx_load(读现状)→cubemx_intent(配,自动补时钟/DMA/NVIC 与隐含键) →cubemx_probe(在副本上预演)→ 落盘 →cubemx_generate→cubemx_inspect_output(验收)。 - 11 个工具的 description 首段都写了「什么时候不用我」,照那个走就不会选错;
其中
cubemx_raw_script是降级接口,主链路上没有它的位置。
项目结构
src/vscode_cube_mcp/— 包源码(src 布局,入口python -m vscode_cube_mcp)cubemx_mcp.py— MCP server(11 个工具;只做参数校验、编排与结果渲染)cubemx_result.py— 步骤名、错误码与统一渲染(失败时能看出卡在哪一步)knowledge_loader.py— 读knowledge/的 YAML;查不到就报错,不猜ioc_editor.py—.ioc文本编辑 + 离线语义预检(写前备份、写后回读校验)intent_resolver.py— 意图 → 动作(信号名与参数都查表得到)ioc_diff.py/output_inspector.py— 结构化 diff / 看生成产物(都只读)
knowledge/— 知识库:ip/、mcu/从 CubeMX 的 db 导出,rules/是实测规则(每条带verified)templates/— 6.18 原生最小模板(按芯片命名;仅芯片标识 + 72MHz/SWD/SysTick,无外设)tests/— 按模块拆开的单元测试(不依赖 CubeMX)+integration/(真启动 CubeMX,默认跳过)tools/gen_knowledge_from_db.py— 从 CubeMX 安装目录的db/导出知识库(只读)
agent 必须知道的坑
- TIM 内部时钟:
set mode TIMx一律 KO。用cubemx_intent的internal_clock(工具会注入 6.18 验证过的标准表达)。 - RCC 时钟:对 RCC 发 set 命令(如 PLLMUL)会把
RCC.PLLSourceVirtual=HSE弄丢、时钟静默降级 (HSI 64MHz)。改时钟用cubemx_new_project的clock_source/pll_mul。 - USART:
set mode USARTx Asynchronous有效;但 BaudRate 等于 db 默认值(115200)时 CubeMX 不写出那一行 —— 探针/回读里看不到不代表命令没生效(换成 9600 就出现了)。 - 有些参数不在
.ioc里:ContinuousConvMode/ScanConvMode这类"取默认值"的行会被省掉, 最终值要读生成的代码:cubemx_inspect_output(project_dir, pattern=...)。 - "移除外设再加回"会留下中间态:摘要的
init_order会暂时少一项(CubeMX 下次 generate 自己重建, 生成代码不受影响),别据此以为外设没配上。 - 模板必须 6.18 原生生成:手写/非 6.18 的
.ioc会被拒绝;缺模板时报错会列出可用模板与生成方法。 - 用户代码写哪里:CMake 工程写工程根的
CMakeLists.txt(# Add sources to executable/# Add include paths,只生成一次、不重写);cmake/stm32cubemx/CMakeLists.txt每次 generate 全量重写,别动。 STM32CubeIDE 用STM32CubeIDE/Application/User/Core/;EWARM / MDK-ARM 实测(2026-10-15)没有 这种独立用户区 —— 生成的是Core/+Drivers/+EWARM|MDK-ARM/,用户代码写Core/Src/*.c的/* USER CODE BEGIN */块里(CubeMX 只保证块内内容不被覆盖)。 - 其余"实测过的坑"和"工具已经自动处理的坑"(ADC 时钟、SPI 波特率、
project path、 零产出校验……)见docs/README.dev-notes.md与knowledge/rules/*.yaml—— 那些不需要 agent 记。
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.
- 22d ago Changed · -58 lines · -2,093 tokens per session 4d1526af65d5
- 25d ago Changed · +74 lines · +2,558 tokens per session cee3449d50e2
- 2mo ago First seen · 54 lines · 1,141 tokens per session scan A 34bd1c1b3ba8
vscode-cube-mcp AGENTS.md is an instructions file published in the GitHub repository h666zhang/vscode-cube-mcp (2 stars, last pushed 22d ago), licensed MIT. It adds 1,606 tokens to every session, about $0.0064 per session on Opus 5.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.
vscode-cube-mcp AGENTS.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| vscode-cube-mcp AGENTS.mdh666zhang/vscode-cube-mcp | Instructions file | 2 | 22d ago | MIT | A | 1,606 | Codex, OpenCode |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 9,719 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 143k | today | MIT | A | 7,461 | Codex, OpenCode |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 5,516 | GitHub Copilot |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 149k | today | MIT | A | 4,680 | Codex, OpenCode |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 3,093 | GitHub Copilot |
| deepseek-harness AGENTS.mddeepseek-ai/deepseek-harness | Instructions file | 275k | 3d ago | MIT | A | 4,313 | Codex, OpenCode |