MCPcopy Index your code
hub / github.com/agent-sh/agnix

github.com/agent-sh/agnix @v0.37.5

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.37.5 ↗ · + Follow
7,170 symbols 22,497 edges 225 files 860 documented · 12%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

agnix

agnix

Lint agent configurations before they break your workflow

<a href="https://www.npmjs.com/package/agnix"><img src="https://img.shields.io/npm/v/agnix.svg?color=3C873A" alt="npm"></a>
<a href="https://crates.io/crates/agnix-cli"><img src="https://img.shields.io/crates/v/agnix-cli.svg?color=E57324" alt="Crates.io"></a>
<a href="https://github.com/agent-sh/agnix/releases"><img src="https://img.shields.io/github/v/release/agent-sh/agnix?color=0A7E8C" alt="Release"></a>
<a href="https://github.com/agent-sh/agnix/actions/workflows/ci.yml"><img src="https://github.com/agent-sh/agnix/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
<a href="https://github.com/agent-sh/agnix/raw/v0.37.5/LICENSE-MIT"><img src="https://img.shields.io/badge/license-MIT%2FApache--2.0-64748B.svg" alt="License"></a>
<a href="https://github.com/hesreallyhim/awesome-claude-code"><img src="https://awesome.re/mentioned-badge.svg" alt="Mentioned in Awesome Claude Code"></a>

Catch broken agent configs before your AI tools silently ignore them.

432 rules across Claude Code, Codex CLI, OpenCode, Cursor, Copilot, and more -

validating CLAUDE.md, SKILL.md, hooks, MCP configs, and other agent files.

Auto-fix | GitHub Action | VS Code + JetBrains + Neovim + Zed

Website Playground Blog Post

New rules and tool support ship constantly. Follow for real-time updates:

Follow on X

Why agnix?

Your skills don't trigger. Vercel's research found skills invoke at 0% without correct syntax. One wrong field and your skill is invisible.

"Almost right" is the worst outcome. 66% of developers cite it as their biggest AI frustration. Misconfigured agents produce exactly this.

Multi-tool stacks fail silently. Cursor + Claude Code + Copilot each want different formats. A config that works in one tool breaks in another.

Bad patterns get amplified. AI assistants don't ignore wrong configs - they learn from them.

agnix validates all of it - 432 rules sourced from official specs, academic research, and real-world breakage patterns. Auto-fix included.

Want to try it first? Open the playground - paste any agent config, see diagnostics instantly. No install, runs in your browser.

Quick Start

$ npx agnix .
Validating: .

CLAUDE.md:15:1 warning: Generic instruction 'Be helpful and accurate' [fixable]
  help: Remove generic instructions. Claude already knows this.

.claude/skills/review/SKILL.md:3:1 error: Invalid name 'Review-Code' [fixable]
  help: Use lowercase letters and hyphens only (e.g., 'code-review')

Found 1 error, 1 warning
  2 issues are automatically fixable

hint: Run with --fix, --fix-safe, or --fix-unsafe to apply fixes

https://github.com/user-attachments/assets/72d5fe7c-476f-46ea-be64-5785cf6d5600

Install

# npm (recommended, all platforms)
npm install -g agnix

# Homebrew (macOS/Linux)
brew tap agent-sh/agnix && brew install agnix

# Cargo
cargo install agnix-cli

Pre-built binaries | All install options

Editor Extensions

Editor Install
VS Code VS Code Marketplace
JetBrains JetBrains Marketplace
Neovim { "agent-sh/agnix", config = function() require("agnix").setup() end }
Zed Search "agnix" in Extensions

Editor setup guide

GitHub Action

- name: Validate agent configs
  uses: agent-sh/agnix@v0
  with:
    target: 'claude-code'

Usage

agnix .              # Validate current directory
agnix --fix .        # Apply only safe fixes
agnix --fix-safe .   # Explicit safe-only fix mode
agnix --fix-unsafe . # Apply all fixes, including medium and LOW confidence
agnix --dry-run --show-fixes .  # Preview fixes with inline diff output
agnix --strict .     # Strict mode (warnings = errors)
agnix --format github .  # GitHub Actions annotations
agnix explain MCP-018    # Explain a rule and its evidence
agnix --target claude-code .  # Legacy target preset (primarily affects CC-* rules)
agnix --target kiro .         # Legacy target preset (use tools = [...] for tool-only filtering)

Full CLI reference | Full rules reference

Supported Tools

