agnix-lsp
Language Server Protocol implementation for agnix.
Provides real-time validation of agent configuration files in editors that support LSP.
Installation
Or build from the workspace root:
The binary will be at target/release/agnix-lsp.
Usage
The server communicates over stdin/stdout using the LSP protocol:
Editor Configuration
VS Code
A dedicated VS Code extension is available at editors/vscode. See editors/vscode/README.md for installation and usage.
Neovim (with nvim-lspconfig)
local lspconfig = require
local configs = require
if not configs.
lspconfig..
Helix
Add to ~/.config/helix/languages.toml:
[[]]
= "markdown"
= ["agnix-lsp"]
[]
= "agnix-lsp"
Zed
Install the agnix extension from the Zed Extensions panel:
- Open Zed > Extensions (
cmd+shift+x) - Search for "agnix"
- Click Install
The extension automatically downloads the agnix-lsp binary. See editors/zed/README.md for details.
Features
-
Real-time diagnostics as you type (via textDocument/didChange)
-
Real-time diagnostics on file open and save
-
Supports all agnix validation rules (385 rules)
-
Project-level validation for cross-file rules (AGM-006, XP-004/005/006, VER-001)
-
Maps diagnostic severity levels (Error, Warning, Info)
-
Rule codes shown in diagnostic messages
-
Quick-fix code actions for auto-fixable diagnostics
-
Hover documentation for frontmatter fields (name, version, model, etc.)
-
Context-aware completions for frontmatter keys, values, and snippets
Supported File Types
The LSP server validates the same file types as the CLI:
SKILL.md- Agent skill definitionsCLAUDE.md,CLAUDE.local.md,AGENTS.md,AGENTS.local.md,AGENTS.override.md- Memory/instruction files.claude/settings.json,.claude/settings.local.json- Hook configurationsplugin.json- Plugin manifests*.mcp.json,mcp.json,mcp-*.json- MCP tool configurations.github/copilot-instructions.md,.github/instructions/*.instructions.md,.github/agents/*.agent.md,.github/prompts/*.prompt.md,.github/hooks/hooks.json,.github/workflows/copilot-setup-steps.yml- GitHub Copilot configuration.cursor/rules/*.mdc,.cursorrules- Cursor project rules
Development
Run tests:
Build in debug mode:
Architecture
agnix-lsp/
├── src/
│ ├── lib.rs # Public API and server setup
│ ├── main.rs # Binary entry point
│ ├── backend.rs # LSP backend facade and LanguageServer wiring
│ ├── backend/
│ │ ├── events.rs # did_open/did_change/did_save/did_close handlers
│ │ ├── helpers.rs # Diagnostics and path normalization helpers
│ │ ├── revalidation.rs # Config and project revalidation orchestration
│ │ └── tests.rs # Backend unit and regression tests
│ ├── diagnostic_mapper.rs # Converts agnix diagnostics to LSP format
│ ├── code_actions.rs # Quick-fix code action generation
│ ├── completion_provider.rs # Context-aware frontmatter completions
│ ├── hover_provider.rs # Hover documentation for frontmatter fields
│ ├── locale.rs # Localization support
│ ├── position.rs # Byte offset to LSP position conversion
│ └── vscode_config.rs # VS Code settings integration
└── tests/
└── lsp_integration.rs # Integration tests
License
MIT OR Apache-2.0