From agent-guardrails
Scans project files to detect languages, loads language-specific safety rules, and checks code against antipatterns to prevent bugs and vulnerabilities.
How this skill is triggered — by the user, by Claude, or both
Slash command
/agent-guardrails:language-detectionThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Automatically detect project languages and apply language-specific prevention rules.
Automatically detect project languages and apply language-specific prevention rules.
Know what language you're working in and apply its safety patterns.
Language detection is determined by:
| Language | Config Signals | Rules |
|---|---|---|
| Python | requirements.txt, pyproject.toml, setup.py, Pipfile | eval/exec, subprocess shell=True, bare except, mutable defaults, pickle, hardcoded secrets, SQL injection, type: ignore |
| TypeScript/JS | tsconfig.json, package.json | any type, non-null assertion, eval/Function, innerHTML, console.log, document.write, hardcoded secrets |
| Go | go.mod, go.sum | ignored errors, panic, SQL concat, os/exec, Close without defer, goroutine without context |
| Rust | Cargo.toml, Cargo.lock | unsafe blocks, unwrap, panic!, todo!/unimplemented!, clone on large types, raw pointer deref |
.guardrails/prevention-rules/languages/guardrail_check_pattern is called, both generic and language-specific rules are appliedfilePatterns — Python rules only fire on .py files, etc.Create a JSON file at .guardrails/prevention-rules/languages/<language>.json:
{
"$schema": "./language-rules.schema.json",
"language": "java",
"version": "1.0.0",
"detectors": ["*.java", "pom.xml", "build.gradle"],
"rules": [
{
"id": "java-reflection",
"name": "Reflection usage",
"pattern": "\\.getDeclaredMethod\\s*\\(",
"severity": "warning",
"message": "Reflection bypasses compile-time checking — verify usage is intentional",
"filePatterns": ["\\.java$"]
}
]
}
When using @architectit/pi-guardrails:
guardrail_detect_language — Scan a project directory and return detected languagesguardrail_get_language_profile — Get detected languages + available rules with descriptionsguardrail_check_pattern — Check code content against all loaded rules (generic + language-specific)Language rules are automatically loaded when PatternRuleEngine.loadRules() is called with a LanguageDetector configured. No manual setup needed — detection happens on first rule load.
npx claudepluginhub thearchitectit/agent-guardrails-templateCreates language variants of existing Semgrep rules for static analysis. Ports rules to specified target languages, producing rule and test directories per language.
Guides AI coding agents to write secure code and prevent vulnerabilities across all languages. Activates for authentication, cryptography, data handling, cloud infra, and more.
Detects programming language, framework, build tools, and test commands for any project. Run via /detect-language or ask "what language is this project?".