Static Analysis logo

Static Analysis

Community
LeoKemp223
static-analysis

当需要对嵌入式 C/C++ 代码运行 cppcheck、clang-tidy 或 GCC analyzer 静态分析,或进行 MISRA-C 合规检查时使用。

Overview

PublisherLeoKemp223
Repositoryembed-ai-tool
Skill namestatic-analysis
Stars
995
Forks
168
Bundled files
4
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 4 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by LeoKemp223 on GitHub. Read the source before you install it.

Installation

Install the Static Analysis AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/LeoKemp223/embed-ai-tool/tree/master/skills/static-analysis
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/LeoKemp223/embed-ai-tool.git /tmp/embed-ai-tool
mkdir -p .claude/skills
cp -r /tmp/embed-ai-tool/skills/static-analysis .claude/skills/static-analysis
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Static Analysis in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Static Analysis on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Static Analysis is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

静态分析

适用场景

  • 提交前需要对代码进行静态分析,发现潜在缺陷。
  • 汽车、医疗等行业需要 MISRA-C 2012 合规检查。
  • 需要使用 cppcheck、clang-tidy 或 GCC -fanalyzer 进行代码质量审查。
  • 需要对静态分析结果按严重级别分组查看摘要。

必要输入

  • 源码目录路径。
  • 至少一个可用的静态分析工具(cppcheck、clang-tidy 或 GCC 12+)。
  • 可选的 compile_commands.json 路径(提升 clang-tidy 准确性)。
  • 可选的严重级别过滤和 MISRA 检查开关。

自动探测

  • --detect 模式检测 cppcheck、clang-tidy 和 arm-none-eabi-gcc 的可用性和版本。
  • GCC -fanalyzer 需要 GCC 12+,脚本会检查版本号。
  • 自动搜索工作区中的 compile_commands.json。

执行步骤

  1. 先阅读 references/usage.md,确认本次使用哪个分析工具。
  2. 若不确定工具是否可用,先运行 scripts/static_analyzer.py 的 --detect 模式。
  3. 使用 --cppcheck --source <dir> 运行 cppcheck 分析。
  4. 使用 --clang-tidy --source <dir> 运行 clang-tidy 分析。
  5. 使用 --gcc-analyzer --source <files> 运行 GCC analyzer 分析。
  6. 需要 MISRA 合规时,添加 --misra 参数启用 cppcheck MISRA addon。
  7. 阅读 references/misra-quick-ref.md 了解常见 MISRA 违规。

失败分流

  • 当所有分析工具都不可用时,返回 environment-missing。
  • 当指定的源码目录不存在时,返回 artifact-missing。
  • 当 compile_commands.json 指定但无效时,返回 project-config-error。
  • 当分析工具运行异常退出时,返回 target-response-abnormal。

平台说明

  • cppcheck 和 clang-tidy 在三大平台均可用,通过包管理器安装。
  • GCC -fanalyzer 需要 GCC 12+,嵌入式交叉编译器版本可能较低。
  • 自带脚本使用 Python 标准库和 subprocess,跨平台兼容。

输出约定

  • 按严重级别(error、warning、style、information)分组输出发现。
  • 每条发现包含文件路径、行号、规则 ID 和描述。
  • --summary 模式只输出统计数字。
  • MISRA 模式额外输出违反的规则编号。

交接关系

  • 当发现严重缺陷需要修复后重新构建时,交给对应的 build-* skill。
  • 当需要了解代码内存影响时,交给 memory-analysis。

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Static Analysis AI skill do?

当需要对嵌入式 C/C++ 代码运行 cppcheck、clang-tidy 或 GCC analyzer 静态分析,或进行 MISRA-C 合规检查时使用。

Why use Static Analysis on TypingMind?

Because you install it once and use it with any model. Static Analysis is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Static Analysis in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/LeoKemp223/embed-ai-tool/tree/master/skills/static-analysis. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Static Analysis?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Static Analysis?

As many as you like. As long as a model supports skills, you can use Static Analysis with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Static Analysis AI skill free?

It is published on GitHub by LeoKemp223. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