@chrisdudek/yg

中文文档
6.1.0发布于 2026/09/29MITTypeScriptES Module构建来源已验证近 30 天下载 2343

Say it once: a rule you write holds in every session after. Your AI coding agent gets only the rules that touch the file it is editing, and must satisfy them before it moves on. Free local checks, keyless CI. Works with Claude Code, Cursor, Copilot, Codex

原始使用文档
文档目录3 节
  1. Install
  2. Docs
  3. License

@chrisdudek/yg

Say it once.

Write a rule and it holds in every session after that, without you repeating yourself. Before your agent edits a file it gets only the rules that touch that file, not the whole rulebook. After the edit they are checked, and a violation comes back as an error the agent has to fix before it moves on.

A rule is either a small local script that runs for free on every check, or plain Markdown that a separate model reads for the calls a script cannot make. Every verdict is tied by hash to the exact code it checked, so CI re-proves the whole set for free, with no API key.

Works with Claude Code, Cursor, Copilot, Codex, Cline and any other agent that reads AGENTS.md.

Install

Requires Node.js 22+.

npm install -g @chrisdudek/yg
cd your-project
yg init

yg init writes the .yggdrasil/ graph and the agent-rules files into your repo, then asks one question: which reviewer should judge your code. "None for now" is a real answer. Script rules, dependency control and the CI gate all work from there with no key and no model calls.

Then tell your agent what matters:

"Every payment operation must emit an audit event. Create a rule for it and apply it to the payments module."

It writes the rule and maps the module. From that point the rule holds, in this session and every one after.

Docs

krzysztofdudek.github.io/Yggdrasil for the full documentation, or the main README.

License

MIT

版本与发布记录

@chrisdudek/yg 共发布 72 个版本,首次发布于 2026/02/23;过去 12 个月发布了 72 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
6.1.0latest2026/09/291 个月前
6.0.02026/09/121 个月前
5.9.02026/09/072 个月前
5.8.02026/09/012 个月前
5.7.22026/08/102 个月前
5.7.12026/08/073 个月前

其他发布通道:alpha → 5.0.0-alpha.6。

关于 @chrisdudek/yg 的常见问题

@chrisdudek/yg 是什么?

Say it once: a rule you write holds in every session after. Your AI coding agent gets only the rules that touch the file it is editing, and must satisfy them before it moves on. Free local checks, keyless CI. Works with Claude Code, Cursor, Copilot, Codex

如何安装 @chrisdudek/yg?

在项目目录运行 npm install @chrisdudek/yg,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 yg,可以用 npx yg 直接运行。

@chrisdudek/yg 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@chrisdudek/yg 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@chrisdudek/yg 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@chrisdudek/yg 可以商用吗?

@chrisdudek/yg 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@chrisdudek/yg 的下载量有多少?

根据 npm 官方下载统计,@chrisdudek/yg 在 2026/10/10 – 2026/11/08 这 30 天内被下载 2,343 次,日均约 78 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@chrisdudek/yg 还在维护吗?

最新版本 6.1.0 发布于 2026/09/29(1 个月前);至今共发布 72 个版本,其中过去 12 个月发布了 72 个;首次发布于 2026/02/23。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。