Configuration

Reference for citadel.yaml and maester.yaml — sources, connectors, MCP servers, and the publish manifest.

Maester is configured through two YAML files: citadel.yaml lives at the root of an aggregating repository, and maester.yaml lives at the root of each source repository.

Both files carry a schemaVersion so future tooling can migrate them. Current version is 1.

You rarely need to edit either file by hand. maester init, maester add | remove | list, and maester publish … create and edit them through the same prompts and validators — see Editing your config.

citadel.yaml

The aggregator’s configuration. Lists the sources to pull from, where their content lands, and any live services agents can query.

schemaVersion: 1
baseDir: context           # optional; defaults to 'citadel'
sources:
  # Manifest-driven: the remote publishes its own maester.yaml.
  - name: source-context
    url: https://github.com/your-org/source-repo
    ref: main
    destination: docs/external/source-context   # optional override
    auth:
      type: token
      envVar: GH_TOKEN
  # Includes-driven: the citadel declares what to pull.
  - name: third-party
    url: https://github.com/another/repo
    ref: main
    includes:
      - 'README.md'                              # bare string — state defaults to draft
      - { path: 'docs/**/*.md', state: draft, category: reference }
      - { path: 'docs/v3/**/*.md', state: canon } # ratified subset
  # Whole-repository: no includes, and the remote has no maester.yaml.
  - name: handbook
    url: https://github.com/your-org/handbook
    excludes:
      - archive/**
  # Local directory: no git, no network.
  - name: platform-docs
    path: ../platform-docs
connectors:
  - name: team-issues
    type: gitlab-issues
    auth: { type: token, envVar: GITLAB_TOKEN }
    config:
      project: your-group/your-project
mcpServers:
  - name: tracker
    kind: remote
    url: https://mcp.tracker.example.com/mcp
    auth: { envVar: TRACKER_TOKEN }

Top-level fields

FieldTypeRequiredDescription
schemaVersionintegeryesSchema version. Current version is 1.
baseDirstringnoParent folder for sources whose destination is unset. Default: citadel.
sourceslistyesWhere documents come from: git repositories or local directories. At least one entry.
connectorslistnoLive services exposed to agents as MCP tools. See Connectors.
mcpServerslistnoThird-party MCP servers shared with every agent host. See MCP servers.

baseDir is validated by the same path-safety rules as a per-source destination: it must be repo-relative, with no leading / and no .. segments. Setting it does not affect sources that declare their own destination — those still land exactly where they’re told.

Changing baseDir after a previous sync is non-destructive: the new sync writes to the new location and leaves any previously-populated directories under the old base alone for you to remove manually.

Per-source fields

Every entry in sources[] declares exactly one of url (a git repository) or path (a directory on this machine), plus:

FieldApplies toDescription
nameallUnique kebab-case slug; becomes the destination folder name unless destination is set.
urlgithttps://, ssh://, or git@host:path.
refgitBranch, tag, or commit SHA. Defaults to the remote’s default branch.
authgit{ type: token, envVar: NAME } — the name of the env var holding the token; the value never lands in YAML.
pathlocalRepo-relative, absolute, ~/…, or ${ENV_VAR}/….
modelocallink (default) or copy. See Local directories.
includesallDeclares the filter set; see How a source picks its files. An empty list is rejected.
excludesallGlobs to skip — whole-repository mode only. Ignored, with a warning, in the other modes.
destinationallOutput path override. Wins over baseDir.
description, tagsallOptional metadata shown by maester list and --verbose output.

ref and auth are rejected on local sources; mode is rejected on git sources.

How a source picks its files

Each source resolves to one of three modes, checked in this order:

  1. Includes-driven — includes is set. The citadel owns the filter set; the remote maester.yaml is not consulted. Use it for public third-party repos or repos you can read but don’t own (see traveling maesters).
  2. Manifest-driven — no includes, and the source has a maester.yaml listing at least one document. The source owns its publish surface.
  3. Whole-repository — no includes, and the source has no maester.yaml (or one with documents: []). Every file is surfaced, minus the built-in excludes and your excludes.

A maester.yaml that fails validation is always an error — it never falls back to whole-repository mode.

Whole-repository sources are linked, not copied

Whole-repository content is never committed into the citadel. Sync fills the destination with one symbolic link per file, pointing into the local cache at .maester/cache/<name>/, and adds the destination to .gitignore the first time. Deleting .maester/ leaves the links dangling: maester status reports cache-missing and the next sync restores them.

These are always skipped (maester sync --help prints the list):

  • VCS, dependency and build directories — .git, node_modules, vendor, .venv, __pycache__, dist, build, target, coverage, .next, .cache, .maester, and similar.
  • Binary files (a NUL byte in the first 8000 bytes) and files over 1 MiB.

To get a committable copy instead, declare includes on the source or publish a maester.yaml from it.

Local directories

A source with path: reads straight from a directory on this machine — a sibling checkout, a notes folder, anything you’re editing locally. It picks its files exactly like a git source.

sources:
  # Linked (default): symlinks to the live files, gitignored.
  - name: platform-docs
    path: ../platform-docs

  # Copied: a committable snapshot, refreshed on each sync.
  - name: handbook
    path: ${HANDBOOK_HOME}
    mode: copy
    includes:
      - '**/*.md'
  • mode: link creates one symlink per file and gitignores the destination. Edits show through immediately; adding or removing files needs a sync.
  • mode: copy copies only the resolved files and stamps inline metadata, like a git source. It requires declared paths (includes or a manifest) — whole-directory copies are refused.
  • Guards: a path may not sit inside, or contain, the citadel’s base directory or any destination. A missing directory or unset ${VAR} fails only that source.

