agnix
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chineseagnix
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 --versionIf not installed:
bash
cargo install agnix-cli必须安装agnix。可通过以下命令检查:
bash
agnix --version若未安装,执行:
bash
cargo install agnix-cliExecution
执行步骤
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参考
| Command | Description |
|---|---|
| Validate current project |
| Auto-fix issues |
| Treat warnings as errors |
| Only Claude Code rules |
| Only Cursor rules |
| Watch mode - re-validate on changes |
| JSON output |
| SARIF for GitHub Code Scanning |
| 命令 | 描述 |
|---|---|
| 验证当前项目 |
| 自动修复问题 |
| 将警告视为错误 |
| 仅使用Claude Code规则 |
| 仅使用Cursor规则 |
| 监听模式 - 文件变更时重新验证 |
| 输出JSON格式结果 |
| 输出SARIF格式用于GitHub代码扫描 |
Supported Files
支持的文件类型
| File Type | Examples |
|---|---|
| Skills | |
| Memory | |
| Hooks | |
| MCP | |
| Cursor | |
| Copilot | |
| 文件类型 | 示例 |
|---|---|
| Skills | |
| Memory | |
| Hooks | |
| MCP | |
| Cursor | |
| Copilot | |
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:
- - No errors (warnings allowed)
0 - - Errors found
1 - - Invalid arguments
2
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
规则分类
| Prefix | Category | Examples |
|---|---|---|
| AS-* | Agent Skills | Name format, triggers, description |
| CC-* | Claude Code | Hooks, memory, plugins |
| MCP-* | MCP Protocol | Server config, tool definitions |
| PE-* | Prompt Engineering | Generic instructions, redundancy |
| XP-* | Cross-Platform | Compatibility across tools |
| AGM-* | AGENTS.md | Structure, sections |
| COP-* | GitHub Copilot | Instructions format |
| CUR-* | Cursor | MDC format, rules |
| 前缀 | 分类 | 示例 |
|---|---|---|
| AS-* | Agent Skills | 名称格式、触发条件、描述 |
| CC-* | Claude Code | Hooks、内存、插件 |
| MCP-* | MCP协议 | 服务器配置、工具定义 |
| PE-* | 提示词工程 | 通用指令、冗余内容 |
| XP-* | 跨平台 | 跨工具兼容性 |
| AGM-* | AGENTS.md | 结构、章节 |
| COP-* | GitHub Copilot | 指令格式 |
| CUR-* | Cursor | MDC格式、规则 |
Common Issues & Fixes
常见问题与修复方案
| Issue | Solution |
|---|---|
| Invalid skill name | Use lowercase with hyphens: |
| Directory/name mismatch | Rename directory to match |
| Generic instructions | Remove "be helpful", "be accurate" |
| Missing trigger phrase | Add "Use when..." to description |
| 问题 | 解决方案 |
|---|---|
| 无效的skill名称 | 使用小写字母加连字符: |
| 目录/名称不匹配 | 重命名目录以匹配 |
| 通用指令 | 删除"be helpful"、"be accurate"这类内容 |
| 缺少触发短语 | 在描述中添加"Use when..." |
Integration
集成方式
This skill is standalone and can be invoked directly via .
/agnixFor CI integration, see the GitHub Action.
该Skill可独立使用,直接通过调用。
/agnix如需集成到CI流程,请查看GitHub Action。