AgentMarketMCP / SKILL 资产档案馆

目录 / 开发工具 / Embedded C/C++ Code Reviewer

SKILL 未评级 已上架

Embedded C/C++ Code Reviewer

--- name: embedded-code-reviewer version: 1.1.0 display_name: 嵌入式C/C++代码审查器 display_name_en: Embedded C/C++ Code Reviewer description_zh: 一段嵌入式C/C++代码喂进来,30秒揪出会让板子死机的雷:ISR里调延时函数、共享变量缺volatile、数组越界、除零、memcpy超限等28条规则,逐条附MISRA C:2012/C++:2008映射与修复建议,一键生成中文HTML审查报告,支持CI门禁。 description_en: Static code review engine for embedded C/C++ with 25 rules covering ISR safety, volatile, array bounds, integer overflow, bitfields and macro side effects. Every finding maps to MISRA C:2012/C++:2008 with fix advice; generates a shareable HTML report. description: 嵌入式C/C++代码静态审查工具,28条规则。查真雷:ISR里调HAL_Delay/printf/RTOS阻塞API(FreeRTOS+RT-Thread双RTOS支持)、共享变量缺volatile、数组越界、整数溢出、寄存器硬编码、裸int位域、宏副作用、C++裸new等,每条附MISRA C:2012/C++:2008编号引用与修复建议,--html一键生成可分享的中文审查报告(自带MISRA覆盖声明)。判据经170,991个真实嵌入式文件语料校准(抽样400实测0错误),120项测试断言。当用户需要review嵌入式C代码、检查ISR安全、代码审查、找bug、查代码问题、程序跑飞/HardFault/随机死机排查、偶发疑难bug定位、毕设课程代码自查、接手老工程摸底体检、MISRA检查、CI代码质量门禁、RT-Thread/FreeRTOS用法检查时使用。 author: fangcun --- # Embedded C/C++ Code Reviewer Give embedded C code a "health check" — no compiling, no toolchain needed. Feed code in, get a severity-ranked issue list (critical/major/minor) with location, root cause, fix advice and MISRA C:2012 rule references for every finding. ## When to Use It - **Latent ISR bombs**: calling `HAL_Delay`/`printf`/`vTaskDelay` inside an ISR — random HardFaults with zero compiler warnings. Rules 1/7/16/22 catch exactly this. - **Un reproducible heisenbugs**: shared ISR/main-loop variables missing `volatile` — the main loop never sees updates under optimization. Rule 2 covers `=`, `++/--`, and all compound assignments. - **MISRA / functional-safety review**: every finding carries MISRA C:2012 rule references verified against IAR C-STAT, Klocwork and Parasoft sources (no invented numbers). - **Taking over an unknown codebase**: `--dir` scans a whole directory; the HTML report shows at a glance where the worst problems live. ## 30-Second Demo Feed in a realistic timer ISR: ```c volatile uint32_t g_adc_raw; uint8_t g_frame_ready; void TIM1_IRQHandler(void) { HAL_Delay(5); // <- wants to wait for ADC g_adc_raw = ADC1->DR; g_frame_ready++; // <- main loop reads this uint8_t buf[4]; buf[5] = 1; // <- off-by-one int total = g_adc_raw * 4096; switch (g_frame_ready) { case 1: break; } vTaskDelay(10); } ``` Review output (**score 66/100**, 4 critical, 2 minor): | Rule | Sev | Location | Issue | MISRA | |------|-----|----------|-------|-------| | R1 | CRIT | L4 | Blocking call `HAL_Delay` inside ISR | MISRA C:2012 14.4 (adapted) | | R2 | MAJ | L6 | Shared var written in ISR without adequate protection pattern | - | | R9 | MAJ | L8 | Array `buf[5]` out of bounds (size 4) | MISRA C:2012 18.1 | | R10 | MIN | L9 | `int total` overflow risk: `g_adc_raw * 4096` exceeds int16 range math assumptions | MISRA C:2012 10.x | | R16 | MAJ | L10 | `switch` without `default` | MISRA C:2012 16.4 | | R7 | CRIT | L11 | RTOS API `vTaskDelay` called from ISR context | - | ## How to Run ```bash python reviewer.py code.c # single file python reviewer.py --dir ./src # whole directory python reviewer.py --html report.html # shareable HTML report ``` Exit codes: 0 = clean, 1 = findings, 2 = internal error. CI-gate friendly. ## What's Inside - 28 rules: ISR blocking calls, volatile, array bounds, integer overflow (incl. return expressions), malloc null-check, float equality, switch default, recursion, RTOS context (FreeRTOS + RT-Thread), large stack arrays, hardcoded register pointers, bitfields, macro side effects and more - Every rule maps to MISRA C:2012 / C++:2008 numbers verified across three commercial tools - Calibrated against a 170,991-file real-world embedded corpus (400-file sample: 0 errors) - 120 test assertions, all green - `references/` carries the rule details; SKILL.md stays lean for agent context ## Hard Rules 1. Findings only from the actual source text — no speculative issues, no invented line numbers. 2. MISRA numbers cited only when verified against at least one commercial-tool source; otherwise explicitly marked "no direct mapping". 3. The tool reviews code; it never rewrites your architecture. Fix advice is a starting point, not a mandate. ## Bundle Notes - `references/` — rule-by-rule details (load on demand) - Works standalone; pairs with embedded-code-generator for a generate-then-review loop

