Skip to content

Authoring

Authoring is what a package author does between mx init and pnpm build. It covers everything that lives on disk before the package is built or run: source files, manifests, declarations.

Pages

  • Scaffold a packagemx init, mx actor, mx webapp, mx cqrs, mx actor-element
  • Package manifest — every field of matrix.json and what each one drives
  • Runtime entrypointsruntime.entry, runtime.browserEntry, runtime.bootstrapEntry, the matrix.service.json factory contract
  • Actor declarations — declaring components in matrix.json, accepts / emits / streams static contracts
  • App surfaces — the webapp block, asset layout, shells, route prefixes
  • Config contract — the config block, schemas, defaults, providers
  • Capability declarations — the permissions block today and the target-state capability surface

Authoring rules that apply to every page in this section

These come from CLAUDE.md Rule 9 and the actor communication contract:

  1. TypeScript strict mode. No any, no as any.
  2. No cross-package ../../ imports. Use declared npm dependencies.
  3. No console.log in actor code. Use actorLog().
  4. No filesystem paths from caller-supplied strings without validation.
  5. No hardcoded ports, hostnames, or roots — packages do not own the environment. Read them from loadPackageEnvironment / Host config.
  6. Every list op returns cursor-based pagination.
  7. Every write op accepts an optional idempotencyKey.
  8. Schema evolution is additive only. Never remove fields; add optional ones.

See also