PenglinChina/footgun-guard
A four-layer local guard for coding agents, from review guidance to CI checks
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Tracked from daily D1 telemetry snapshots. Hover any data point for exact daily star counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
FootgunGuard separates four responsibilities: agent instructions, local detection, post-edit feedback, and CI enforcement. skill/SKILL.md and AGENTS.md guide the agent; src/cli.js routes commands to a dependency-free JavaScript engine. The engine identifies the language, masks comments and strings, and applies rules to source text and nearby context. Rules in src/rules/ map to stable IDs in the Chinese and English GuardLists; manual entries have no detector.
src/commands/hook.js returns findings to the agent as non-blocking additionalContext. CI consumes the scanner's exit status independently of the agent. The integration surface is a local CLI, skill bundles, and host hooks; no MCP transport or server entrypoint is shown.
Key Capabilities & Differentiators
Coverage spans C, C++, C#, Java, JS/TS, Python, Go, and Rust. The current GuardLists contain 80 entries, including deliverable-quality checks; that is not a count of automated detectors. doctor checks mapping completeness and hook wiring, list --manual identifies checks that require review, and explain looks up a rule. The fixture tests check that each language's positive sample hits all of its detectable checklist items and that its clean sample produces no findings.
detect supports JSON, SARIF, and GitHub-oriented output. It returns 0 for a clean scan, 2 for findings, and 1 if a target cannot be scanned. The SARIF upload example deliberately accepts exit 2 so the report can be uploaded. To block merges on findings, configure a required CI check that treats 2 as a failure.
Trade-offs & Limitations
Compared with relying on ESLint and similar language-specific linters alone, FootgunGuard adds a shared review baseline and an edit-to-agent feedback loop across languages. It does not replace richer language tooling: the scanner does not follow cross-function data flow, expand macros, or infer types across files. It treats .h files as C and skips code embedded in masked strings or comments.
Deterministic output makes recurring findings reproducible, not necessarily correct. Context heuristics can still raise false positives, while questions such as whether a test independently validates a requirement need human judgment. Start by reviewing findings on representative code before making the check mandatory. An exit code of 0 confirms only that the enabled detectors found nothing.
Hardware & Deployment Guide
Use Node.js 18.19.0 or newer. The package exposes the footgun binary, but the checkout-based path avoids relying on npm publication: node src/cli.js detect . runs directly from the repository. The scanner needs neither a model API nor a GPU and can run offline on developer machines or CI runners. Start with the intended scan paths when evaluating runtime cost; no resource measurements are available.
For skill installation, node scripts/install.mjs --host claude targets the current project; --scope global selects a user-level install for supported paths. Claude Code's settings snippet and the DSH plugin provide separate hook wiring. Twenty generated host directories are checked in with bundled scanner copies, and node scripts/build.mjs --check verifies that those artifacts match their sources. v0.1.0 is the first integration release.
footgun list --manual exposes checklist items that have no detector.additionalContext.build --check detects drift from source.Polyglot teams using coding agents that want a shared review baseline, immediate post-edit feedback, and a local CI check whose failure policy they control.
You need an MCP endpoint, deep interprocedural analysis, or a tool that can certify code safety from a clean scan.
Quick Start & Installation
node src/cli.js detect . # 扫当前目录 node src/cli.js detect src/ --json # 机器可读 node src/cli.js context # 打印给 agent 的常驻指令块 node src/cli.js list --manual # 列出没有检测器的条目 node src/cli.js explain c-unsafe-string-fn # 查一条规则 node src/cli.js doctor # 自检:规则完整性、hook 接线
Comparison vs. Top Coding, Skills & MCP Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| footgun-guard ★ | 77 | +76 | JavaScript | MIT | A four-layer local guard for coding agents, from review guidance to CI checks |
| taste-skill | 125.3k | +2.9k | JavaScript | MIT | An agent skill for directing company website design and checking builds in a bro |
| agent-skills | 122.5k | +1.7k | JavaScript | MIT | A modular skill pack for consistent coding-agent workflows, from spec to release |
| archify | 103.1k | +2k | JavaScript | Apache-2.0 | Agent skill and Node CLI for source-backed, interactive architecture diagrams. |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/PenglinChina/footgun-guard.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about footgun-guard
How do I connect it to Claude Code, and do I need an MCP server?
node scripts/install.mjs --host claude. To add post-edit feedback, separately merge hooks/claude-settings.json into .claude/settings.json. Run node src/cli.js doctor to check rule coverage and hook wiring.What hardware and runtime does scanning require?
Can a company run it internally or redistribute it?
Should it replace language linters or a deeper static analyzer?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy