v1.1.12: π€ Proactive AI Guardrails: Stop Bad Code *Before* It's Written
AI tools are incredibly powerful, but they consistently hallucinate the same dangerous code patterns: swallowed errors, floating promises, and exposed secrets.
Until now, eslint-plugin-ai-guard caught these mistakes after the AI generated them. With v1.1.12, we are moving the defense line forward. π‘οΈ
Weβre thrilled to introduce npx ai-guard init-context β a brand new interactive CLI command that prevents AI agents from generating these anti-patterns in the first place!
π₯ What's New?
π€ Pre-Emptive AI Rules Generation (npx ai-guard init-context)
Automatically inject structural coding rules directly into your AI editors! This feature translates ai-guard's 17 custom ESLint rules into the specific context instructions required by modern AI tools.
Run this simple command:
```bash
npx ai-guard init-context
```
And select the agents you use. We will instantly orchestrate:
- π§
CLAUDE.mdβ Automatically steer Claude Code and Claude Desktop. - π±οΈ
.cursorrulesβ Force Cursor IDE's chat and completions to avoid bugs. - π
.github/copilot-instructions.mdβ Give GitHub Copilot strict guardrails.
These generated instruction files provide your AI tools with specific Never: and Always: directives along with β/β
code examples, ensuring it generates safe code from the jump.
β‘ CLI Enhancements
- Added
--all,--dry-run,--force, and category-specific--rulesflags to strictly control the context initialization process. - Integrated real-time version bumping injection within generated templates.
- Polished our terminal output visuals for a crisp, premium setup aesthetic.
π Documentation Supercharge
- Vitepress Documentation Expanded: Added a full init-context CLI guide to the static site navigation structure.
- README Rewrite: Introduced the new
π€ Set Up AI Agent Rulescanonical section specifically highlighting proactive context integrations right inside initialization guides.
π Get Started Immediately!
Upgrade your plugin effortlessly:
npm install eslint-plugin-ai-guard@latest --save-dev npx ai-guard init-context --all
Stop fighting the same AI coding hallucinations today.