Tool Rules Count Config Files
Agent Skills AS-*, CC-SK-* 31 SKILL.md
Claude Code CC-* 53 CLAUDE.md, hooks, agents, plugins
GitHub Copilot COP-* 6 .github/copilot-instructions.md, .github/instructions/*.instructions.md
Cursor CUR-* 16 .cursor/rules/*.mdc, .cursorrules, .cursor/hooks.json, .cursor/agents/**/*.md, .cursor/environment.json
Kiro KIRO-*, KR-SK-*, KR-AG-*, KR-HK-*, KR-PW-*, KR-MCP-* 52 .kiro/steering/**/*.md, .kiro/skills/**/SKILL.md, .kiro/agents/*.json, .kiro/hooks/*.kiro.hook, .kiro/settings/mcp.json, .kiro/powers/*/POWER.md
MCP MCP-* 12 *.mcp.json
AGENTS.md AGM-*, XP-* 13 AGENTS.md, AGENTS.local.md, AGENTS.override.md
Cline CLN-* 4 .clinerules, .clinerules/*.md, .clinerules/*.txt
Gemini CLI GM-* 9 GEMINI.md, GEMINI.local.md, .gemini/settings.json (hooks), gemini-extension.json (extensions), .geminiignore

Architecture

Rust workspace crates: - agnix-rules - rule metadata generated from knowledge-base/rules.json - agnix-core - shared validation engine library - agnix-cli - command-line interface binary - agnix-lsp - language server binary - agnix-mcp - MCP server binary - agnix-wasm - WebAssembly bindings for browser/runtime integrations

Contributing

Contributions welcome. See CONTRIBUTING.md for the development guide.

Report a bug | Request a rule | Good first issues

License

MIT OR Apache-2.0


Star this repo to help other developers find agnix.

Extension points exported contracts — how you extend this code

ValidatorProvider (Interface)
A provider of validator factories. Implement this trait to supply validators from an external source (e.g., a plugin or [22 …
crates/agnix-core/src/registry.rs
LspConfig (Interface)
* LSP configuration structure sent to the language server. * * Maps VS Code settings to the Rust LintConfig structure.
editors/vscode/src/extension.ts
Validator (Interface)
Trait for file validators. Implementors define validation logic for specific file types. Each validator is created by a [51 …
crates/agnix-core/src/rules/mod.rs
ClientLifecycleDelegate (Interface)
(no doc)
editors/vscode/src/clientLifecycle.ts
FrontmatterRanges (Interface)
Trait for frontmatter types that support value range finding. Both ParsedFrontmatter (copilot) and ParsedMdcFrontmatter [6 …
crates/agnix-core/src/rules/mod.rs
VersionCheckDeps (Interface)
(no doc)
editors/vscode/src/version-check.ts
FileTypeDetector (Interface)
A single file type detection strategy. Implementors inspect a path and return `Some(FileType)` when they recognise the [4 …
crates/agnix-core/src/file_types/detector.rs
PlatformInfo (Interface)
(no doc)
editors/vscode/src/extension.ts

Core symbols most depended-on inside this repo

path
called by 1087
crates/agnix-core/src/diagnostics.rs
push
called by 890
crates/agnix-core/src/file_types/detector.rs
validate
called by 713
crates/agnix-core/src/rules/mod.rs
with_suggestion
called by 670
crates/agnix-core/src/diagnostics.rs
is_rule_enabled
called by 473
crates/agnix-core/src/config/rule_filter.rs
len
called by 416
crates/agnix-core/src/file_types/detector.rs
as_str
called by 382
crates/agnix-core/src/schemas/cross_platform.rs
is_empty
called by 281
crates/agnix-core/src/file_types/detector.rs

Shape

Function 6,067
Method 675
Class 365
Enum 49
Interface 14

Languages

Rust94%
Kotlin3%
TypeScript2%
Python1%
Ruby1%

Modules by API surface

crates/agnix-core/src/config/tests.rs261 symbols
crates/agnix-core/src/rules/skill/tests.rs221 symbols
crates/agnix-core/src/rules/codex.rs215 symbols
crates/agnix-core/src/rules/opencode.rs211 symbols
crates/agnix-core/src/rules/hooks/tests.rs206 symbols
crates/agnix-core/tests/lib_tests.rs192 symbols
crates/agnix-core/src/rules/mcp.rs177 symbols
crates/agnix-core/src/rules/agent.rs174 symbols
crates/agnix-core/src/rules/claude_settings.rs153 symbols
crates/agnix-core/src/registry.rs145 symbols
crates/agnix-cli/tests/cli_integration.rs144 symbols
crates/agnix-core/src/diagnostics.rs143 symbols

For agents

$ claude mcp add agnix \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact