agnix

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

agnix

agnix

Lint agent configurations before they break your workflow. Validates Skills, Hooks, MCP, Memory, Plugins across 10+ AI tools including Claude Code, Cursor, GitHub Copilot, Codex CLI, OpenCode, Gemini CLI, Cline, Windsurf, Kiro, and Amp.
在agent配置文件破坏工作流之前对其进行Lint检查。可验证Skills、Hooks、MCP、Memory、Plugins,支持Claude Code、Cursor、GitHub Copilot、Codex CLI、OpenCode、Gemini CLI、Cline、Windsurf、Kiro和Amp等10余种AI工具。

Parse Arguments

解析参数

javascript
const args = '$ARGUMENTS'.split(' ').filter(Boolean);
const targetPath = args.find(a => !a.startsWith('--')) || '.';
const fix = args.includes('--fix');
const strict = args.includes('--strict');
const target = args.find(a => a.startsWith('--target='))?.split('=')[1] || 'claude-code';
javascript
const args = '$ARGUMENTS'.split(' ').filter(Boolean);
const targetPath = args.find(a => !a.startsWith('--')) || '.';
const fix = args.includes('--fix');
const strict = args.includes('--strict');
const target = args.find(a => a.startsWith('--target='))?.split('=')[1] || 'claude-code';

When to Use

使用场景

Invoke when user asks to:
  • "Lint my agent configs"
  • "Validate my skills"
  • "Check my CLAUDE.md"
  • "Validate hooks"
  • "Lint MCP configs"
  • "Fix agent configuration issues"
  • "Check if my SKILL.md is correct"
当用户提出以下需求时调用:
  • "Lint我的agent配置文件"
  • "验证我的skills"
  • "检查我的CLAUDE.md"
  • "验证hooks"
  • "Lint MCP配置文件"
  • "修复agent配置问题"
  • "检查我的SKILL.md是否正确"

Prerequisites

前置条件

agnix must be installed. Check with:
bash
agnix --version
If not installed:
bash
cargo install agnix-cli
必须安装agnix。可通过以下命令检查:
bash
agnix --version
若未安装,执行:
bash
cargo install agnix-cli

Execution

执行步骤

1. Validate Project

1. 验证项目

bash
agnix .
bash
agnix .

2. If Issues Found and Fix Requested

2. 若发现问题且需要修复

bash
agnix --fix .
bash
agnix --fix .

3. Re-validate to Confirm

3. 重新验证以确认修复

bash
agnix .
bash
agnix .

CLI Reference

CLI参考

CommandDescription
agnix .
Validate current project
agnix --fix .
Auto-fix issues
agnix --strict .
Treat warnings as errors
agnix --target claude-code .
Only Claude Code rules
agnix --target cursor .
Only Cursor rules
agnix --watch .
Watch mode - re-validate on changes
agnix --format json .
JSON output
agnix --format sarif .
SARIF for GitHub Code Scanning
命令描述
agnix .
验证当前项目
agnix --fix .
自动修复问题
agnix --strict .
将警告视为错误
agnix --target claude-code .
仅使用Claude Code规则
agnix --target cursor .
仅使用Cursor规则
agnix --watch .
监听模式 - 文件变更时重新验证
agnix --format json .
输出JSON格式结果
agnix --format sarif .
输出SARIF格式用于GitHub代码扫描

Supported Files

支持的文件类型

File TypeExamples
Skills
SKILL.md
Memory
CLAUDE.md
,
AGENTS.md
Hooks
${STATE_DIR}/settings.json
MCP
*.mcp.json
Cursor
.cursor/rules/*.mdc
Copilot
.github/copilot-instructions.md
文件类型示例
Skills
SKILL.md
Memory
CLAUDE.md
,
AGENTS.md
Hooks
${STATE_DIR}/settings.json
MCP
*.mcp.json
Cursor
.cursor/rules/*.mdc
Copilot
.github/copilot-instructions.md

Output Format

输出格式

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

skills/review/SKILL.md:3:1 error: Invalid name [fixable]
  help: Use lowercase letters and hyphens only

Found 1 error, 1 warning (2 fixable)
Exit codes:
  • 0
    - No errors (warnings allowed)
  • 1
    - Errors found
  • 2
    - Invalid arguments
CLAUDE.md:15:1 warning: Generic instruction 'Be helpful' [fixable]
  help: Remove generic instructions. Claude already knows this.

skills/review/SKILL.md:3:1 error: Invalid name [fixable]
  help: Use lowercase letters and hyphens only

Found 1 error, 1 warning (2 fixable)
退出码:
  • 0
    - 无错误(允许存在警告)
  • 1
    - 发现错误
  • 2
    - 参数无效

Rule Categories

规则分类

PrefixCategoryExamples
AS-*Agent SkillsName format, triggers, description
CC-*Claude CodeHooks, memory, plugins
MCP-*MCP ProtocolServer config, tool definitions
PE-*Prompt EngineeringGeneric instructions, redundancy
XP-*Cross-PlatformCompatibility across tools
AGM-*AGENTS.mdStructure, sections
COP-*GitHub CopilotInstructions format
CUR-*CursorMDC format, rules
前缀分类示例
AS-*Agent Skills名称格式、触发条件、描述
CC-*Claude CodeHooks、内存、插件
MCP-*MCP协议服务器配置、工具定义
PE-*提示词工程通用指令、冗余内容
XP-*跨平台跨工具兼容性
AGM-*AGENTS.md结构、章节
COP-*GitHub Copilot指令格式
CUR-*CursorMDC格式、规则

Common Issues & Fixes

常见问题与修复方案

IssueSolution
Invalid skill nameUse lowercase with hyphens:
my-skill
Directory/name mismatchRename directory to match
name:
field
Generic instructionsRemove "be helpful", "be accurate"
Missing trigger phraseAdd "Use when..." to description
问题解决方案
无效的skill名称使用小写字母加连字符:
my-skill
目录/名称不匹配重命名目录以匹配
name:
字段
通用指令删除"be helpful"、"be accurate"这类内容
缺少触发短语在描述中添加"Use when..."

Integration

集成方式

This skill is standalone and can be invoked directly via
/agnix
.
For CI integration, see the GitHub Action.
该Skill可独立使用,直接通过
/agnix
调用。
如需集成到CI流程,请查看GitHub Action

Links

相关链接