Shared ai-rulez modules for the xberg-io organization's repositories. Include modules by path; consumer
repos generate local AGENTS.md from these sources.
Modules hold generic conventions only: content that is true in every repository that includes the module.
Product knowledge (a product's corpora, formats, benchmarks, crates) lives in that product's own .ai-rulez/.
Where an ai-rulez builtin already says the same thing, the module does not repeat it.
- Rules, always on (12): adr-discipline, agent-workflow, basemind-usage, comment-discipline, commit-messages, commit-procedure, correctness, prove-the-check-fired, safe-git-operations, skill-discovery, test-alongside-code, toolchain-management
- Context (1): polyrepo-structure
- Skills (11): adr-authoring, agent-coordination, basemind-tools, correctness-review, mise-tasks, mise-toolchains, poly-lint-format, pull-requests, release-workflow, tdd-workflow, verification-harness
test-alongside-code and tdd-workflow replace the testing builtin's rule and skill of the same ids, which say to
run the full suite before committing, and agent-workflow replaces the ai-governance builtin's, adding the
subagent rules (no compiling in subagents, disjoint worktrees, implement-review-adjust rounds, reported deviations).
Each override works but raises AR703 duplicate-collapsed, which fails ai-rulez validate --strict; add
"!testing/test-alongside-code", "!testing/tdd-workflow" and "!ai-governance/agent-workflow" to builtins to
keep the module items without the warning.
mise-tasks replaces the token-efficiency builtin's go-task task-runner skill under a new name, so
there is no warning: add "!token-efficiency/task-runner" to builtins, or both skills load and contradict.
- Rules, glob-scoped (12): rust, python, typescript, ruby, php, go, java, kotlin-android, csharp, elixir, r, shell
(Bats is the only shell test framework). Plain
language conventions plus org policy (for example Pyrefly as the only Python type checker), gated on the language's
file types, so a rule costs nothing until a matching file is read. They replace the ai-rulez language builtins;
drop those from
builtinswhen you include this module. - Skills (2), Rust paths: feature-flag-conventions (
**/Cargo.toml), tracing-conventions - Agents (1): performance-engineer
- Rules, glob-scoped (3), gated on the alef layout: rust-native-bindings (PyO3, napi-rs, Magnus,
ext-php-rs, Rustler, extendr, wasm-bindgen, and the Dart and Swift bridge crates), c-abi-wrappers (the
crates/*-ffiC ABI plus the Go, C# and Zig wrappers), jvm-bindings (Java, Kotlin Android,crates/*-jni) - Skills (3): binding-architecture, consumer-release-gates, e2e-generation (
e2e/**,fixtures/**,alef.toml)
A repo that includes this module must enable the polyglot-bindings builtin: it holds the general binding
and FFI principles (ownership, opaque handles, error and async boundaries, ABI stability) and the
ffi-engineer and polyglot-architect agents, which this module does not repeat. Exclude
!polyglot-bindings/rust-polyglot-conventions: it restates the languages module's rust rule. alef's own installed skill
([[installed_skills]] alef) covers the generator, its tasks and the version sync.
- Skills (2): github-workflow-conventions (
.github/workflows/**,.github/actions/**), scoop-distribution (scripts/publish/**)
The cicd builtin (cicd/github-workflow, cicd/pipeline-standards) is opt-in; no consumer enables it.
- Skills (1): gcloud-conventions (IaC, workflow and deploy paths)
Container and service-observability guidance is the docker and observability builtins.
- Skills (1): xberg-brand-and-docs (
docs-site/**,readme_templates/**,templates/readme/**): brand, product list, the shared docs theme, docs tasks, analytics IDs, README-template policy
- Skills (1): document-corpus-handling (corpus, manifest and attribution paths)
Every session should start with the smallest context that lets it do the task, and load the rest when the work reaches it. Place each rule, skill or agent at the first level that fits:
- True for every file and task in the repo: an always-on rule. Keep it short.
- Tied to a file type or a directory: a rule with
paths:globs, or a skill withpaths:. Shared modules use the org's repeatable layout (crates/<name>-<lang>/,packages/<lang>/,e2e/,fixtures/,alef.toml) so one definition gates correctly in every repo. Presets without path scoping (Codex, OpenCode) get each glob-scoped rule as an on-demand skill in.agents/skillsthrough[rules] scoped_fallback = "skill", instead of having it inlined into the sharedAGENTS.md, where every preset would load it at start. - An area with its own skills, agents and toolchain that people work in directly (an integration package, a docs
site, a tool): a nested
.ai-rulez/in that directory, generated withai-rulez generate --recursive. It writes a nestedCLAUDE.md/AGENTS.mdand nested skills that load only inside that tree. Setbuiltins = falsethere so the root's builtins are not repeated. - A procedure used for some tasks: a skill whose description (250 characters or less) says what it is for and the words a user would say.
- Needs isolation or restricted tools: an agent. Otherwise not an agent.
- Shared across repos: a module here, only if it is true in every repo that includes the module.
ai-rulez exposure reports what each consumer loads at start, and ai-rulez exposure leakage flags product terms that
leak into another product's start context against the taxonomy in tools/context-evals/domains.toml; see
tools/context-evals.
version = "5.0"
name = "your-project"
presets = ["claude", "codex", "opencode"]
default_layers = ["plugins"]
compact = true
# The agent roster repeats the agent files in every root file; harnesses list agents natively.
builtins = [
"!agent-delegation", "!git-workflow", "!ai-governance/agent-workflow",
"!testing/test-alongside-code", "!testing/tdd-workflow",
"!token-efficiency/output-awareness", "!token-efficiency/task-runner", "!ai-governance/explain-reasoning",
"!security/least-privilege", "!security/input-validation",
"default-commands",
]
# Glob-scoped rules stay out of the shared AGENTS.md (and so out of CLAUDE.md, which imports it): Claude
# loads them from .claude/rules on a matching read, presets without a rules folder as path-gated skills.
[rules]
scoped_fallback = "skill"
# The full ai-rulez server lists 67 tools (~38k tokens) at every start; skill discovery needs two (~1.1k).
# core's skill-discovery rule points the model at them.
[mcp]
self_server_command = ["ai-rulez", "mcp"]
serve_skills = true
read_only = true
discover_skills = "repo"
tools = ["find_skill", "load_skill"]
[[includes]]
name = "xberg-core"
source = "https://github.com/xberg-io/agent-conventions.git"
version = "^1"
path = "modules/core"
merge_strategy = "local-override"
[[includes]]
name = "xberg-languages"
source = "https://github.com/xberg-io/agent-conventions.git"
version = "^1"
path = "modules/languages"
merge_strategy = "local-override"
[[includes]]
name = "xberg-cicd"
source = "https://github.com/xberg-io/agent-conventions.git"
version = "^1"
path = "modules/cicd"
merge_strategy = "local-override"Put the example in .ai-rulez/config.toml. The repository's own root context is short: an area map in
.ai-rulez/context/area-map.md (one line per top-level area, pointing to the scoped rules and skills that cover
it, no procedures) and only the rules that hold for every file. Everything else is a path-scoped rule, a skill
gated by paths:, or a nested .ai-rulez under the directory it serves. Put marketplace and plugin declarations in
.ai-rulez/config.plugins.toml, selected by the plugins default layer. Add only the modules
your repository uses, by version range (version = "^1"; the lock records the exact tag and commit). ai-rulez is never
pinned and always runs the latest release: tasks through npx -y ai-rulez@latest, CI through
xberg-io/actions/setup-ai-rulez, and the hooks through poly's npm channel. Validate and
regenerate after editing sources:
npx -y ai-rulez@latest validate --no-local
npx -y ai-rulez@latest generate --no-local --strict-config
mise run governance:checkPush a vX.Y.Z tag, or run the Conventions Release workflow (release-conventions.yaml) from the default branch
with a version: it validates, creates the tag if needed, moves the floating vX tag to it with a lease (never
backwards), and publishes the GitHub release. Consumers then move their pins with ai-rulez update (the polyrepo
root runs it everywhere with mise run ai-rulez:update); ai-rulez lock --outdated shows what would move.
Bump the major version only for a change that breaks consumers, such as removing or renaming a module or item.
Consumers generate local harness files from these modules. Product plugin content is maintained
separately under each product's plugin/.ai-rulez/; its public skills/ export contains product
integration instructions. It does not expose this repository's internal contributor conventions.
CI gates the start context with actions/context-exposure (ai-rulez's native exposure checks: the consumer's
[exposure] budgets and leakage); see
tools/context-evals and docs/load-mechanics.md.
Reviewed Poly hooks validate staged source configuration; mise run governance:check checks the
materialized local output. See CONTRIBUTING.md for editing and hook setup.
The public skills/ directory contains the Agent Skills maintained in these modules
plus the ai-rulez built-in governance skills. A native ai-rulez provider projects their consumer frontmatter
and supporting resources; edit the source modules and run ai-rulez generate --no-local --strict-config,
then mise run governance:check. The generated export is committed and checked in CI.
npx skills add xberg-io/agent-conventions --skill release-workflowFor Codex, a skill can also be copied into your project’s .agents/skills/ or your user skills
directory. These skills describe repository development and release conventions; product SDK
skills live in each product repository.
Repos that include bindings also enable the polyglot-bindings builtin; infra enables the docker and
observability builtins, xberg-enterprise docker.
| Repo | Modules |
|---|---|
| xberg | core, languages, cicd, infrastructure, bindings, document-corpora, docs-sites |
| crawlberg, html-to-markdown, liter-llm, tree-sitter-language-pack | core, languages, cicd, bindings, docs-sites |
| xberg-enterprise | core, languages, cicd, infrastructure, document-corpora, docs-sites |
| sceptre, sdks | core, languages, cicd, docs-sites |
| alef, actions, test-apps | core, languages, cicd |
| infra | core, languages, cicd, infrastructure |
| docs-theme | core, cicd, docs-sites |
| test_documents | core, cicd, document-corpora |
| paddle-to-onnx | core, languages |
| assets, homebrew-tap, scoop-bucket, polyrepo root | core |
See the LICENSE file for licensing information.