ai-rulez 5.10.0 → 5.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +113 -419
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
5
|
<p align="center">
|
|
6
|
-
<strong>
|
|
6
|
+
<strong>One source for the rules, skills and settings of every AI coding assistant</strong>
|
|
7
7
|
</p>
|
|
8
8
|
|
|
9
9
|
<p align="center">
|
|
@@ -26,82 +26,79 @@
|
|
|
26
26
|
|
|
27
27
|
## What it is
|
|
28
28
|
|
|
29
|
-
ai-rulez
|
|
30
|
-
agents, commands, hooks, permissions and MCP servers
|
|
31
|
-
|
|
29
|
+
ai-rulez keeps the instructions for your AI coding assistants in one directory, `.ai-rulez/`: rules, context, skills,
|
|
30
|
+
agents, commands, hooks, permissions and MCP servers. From that source it generates the native files of each assistant
|
|
31
|
+
your team uses (`AGENTS.md`, `CLAUDE.md`, `.cursor/rules/`, `.github/instructions/`, skill folders, MCP and settings
|
|
32
|
+
files) for 52 tools, and keeps them in sync.
|
|
33
|
+
|
|
34
|
+
- **One source, every tool.** Edit `.ai-rulez/`, run `generate`, and Claude Code, Cursor, Codex, Copilot, Gemini CLI
|
|
35
|
+
and the rest get the same guidance in their own format.
|
|
36
|
+
- **Checked in CI.** `generate --check` catches drift; `validate` lints content, links and security issues with stable
|
|
37
|
+
`AR` rule codes, and also works on plain `AGENTS.md` and `SKILL.md` files with no configuration.
|
|
38
|
+
- **Governed like dependencies.** A lock file pins remote includes, installed skills and authored content; approvals,
|
|
39
|
+
Sigstore signatures, SBOMs and an organization policy cover the rest.
|
|
40
|
+
- **Packaged for distribution.** Build plugin bundles and marketplaces, Agent Plugins and ARD manifests, and publish
|
|
41
|
+
them.
|
|
42
|
+
|
|
43
|
+
## 30-second example
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
npx ai-rulez@latest init acme
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Set the tools you use in `.ai-rulez/config.toml`:
|
|
50
|
+
|
|
51
|
+
```toml
|
|
52
|
+
version = "5.0"
|
|
53
|
+
name = "acme"
|
|
54
|
+
presets = ["claude", "cursor", "codex", "copilot", "gemini"]
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Add a rule and generate:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
npx ai-rulez@latest add rule testing --content '# Testing
|
|
61
|
+
|
|
62
|
+
- Every bug fix ships with a regression test.'
|
|
63
|
+
npx ai-rulez@latest generate
|
|
64
|
+
```
|
|
32
65
|
|
|
33
66
|
```text
|
|
34
|
-
|
|
67
|
+
AGENTS.md # rules and context, read by Codex, Cursor, Copilot and Gemini CLI
|
|
68
|
+
CLAUDE.md # imports @AGENTS.md for Claude Code
|
|
69
|
+
.agents/skills/ # skills
|
|
70
|
+
.claude/skills/
|
|
71
|
+
.gemini/settings.json # points Gemini CLI at AGENTS.md
|
|
72
|
+
.mcp.json, .cursor/mcp.json, .vscode/mcp.json, .codex/config.toml
|
|
35
73
|
```
|
|
36
74
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
repository can loosen.
|
|
40
|
-
|
|
41
|
-
- **One source, 52 targets.** Author once in `.ai-rulez/`; generate native files for every harness your team uses instead of hand-copying rules across tools.
|
|
42
|
-
- **A real lock file.** `ai-rulez.lock` pins remote includes, installed skills and authored content the way `go.sum` or `package-lock.json` pin dependencies.
|
|
43
|
-
- **Supply-chain-grade trust.** Sigstore signing, in-toto/DSSE attestations, CycloneDX/SPDX SBOMs and reviewer approvals, so "what prompt is actually running in production" has a verifiable answer.
|
|
44
|
-
- **Org-wide policy, not just repo config.** A central [policy](docs/policy.md) sets tighten-only floors; `verify` and CI gates enforce it everywhere.
|
|
45
|
-
|
|
46
|
-
## Features
|
|
47
|
-
|
|
48
|
-
The table covers the implemented capabilities. The [CLI reference](docs/cli-reference.md) lists every command and flag;
|
|
49
|
-
[standards](#standards) below distinguishes supported formats from partial integrations.
|
|
50
|
-
|
|
51
|
-
| Feature | What it does | Commands / configuration | Docs |
|
|
52
|
-
| ------- | ------------ | ------------------------ | ---- |
|
|
53
|
-
| Content authoring | Manage rules, context, skills with scripts and references, agents, commands and code-review checks. | `init`, `add`, `edit`, `show`, `list`, `remove` | [Configuration](docs/configuration.md), [Skills](docs/skills.md), [Checks](docs/checks.md) |
|
|
54
|
-
| Open-standard sources | Use `.ai-rulez/` as an OKF bundle, or author in `AGENTS.md` and `.agents/` without generation overwriting that source. Convert a pre-OKF content tree in place. | `source = "agents"`, `migrate okf`, `export okf`, `import okf`, `okf validate` | [OKF](docs/okf.md), [Agents source](docs/agents-source.md) |
|
|
55
|
-
| Domains, profiles and roles | Organize content by domain, select domains by profile, and compose roles that filter items and control skill modes. | `domain`, `profile`, `roles`, `--profile`, `--role` | [Domains and profiles](docs/domains.md), [Roles](docs/roles.md) |
|
|
56
|
-
| Configuration layers and local overrides | Merge named TOML layers, a developer's local overlay and user-level settings; inspect the effective local changes. | `config layers`, `local`, `config.<name>.toml`, `--no-local` | [Layers](docs/configuration.md#layered-configuration), [Local configuration](docs/local-overrides.md) |
|
|
57
|
-
| Shared includes and skill installation | Reuse local or Git content, choose merge precedence, install individual skills and load skill sources with pinned revisions or version ranges. | `include`, `skill install/list/remove/update`, `includes`, `installed_skills`, `skill_sources` | [Includes](docs/includes.md), [Installed skills](docs/installed-skills.md) |
|
|
58
|
-
| Builtin content | Select bundled domains and individual guidance items, or exclude items from a selected pack. | `builtins list/show`, `builtins` | [Builtin domains](docs/domains.md) |
|
|
59
|
-
| Import and migration | Convert existing harness files and supported third-party layouts with a lossiness report; migrate a 4.x configuration to v5. | `convert`, `migrate v5` | [Conversion](docs/cli.md#convert-command), [Migration](docs/migration-v5.md) |
|
|
60
|
-
| Native generation | Render the file layouts, frontmatter and settings of 52 built-in harnesses, including Claude Code, Cursor, Codex, Copilot and Gemini CLI. | `generate`, `presets` | [Harness matrix](docs/harnesses.md) |
|
|
61
|
-
| Custom presets | Define templates or provider-backed presets for an additional harness and its supported content and settings. | `presets` inline tables, provider specs | [Custom presets](docs/profiles.md), [Provider-backed presets](docs/configuration.md#provider-backed-presets-full-parity) |
|
|
62
|
-
| Hooks, permissions and MCP settings | Translate shared hooks, allow/deny rules and MCP server definitions to each harness's supported native settings; report unsupported translations. | `hooks`, `permissions`, `mcp_servers` | [Settings](docs/settings.md), [Permissions](docs/permissions.md) |
|
|
63
|
-
| Remote-session setup | A `SessionStart` hook (on by default for Claude Code) that runs `ai-rulez generate` when a cloud session starts. | `[session_start]`, `session-start` | [Remote sessions](docs/session-start.md) |
|
|
64
|
-
| Generated-file guard | Install a supported harness's PreToolUse hook to block agent edits to generated files. | `[guard] generated = true`, `guard` | [Guard](docs/cli.md#guard-command) |
|
|
65
|
-
| User scope and monorepos | Generate user-level assistant configuration, watch source changes, or process nested project roots with ordered reports. | `generate --user`, `generate --watch`, `generate/validate --recursive` | [User scope](docs/user-scope.md), [Monorepos](docs/monorepo.md) |
|
|
66
|
-
| Drift, cleanup and diagnostics | Preview a generation plan, detect output drift, remove generated files and diagnose configuration, locks, tools and MCP placeholders. | `generate --dry-run/--emit-plan/--check`, `clean`, `doctor` | [CLI reference](docs/cli.md), [Architecture](docs/architecture.md) |
|
|
67
|
-
| Plugin and marketplace authoring | Bundle runtime-specific plugins and marketplace indexes, including multi-plugin definitions, Agent Plugins and opt-in Pi packages. | `generate --plugin`, `plugin`, `plugins_authoring`, `marketplaces_authoring` | [Plugins](docs/plugins.md), [Agent Plugins](docs/agent-plugins.md) |
|
|
68
|
-
| Discovery and documentation formats | Generate `AGENTS.md` and `llms.txt`; emit ARD manifests and experimental MCP Server Cards. | `agents_md`, `llms-txt` preset, `publish --emit`, `publish emit` | [AGENTS.md](docs/agents-md.md), [llms.txt](docs/llms-txt.md), [ARD](docs/ard.md), [MCP Server Cards](docs/mcp-server-card.md) |
|
|
69
|
-
| Release artifacts and publishing | Build reproducible archives, manifests and checksums, optionally sign them, verify a dist directory and explicitly upload to GitHub releases, npm or OCI. | `publish`, `publish verify`, `--to`, `--execute --yes` | [Publishing](docs/publish.md) |
|
|
70
|
-
| Static validation and security scanning | Check config, content, scripts and conventional harness files with stable `AR` codes, without requiring an ai-rulez config. Scope by paths, globs or Git changes; use fixes, suppressions, baselines and JSON/SARIF reports. | `validate`, `scan`, `--strict`, `--path`, `--glob`, `--outputs`, `--changed` | [Validation and security rules](docs/strict-validation.md), [Harness traps](docs/harness-traps.md) |
|
|
71
|
-
| External scanners | Run configured scanner programs with explicit execution/egress controls and merge their findings into validation reports. | `lint.external`, `scanners list/doctor`, `validate/scan --external` | [Scanner integrations](docs/strict-validation.md) |
|
|
72
|
-
| Repository verifiers | Run declared deterministic checks, opt into command or LLM predicates, link checks to rules, test fixtures and calibrate model-backed checks. | `verifiers run/list/explain/test/calibrate/suggest`, `validate --verifiers` | [Verifiers](docs/verifiers.md) |
|
|
73
|
-
| Model-based judge | Review agent configuration for security, quality and governance with quoted evidence, an adjudicator, rubric skills, change-impact selection and explicit incomplete coverage. Estimate before sending; cap spend and emit JSON or SARIF. | `judge`, `--estimate`, `--allow-llm`, `--changed`, `--skill`, `--fail-on` | [Judge](docs/judge.md) |
|
|
74
|
-
| Rubric review and patch proposals | Score configured items offline or with a semantic model, calibrate a rubric's gate and propose verified patches for findings. | `review`, `review calibrate/explain/fix`, `rubric` | [Review](docs/review.md) |
|
|
75
|
-
| Skill evaluation | Run harness-neutral eval cases through adapters; measure pass rate, trigger precision/recall, ablation and cost; import scenarios and calibrate estimates. | `eval run/import/calibrate-estimate` | [Evals](docs/evals.md) |
|
|
76
|
-
| Skill improvement (experimental) | Run an external optimizer on a copy, gate candidates against held-out evals, inspect results, apply an accepted change or open an isolated PR. | `improve run/show/apply/pr/clean/adapters` | [Improve](docs/improve.md) |
|
|
77
|
-
| Locks and source updates | Pin remote sources, installed skills, authored content and outputs; check drift, inspect outdated sources and update version-range pins. | `lock`, `lock --check/--diff/--outdated`, `update`, `skill update` | [Lock file](docs/lockfile.md) |
|
|
78
|
-
| Organization policy | Apply central floors for sources, approvals, signatures, execution and model use that repository settings cannot loosen. | `--policy`, `AI_RULEZ_POLICY`, `validate --show-policy` | [Policy](docs/policy.md), [Trust model](docs/trust-model.md) |
|
|
79
|
-
| Reviewer approvals | Bind approvals to content digests, review diffs, revoke or deny content, enforce authorized reviewers and verify signed approvals. | `approve`, `verify --approvals` | [Approvals](docs/approvals.md) |
|
|
80
|
-
| Signatures and attestations | Sign locks, bundles, skills, SBOMs and policies; verify Sigstore bundles, in-toto/DSSE attestations and publisher provenance. | `sign`, `verify --attestation/--self/--plugin`, `trust update` | [Signing](docs/signing.md) |
|
|
81
|
-
| Software bills of materials | Inventory AI content, dependencies and MCP packages in CycloneDX 1.6 or SPDX 2.3; detect SBOM drift and enforce lock and pin gates. | `sbom`, `sbom --check -o <file>`, `--require-lock`, `--strict-pins`, `--type spdx-json` | [SBOM](docs/sbom.md) |
|
|
82
|
-
| MCP management and skill serving | Expose configuration tools and reports to assistants; serve skills and supporting resources on demand with role filters and session budgets. Select a read-only server or reuse a local daemon. | `mcp`, `--serve-skills`, `--read-only`, `--daemon` | [MCP server](docs/mcp-server.md) |
|
|
83
|
-
| Skill search | Rank skills lexically, by vectors or with hybrid embeddings, maintain the index, evaluate ranking and mine queries from usage. | `search`, `search index/status/mine`, `search --eval` | [Search](docs/search.md) |
|
|
84
|
-
| Catalog and inventory | Inspect item metadata, owners, roles, dependencies and lock status; join eval/usage results, compare catalogs and build a static catalog website. | `catalog`, `catalog diff`, `catalog --html` | [Catalog](docs/catalog.md) |
|
|
85
|
-
| Token and context budgets | Report generated prompt tokens, compare profiles and roles, identify costly content and gate always-loaded or on-demand budgets. | `tokens`, `cost`, `--budget`, `--on-demand-budget` | [Token reports](docs/cli.md#tokens-command), [Cost reports](docs/cli.md#cost-command) |
|
|
86
|
-
| Session exposure and areas | Show what a Claude Code session loads at its start and what that costs, map repository areas to owners and terms, and flag area terms leaking into start-of-session text, overlapping skill listings and unreadable gates (`AR9W0`-`AR9W6`). | `exposure`, `exposure inventory/areas/collisions/leakage`, `[exposure]` | [Session exposure](docs/exposure.md) |
|
|
87
|
-
| Usage and item-load telemetry | Opt into identifier-only skill invocation, feedback and item-load records; report usage and optionally export item-load telemetry through OTLP. | `telemetry record/report/feedback/enable/export` | [Usage telemetry](docs/usage-telemetry.md), [Item loads and OTLP](docs/telemetry.md) |
|
|
88
|
-
| Shared model access | Route model calls through liter-llm, including AWS Bedrock credential refresh and OpenAI-compatible gateways, with network consent, budgets, authenticated caching and redacted diagnostics. | `[llm]`, `llm doctor`, `llm estimate` | [LLM access](docs/llm.md) |
|
|
89
|
-
| Automation and embedding | Use the composite GitHub Action, pre-commit/prek, Poly or Lefthook; call the experimental Go API to load, validate, plan/apply generation and manage locks. Shell completion and JSON schemas support other integrations. | [Action](action.yml), `init --setup-hooks`, `completion`, `pkg/airulez` | [Git hooks](#git-hooks), [GitHub Actions](#github-actions), [Go API](docs/embedding.md), [Schemas](docs/schema.md) |
|
|
75
|
+
Commit `.ai-rulez/` with the generated files, and add `ai-rulez generate --check` to CI. The
|
|
76
|
+
[Quick start](https://goldziher.github.io/ai-rulez/quick-start/) walks through it in five minutes.
|
|
90
77
|
|
|
91
78
|
<p align="center">
|
|
92
|
-
<img src="https://raw.githubusercontent.com/Goldziher/ai-rulez/main/docs/assets/quickstart.gif" alt="ai-rulez init and generate: one .ai-rulez source becomes the native files of
|
|
79
|
+
<img src="https://raw.githubusercontent.com/Goldziher/ai-rulez/main/docs/assets/quickstart.gif" alt="ai-rulez init and generate: one .ai-rulez source becomes the native files of several AI tools" width="820" />
|
|
93
80
|
</p>
|
|
94
81
|
|
|
82
|
+
## Install
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
brew install goldziher/tap/ai-rulez # Homebrew (macOS, Linux)
|
|
86
|
+
npm install -g ai-rulez # npm (Node.js 22+)
|
|
87
|
+
pipx install ai-rulez # PyPI (Python 3.11+); or uv tool install ai-rulez
|
|
88
|
+
go install github.com/Goldziher/ai-rulez/v5/cmd/ai-rulez@latest # Go (note the /v5)
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Or run it without installing: `npx ai-rulez@latest <command>` or `uvx ai-rulez <command>`. See
|
|
92
|
+
[Installation](https://goldziher.github.io/ai-rulez/installation/) for platforms, shell completion and git hooks.
|
|
93
|
+
|
|
95
94
|
## Supported tools
|
|
96
95
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
checks, user scope) is in [Supported harnesses](docs/harnesses.md), and a provider that isn't listed yet still gets
|
|
101
|
-
full parity through a [custom provider-backed preset](docs/configuration.md#provider-backed-presets-full-parity).
|
|
96
|
+
52 built-in presets, one per assistant, CLI agent or IDE integration. Combine any of them in `presets = [...]`;
|
|
97
|
+
[Supported harnesses](https://goldziher.github.io/ai-rulez/harnesses/) shows which rules, skills, agents, commands, MCP servers, hooks and permissions
|
|
98
|
+
each one receives. A tool that is not listed can be added as a [custom preset](https://goldziher.github.io/ai-rulez/profiles/).
|
|
102
99
|
|
|
103
100
|
<details>
|
|
104
|
-
<summary><strong>All 52
|
|
101
|
+
<summary><strong>All 52 built-in presets</strong></summary>
|
|
105
102
|
|
|
106
103
|
| Preset | Tool |
|
|
107
104
|
| ------ | ---- |
|
|
@@ -160,392 +157,89 @@ full parity through a [custom provider-backed preset](docs/configuration.md#prov
|
|
|
160
157
|
|
|
161
158
|
</details>
|
|
162
159
|
|
|
163
|
-
##
|
|
160
|
+
## What else it does
|
|
164
161
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
|
170
|
-
|
|
|
171
|
-
|
|
|
172
|
-
|
|
|
173
|
-
|
|
|
174
|
-
|
|
|
175
|
-
| [AGENTS.md](docs/agents-md.md), also as the [source](docs/agents-source.md) with `source = "agents"` | supported | `generate` | `validate` |
|
|
176
|
-
| [llms.txt](docs/llms-txt.md) | supported | the `llms-txt` preset | `validate` |
|
|
177
|
-
| MCP server config | supported | `generate` | `validate` (partial) |
|
|
178
|
-
| MCP server card | partial (experimental extension, pinned `526201b`) | `publish --emit mcp-server-card`, `publish --emit ard` | conformance tests only |
|
|
179
|
-
| [CycloneDX / SPDX SBOM](docs/sbom.md) | supported | `sbom` | `sbom --check` |
|
|
180
|
-
| [in-toto / DSSE / Sigstore](docs/signing.md) | supported | `sign` | `verify --attestation` |
|
|
181
|
-
| [OpenTelemetry (OTLP)](docs/telemetry.md) | supported | `telemetry export --to otlp` | not applicable |
|
|
182
|
-
|
|
183
|
-
## Usage
|
|
184
|
-
|
|
185
|
-
Every option below produces the same `.ai-rulez/` tree and the same generated output — pick however your project
|
|
186
|
-
already runs tools. Each one walks through init, generate and validate; [Bundle and publish](#bundle-and-publish),
|
|
187
|
-
[Validate](#validate) and [Govern](#govern) below cover what comes after.
|
|
162
|
+
| Area | Commands | Docs |
|
|
163
|
+
| ---- | -------- | ---- |
|
|
164
|
+
| Author | `add`, `edit`, `show`, `list`, `remove`, `domain`, `profile`, `include`, `skill install` | [Configuration](https://goldziher.github.io/ai-rulez/configuration/), [Rules](https://goldziher.github.io/ai-rulez/rules/), [Skills](https://goldziher.github.io/ai-rulez/skills/), [Includes](https://goldziher.github.io/ai-rulez/includes/) |
|
|
165
|
+
| Import | `init --from auto`, `convert`, `migrate v5` | [CLI](https://goldziher.github.io/ai-rulez/cli/), [Migrating to v5](https://goldziher.github.io/ai-rulez/migration-v5/) |
|
|
166
|
+
| Generate | `generate`, `generate --user`, `generate --recursive`, `generate --watch`, `clean` | [Harnesses](https://goldziher.github.io/ai-rulez/harnesses/), [Hooks and settings](https://goldziher.github.io/ai-rulez/settings/), [Monorepo](https://goldziher.github.io/ai-rulez/monorepo/) |
|
|
167
|
+
| Validate | `validate`, `scan`, `verifiers run`, `judge`, `review` | [Strict validation](https://goldziher.github.io/ai-rulez/strict-validation/), [Verifiers](https://goldziher.github.io/ai-rulez/verifiers/), [Judge](https://goldziher.github.io/ai-rulez/judge/) |
|
|
168
|
+
| Govern | `lock`, `update`, `approve`, `sign`, `verify`, `sbom` | [Lock file](https://goldziher.github.io/ai-rulez/lockfile/), [Signing](https://goldziher.github.io/ai-rulez/signing/), [Policy](https://goldziher.github.io/ai-rulez/policy/) |
|
|
169
|
+
| Bundle and publish | `generate --plugin`, `verify --plugin`, `publish` | [Plugins](https://goldziher.github.io/ai-rulez/plugins/), [Publish](https://goldziher.github.io/ai-rulez/publish/) |
|
|
170
|
+
| Operate | `mcp --serve-skills`, `search`, `eval`, `tokens`, `cost`, `catalog`, `telemetry` | [MCP server](https://goldziher.github.io/ai-rulez/mcp-server/), [Evals](https://goldziher.github.io/ai-rulez/evals/) |
|
|
171
|
+
| Embed | `pkg/airulez` | [Go API](https://goldziher.github.io/ai-rulez/embedding/) |
|
|
188
172
|
|
|
189
|
-
|
|
190
|
-
# .ai-rulez/config.toml
|
|
191
|
-
presets = ["claude", "cursor", "codex", "copilot", "gemini"] # any of the 52 harnesses
|
|
192
|
-
```
|
|
193
|
-
|
|
194
|
-
<details>
|
|
195
|
-
<summary><strong>npx (Node.js, no install)</strong></summary>
|
|
196
|
-
|
|
197
|
-
```bash
|
|
198
|
-
npx ai-rulez@latest init
|
|
199
|
-
npx ai-rulez@latest generate
|
|
200
|
-
npx ai-rulez@latest validate --strict
|
|
201
|
-
```
|
|
202
|
-
|
|
203
|
-
</details>
|
|
204
|
-
|
|
205
|
-
<details>
|
|
206
|
-
<summary><strong>uvx (Python, no install)</strong></summary>
|
|
207
|
-
|
|
208
|
-
```bash
|
|
209
|
-
uvx ai-rulez init
|
|
210
|
-
uvx ai-rulez generate
|
|
211
|
-
uvx ai-rulez validate --strict
|
|
212
|
-
```
|
|
213
|
-
|
|
214
|
-
</details>
|
|
215
|
-
|
|
216
|
-
<details>
|
|
217
|
-
<summary><strong>Homebrew (macOS / Linux)</strong></summary>
|
|
218
|
-
|
|
219
|
-
```bash
|
|
220
|
-
brew install goldziher/tap/ai-rulez
|
|
221
|
-
ai-rulez init
|
|
222
|
-
ai-rulez generate
|
|
223
|
-
ai-rulez validate --strict
|
|
224
|
-
```
|
|
225
|
-
|
|
226
|
-
</details>
|
|
227
|
-
|
|
228
|
-
<details>
|
|
229
|
-
<summary><strong>Go</strong></summary>
|
|
230
|
-
|
|
231
|
-
```bash
|
|
232
|
-
go install github.com/Goldziher/ai-rulez/v5/cmd/ai-rulez@latest
|
|
233
|
-
ai-rulez init
|
|
234
|
-
ai-rulez generate
|
|
235
|
-
ai-rulez validate --strict
|
|
236
|
-
```
|
|
237
|
-
|
|
238
|
-
The module path needs `/v5`; without it `@latest` resolves to an old build.
|
|
239
|
-
This local build needs cgo, a C toolchain and the Go module cache at runtime.
|
|
240
|
-
For a statically linked build, use `mise run build` from a clone; see [source installation](docs/installation.md).
|
|
241
|
-
|
|
242
|
-
</details>
|
|
243
|
-
|
|
244
|
-
<details>
|
|
245
|
-
<summary><strong>npm (global)</strong></summary>
|
|
246
|
-
|
|
247
|
-
```bash
|
|
248
|
-
npm install -g ai-rulez
|
|
249
|
-
ai-rulez init
|
|
250
|
-
ai-rulez generate
|
|
251
|
-
ai-rulez validate --strict
|
|
252
|
-
```
|
|
253
|
-
|
|
254
|
-
</details>
|
|
255
|
-
|
|
256
|
-
<details>
|
|
257
|
-
<summary><strong>uv tool</strong></summary>
|
|
258
|
-
|
|
259
|
-
```bash
|
|
260
|
-
uv tool install ai-rulez
|
|
261
|
-
ai-rulez init
|
|
262
|
-
ai-rulez generate
|
|
263
|
-
ai-rulez validate --strict
|
|
264
|
-
```
|
|
265
|
-
|
|
266
|
-
</details>
|
|
267
|
-
|
|
268
|
-
<details>
|
|
269
|
-
<summary><strong>pip / pipx</strong></summary>
|
|
270
|
-
|
|
271
|
-
```bash
|
|
272
|
-
pip install ai-rulez
|
|
273
|
-
# or, isolated:
|
|
274
|
-
pipx install ai-rulez
|
|
275
|
-
|
|
276
|
-
ai-rulez init
|
|
277
|
-
ai-rulez generate
|
|
278
|
-
ai-rulez validate --strict
|
|
279
|
-
```
|
|
280
|
-
|
|
281
|
-
</details>
|
|
282
|
-
|
|
283
|
-
<details>
|
|
284
|
-
<summary><strong>Day-to-day commands</strong></summary>
|
|
285
|
-
|
|
286
|
-
```bash
|
|
287
|
-
ai-rulez generate --watch # regenerate on every change to .ai-rulez/
|
|
288
|
-
ai-rulez generate --check # CI: exit 2 when committed outputs differ from the sources
|
|
289
|
-
ai-rulez doctor # read-only diagnostics: drift, removed presets, missing tools
|
|
290
|
-
ai-rulez generate --user # the same, for your home directory (~/.claude, ~/.codex, ...)
|
|
291
|
-
```
|
|
292
|
-
|
|
293
|
-
</details>
|
|
294
|
-
|
|
295
|
-
Prefer the project-level [`.config/` convention](https://github.com/pi0/config-dir)? ai-rulez also discovers
|
|
296
|
-
`.config/ai-rulez/`, and `ai-rulez init --config-dir .config/ai-rulez` scaffolds it.
|
|
297
|
-
|
|
298
|
-
## Bundle and publish
|
|
299
|
-
|
|
300
|
-
Bundling and publishing need a `[plugin]` block (`name`, `version` and `description`) in `config.toml`:
|
|
301
|
-
|
|
302
|
-
<details>
|
|
303
|
-
<summary><strong>Show commands</strong></summary>
|
|
304
|
-
|
|
305
|
-
```bash
|
|
306
|
-
ai-rulez generate --plugin # plugin bundles and a marketplace index from the [plugin] block
|
|
307
|
-
ai-rulez export okf # an OKF bundle of your rules, context and skills (docs/okf)
|
|
308
|
-
ai-rulez publish --emit agent-plugins --emit ard --dry-run
|
|
309
|
-
ai-rulez publish --to github-release --execute --yes
|
|
310
|
-
```
|
|
311
|
-
|
|
312
|
-
</details>
|
|
313
|
-
|
|
314
|
-
`publish` runs a preflight first (`validate --strict`, `lock --check`, `verify --plugin`, a secret scan and the policy
|
|
315
|
-
gates), writes a byte-reproducible tar.gz with `SHA256SUMS`, and uploads only when you pass `--execute --yes`. See
|
|
316
|
-
[Publish](docs/publish.md) and [Authoring plugins](docs/plugins.md).
|
|
317
|
-
|
|
318
|
-
Pi packages are opt-in with `[plugin] runtimes = ["pi"]`: skills and prompt templates can be installed
|
|
319
|
-
from Git or npm. Publishing to npm preserves Pi and OpenCode runtime metadata while using the
|
|
320
|
-
configured scope and plugin name for the released package.
|
|
321
|
-
|
|
322
|
-
`verify --plugin` reports a hand-edited or stray file in a bundle as drift, and `generate --plugin` restores it:
|
|
173
|
+
`validate --strict` flags a defect, `--explain` describes it, and `generate --check` fails on drift:
|
|
323
174
|
|
|
324
175
|
<p align="center">
|
|
325
|
-
<img src="https://raw.githubusercontent.com/Goldziher/ai-rulez/main/docs/assets/
|
|
176
|
+
<img src="https://raw.githubusercontent.com/Goldziher/ai-rulez/main/docs/assets/validate.gif" alt="ai-rulez validate --strict flags a defect, --explain describes it, and generate --check fails on drift" width="820" />
|
|
326
177
|
</p>
|
|
327
178
|
|
|
328
|
-
|
|
179
|
+
`verify --plugin` reports hand-edited or stray files in a plugin bundle, and `generate --plugin` restores it:
|
|
329
180
|
|
|
330
181
|
<p align="center">
|
|
331
|
-
<img src="https://raw.githubusercontent.com/Goldziher/ai-rulez/main/docs/assets/
|
|
182
|
+
<img src="https://raw.githubusercontent.com/Goldziher/ai-rulez/main/docs/assets/plugin-drift.gif" alt="ai-rulez verify --plugin reporting changed and extra files in a plugin bundle, then generate --plugin restoring it" width="820" />
|
|
332
183
|
</p>
|
|
333
184
|
|
|
334
|
-
|
|
335
|
-
<summary><strong>Show commands</strong></summary>
|
|
336
|
-
|
|
337
|
-
```bash
|
|
338
|
-
ai-rulez validate # config plus content checks, exit 2 on findings
|
|
339
|
-
ai-rulez validate --explain AR001 # what a rule checks and how to suppress it
|
|
340
|
-
ai-rulez validate --format sarif --output ai-rulez.sarif
|
|
341
|
-
ai-rulez validate --path catalog --glob "plugins/**/*.json" # also lint files outside .ai-rulez/
|
|
342
|
-
ai-rulez validate --outputs # also lint the generated files; each problem is reported once
|
|
343
|
-
ai-rulez validate --strict # in any repo: with no config it lints AGENTS.md, SKILL.md, .claude/, .agents/
|
|
344
|
-
ai-rulez okf validate docs/okf # lint any OKF bundle, ai-rulez's or a third party's
|
|
345
|
-
ai-rulez generate --check # generated files still match their sources
|
|
346
|
-
```
|
|
347
|
-
|
|
348
|
-
</details>
|
|
349
|
-
|
|
350
|
-
## Govern
|
|
351
|
-
|
|
352
|
-
<details>
|
|
353
|
-
<summary><strong>Show commands</strong></summary>
|
|
354
|
-
|
|
355
|
-
```bash
|
|
356
|
-
ai-rulez lock # pin remote includes, installed skills and authored content
|
|
357
|
-
ai-rulez approve --list # what still needs a reviewer's approval
|
|
358
|
-
ai-rulez sign --lock # a Sigstore bundle (DSSE over an in-toto statement) for the lock
|
|
359
|
-
ai-rulez verify --attestation # check it offline against the [signing] policy
|
|
360
|
-
ai-rulez sbom -o ai-bom.cdx.json # CycloneDX 1.6 (or --type spdx-json)
|
|
361
|
-
```
|
|
362
|
-
|
|
363
|
-
</details>
|
|
364
|
-
|
|
365
|
-
An organization [policy](docs/policy.md) sets tighten-only floors a repository cannot loosen. See the
|
|
366
|
-
[trust model](docs/trust-model.md).
|
|
367
|
-
|
|
368
|
-
## Operate
|
|
369
|
-
|
|
370
|
-
- **MCP server.** `ai-rulez mcp` lets an assistant manage the configuration; with `--serve-skills` one server serves
|
|
371
|
-
skills on demand and the config tools together (`--read-only` keeps only the read-only tools).
|
|
372
|
-
See [MCP server](docs/mcp-server.md).
|
|
373
|
-
Served skills cost nothing until an assistant asks for them:
|
|
185
|
+
Skills served over MCP cost no context until an assistant asks for them:
|
|
374
186
|
|
|
187
|
+
<p align="center">
|
|
375
188
|
<img src="https://raw.githubusercontent.com/Goldziher/ai-rulez/main/docs/assets/skills-mcp.gif" alt="ai-rulez tokens before and after serving skills over MCP, then find_skill and load_skill" width="780" />
|
|
189
|
+
</p>
|
|
376
190
|
|
|
377
|
-
|
|
378
|
-
`validate --recursive` walk them all, and `tokens --budget` gates what every session loads.
|
|
379
|
-
See [Monorepos](docs/monorepo.md).
|
|
191
|
+
In a monorepo, `generate --recursive` and `validate --recursive` process every nested `.ai-rulez/`:
|
|
380
192
|
|
|
193
|
+
<p align="center">
|
|
381
194
|
<img src="https://raw.githubusercontent.com/Goldziher/ai-rulez/main/docs/assets/monorepo.gif" alt="ai-rulez generate --recursive over two nested roots, recursive validation, and a token budget check" width="780" />
|
|
195
|
+
</p>
|
|
382
196
|
|
|
383
|
-
|
|
384
|
-
- **Evals and improve.** `ai-rulez eval` scores skills; `improve` (experimental) optimizes them behind a held-out eval
|
|
385
|
-
gate. See [evals](docs/evals.md) and [improve](docs/improve.md).
|
|
386
|
-
- **Judge.** `ai-rulez judge` reviews skills, agents, commands, rules, `CLAUDE.md`, `AGENTS.md`, MCP and settings files
|
|
387
|
-
with models, from the command line alone: security, quality and governance reviewers, a verifier that checks quoted
|
|
388
|
-
evidence, an independent adjudicator, and scores computed in code. Failed rubric criteria without a verifiable quote
|
|
389
|
-
are reported separately as unit-level findings. Governance reads the rules and
|
|
390
|
-
`CLAUDE.md` files that apply to each unit, nested `.claude/` directories at any depth. `ai-rulez judge --estimate`, then
|
|
391
|
-
`--allow-llm` to send; `--changed=origin/main` for a pull request, `--format sarif` for code scanning. See [judge](docs/judge.md).
|
|
392
|
-
- **Cost and inventory.** `tokens`, `cost`, `catalog` and `search` report what the configuration contains and costs.
|
|
393
|
-
- **Session exposure.** `exposure` reports what a Claude Code session loads at its start and gates it with `[exposure] start_budget`; with an `[exposure]` area map, `exposure leakage` and `exposure collisions` find area terms in start-of-session text and overlapping skill listings. See [Session exposure](docs/exposure.md).
|
|
394
|
-
|
|
395
|
-
Existing project on 4.x? Run `ai-rulez migrate v5 --dry-run`, then see [Migrating to v5](docs/migration-v5.md).
|
|
197
|
+
## Standards
|
|
396
198
|
|
|
397
|
-
|
|
199
|
+
ai-rulez generates and validates AGENTS.md, Agent Skills, Agent Plugins, ARD, llms.txt, OKF (the format of
|
|
200
|
+
`.ai-rulez/` itself), MCP server configuration and Server Cards, CycloneDX and SPDX SBOMs, and in-toto/DSSE
|
|
201
|
+
attestations in Sigstore bundles. [Standards conformance](https://goldziher.github.io/ai-rulez/standards/) lists the versions, the conformance tests
|
|
202
|
+
and the known gaps.
|
|
398
203
|
|
|
399
|
-
|
|
400
|
-
generated files, and the package map, see [Architecture](docs/architecture.md).
|
|
204
|
+
## CI and git hooks
|
|
401
205
|
|
|
402
|
-
|
|
206
|
+
GitHub Actions:
|
|
403
207
|
|
|
404
|
-
|
|
208
|
+
```yaml
|
|
209
|
+
steps:
|
|
210
|
+
- uses: actions/checkout@v7
|
|
211
|
+
- uses: Goldziher/ai-rulez@v5
|
|
212
|
+
with:
|
|
213
|
+
version: 5.10.0
|
|
214
|
+
- run: ai-rulez generate --check
|
|
215
|
+
- run: ai-rulez validate
|
|
216
|
+
```
|
|
405
217
|
|
|
406
|
-
|
|
407
|
-
<summary><strong>pre-commit/prek</strong></summary>
|
|
218
|
+
See [GitHub Actions](https://goldziher.github.io/ai-rulez/github-actions/) for the full workflow and the governance gate.
|
|
408
219
|
|
|
409
|
-
|
|
220
|
+
pre-commit or prek:
|
|
410
221
|
|
|
411
222
|
```yaml
|
|
412
223
|
repos:
|
|
413
224
|
- repo: https://github.com/Goldziher/ai-rulez
|
|
414
|
-
rev: v5.
|
|
225
|
+
rev: v5.11.0
|
|
415
226
|
hooks:
|
|
416
|
-
- id: ai-rulez-recursive
|
|
417
|
-
- id: ai-rulez-validate
|
|
418
|
-
```
|
|
419
|
-
|
|
420
|
-
Every hook runs `scripts/pre-commit/run-ai-rulez.sh` and triggers only on root or nested `.ai-rulez/` changes:
|
|
421
|
-
|
|
422
|
-
| Hook id | Runs |
|
|
423
|
-
| --- | --- |
|
|
424
|
-
| `ai-rulez-generate` | `generate`, the root `.ai-rulez/` only |
|
|
425
|
-
| `ai-rulez-recursive` | `generate --recursive`, every nested root |
|
|
426
|
-
| `ai-rulez-validate` | `validate --recursive` — a real validation run, not a dry run |
|
|
427
|
-
| `ai-rulez-plugin-generate` | `generate --recursive --plugin --if-configured` |
|
|
428
|
-
| `ai-rulez-plugin-verify` | `verify --recursive --plugin --if-configured` |
|
|
429
|
-
|
|
430
|
-
Add `ai-rulez-plugin-generate` and `ai-rulez-plugin-verify` too if the repository ships plugin bundles; the
|
|
431
|
-
`--if-configured` flag makes them no-ops on consumer-only repositories.
|
|
432
|
-
|
|
433
|
-
</details>
|
|
434
|
-
|
|
435
|
-
<details>
|
|
436
|
-
<summary><strong>Poly</strong></summary>
|
|
437
|
-
|
|
438
|
-
Add ai-rulez as a managed source in your existing `poly.toml` and select the hooks your
|
|
439
|
-
repository needs:
|
|
440
|
-
|
|
441
|
-
```toml
|
|
442
|
-
[[hooks.sources]]
|
|
443
|
-
id = "ai-rulez"
|
|
444
|
-
git = "https://github.com/Goldziher/ai-rulez.git"
|
|
445
|
-
revision = "v5.10.0"
|
|
446
|
-
hooks = ["ai-rulez-recursive", "ai-rulez-plugin-verify"]
|
|
447
|
-
```
|
|
448
|
-
|
|
449
|
-
The source also provides `ai-rulez-validate`, `ai-rulez-generate`,
|
|
450
|
-
and `ai-rulez-plugin-generate`.
|
|
451
|
-
Plugin hooks use `--if-configured`, so they skip consumer-only repositories that
|
|
452
|
-
do not contain a producer `[plugin]` or multi-member `[marketplace]` block.
|
|
453
|
-
|
|
454
|
-
Resolve and commit the source lock, then install the Git shims:
|
|
455
|
-
|
|
456
|
-
```bash
|
|
457
|
-
poly hooks update
|
|
458
|
-
git add poly.toml poly-hooks.lock
|
|
459
|
-
poly hooks install
|
|
460
|
-
```
|
|
461
|
-
|
|
462
|
-
</details>
|
|
463
|
-
|
|
464
|
-
<details>
|
|
465
|
-
<summary><strong>Lefthook</strong></summary>
|
|
466
|
-
|
|
467
|
-
Add to `lefthook.yml`:
|
|
468
|
-
|
|
469
|
-
```yaml
|
|
470
|
-
pre-commit:
|
|
471
|
-
commands:
|
|
472
|
-
ai-rulez:
|
|
473
|
-
glob: ".ai-rulez/**"
|
|
474
|
-
run: ai-rulez generate --recursive --no-local
|
|
227
|
+
- id: ai-rulez-recursive
|
|
228
|
+
- id: ai-rulez-validate
|
|
475
229
|
```
|
|
476
230
|
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
and `tokens`) where a hook should see only the shared configuration, as a teammate or CI does. If you do
|
|
480
|
-
not, `generate` still refuses to write local-derived changes into tracked shared files; never add
|
|
481
|
-
`--allow-local-drift` to a hook. See [Poly hooks guide](docs/poly-hooks.md#machine-local-configuration-in-hooks).
|
|
482
|
-
|
|
483
|
-
In a monorepo, `ai-rulez generate --recursive` and `ai-rulez validate --recursive` process every nested
|
|
484
|
-
`.ai-rulez/` root, report all failures, and exit non-zero if any root failed.
|
|
231
|
+
See [GitHub Actions](https://goldziher.github.io/ai-rulez/github-actions/) for the governance gate and scheduled pin updates, and
|
|
232
|
+
[Installation](https://goldziher.github.io/ai-rulez/installation/#git-hooks) for Lefthook, Poly and `init --setup-hooks`.
|
|
485
233
|
|
|
486
|
-
|
|
234
|
+
## Upgrading from 4.x
|
|
487
235
|
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
## GitHub Actions
|
|
491
|
-
|
|
492
|
-
ai-rulez ships its own composite Action ([`action.yml`](action.yml) at the repository root), so any workflow can
|
|
493
|
-
`uses: Goldziher/ai-rulez@<ref>` directly — no subpath. It downloads a release binary, verifies its sha256 against
|
|
494
|
-
the release's `checksums.txt`, caches it (keyed by OS, arch and the resolved version) and adds it to `PATH`. No Go
|
|
495
|
-
toolchain, Node or Python needed in the job. It reuses the same `scripts/pre-commit/run-ai-rulez.sh`
|
|
496
|
-
download-and-verify logic the pre-commit hooks above use, so the two stay in sync.
|
|
497
|
-
|
|
498
|
-
Use `Goldziher/ai-rulez@v5` for compatible action updates: publishing a stable v5 release moves
|
|
499
|
-
this annotated floating tag after all distribution jobs succeed. `uses: Goldziher/ai-rulez@v5` with
|
|
500
|
-
`version: latest` keeps a workflow on the newest 5.x action and the newest released CLI with no
|
|
501
|
-
per-release edits. Pin a full release tag or commit SHA to fix the action code. The action ref and
|
|
502
|
-
installed CLI version are independent: set `version` as well to pin the binary; its default
|
|
503
|
-
`latest` can eventually select a newer major release.
|
|
504
|
-
|
|
505
|
-
| | |
|
|
506
|
-
| --- | --- |
|
|
507
|
-
| **Input** `version` | `X.Y.Z`, `vX.Y.Z`, `X.Y.Z-rc.N` or `latest` (default: the newest stable GitHub release). Optional — omit it to always use the newest release. |
|
|
508
|
-
| **Inputs** `llm-*` | Optional provider, model, gateway, credential variable name, network opt-in, budgets and other LLM settings exported to later steps. [Full reference](docs/github-actions.md#llm-configuration-inputs). |
|
|
509
|
-
| **Output** `version` | The resolved version, without the leading `v`. |
|
|
510
|
-
| **Output** `path` | Absolute path to the installed `ai-rulez` binary. |
|
|
236
|
+
Run `ai-rulez migrate v5 --dry-run`, then follow [Migrating to v5](https://goldziher.github.io/ai-rulez/migration-v5/).
|
|
511
237
|
|
|
512
|
-
|
|
513
|
-
<summary><strong>Show workflow</strong></summary>
|
|
238
|
+
## Documentation
|
|
514
239
|
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
on:
|
|
518
|
-
pull_request:
|
|
519
|
-
push:
|
|
520
|
-
branches: [main]
|
|
521
|
-
jobs:
|
|
522
|
-
check:
|
|
523
|
-
runs-on: ubuntu-latest
|
|
524
|
-
steps:
|
|
525
|
-
- uses: actions/checkout@v7
|
|
526
|
-
- uses: Goldziher/ai-rulez@v5
|
|
527
|
-
with:
|
|
528
|
-
version: 5.9.2 # pin the CLI independently of the floating action ref
|
|
529
|
-
- run: ai-rulez generate --check # the committed output matches the sources
|
|
530
|
-
- run: ai-rulez validate --strict # content and security checks, warnings fail
|
|
531
|
-
- run: ai-rulez lock --check # pins were updated when the sources were
|
|
532
|
-
```
|
|
240
|
+
Full documentation: [goldziher.github.io/ai-rulez](https://goldziher.github.io/ai-rulez/). Contributors: see
|
|
241
|
+
[CONTRIBUTING.md](CONTRIBUTING.md) and [Architecture](https://goldziher.github.io/ai-rulez/architecture/).
|
|
533
242
|
|
|
534
|
-
|
|
243
|
+
## License
|
|
535
244
|
|
|
536
|
-
|
|
537
|
-
configuration root: `migrate okf --check`, `validate --strict --no-local`, `lock --check`, `generate` then
|
|
538
|
-
`generate --check`, optionally `verify --plugin` and `tokens --budget`, then a clean `git diff HEAD` with no new
|
|
539
|
-
untracked files. `expected-config-count` fails a run that finds a different number of roots, and a job summary lists
|
|
540
|
-
every command. See [the check sub-action](docs/github-actions.md#governance-gate-check).
|
|
541
|
-
`uses: Goldziher/ai-rulez/update@v5` on a schedule runs `ai-rulez update` when `lock --outdated` reports an allowed
|
|
542
|
-
update, regenerates, re-pins the content and opens a pull request with the outdated table (or pushes directly with
|
|
543
|
-
`direct: true`). See [scheduled pin updates](docs/github-actions.md#scheduled-pin-updates-update).
|
|
544
|
-
|
|
545
|
-
For model-backed reviews, configure `llm-model`, `llm-allow-network: 'true'` and spend limits,
|
|
546
|
-
pass provider credentials through `env:` on the command step or job, and run `ai-rulez judge
|
|
547
|
-
--allow-llm`. Installation itself makes no model requests. See the [action guide](docs/github-actions.md)
|
|
548
|
-
for all inputs, environment precedence, Bedrock, outputs and complete examples.
|
|
549
|
-
|
|
550
|
-
See [CI usage](docs/lockfile.md#ci-usage) for the lock-check-vs-generate-check distinction and a scheduled
|
|
551
|
-
"outdated sources" report job.
|
|
245
|
+
[MIT](LICENSE)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ai-rulez",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.11.0",
|
|
4
4
|
"description": "Author, generate, validate and govern AI agent rules, skills, plugins and MCP configuration across 52 coding assistants. Review with verified model evidence, evaluate skills, lock and sign dependencies, and publish bundles. CLI, MCP server and Go API.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agent-plugins",
|