On this page
domain.yaml
A domain plugin is one YAML file. It declares the tags, axes, contract scaffolds,
and L5 validators specific to your domain. The runtime discovers it recursively
from $PRIME_DIR; no code changes.
Minimum example
# domain.yaml — at the corpus root
name: my-domain
version: "1.0.0"
description: One sentence describing what knowledge lives in this corpus. The runtime loads this as-is; axes, validators, and all other fields are optional.
Full reference
name: frontend-design
version: "1.0.0"
description: Design knowledge for AI agents — color, typography, motion, spacing,
accessibility, and component patterns.
# Optional. Hints to the retriever about the dominant taxonomy.
hierarchy: visual-hierarchy
# Optional. Multi-axis tags the retriever boosts on when intent matches.
axes:
- layout
- typography
- spacing
- color
- motion
- accessibility
# Optional. Default contract scaffolds applied when a method doesn't override.
contract:
typography: atom-12-array
color: atom-token-semantic
# Optional. L5 validator hooks (zero or more).
validators:
- name: html-semantic
checker: regex
pattern: '^<([a-z][a-z0-9]*)\b[^>]*>'
- name: color-token
checker: ai-judge
rubric: '@frontend-design/rubric-color-token'
# Optional. Default budget hints — used by the retriever when none specified.
budgets:
default-tokens: 1200
max-tokens: 2400 Field reference
| Field | Type | Required? | Notes |
|---|---|---|---|
name | kebab-case string | yes | Unique across loaded domains. |
version | semver | yes | Use the same versioning policy as your Prime. |
description | string | yes | Shown in marketplace listings. |
hierarchy | string | no | Hints to the retriever about dominant taxonomy. |
axes | list of strings | no | Tags the retriever boosts on. Unicode allowed. |
contract | map | no | Default contract scaffolds. |
validators | list of validator specs | no | L5 hooks. |
budgets | map | no | Default token budgets. |
Validator specs
v0.1.0 ships two checker types; domain MCP wrappers can register more.
| Checker | Parameters | What it does |
|---|---|---|
regex | pattern | Match against generated artifact; pass if at least one match. |
ai-judge | rubric (atom id) | Send artifact + rubric atom to an LLM, parse pass/fix verdict. |
Discovery rules
- Files named exactly
domain.yamlat any level of$PRIME_DIR, max depth 4. - Names must be unique across loaded domains. Conflicts hard-fail at boot.
- Loaded once per server process. Send
SIGHUPto reload.
From v0.0.x code-defined domains
If you have an old monorepo with a packages/domain-foo/ directory,
migrate by lifting its tag list into axes, its validators into
validators, and dropping it into the corpus root as
domain.yaml. The runtime will pick it up automatically.