# @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

Latest version **6.1.0** (published 2026-09-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install @chrisdudek/yg
pnpm add @chrisdudek/yg
yarn add @chrisdudek/yg
bun add @chrisdudek/yg
```

Provides the command `yg`.

## Health

**Score 65/100 (B)** — status: active.

Positive: esm support; no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads; no types; large bundle.

## Facts

| | |
|---|---|
| Version | 6.1.0 |
| Published | 2026-09-29 |
| First published | 2026-02-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | >=22 |
| Dependencies | 11 |
| Unpacked size | 27.9 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 34 |
| Author | Krzysztof Dudek |
| Maintainers | krzysztofdudek |
| Keywords | yggdrasil, architecture-enforcement, code-guardrails, agentic-guardrails, rule-engine, agents-md, claude-md, claude-code, ai-agents, coding-agents, ai-coding, ai-assisted-development, cli, developer-tools |

## Links

- npm: https://www.npmjs.com/package/@chrisdudek/yg
- Repository: https://github.com/krzysztofdudek/Yggdrasil
- Homepage: https://github.com/krzysztofdudek/Yggdrasil#readme
- Issues: https://github.com/krzysztofdudek/Yggdrasil/issues
- npm.io page: https://npm.io/package/@chrisdudek/yg

## Dependencies (11)

- [yaml](https://npm.io/package/yaml.md) ^2.9.0
- [chalk](https://npm.io/package/chalk.md) ^6.0.0
- [ignore](https://npm.io/package/ignore.md) ^7.0.9
- [semver](https://npm.io/package/semver.md) ^7.8.1
- [commander](https://npm.io/package/commander.md) ^15.0.0
- [minimatch](https://npm.io/package/minimatch.md) ^10.2.5
- [smol-toml](https://npm.io/package/smol-toml.md) ^1.8.0
- [minisearch](https://npm.io/package/minisearch.md) ^7.2.0
- [@clack/prompts](https://npm.io/package/@clack/prompts.md) ^1.8.0
- [web-tree-sitter](https://npm.io/package/web-tree-sitter.md) 0.27.0
- [@chrisdudek/runes](https://npm.io/package/@chrisdudek/runes.md) 1.0.0

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 6.1.0 (latest) — 2026-09-29
- 5.0.0-alpha.6 (alpha) — 2026-06-15
- 6.0.0 — 2026-09-12
- 5.9.0 — 2026-09-07
- 5.8.0 — 2026-09-01
- 5.7.2 — 2026-08-09
- 5.7.1 — 2026-08-07
- 5.7.0 — 2026-08-06
- 5.6.0 — 2026-07-25
- 5.5.1 — 2026-07-06
- 5.5.0 — 2026-07-06
- 5.4.2 — 2026-07-02
- 5.4.1 — 2026-07-01
- 5.4.0 — 2026-06-30
- 5.3.0 — 2026-06-27
- … 57 more at https://npm.io/package/@chrisdudek/yg/versions

## README

# @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+.

```bash
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](https://krzysztofdudek.github.io/Yggdrasil/) for the full documentation, or the [main README](https://github.com/krzysztofdudek/Yggdrasil#readme).

## License

MIT

---
_Source: https://npm.io/package/@chrisdudek/yg · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
