Skip to content

Declare once, derive every interface

A capability is written in one place, and the command line, the HTTP API, the OpenAPI document, MCP, the Cockpit, the reference and this website are projections of it.

status
feature status: stable
domain
Surfaces
on the homepage
featured

What it does

An executable capability is one capability! block in its module's file, with a typed input, a typed output and a handler. A declarative object — a rule, a skill, a decision, a use case, an operational moment, a feature like this one — is one file under .ai/ whose kind and schema the tool distribution declares. The registry is built from both on every start, validated and fingerprinted, and everything a person or a program reaches is a reading of it: the MCP tools and resources, the routes under /api/v1/, the OpenAPI document and the Swagger UI over it, the words after majordomus, the benchmark targets, the Cockpit's pages, the generated reference under docs/generated/, and the datasets this website is rendered from.

majordomus generate writes every committed projection from one plan; majordomus generate --check refuses a tree in which any of them differs from what the sources produce, and CI refuses to merge or deploy such a tree. The feature you are reading is itself one file under the layer, and the surfaces listed beside it were derived from that file rather than typed onto this page.

What it does not do

It does not discover a capability nobody declared: a handler without a capability! block is not exposed anywhere, by design. It does not infer a relation from a name or a substring; every reference a file makes is typed and resolved against the thing it names, and one that resolves to nothing fails validation rather than becoming a link to nothing.

Why it exists

Operational moments from the Why catalogue that name one of this feature's mechanisms. Nothing here was assigned: a moment appears because it names a rule, a command, a capability or a claim this feature also names.

Every moment it answers (15)

How it works

The capability modules of the executable this feature names, each with the capabilities it composes. The interfaces each one reaches are listed under Interfaces below: they are projections of one declaration, not separate registrations.

Capabilities capabilities behaviorally verified

The registry seen through itself: every capability with its kind, stability, provenance, exposures, benchmark and cache policy, and one capability in full.

Generated artifacts artifacts behaviorally verified

What `majordomus generate` writes: every document with the encodings it is committed in — JSON for a program, YAML beside it, Markdown for a reader — each with its schema, its source and its hash, reconciled with the working tree. The declaration is the generator's own manifest; nothing here keeps a list.

Product product behaviorally verified

What this repository's product does for a person, as the features under the layer's features section declare it: each feature made of modules, commands, kinds, rules, documents, decisions, claims, use cases, Cockpit areas and web surfaces it names, with the interfaces it is exposed through, every count, the moments it answers and what is guaranteed derived from those references. The matrix of features against interfaces, the providers the tool has an adapter for, and the model's own validation. The homepage is a reader of this module and holds no inventory of its own.

Public API quality quality behaviorally verified

What this executable's own public surface is held to, measured from its syntax tree: documentation that says more than the signature, an executable example on everything that carries behaviour, a module boundary something exercises, and every command of the command line accounted for against the capability registry. The rules are project.rust-public-api-quality and project.operation-transport-parity; this is the measurement of them.

The objects it is made of

Kinds of the layer. Each is a schema, a source class and a file on disk; the number beside it is what this repository holds today, counted at build time.

  • feature29
  • domain6
  • command31
  • claim250

Where it sits

domain
Surfaces — One declaration in the repository becomes the command line, the HTTP API, MCP, the UI, the Cockpit, the documentation and this site, and a projection that disagrees with it fails the build.
areas of work
documentationgovernance

Interfaces

Each capability behind it, on every interface it is projected onto. A link goes to this site's reference for that interface; an HTTP route and an MCP tool are answered by a running majordomus serve, not by this site.

in the Cockpit, of a running server
/cockpit/capabilities Capabilities
/cockpit/artifacts Artifacts
served by the executable
/openapi.json The OpenAPI document of the capability registry

Evidence

What is guaranteed

Each claim this feature names, with the status its row declares, the verdict the recorded runs support, and the test that settles it.

Executable use cases

The rules that hold it

  • blocking External interfaces are projections of one capability definitionproject.interfaces-are-projections
  • blocking One canonical declaration; modules compose capabilities; the root composes modulesproject.rust-canonical-declaration
  • blocking Derived files are regenerated, never editedproject.derived-files-regenerated
  • blocking A generated artifact declares its document, its encoding, its contract and its sourceproject.generated-artifacts-are-typed
  • advisory Derived state is computed once per state versionproject.derived-once

The decisions behind it

Using it

The commands that run it

  • majordomus update setup

    Regenerate every provider instruction file from the one policy, deterministically.

  • majordomus doctor inspect · read-only

    It checks governance only: is Majordomus itself healthy, and is every enforcement it declares actually wired here?

From the executable's command line

The synopsis of each, as the executable's own help prints it.

Where this page comes from

the file
.ai/repo/features/declare-once.md
the same answer
majordomus product show declare-once

Searches the titles and descriptions of every page this site publishes.