Footgun Guard logo

Footgun Guard

Community
PenglinChina
footgun-guard

GuardList 守卫。在编写、修改、审阅或阅读 C / C++ / C# / Java / Python / JavaScript / TypeScript / Go / Rust 代码时,防止踩中 80 条已知 footgun (空指针/内存/闭包捕获/隐式转换/集合变更/浮点/并发,以及目标替换/伪修复/ 过度自信等交付物问题)。当用户说 "footgun"、"GuardList"、"检查这段代码"、 "review 我的改动"、"读一下这个项目" 时使用。含确定性检测器与编辑后自动提醒。

Overview

PublisherPenglinChina
Repositoryfootgun-guard
Skill namefootgun-guard
Stars
76
Forks
0
Bundled files
31
LicenseMIT
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.

  • 31 bundled files

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

  • Open source

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

Installation

Install the Footgun Guard 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/PenglinChina/footgun-guard/tree/main/.agent/skills/footgun-guard
  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/PenglinChina/footgun-guard.git /tmp/footgun-guard
mkdir -p .claude/skills
cp -r /tmp/footgun-guard/.agent/skills/footgun-guard .claude/skills/footgun-guard
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Footgun Guard 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 Footgun Guard 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 Footgun Guard 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.

FootgunGuard

你在写、改、审、读代码时,必须主动规避 GuardList 里的 80 条 footgun(其中 19 条没有检测器,只能人工判断),并在结束前自检一遍。这份清单不是"注意事项",是可判定的失败模式:每一条都有具体的触发写法和具体的改法。

Setup

  1. 先跑一次 node .agent/skills/footgun-guard/scripts/cli.js context,它按当前项目的语言列出相关条目;也可直接读 reference/<语言>.md(相对本 SKILL.md 所在目录)。
  2. 只有相关的语言包才展开细读:C / C++ / C# / Java / Python / JavaScript / Go / Rust。不要为了"全面"把 8 个文件全读进上下文。
  3. 编辑过程中,若宿主装了 hook,检测到的发现会被直接推给你(第③层)。收到就修,不要忽略,也不要在回复里复述它。

node .agent/skills/footgun-guard/scripts/cli.js 是本技能自带检测器的调用方式。若你把本技能装到了别的路径,用那个路径替换;技能目录里还带 scripts/,无需另装依赖。

三条总律

  • 先读后写。 改一个函数前先读它的所有调用方与它依赖的类型定义。清单里的多数 footgun 是"局部看起来正确、跨边界才出错"(数组退化、对象切片、迭代器失效、闭包捕获、切片共享)。
  • 检查必须改变控制流。 只记日志、只断言、只吞异常的"防御"不算防御(共通3)。写完问一句:这个检查失败时,谁观察到、然后发生了什么?
  • 不写没核实过的 API。 拿不准签名就去读本地依赖的源码(共通1)。宁可少用一个函数,不要猜参数顺序。

什么时候做什么

场景动作
写新代码按语言读 reference/<语言>.md,写完跑 node .agent/skills/footgun-guard/scripts/cli.js detect <改动文件>,退出码 2 就修
改现有代码先 grep 该符号的所有调用方,再改;改完同样自检
审 diff读 reference/review.md 并按它执行:读改动及其触碰的未改动文件,按 P0→P3 排序,每条给出"会发生什么"
读陌生项目读 reference/audit.md:先排除"已经写在代码里的 footgun",再回答用户的问题
交付/汇报前按 reference/common.md 的 共通6–13 自检:目标、语义、范围、完成证据
想知道某条为什么算 footgunnode .agent/skills/footgun-guard/scripts/cli.js explain <rule-id>

自检(回答前跑一遍)

  1. 我这次改动触碰的每个文件,detect 是否干净?没修的那条,我在回复里说明了吗?
  2. 我加的每个 if/try/assert,失败路径是否真的有人处理?(共通3)
  3. 注释里提到的边界,代码里是否有对应分支?(共通4)
  4. 我写的测试,期望值是从需求推出来的,还是从实现抄的?(共通5)
  5. 我用的每个库函数,签名是否在本地确认过?(共通1)
  6. 我的完成声明有实际运行证据吗?(共通12)
  7. 验证手段失效时,我写清边界与置信度了吗?(共通13)
  8. diff 里有没有未经授权的范围扩大?(共通11)

检测器的诚实边界

  • 自动检测只覆盖可判定的写法。common 里 12 条只能人工判断(4 条代码判据 + 8 条交付物判据),detect 的输出会明说"发现是不完全统计,不是健康证明"。
  • 有 3 种情况会被漏报:注释/字符串里的代码(被掩码)、#include 引入的宏展开、跨文件的类型推断。
  • Rust 的 6 条大多被 rustc 在编译期强制,检测器只补 3 条运行时语义(自引用结构体 / RefCell 重复借用 / Drop 中 panic)。不要以为"detect 干净"等于 Rust 安全。
  • 带 tier: heuristic 的规则宁可漏报:它们只在证据明确时开口。

Playbook

文件用途
reference/common.md共通 13 条(其中 12 条无检测器,只有判据与反例)
reference/c.md … reference/rust.md8 个语言包,每条含修复写法
reference/review.md审 diff 的流程与 P0-P3 输出格式
reference/audit.md读陌生项目的顺序与输出格式

结束时

用一两行说明:哪些发现没修、为什么;以及你没能验证的部分(没跑测试、没编过、没读到的调用方)。不要把"我检查过了"当结论。


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 Footgun Guard AI skill do?

GuardList 守卫。在编写、修改、审阅或阅读 C / C++ / C# / Java / Python / JavaScript / TypeScript / Go / Rust 代码时,防止踩中 80 条已知 footgun (空指针/内存/闭包捕获/隐式转换/集合变更/浮点/并发,以及目标替换/伪修复/ 过度自信等交付物问题)。当用户说 "footgun"、"GuardList"、"检查这段代码"、 "review 我的改动"、"读一下这个项目" 时使用。含确定性检测器与编辑后自动提醒。

Why use Footgun Guard on TypingMind?

Because you install it once and use it with any model. Footgun Guard 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 Footgun Guard in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/PenglinChina/footgun-guard/tree/main/.agent/skills/footgun-guard. 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 Footgun Guard?

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 Footgun Guard?

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

Is the Footgun Guard AI skill free?

Yes. It is published on GitHub by PenglinChina under the MIT license. 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 👇