Quickstart · spec 1.0

Build a context layer, prove it conforms.

The reference CLI does the mechanical work: bootstrap or map a context layer, validate every artifact against the schemas, and score it against the conformance level it claims. Schemas and templates ship inside the package; no network access is needed.

Currently supported Node.js Node.js 22+ Python Python 3.10+ Go Go 1.23+

01Install the tooling

leji is one CLI with three homes: npm, PyPI, and Go. All three are tested against the same fixture suite, so commands, flags, JSON findings, and exit codes stay identical no matter which one your toolchain or CI installs.

npm install -g @leji-org/leji   # or: npx @leji-org/leji
pip install leji        # the PyPI twin
go install github.com/leji-org/leji/packages/sdk-go/cmd/leji@latest   # single binary, no runtime

02Bootstrap a context layer, or map the one you have

leji init walks you through it: a leji.json manifest at the repository root, a boot profile, and category mappings, generated from the spec's templates.

leji init               # interactive bootstrap

03Validate

Every artifact checks against the v1.0 schemas: the manifest, the index, the changelog, agent-profile and decision-record frontmatter. Lint rules cover what schemas can't: declared files must exist, the changelog is append-only, and a stale index is a hard failure.

leji validate           # schemas + lint rules
leji index              # generate the index
leji freshness          # review horizons

04Claim a level, then prove it

Partial adoption is by design: start at core, and each level contains the last. The manifest declares the claim; leji conformance scores the context layer against it.

coreindexedgovernedfederated

What each level asks of you

leji conformance        # score the claim

Keep it honest in CI

The mechanical guarantees are cheap to enforce. Three checks in CI and the context layer can't silently rot:

leji validate           # schemas + lint rules
leji index --check      # stale index fails
leji changelog check    # append-only

Exit codes are CI-native: 0 clean, 1 findings, 2 usage error.

Enter the context layer

The cleanest entry needs no vendor files at all: point the agent host at the boot profile in the invocation itself, so the context layer is the agent's first context with zero hops.

claude "Read ./docs/boot-profile.md, follow all instructions, and tell me when you are ready to begin."

Entering the context layer: the npm-script pattern and the vendor-file fallback table.

Then adopt for your situation

Monorepo One repository, one context layer. The full path is five steps.
Multi-repo A dedicated context repository, mounted docs-only in each consuming repo, pinned per repository.
Existing context repo Don't merge it. Mount it as a sibling context layer; ownership and workflow stay unchanged.

From a script

Everything the CLI does is exported as a library, for hooks, bots, and build steps. Source lives at leji-org/leji under packages/sdk, Apache-2.0.

import { validateLayer, writeIndex, conformanceReport } from '@leji-org/leji';

const { findings } = validateLayer('.');