@jgalego/teamapi-schema
Zod schemas and inferred TypeScript types for the
Team API as Code extended spec
— roles, members, services, bounded contexts, interactions, dependencies, cognitive load
assessments, and the root TeamApiDocument.
Install#
npm install @jgalego/teamapi-schema
Usage#
import { TeamApiDocumentSchema } from "@jgalego/teamapi-schema";
const doc = TeamApiDocumentSchema.parse(yourParsedYaml);
Exports#
TeamApiDocumentSchema/TeamApiDocument— the root document schema and its inferred type.v1— namespace re-export of everyv1/*schema/type (RoleSchema,ServiceSchema,InteractionSchema,DependencySchema,CognitiveLoadAssessmentSchema,WorkSchema,MeetingSchema,ChannelSchema,SearchTermSchema, etc.) for consumers that need a specific sub-schema or type rather than the whole document.getTeamApiJsonSchema()— the same schema as plain JSON Schema, for editors/IDEs or non-Zod consumers. The published copy lives at https://teamapi.dev/schema/v1.json, so a# yaml-language-server: $schema=modeline gives you validation and autocompletion as you type.SCHEMA_REGISTRY,isSupportedVersion(version),resolveSchemaForVersion(version)— a forward-compatibility seam for validating a document against whicheverteamApiVersionschema it declares; currently only"1.0.0"is registered.SUGGESTED_ROLE_KINDS— a non-exhaustive list of commonroles[].kindvalues, offered for editor autocompletion (roles[].kinditself accepts any non-empty string).responsibilityText(responsibility)/responsibilityDoneWhen(responsibility)— helpers for reading aRole.responsibilities[]entry regardless of whether it's the plain-string or{ text, doneWhen }object form.
Validation beyond field types#
Parsing also enforces several cross-field rules:
- A role's
reportsToandreportsToRefare mutually exclusive. - A role's
reportsTomust match another role'sidwithin the same team, and same-teamreportsTocycles (including self-reports) are rejected. roles[].idandmembers[].idmust each be unique within a team.
Full docs and the extended spec: https://github.com/JGalego/TeamAPI
The TeamAPI toolchain#
One org graph, seven doors into it — install only the ones you need:
| Package | What it does |
|---|---|
@jgalego/teamapi |
The CLI — validate, diagram, check, import, reconcile, serve and chat with your org |
@jgalego/teamapi-core |
The engine: $ref resolution, the org graph, scoring, checks, diagrams, generators |
@jgalego/teamapi-schema (this package) |
Zod schemas and TypeScript types for the extended spec |
@jgalego/teamapi-rest-api |
REST API, live dashboard, Swagger UI, Prometheus metrics |
@jgalego/teamapi-mcp-server |
The org graph as MCP tools for LLM assistants |
@jgalego/teamapi-chat |
Chat as a team or member — Anthropic or any OpenAI-compatible endpoint |
@jgalego/teamapi-backstage |
Live Backstage catalog entity provider |
Docs, examples and the extended spec: teamapi.dev · github.com/JGalego/TeamAPI
License#
MIT