@prata.ma/anvil-schema
v2.1.2
Published
Shared schema parsing and authored schema package for Anvil workspaces.
Readme
@prata.ma/anvil-schema
Shared schema package for Anvil workspaces.
Overview
@prata.ma/anvil-schema owns shared schema parsing utilities plus the package-owned home for authored artifact schemas and their companion Zod definitions. It exists to stop schema ownership from fragmenting across catalog skill assets, individual consumer packages, and Hub-side target adapters.
The package now owns the shared *.schema.yaml parser, the authored YAML schema files that previously lived under catalog blocks, the first companion Zod schemas for artifact and manifest surfaces, and shared AI rule-budget constants that downstream consumers can import instead of duplicating.
Installation
Install from npm or consume it through a workspace dependency while developing inside this monorepo.
npm
pnpm add @prata.ma/anvil-schemaWorkspace
{
"dependencies": {
"@prata.ma/anvil-schema": "workspace:*"
}
}Layout
src/format/- shared schema-format parser and types for*.schema.yamlsrc/schemas/- package-owned artifact and manifest schema folderssrc/schemas/{domain}/{artifact}/- per-artifact folders where YAML schemas, companion Zod schemas, variants, and supporting files live togethertest/- package tests for shared schema parsing and validation behavior
Conventions
- Keep one artifact folder per durable schema concern, for example
src/schemas/state/plan/ - Colocate the authored YAML schema, companion Zod schema, variants, and supporting schemas in the same artifact folder
- Use
artifacts/in framework docs for artifact specification and keep package schema ownership here rather than in catalog block skill assets - Treat this package as the shared schema source for consumers such as
@prata.ma/anvil-eslint,@prata.ma/anvil,@prata.ma/anvil-ai, and later@prata.ma/anvil-hub - Prefer shared exported constants when multiple consumers need the same durable contract, such as the AI rule-budget limits and prohibited constructs
Surface
src/format/template-schema.tssupports parser-level artifact constraints such asmaxChars,maxLines,maxTokens, and prohibited markdown constructssrc/schemas/ai/rule/rule.tsexports the sharedharnessRuleBudgetcontract for AI rule limits and prohibited constructssrc/schemas/ai/managed.tsexports the shared managed deployment marker contract used across reparsed deployable artifactssrc/schemas/ai/agent/agent.tsowns the one-file markdown agent frontmatter contract used by sync-owned agent deployment
Development
pnpm --filter @prata.ma/anvil-schema release:check
pnpm --filter @prata.ma/anvil-schema build
pnpm --filter @prata.ma/anvil-schema lint
pnpm --filter @prata.ma/anvil-schema test
pnpm --filter @prata.ma/anvil-schema test:typeNotes
@prata.ma/anvil-schemanow participates in the repo's Changesets, npm publish, and GitHub Release automation.- The package remains the shared schema source for
@prata.ma/anvil,@prata.ma/anvil-eslint,@prata.ma/anvil-ai, and@prata.ma/anvil-hub.