模型生成摘要(rules/v1 · 2026-11-13 18:52):---
这是模型对公开材料的总结,不是官方声明,请以原链内容为准。

存档时间线

版本存档时间内容哈希内容
v12026-11-13 18:52a4c5b7d2 可取

版本索引永久保留;内容副本只保留最新 1 份,更早版本仅留索引与哈希(存档时间线的证据链不会因此断裂)。

下载存档内容副本

相关资产

MCP 需 API Key

mcp-perplexity-search

启用 Perplexity 的 AI API 与大语言模型的集成,通过使用专门的提示模板来实现高级聊天补全,适用于技术文档、代码审查和 API 文档等任务

ERP代码审查
原作者:@spences10 来源:ModelScope MCP 仅卡片存档
SKILL

DDD领域驱动设计技能

DDD 领域驱动设计完整技能套件

代码审查
原作者:renyangy 来源:腾讯 SkillHub、ClawHub 许可:MIT-0 含内容副本 · 可下载 存档:v13 · 2026-10-05 hash 915bae7f
SKILL

Self Dev Miniprogram Review Delivery

微信小程序全流程工作流:CI 自动上传部署、代码审查、安全修复、NPC评审(CNB云开发工程师)、打包发布和交付测试

代码审查
原作者:user_f12a44b7 来源:腾讯 SkillHub 许可:未标注 含内容副本 · 可下载 存档:v1 · 2026-09-21 hash 33fdbb2e
SKILL

K8s专家

K8s专家 覆盖:代码评审、技术方案设计、调试排错、架构权衡

代码审查
原作者:u_441b0ae9 来源:腾讯 SkillHub 许可:Proprietary 含内容副本 · 可下载 存档:v30 · 2026-10-01 hash fe5ec691
SKILL

golang-code-review

为 Git 合并提交提供全面的 Golang 代码审查,检查格式、质量、最佳实践和安全性,并生成详细的 Markdown 报告

代码审查Markdown
原作者:knifean 来源:腾讯 SkillHub、DeepSkill Market 许可:MIT-0 含内容副本 · 可下载 存档:v2 · 2026-10-31 hash 57fb97e3
SKILL

Java Code Reviewer

Java 代码审查报告生成器

代码审查
原作者:wxweven 来源:腾讯 SkillHub、ClawHub 许可:MIT-0 含内容副本 · 可下载 存档:v7 · 2026-10-01 hash 6e328f28
纠错与举报(发现条目失效、署名有误或涉及侵权?)
提交举报 / 纠错

侵权举报经核验成立后,我们会即时下线该条目并删除已存的内容副本。