Skill Wiki v0.1.0

Docs / extending / domain-yaml

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

FieldTypeRequired?Notes
namekebab-case stringyesUnique across loaded domains.
versionsemveryesUse the same versioning policy as your Prime.
descriptionstringyesShown in marketplace listings.
hierarchystringnoHints to the retriever about dominant taxonomy.
axeslist of stringsnoTags the retriever boosts on. Unicode allowed.
contractmapnoDefault contract scaffolds.
validatorslist of validator specsnoL5 hooks.
budgetsmapnoDefault token budgets.

Validator specs

v0.1.0 ships two checker types; domain MCP wrappers can register more.

CheckerParametersWhat it does
regexpatternMatch against generated artifact; pass if at least one match.
ai-judgerubric (atom id)Send artifact + rubric atom to an LLM, parse pass/fix verdict.

Discovery rules

  • Files named exactly domain.yaml at 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 SIGHUP to 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.