@yz-xingtu/agent-rules
v0.1.1
Published
将团队 AI Agent 规则和技能同步到各厂商规则目录。
Readme
@yz-xingtu/agent-rules
从项目仓库的 .agent/ 元结构生成各 AI 编程工具可识别的规则、技能和本地入口文件,避免长期手工维护多套重复目录。
使用方式
在项目仓库根目录运行:
npx -y @yz-xingtu/agent-rules@latest init
npx -y @yz-xingtu/agent-rules@latest sync
npx -y @yz-xingtu/agent-rules@latest doctor如果已经全局安装,也可以直接使用 agent-rules:
npm install -g @yz-xingtu/agent-rules
agent-rules init命令
init
初始化当前使用者和 Agent 厂商:
npx -y @yz-xingtu/agent-rules@latest init --agents=codex,claude,cursor,qoderinit 会生成本地 AGENTS.md,并按 --agents 选择生成 CLAUDE.md、.cursor/、.qoder/ 等厂商文件,同时配置当前仓库的 git user.name、user.email 和 github.user。
sync
从 .agent/ 源结构刷新生成物:
npx -y @yz-xingtu/agent-rules@latest syncsync 会刷新 AGENTS.md 和已存在的 CLAUDE.md。厂商目录默认按当前项目已存在的 .cursor/、.qoder/ 推断;如果项目还没有厂商目录,需要显式指定:
npx -y @yz-xingtu/agent-rules@latest sync --target=qoder,cursordoctor
检查当前生成物是否与 .agent/ 源结构一致:
npx -y @yz-xingtu/agent-rules@latest doctor源结构
项目需要在仓库根目录维护 .agent/:
.agent/rules/ 团队规则源
.agent/skills/ 通用技能源
.agent/team/ 团队成员和角色信息
.agent/adapters/ 厂商输出适配配置
.agent/templates/ AGENTS.md / CLAUDE.md 模板AGENTS.md、CLAUDE.md、.cursor/、.qoder/ 等通常是本地生成物,建议加入项目 .gitignore。
发布
这是 npm scoped public 包。首次发布或后续发布公开版本时使用:
npm publish --access public发布前建议检查:
npm run check
npm pack --dry-run