Figram Diagram Authoring
Structure
version: 1
docId: "unique-id" # WebSocket matching
title: "Diagram Title" # Optional
nodes:
- id: node-id # Unique, descriptive (e.g., user-api)
provider: aws # aws | gcp | azure
kind: compute.ec2 # See Icons Reference
label: "Display" # Optional, defaults to id
layout: {x, y} # Required for top-level nodes
parent: vpc-id # Optional, for nesting
edges:
- id: edge-id
from: node-a
to: node-b
label: "description" # Optional
color: "#3498DB" # Optional, default: #666666
Layout Rules
| Node Type |
Layout |
| Top-level |
{x, y} required |
| Container (VPC, Subnet) |
{x, y, w, h} required |
| Child (has parent) |
Optional (auto-positioned in 3-column grid) |
Edge Colors (Convention)
| Color |
HEX |
Use |
| Blue |
#3498DB |
HTTP/HTTPS |
| Green |
#27AE60 |
Database |
| Orange |
#E67E22 |
Cache |
| Purple |
#9B59B6 |
Container |
| Gray |
#666666 |
Default |
Icons Reference
Full lists: AWS | GCP | Azure
Common Kinds
AWS:
- Compute:
compute.ec2, compute.lambda, compute.lb.alb, compute.container.ecs
- Database:
database.rds, database.dynamodb, database.aurora
- Storage:
storage.s3, storage.efs
- Network:
network.vpc, network.subnet, network.apigateway, network.cloudfront
- Integration:
integration.sqs, integration.sns, integration.eventbridge
GCP:
- Compute:
compute.gce, compute.functions, compute.cloudrun, compute.container.gke
- Database:
database.cloudsql, database.firestore, database.spanner
- Storage:
storage.gcs
- Network:
network.vpc, network.cdn, network.apigateway
- Integration:
integration.pubsub, integration.tasks
Azure:
- Compute:
compute.vm, compute.functions, compute.appservice, compute.container.aks
- Database:
database.sql, database.cosmosdb, database.redis
- Storage:
storage.blob, storage.storage
- Network:
network.vnet, network.frontdoor, network.apim
- Integration:
integration.servicebus, integration.eventhubs
Examples
Serverless API (AWS)
version: 1
docId: serverless-api
title: "Serverless REST API"
nodes:
- id: apigw
provider: aws
kind: network.apigateway
label: "REST API"
layout: { x: 100, y: 150 }
- id: lambda
provider: aws
kind: compute.lambda
label: "Handler"
layout: { x: 300, y: 150 }
- id: dynamodb
provider: aws
kind: database.dynamodb
label: "Users Table"
layout: { x: 500, y: 150 }
edges:
- id: api-to-lambda
from: apigw
to: lambda
label: "invoke"
color: "#3498DB"
- id: lambda-to-db
from: lambda
to: dynamodb
label: "read/write"
color: "#27AE60"
VPC with Auto-Layout
version: 1
docId: vpc-architecture
title: "VPC Architecture"
nodes:
- id: vpc
provider: aws
kind: network.vpc
label: "Production VPC"
layout: { x: 0, y: 0, w: 600, h: 400 }
- id: alb
provider: aws
kind: compute.lb.alb
parent: vpc
# Auto-positioned: (60, 60)
- id: ecs
provider: aws
kind: compute.container.ecs_service
parent: vpc
# Auto-positioned: (220, 60)
- id: rds
provider: aws
kind: database.rds
parent: vpc
# Auto-positioned: (380, 60)
edges:
- id: alb-to-ecs
from: alb
to: ecs
- id: ecs-to-rds
from: ecs
to: rds
Validation Errors
| Error |
Fix |
| Missing required field "version" |
Add version: 1 |
| Missing required field "docId" |
Add unique docId |
| Duplicate node id |
Use unique IDs |
| layout is required for top-level nodes |
Add layout: {x, y} |
| references unknown parent |
Fix parent ID |
| Edge references unknown node |
Fix from/to IDs |
| Cycle detected in parent hierarchy |
Break the cycle |
Custom Icons
# In diagram.yaml or figram-icons.yaml
icons:
aws:
"compute": "./icons/compute-generic.png" # Fallback
"compute.ec2": "./icons/ec2.png" # Specific
Supported: PNG, JPG, JPEG, GIF, WebP (no SVG)
Commands
npx figram init # Create template
npx figram build diagram.yaml # Validate and build
npx figram serve diagram.yaml # Start live server
npx figram serve diagram.yaml -p 8080 # Custom port
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: figram-diagrams3description: Create and validate YAML diagram files for Figram (AWS/GCP/Azure architecture diagrams). Use when users want to create new architecture diagrams, add/modify nodes or edges, troubleshoot YAML validation errors, convert text descriptions to Figram YAML, or work with cloud infrastructure visualizations. Use when this capability is needed.4---56# Figram Diagram Authoring78## Structure910```yaml11version: 112docId: "unique-id" # WebSocket matching13title: "Diagram Title" # Optional1415nodes:16 - id: node-id # Unique, descriptive (e.g., user-api)17 provider: aws # aws | gcp | azure18 kind: compute.ec2 # See Icons Reference19 label: "Display" # Optional, defaults to id20 layout: {x, y} # Required for top-level nodes21 parent: vpc-id # Optional, for nesting2223edges:24 - id: edge-id25 from: node-a26 to: node-b27 label: "description" # Optional28 color: "#3498DB" # Optional, default: #66666629```3031## Layout Rules3233| Node Type | Layout |34|-----------|--------|35| Top-level | `{x, y}` required |36| Container (VPC, Subnet) | `{x, y, w, h}` required |37| Child (has parent) | Optional (auto-positioned in 3-column grid) |3839## Edge Colors (Convention)4041| Color | HEX | Use |42|-------|-----|-----|43| Blue | `#3498DB` | HTTP/HTTPS |44| Green | `#27AE60` | Database |45| Orange | `#E67E22` | Cache |46| Purple | `#9B59B6` | Container |47| Gray | `#666666` | Default |4849## Icons Reference5051Full lists: [AWS](https://figram.7nohe.dev/en/icons-aws/) | [GCP](https://figram.7nohe.dev/en/icons-gcp/) | [Azure](https://figram.7nohe.dev/en/icons-azure/)5253### Common Kinds5455**AWS:**56- Compute: `compute.ec2`, `compute.lambda`, `compute.lb.alb`, `compute.container.ecs`57- Database: `database.rds`, `database.dynamodb`, `database.aurora`58- Storage: `storage.s3`, `storage.efs`59- Network: `network.vpc`, `network.subnet`, `network.apigateway`, `network.cloudfront`60- Integration: `integration.sqs`, `integration.sns`, `integration.eventbridge`6162**GCP:**63- Compute: `compute.gce`, `compute.functions`, `compute.cloudrun`, `compute.container.gke`64- Database: `database.cloudsql`, `database.firestore`, `database.spanner`65- Storage: `storage.gcs`66- Network: `network.vpc`, `network.cdn`, `network.apigateway`67- Integration: `integration.pubsub`, `integration.tasks`6869**Azure:**70- Compute: `compute.vm`, `compute.functions`, `compute.appservice`, `compute.container.aks`71- Database: `database.sql`, `database.cosmosdb`, `database.redis`72- Storage: `storage.blob`, `storage.storage`73- Network: `network.vnet`, `network.frontdoor`, `network.apim`74- Integration: `integration.servicebus`, `integration.eventhubs`7576## Examples7778### Serverless API (AWS)7980```yaml81version: 182docId: serverless-api83title: "Serverless REST API"8485nodes:86 - id: apigw87 provider: aws88 kind: network.apigateway89 label: "REST API"90 layout: { x: 100, y: 150 }9192 - id: lambda93 provider: aws94 kind: compute.lambda95 label: "Handler"96 layout: { x: 300, y: 150 }9798 - id: dynamodb99 provider: aws100 kind: database.dynamodb101 label: "Users Table"102 layout: { x: 500, y: 150 }103104edges:105 - id: api-to-lambda106 from: apigw107 to: lambda108 label: "invoke"109 color: "#3498DB"110111 - id: lambda-to-db112 from: lambda113 to: dynamodb114 label: "read/write"115 color: "#27AE60"116```117118### VPC with Auto-Layout119120```yaml121version: 1122docId: vpc-architecture123title: "VPC Architecture"124125nodes:126 - id: vpc127 provider: aws128 kind: network.vpc129 label: "Production VPC"130 layout: { x: 0, y: 0, w: 600, h: 400 }131132 - id: alb133 provider: aws134 kind: compute.lb.alb135 parent: vpc136 # Auto-positioned: (60, 60)137138 - id: ecs139 provider: aws140 kind: compute.container.ecs_service141 parent: vpc142 # Auto-positioned: (220, 60)143144 - id: rds145 provider: aws146 kind: database.rds147 parent: vpc148 # Auto-positioned: (380, 60)149150edges:151 - id: alb-to-ecs152 from: alb153 to: ecs154 - id: ecs-to-rds155 from: ecs156 to: rds157```158159## Validation Errors160161| Error | Fix |162|-------|-----|163| Missing required field "version" | Add `version: 1` |164| Missing required field "docId" | Add unique `docId` |165| Duplicate node id | Use unique IDs |166| layout is required for top-level nodes | Add `layout: {x, y}` |167| references unknown parent | Fix parent ID |168| Edge references unknown node | Fix `from`/`to` IDs |169| Cycle detected in parent hierarchy | Break the cycle |170171## Custom Icons172173```yaml174# In diagram.yaml or figram-icons.yaml175icons:176 aws:177 "compute": "./icons/compute-generic.png" # Fallback178 "compute.ec2": "./icons/ec2.png" # Specific179```180181Supported: PNG, JPG, JPEG, GIF, WebP (no SVG)182183## Commands184185```bash186npx figram init # Create template187npx figram build diagram.yaml # Validate and build188npx figram serve diagram.yaml # Start live server189npx figram serve diagram.yaml -p 8080 # Custom port190```191192---193> Converted and distributed by [TomeVault](https://tomevault.io/claim/7nohe) — claim your Tome and manage your conversions.194<!-- tomevault:4.0:skill_md:2026-04-13 -->