Skip to main content

A coordination CLI for validated architecture documentation

Project description

slartiarch

Slartibartfast

Slartibartfast: the architect. From The Hitchhiker's Guide to the Galaxy, the curmudgeonly designer of Norway's fjords — and the namesake of this tool.

slartiarch is a coordination CLI that checks consistency between LikeC4 architecture diagrams, LinkML schemas, and SHACL shapes. It also regenerates the diagrams in your architecture document so the prose never drifts.

Each tool is useful on its own with no slartiarch involved. slartiarch adds the seams — rules that span two tools, and checks that the answers still agree.

Install

uv tool install slartiarch
npm install likec4
pip install linkml pyshacl

Use

slartiarch init          # scaffold docs/slarti/ and a config
slartiarch doctor        # resolved paths and tool versions
slartiarch check         # run all validations (CI command)
slartiarch check --json  # structured output for automation
slartiarch docs          # regenerate diagrams and tables into your docs
slartiarch docs --check  # fail if committed output is stale
slartiarch report        # every rule, shape, and check ID
slartiarch report --json # fully detailed, for agents

Run slartiarch with no arguments for a full reference. slartiarch report --json describes every rule, enforcer kind, check ID, and remedy.

Layout

docs/
  architecture.md      prose with generated diagram and table regions
  diagrams/            GENERATED — never hand-edited
  slarti/
    likec4/*.c4        LikeC4 architecture model
    linkml/*.yaml      LinkML domain schemas
    shacl/*.ttl        hand-written SHACL shapes
    constraints.yaml   rule registry
    data/valid/*       fixtures that must pass validation
    data/invalid/*     one fixture per SHACL rule; each must fail

How the tools work together

LikeC4 draws the system. LinkML defines the entities. SHACL validates instances. Each works standalone:

likec4 start docs/slarti/likec4                  # live architecture browser
gen-pydantic docs/slarti/linkml/slarti.yaml       # Python interfaces from schema
pyshacl -s docs/slarti/shacl/invariants.ttl ...   # validate RDF against shapes

A constraint in the registry ties them together:

# docs/slarti/constraints.yaml
- id: D8
  statement: A subtask belongs to the same list as its parent.
  enforced_by:
    kind: shacl_shape
    ref: "todo:SubtaskSharesListWithParent"
    fixture: docs/slarti/data/invalid/D8.yaml

Running slartiarch check walks the seams: it verifies the shape exists, the fixture fails (proving the shape fires), both halves of the ownership claim agree, and the constraint table in your document still matches. slartiarch docs regenerates the Mermaid diagrams and tables so the architecture document never goes stale.

Dogfooding

This repository's docs/architecture.md is generated by slartiarch from docs/slarti/. CI runs slartiarch check and slartiarch docs --check.

Dev

make setup   # uv venv + sync
npm ci       # pinned LikeC4
make domain  # regenerate slarti/domain.py from the LinkML schema
make ci      # tests, lint, types, complexity, duplication, dead code

Architecture decisions live in docs/adr/.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

slartiarch-0.2.0.tar.gz (225.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

slartiarch-0.2.0-py3-none-any.whl (34.5 kB view details)

Uploaded Python 3

File details

Details for the file slartiarch-0.2.0.tar.gz.

File metadata

  • Download URL: slartiarch-0.2.0.tar.gz
  • Upload date:
  • Size: 225.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for slartiarch-0.2.0.tar.gz
Algorithm Hash digest
SHA256 31a5037e4e7562395d934d06916c86a3a1a3e71f08a452c2b654c9cf7471d593
MD5 0eced20f65a087cde8330b27a3b5cd17
BLAKE2b-256 692d66d62322510207ffab905c5c991015ff1db412a79b2f72569460b4f2fa23

See more details on using hashes here.

File details

Details for the file slartiarch-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: slartiarch-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 34.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for slartiarch-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a5a523dcd9d056743d7b8d381f8a9ce726cd7f03d120a975759d2dad6082b499
MD5 03938c2a6bbf3fdff6c9a1ab191f95c0
BLAKE2b-256 9f396e93149c7432db5f01f3e768d9444c88e8323f66d0ac5294bdebdc5f4157

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page