includes entry forms

Each entry in an includes list can take two shapes:

includes:
  - 'README.md'                                    # bare string
  - { path: 'docs/**/*.md', state: draft }         # object with metadata
  - { path: 'docs/adr/*.md', category: adr, tags: [architecture] }

The bare-string form is shorthand for { path: '<value>' }. The object form accepts state, category, and tags, which are stamped into each copied file. Mixing the two forms in the same list is fine.

Destination resolution

For each source, sync resolves the destination in this order:

  1. The source’s explicit destination field, if set.
  2. <baseDir>/<source-name>/, if baseDir is set.
  3. citadel/<source-name>/, the default.

Destination collisions across sources (two sources resolving to the same directory) are rejected at config-validation time, before any sync work begins.

Connectors

A connector registers a live external service — a traveling maester — whose operations agents call as MCP tools through maester mcp.

connectors:
  - name: team-issues            # tools appear as team_issues__list_issues, …
    type: gitlab-issues
    description: Issues for the payments service.
    auth: { type: token, envVar: GITLAB_TOKEN }
    config:
      host: https://gitlab.com   # optional; defaults to gitlab.com
      project: your-group/your-project
FieldRequiredDescription
nameyesKebab-case slug; the prefix of every tool the connector exposes.
typeyesConnector type. Built in: gitlab-issues (list-issues, get-issue).
authno{ type: token, envVar: NAME } — names only, never values.
descriptionnoPrepended to each tool’s description.
configper typeValidated by the type. gitlab-issues takes project (required) and host (HTTPS, optional).

MCP servers

Declare a third-party MCP server once and every agent host with the Grand Maester installed gets the same tools.

mcpServers:
  - name: code-host                 # tools appear as code_host__<tool>
    kind: local
    command: npx
    args: ['-y', '@example/code-host-mcp']
    envVars: [CODE_HOST_TOKEN]      # names only; export the values yourself

  - name: wiki
    kind: remote
    url: https://mcp.wiki.example.com/mcp
    register: direct                # written into each host's own config
FieldApplies toDescription
nameallLowercase letters, digits and -; at most 32 characters.
kindalllocal (maester starts a command) or remote (a Streamable HTTP URL).
command, argslocalThe executable and its arguments. No shell is used.
envVarslocalEnv-var names forwarded to the server.
urlremotehttps:// (or http:// for localhost only).
authremote{ envVar: NAME, header?: Header-Name } — sent as Authorization: Bearer <value> by default.
registerallproxy (default: tools appear under maester’s own MCP entry) or direct (a separate managed entry per host).
toolsallOptional allowlist of upstream tool names.
descriptionallOptional.

Connector and MCP server names share one namespace, and maester and citadel are reserved.

maester.yaml

The publish manifest a source repository ships. Lists the documentation the source is willing to share.

schemaVersion: 1
documents:
  - path: README.md
    category: readme
    description: Project overview.
    state: canon
  - path: docs/architecture.md
    category: reference
    state: draft
  - path: docs/runbooks/**/*.md
    state: canon
    tags: [runbook, ops]

Fields

FieldTypeRequiredDescription
schemaVersionintegeryesCurrent version is 1.
documentslistnoThe publish list. Empty or omitted means publish the whole repository.

Each entry in documents[] accepts:

  • path — file or glob, repo-relative. Leading slashes and .. segments are rejected.
  • description — short free-text.
  • category — one kebab-case slug (e.g. readme, runbook, adr).
  • tags — list of kebab-case slugs.
  • state — canon or draft. Omit it to let each file’s own header decide.

state, category, and tags are written inline into every file the entry matches when a citadel copies it; a value already in the file wins. See Document state, category and tags.

You can also let your coding agent draft this file — see Publisher.

Editing your config

Once a file exists, change it with the same prompts that created it:

Citadel (citadel.yaml)Maester (maester.yaml)
maester add — add a sourcemaester publish add — add a document
maester remove — remove a sourcemaester publish remove — remove a document
maester list — table of sourcesmaester publish list — table of documents
maester connector add, removemaester publish update --path … — change one entry
maester mcp-server add, removemaester publish apply — apply a change set
  • Edits keep your comments, key order, and every entry you didn’t touch, and are written atomically after a full re-validation.
  • remove won’t delete the last entry: a citadel needs one source, and an empty documents list would publish the whole repository.
  • Running npx baller-maester with no arguments offers these verbs once a config exists.

Validation

Both files are validated before any work begins:

  • Unknown fields are rejected, with the field named in the error.
  • Required fields with the wrong shape fail with a clear, field-named error pointing at the offending entry.
  • state values outside {canon, draft} and category / tags values that aren’t kebab-case slugs are rejected.
  • Path safety rules (no .. segments, no leading /) apply to baseDir, destination, every includes / excludes entry, and every manifest path.
  • Credential fields accept env-var names only (uppercase letters, digits, underscores) — a pasted token is rejected.

When validation fails, maester sync exits with code 1 and no remote operations occur.