Where to Find Archify Schemas for Different Diagram Types: Complete File Reference
Archify stores JSON Schema definitions for every supported diagram type in the archify/schemas directory, with separate files validating architecture, dataflow, lifecycle, sequence, and workflow diagrams against the JSON Schema Draft 2020-12 specification.
The tt-a1i/archify repository uses these schemas to enforce strict structural validation across all diagram families. Each schema file defines required properties like schema_version, diagram_type, nodes, and edges, while inheriting shared type definitions from a centralized common.schema.json file.
Schema Directory Location and Structure
All diagram type schemas reside in the archify/schemas directory at the repository root. This centralized location ensures consistent validation logic across the codebase.
Repository File Layout
The directory contains six schema files with specific responsibilities:
archify/schemas/architecture.schema.json– Validates diagrams withdiagram_type: "architecture"archify/schemas/dataflow.schema.json– Validates diagrams withdiagram_type: "dataflow"archify/schemas/lifecycle.schema.json– Validates diagrams withdiagram_type: "lifecycle"archify/schemas/sequence.schema.json– Validates diagrams withdiagram_type: "sequence"archify/schemas/workflow.schema.json– Validates diagrams withdiagram_type: "workflow"archify/schemas/common.schema.json– Provides shared definitions for nodes and edges referenced via$ref
Each schema file declares "$schema": "https://json-schema.org/draft/2020-12/schema" at the root, ensuring compatibility with modern JSON Schema validators.
Schema Inheritance Model
The common.schema.json file contains reusable definitions for base node types and edge structures. Type-specific schemas reference these definitions using the $ref keyword, maintaining consistency while allowing diagram-specific property extensions.
Diagram Type to Schema Mapping
Archify maps the diagram_type property value directly to its corresponding schema file:
"architecture"→archify/schemas/architecture.schema.json"dataflow"→archify/schemas/dataflow.schema.json"lifecycle"→archify/schemas/lifecycle.schema.json"sequence"→archify/schemas/sequence.schema.json"workflow"→archify/schemas/workflow.schema.json
Code Examples: Validating Against Archify Schemas
Minimal Architecture Diagram
This example validates against architecture.schema.json and demonstrates the required schema_version, nodes, and edges structure:
{
"schema_version": 1,
"diagram_type": "architecture",
"nodes": [
{ "id": "browser", "type": "client", "label": "Browser" },
{ "id": "cdn", "type": "cloud", "label": "CDN" }
],
"edges": [
{ "from": "browser", "to": "cdn", "variant": "emphasis", "label": "HTTPS" }
]
}
Dataflow Diagram with Metadata
The following validates against dataflow.schema.json and uses metadata fields defined in common.schema.json:
{
"schema_version": 1,
"diagram_type": "dataflow",
"nodes": [
{ "id": "source", "type": "source", "label": "Web SDK" },
{ "id": "ingest", "type": "service", "label": "Edge API" }
],
"edges": [
{ "from": "source", "to": "ingest", "variant": "emphasis", "label": "event" }
]
}
Referencing Schema URIs
For validation tools requiring explicit schema references, point to the GitHub URL:
{
"$schema": "https://github.com/tt-a1i/archify/blob/main/archify/schemas/architecture.schema.json",
"schema_version": 1,
"diagram_type": "architecture",
"nodes": [
{
"id": "api",
"type": "backend",
"label": "API Server",
"metadata": { "language": "Node.js", "port": 8000 }
}
],
"edges": [
{
"from": "browser",
"to": "api",
"variant": "emphasis",
"label": "HTTPS"
}
]
}
Summary
- Archify schemas for different diagram types are located in the
archify/schemasdirectory of thett-a1i/archifyrepository. - Each diagram type has a dedicated schema file:
architecture.schema.json,dataflow.schema.json,lifecycle.schema.json,sequence.schema.json, andworkflow.schema.json. - The
common.schema.jsonfile provides shared node and edge definitions referenced by all type-specific schemas via$refpointers. - All schemas implement JSON Schema Draft 2020-12 and enforce required top-level properties:
schema_version,diagram_type,nodes, andedges. - The
variantproperty in edge objects supports values like"emphasis"to control visual styling.
Frequently Asked Questions
Where are the Archify schema files located in the repository?
All schema files reside in the archify/schemas directory at the root of the tt-a1i/archify repository. This directory contains five type-specific schema files and one common.schema.json file containing shared definitions.
What JSON Schema version does Archify use?
Archify schemas implement the JSON Schema Draft 2020-12 specification, declared via "$schema": "https://json-schema.org/draft/2020-12/schema" in each file. This version supports advanced features like recursive references and conditional validation used in the common definitions.
How do I reference the common definitions in my diagram JSON?
You do not need to manually reference common.schema.json. The type-specific schema files (such as architecture.schema.json) automatically include common definitions through $ref pointers. Simply validate your JSON against the appropriate diagram type schema, and the shared node and edge validations apply automatically.
Which diagram types are supported by Archify schemas?
Archify supports five diagram types, each with dedicated schema files: architecture, dataflow, lifecycle, sequence, and workflow. The diagram_type property in your JSON must match one of these string values exactly, or validation will fail against the corresponding schema file.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →