ag-kit

框架

vudovn/ag-kit

以反重力优先的智能体工程工具包,包含规则、技能、工作流和安全钩子。

项目简介

AG Kit 为在 Antigravity 上构建智能体提供了完整的工作空间契约,包含 20 个专家代理、47 项技能、13 个工作流、6 条规则和原生安全钩子,支持安全更新、回滚和 MCP 集成。

README 预览

\n  \n\n\nAG KIT\n\n\n  Antigravity-first agent engineering kit with rules, skills, specialist agents, workflows, persistent memory, MCP guidance, orchestration, and a native safety hook.\n\n\n\n  \n  \n  \n\n\n\n  Primary runtime: Google Antigravity\n  Tiếng Việt · Migration guide · Production checklist · Security\n\n\n---\n\n## Production profile\n\nAG Kit installs a complete `.agents/` workspace contract. Antigravity is the supported production runtime for this release. Other tools may read the Markdown components, but runtime behavior outside Antigravity is not part of the production compatibility guarantee.\n\n| Capability | Production implementation |\n| --- | --- |\n| Rules and skill discovery | `.agents/rules/`, `.agents/skills/`, `.agents/workflows/` |\n| Specialist routing | 20 role definitions and intelligent-routing skills |\n| Persistent context | `.agents/memory/` and context-compression guidance |\n| Orchestration | `/coordinate`, `/orchestrate`, Antigravity `/agents` and `/tasks` |\n| MCP | Workspace config plus explicit, backup-aware sync helper |\n| Tool safety | Native `PreToolUse` gate for high-confidence destructive commands |\n| Packaging | Local Antigravity plugin bundle with a SHA-256 content inventory |\n| Validation | Toolkit CI, Antigravity Doctor, regression tests, Dependency Review, CLI and web checks |\n\nThe native hook is deliberately narrow. It blocks root-filesystem deletion, drive formatting, and raw-disk overwrite patterns while allowing normal project cleanup such as deleting `dist/` or `node_modules/`. It does not replace Antigravity permissions, workspace trust, sandboxing, or human approval.\n\n## Requirements\n\n- Node.js 22 or newer for repository-level Antigravity tooling.\n- Python 3.10 or newer for AG Kit validators and utility scripts.\n- A trusted Google Antigravity workspace.\n- Git for safe update, review, and rollback workflows.\n\nThe published CLI currently supports Node.js 18 or newer; the Antigravity integration 

常见问题 (2)

故障排除
如何修复在 Windows 上运行 npx @vudovn/ag-kit init 或 update 时出现的 "EIO: Access is denied" 错误?

该错误的发生是因为 CLI 对 .agent 目录使用了同步的 fs.rmSync() 和 fs.cpSync() 操作。Windows Defender、IDE 或文件监视器可能会短暂锁定该目录,导致 Node.js 失败并报错 EIO, Access is denied。

修复方法是将同步的文件系统调用替换为 fs-extra 的异步方法,这些方法内置了 Windows 文件锁定的重试处理机制:

import fse from 'fs-extra';

await fse.remove(targetAgentDir);
await fse.copy(sourceAgentDir, targetAgentDir, { overwrite: true });

将调用函数改为 async,并将 existsSync 等相关的同步检查替换为:

if (!(await fse.pathExists(sourceAgentDir))) {
  throw new Error(`Could not find ${AGENT_FOLDER} folder in source repository!`);
}

fs-extra 已列在包的依赖项中,因此无需新增依赖。作为临时解决方案,可以在重新运行以下命令之前,关闭正在监视该项目的 IDE 或终端,并在 Windows Defender 中放行 .agent 文件夹:

npx @vudovn/ag-kit init

来源 Issue #53
故障排除
为什么安装 .agent 文件夹后,IDE 下拉菜单中缺少 Antigravity Kit 的斜杠命令?

IDE 可能会忽略位于被 Git 忽略的 .agent/ 目录中的斜杠命令文件。请从项目的主 .gitignore 文件中移除 .agent/ 条目,然后改为将其添加到本地的 .git/info/exclude 中:

1. 从 .gitignore 中删除 .agent/ 这一行。
2. 将 .agent/ 添加到 .git/info/exclude:

echo ".agent/" >> .git/info/exclude

这样可以使 .agent/ 在本地保持未跟踪状态,同时允许 IDE 检测 /plan、/brainstorm、/debug 及其他命令。如果下拉菜单没有立即更新,请重新加载或重启 IDE。

来源 Issue #27