A Go-native system topology specification for modeling microservices, infrastructure, and connectivity.
- 🔒 Strongly-typed - Go structs are source of truth; no
interface{}orany - 📄 JSON-first - JSON format with generated JSON Schema
- 🔗 Graph-aware - Services as nodes, connections as edges
- ☁️ Multi-cloud - AWS, GCP, and Cloudflare resource bindings
- 🎨 Multi-render - D2, Mermaid, Cytoscape.js, Sigma.js, GraphViz
go install github.com/plexusone/system-spec/cmd/system-spec@latestgo get github.com/plexusone/system-spec@latestCreate system.json:
{
"name": "my-system",
"services": {
"api": {
"image": { "name": "myorg/api", "tag": "v1.0" },
"repo": { "url": "https://github.com/myorg/api" },
"connections": {
"database": { "port": 5432, "protocol": "sql" }
}
},
"database": {
"image": { "name": "postgres", "tag": "15" }
}
}
}Validate and render:
# Validate
system-spec validate system.json
# Render to D2
system-spec render system.json --format d2 > system.d2
d2 system.d2 system.svg
# Render to Mermaid (GitHub-compatible)
system-spec render system.json --format mermaid
# Render to Cytoscape.js (web visualization)
system-spec render system.json --format cytoscape > system.jsonimport (
"github.com/plexusone/system-spec/spec"
"github.com/plexusone/system-spec/graph"
"github.com/plexusone/system-spec/render"
)
// Load and validate
sys, err := spec.LoadFromFile("system.json")
if err != nil {
log.Fatal(err)
}
// Convert to graph
g := graph.FromSystem(sys)
// Render
renderers := render.NewRenderers()
output, err := renderers.D2.Render(g)| Version | Spec | Schema |
|---|---|---|
| v0.1.0 | spec.md | system.schema.json |
The human-readable spec (spec.md) is for developers. The JSON Schema is for tools and AI agents.
| Provider | Resources |
|---|---|
| AWS | RDS, DynamoDB, SQS, SNS, S3, Bedrock |
| GCP | CloudSQL, PubSub, GCS |
| Cloudflare | Workers, R2 |
| Tool | Support |
|---|---|
| Helm | Chart references with service mapping |
| Terraform | Module references with resource mapping |
| Format | Output | Use Case |
|---|---|---|
| D2 | Text | Static diagrams, documentation |
| Mermaid | Text | GitHub Markdown, wikis |
| Cytoscape | JSON | Interactive web visualization |
| Sigma | JSON | Large graph visualization |
| DOT | Text | GraphViz, PDF/PNG export |
- Go-first: Go structs → JSON Schema (not the reverse)
- No polymorphism:
map[string]Servicenotmap[string]interface{} - Schema validation: Must pass schemalint
- Graph-native: Built for visualization and dependency analysis
system-spec/
├── spec/ # Core Go types (System, Service, etc.)
├── graph/ # Graph representation and conversion
├── render/ # Multi-format renderers
├── schema/ # JSON Schema generation
├── cmd/system-spec/# CLI tool
├── versions/ # Versioned specs and schemas
│ └── v0.1.0/
│ ├── spec.md # Human-readable
│ └── system.schema.json # Machine-readable
├── docs/ # MkDocs documentation
└── examples/ # Example system specs
- Fork the repository
- Create a feature branch
- Make changes with tests
- Run
go test ./...andgolangci-lint run - Submit a pull request
See CHANGELOG.md for release history.
Generated from CHANGELOG.json using structured-changelog.
MIT License - see LICENSE for details.