Where to Find JSON Schemas for Archify Diagrams: Complete File Location Guide

Archify stores its JSON schemas in the archify/schemas/ directory, with six schema files covering architecture, dataflow, workflow, sequence, lifecycle diagrams, plus a shared common schema for reusable definitions.

All diagram validation and generation in the Archify open-source project relies on formal JSON Schema definitions. These schemas enforce structure, enable IDE autocomplete, and power the CLI's validation pipeline. Whether you're building a custom diagram generator or validating existing files, you'll need to reference the schema files directly from the repository.

JSON Schema File Locations in Archify

The tt-a1i/archify repository organizes schemas under a dedicated subdirectory. Each diagram type has its own schema file, plus one shared schema for common definitions.

Complete Schema File Inventory

Diagram Type Filename Direct Repository Path
Architecture architecture.schema.json archify/schemas/architecture.schema.json
Dataflow dataflow.schema.json archify/schemas/dataflow.schema.json
Workflow workflow.schema.json archify/schemas/workflow.schema.json
Sequence sequence.schema.json archify/schemas/sequence.schema.json
Lifecycle lifecycle.schema.json archify/schemas/lifecycle.schema.json
Common (shared) common.schema.json archify/schemas/common.schema.json

All files follow JSON Schema Draft-07 specification and reside in the main branch.

Cross-Schema References

The individual diagram schemas import definitions from common.schema.json. For example, architecture.schema.json references shared types like id, label, and metadata rather than redefining them. This modular structure keeps schemas maintainable and consistent across diagram types.

Validating Diagrams Against Archify JSON Schemas

You can validate diagram files programmatically using any JSON Schema validator. Below is a Node.js implementation using the ajv library against architecture.schema.json.

const fs = require('fs');
const Ajv = require('ajv');
const ajv = new Ajv({ allErrors: true });

const schema = JSON.parse(
  fs.readFileSync('archify/schemas/architecture.schema.json', 'utf8')
);
const diagram = JSON.parse(
  fs.readFileSync('archify/examples/web-app.architecture.json', 'utf8')
);

const validate = ajv.compile(schema);
if (validate(diagram)) {
  console.log('Diagram is valid!');
} else {
  console.error('Validation errors:', validate.errors);
}

This pattern works for any schema in the directory—simply swap the schema filename and target diagram file.

Creating Compliant Diagram Files

To ensure your diagrams pass validation, structure them according to the relevant schema. Here's a minimal example conforming to dataflow.schema.json:

{
  "$schema": "https://json-schema.org/draft-07/schema#",
  "type": "object",
  "title": "Sample Dataflow",
  "description": "A minimal dataflow diagram for demonstration purposes.",
  "properties": {
    "name": { "type": "string", "description": "Diagram name" },
    "nodes": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id":   { "type": "string" },
          "type": { "type": "string", "enum": ["source", "processor", "sink"] },
          "label":{ "type": "string" }
        },
        "required": ["id", "type"]
      }
    },
    "edges": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "from": { "type": "string" },
          "to":   { "type": "string" },
          "label":{ "type": "string" }
        },
        "required": ["from", "to"]
      }
    }
  },
  "required": ["name", "nodes", "edges"]
}

Include the $schema declaration to enable editor support and explicit version tracking.

Using Schemas with the Archify CLI

The Archify CLI automatically references these schemas when processing diagram files. After installing Archify globally, generate diagrams with:

archify render examples/web-app.architecture.json --out diagrams/web-app.svg

The CLI loads the appropriate schema from archify/schemas/ based on the input file's diagram type, validates the structure, then proceeds with rendering. Validation failures surface as descriptive error messages with line numbers.

Summary

  • Primary location: All JSON schemas for Archify diagrams live in archify/schemas/ in the main branch of tt-a1i/archify
  • Six schema files: architecture, dataflow, workflow, sequence, lifecycle, plus common shared definitions
  • Schema version: JSON Schema Draft-07 with cross-references from specific diagrams to common.schema.json
  • Validation: Use ajv, similar libraries, or the built-in CLI validation
  • Integration: Reference schemas directly for IDE autocomplete and programmatic validation pipelines

Frequently Asked Questions

What schema format does Archify use?

Archify uses JSON Schema Draft-07 for all diagram type definitions. This version provides robust validation features including conditional schemas, property dependencies, and reference resolution—all utilized across the six schema files in archify/schemas/.

Can I extend the Archify schemas for custom diagram types?

Yes. Fork the repository and add new schema files to archify/schemas/, following the Draft-07 specification. Import shared definitions from common.schema.json using $ref pointers. The CLI's schema resolution is path-based, so custom schemas integrate seamlessly if placed in the schemas directory.

How do the schemas relate to the CLI validation?

The Archify CLI maps input file extensions or explicit --type flags to schema filenames in archify/schemas/. It compiles the relevant schema using ajv internally, validates the input JSON, and aborts with detailed error output if validation fails. This ensures only structurally sound diagrams proceed to rendering.

Where can I find example diagram files that pass validation?

The repository includes validated examples in archify/examples/. Files like web-app.architecture.json demonstrate compliant structure against architecture.schema.json. Use these as templates when authoring new diagrams.

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:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →