Documentation

Keep your context through the next migration

Import the repository guidance you already have into .stemma/, then generate the configuration your next coding agent needs. Maintain that canonical source so a later migration can reuse the same context.

Choose your starting point#

Stemma migrates repository context. You still review differences in provider capabilities and test the result with the destination agent. It does not transfer licenses, conversations or personal settings.

The canonical project#

The canonical project is a directory of ordinary Markdown files with structured metadata in front matter. Entities are Markdown because almost everything in them is Markdown: holding multi-line prose inside JSON strings would make the file you are supposed to edit the least pleasant one in the repository.

.stemma/
.stemma/├── project.json      # name, targets, token budgets├── context/          # architecture.md, testing.md, …├── rules/            # api-validation.md, …├── procedures/├── skills/├── agents/├── decisions/├── profiles/         # <target>.json — delivery, never truth├── provenance.json   # where each entity came from└── manifest.json     # files generated, or verified at import

The file name is the entity's slug, so the filesystem mirrors the entity ids: rule.api-validation lives at .stemma/rules/api-validation.md.

What each part is for#

Markdown entity files
One file per entity, named after its id. The body is the content a person edits; nothing about it is machine-owned.
Front matter
Structured delivery metadata in a restricted YAML subset — no tags, anchors or aliases.
provenance.json
Where every imported entity came from: source format, path, hash, byte and line span, and how it was handled.
manifest.json
What Stemma generated, with hashes, so it can tell an untouched file from one you edited.
profiles/<target>.json
Delivery decisions for one target: include or exclude, activation, destination, accepted diagnostics. Never canonical truth.

The rule that makes profiles safe

A profile changes how one target receives an entity without editing the canonical source. A contentOverride can replace the projected wording and is explicitly reported for review. A profile cannot re-enable an entity disabled in the canonical project.

Entities#

Six entity types cover what repository guidance actually contains. Each has a stable id of the form <entityType>.<slug>, an activation, provenance and provider extensions.

  • Context document — durable prose guidance, with a kind and an audience of agent, human or both. A human-audience document is never projected into agent-facing output.
  • Rule — a single actionable instruction with a priority of must, should or may. Only the instruction is necessarily agent-facing; rationale and examples stay for people.
  • Procedure — an ordered, invocable workflow.
  • Skill — reusable on-demand capability documentation.
  • Specialist agent — name, description, instructions, tools and model preference, treated as opaque provider metadata. Stemma never translates tool names between providers.
  • Architecture decision — normally only its agentConstraints reach an agent; the rest is human documentation.

Nothing is silently discarded#

Content Stemma refuses to interpret is preserved verbatim as an opaque block, with its provider, source path, span, hash and a human-readable reason. Unrecognised front matter keys survive as extensions.<provider>.<key> and are re-emitted when exporting back to the same provider.

Where to go next#

Source of truth for this page: docs/canonical-model.md ↗