9.7 KiB
LLM Generation Guide for Isoflow Compact Format
Overview
This guide explains how to generate JSON files in the Isoflow compact format that can be successfully imported into the application. The compact format is designed for LLM generation with minimal token usage while preserving all essential diagram information.
Format Structure
The compact format uses this JSON structure:
{
"t": "Diagram Title (max 40 chars)",
"i": [
["Item Name (max 30 chars)", "icon_name", "Description (max 100 chars)"],
["Another Item", "storage", "Database server for user data"]
],
"v": [
[
[[0, 2, 4], [1, -2, 6]],
[[0, 1], [1, 0]]
]
],
"_": { "f": "compact", "v": "1.0" }
}
Structure Explanation
Root Level
t: Title - Short diagram title (max 40 characters)i: Items - Array of diagram elementsv: Views - Array of views (usually just one)_: Metadata - Format identifier (always{"f": "compact", "v": "1.0"})
Items Array (i)
Each item is an array with 3 elements:
- Name (string, max 30 chars): Display name of the item
- Icon (string): Icon identifier from available icons
- Description (string, max 100 chars): Brief description
Views Array (v)
Each view contains:
- Positions Array:
[[itemIndex, x, y], ...]- Position of each item - Connections Array:
[[fromIndex, toIndex], ...]- Connections between items
Available Icons
Basic Icons (ISOFLOW Collection)
Common icons for general use:
storage- Database/storageserver- Generic serveruser- User/personcloud- Cloud servicesnetwork- Network componentsecurity- Security/firewallapi- API/interfacequeue- Message queuecache- Caching systemfunction- Function/lambdamobile- Mobile deviceweb- Web applicationemail- Email serviceanalytics- Analytics/monitoringbackup- Backup systemload-balancer- Load balancercdn- Content delivery networkvpn- VPN connectionfirewall- Firewall/securitymonitor- Monitoring system
AWS Icons (320 available)
Use aws- prefix for AWS services:
aws-ec2- EC2 instancesaws-s3- S3 storageaws-rds- RDS databaseaws-lambda- Lambda functionsaws-api-gateway- API Gatewayaws-cloudfront- CloudFront CDNaws-route-53- Route 53 DNSaws-vpc- Virtual Private Cloudaws-elb- Load balanceraws-iam- Identity managementaws-cloudwatch- Monitoringaws-sns- Simple notificationaws-sqs- Simple queueaws-dynamodb- DynamoDB databaseaws-elasticsearch- Elasticsearchaws-redshift- Data warehouseaws-kinesis- Data streamingaws-eks- Kubernetes serviceaws-fargate- Container serviceaws-cognito- User authentication
Azure Icons (369 available)
Use azure- prefix for Azure services:
azure-virtual-machine- Virtual machinesazure-storage-account- Storageazure-sql-database- SQL databaseazure-app-service- Web appsazure-function-app- Functionsazure-api-management- API managementazure-cdn- Content deliveryazure-dns- DNS serviceazure-load-balancer- Load balancerazure-active-directory- Identityazure-monitor- Monitoringazure-service-bus- Message busazure-cosmos-db- NoSQL databaseazure-redis-cache- Redis cacheazure-kubernetes-service- Kubernetesazure-container-instances- Containersazure-logic-apps- Logic appsazure-data-factory- Data pipelineazure-key-vault- Key managementazure-cognitive-services- AI services
GCP Icons (280 available)
Use gcp- prefix for Google Cloud services:
gcp-compute-engine- Virtual machinesgcp-cloud-storage- Storagegcp-cloud-sql- SQL databasegcp-app-engine- Web appsgcp-cloud-functions- Functionsgcp-api-gateway- API gatewaygcp-cloud-cdn- Content deliverygcp-cloud-dns- DNS servicegcp-cloud-load-balancing- Load balancergcp-identity-access-management- IAMgcp-cloud-monitoring- Monitoringgcp-cloud-pub-sub- Message queuegcp-cloud-firestore- NoSQL databasegcp-memorystore- Redis cachegcp-kubernetes-engine- Kubernetesgcp-cloud-run- Container servicegcp-cloud-workflows- Workflowsgcp-cloud-dataflow- Data pipelinegcp-secret-manager- Secret managementgcp-ai-platform- AI/ML platform
Kubernetes Icons (56 available)
Use k8s- prefix for Kubernetes resources:
k8s-pod- Podsk8s-service- Servicesk8s-deployment- Deploymentsk8s-configmap- ConfigMapsk8s-secret- Secretsk8s-ingress- Ingressk8s-namespace- Namespacesk8s-node- Nodesk8s-persistent-volume- Storagek8s-daemonset- DaemonSetsk8s-statefulset- StatefulSetsk8s-job- Jobsk8s-cronjob- CronJobsk8s-hpa- Auto-scalingk8s-rbac- Role-based access
Positioning System
The positioning system uses a grid-based coordinate system:
- X-axis: Horizontal position (negative = left, positive = right)
- Y-axis: Vertical position (negative = up, positive = down)
- Grid spacing: Each unit represents one grid cell
- Typical range: -20 to +20 for both axes
Positioning Guidelines:
- Start with main components around (0, 0)
- Place related components close together
- Use consistent spacing (3-5 units between components)
- Arrange in logical flow (left to right, top to bottom)
Connection Guidelines
Connections are defined as [fromIndex, toIndex] pairs:
- fromIndex: Index of source item in items array
- toIndex: Index of destination item in items array
- Direction: Connections are directional (from → to)
Common Connection Patterns:
- Linear flow: [0,1], [1,2], [2,3]
- Hub and spoke: [0,1], [0,2], [0,3]
- Mesh: Multiple bidirectional connections
- Layered: Connections between architectural layers
Generation Examples
Example 1: Simple Web Application
{
"t": "Simple Web App Architecture",
"i": [
["Web App", "web", "Frontend application"],
["API Gateway", "api", "API management layer"],
["Database", "storage", "User data storage"],
["Cache", "cache", "Redis caching layer"]
],
"v": [
[
[[0, -6, 0], [1, 0, 0], [2, 6, 0], [3, 0, -4]],
[[0, 1], [1, 2], [1, 3]]
]
],
"_": { "f": "compact", "v": "1.0" }
}
Example 2: AWS Architecture
{
"t": "AWS Serverless Architecture",
"i": [
["CloudFront", "aws-cloudfront", "Content delivery network"],
["API Gateway", "aws-api-gateway", "API management"],
["Lambda", "aws-lambda", "Serverless functions"],
["DynamoDB", "aws-dynamodb", "NoSQL database"],
["S3", "aws-s3", "Static file storage"]
],
"v": [
[
[[0, -8, -4], [1, 0, 0], [2, 0, 4], [3, 8, 4], [4, 8, -4]],
[[0, 1], [1, 2], [2, 3], [0, 4]]
]
],
"_": { "f": "compact", "v": "1.0" }
}
Example 3: Kubernetes Architecture
{
"t": "Kubernetes Application",
"i": [
["Ingress", "k8s-ingress", "Traffic routing"],
["Frontend", "k8s-pod", "React application"],
["API Service", "k8s-service", "Backend API"],
["Database", "k8s-pod", "PostgreSQL database"],
["ConfigMap", "k8s-configmap", "Configuration data"]
],
"v": [
[
[[0, 0, -6], [1, -4, 0], [2, 4, 0], [3, 4, 6], [4, -4, 6]],
[[0, 1], [0, 2], [2, 3], [4, 1], [4, 2]]
]
],
"_": { "f": "compact", "v": "1.0" }
}
Best Practices for LLM Generation
1. Icon Selection
- Use specific cloud provider icons when targeting that platform
- Use generic icons for platform-agnostic diagrams
- Match icon semantics to component function
- Prefer well-known service icons over generic ones
2. Naming
- Keep names concise but descriptive
- Use standard terminology for components
- Include version/type info when relevant
- Avoid special characters in names
3. Descriptions
- Provide context about component purpose
- Include key technologies/versions
- Mention important configurations
- Keep under 100 characters
4. Layout
- Group related components together
- Use consistent spacing between layers
- Consider data flow direction
- Leave space for connection lines
5. Connections
- Model actual data/control flow
- Avoid crossing connections when possible
- Use consistent connection semantics
- Consider bidirectional vs unidirectional flows
Validation Checklist
Before generating, ensure:
- All icon names exist in available icons list
- Item names are ≤ 30 characters
- Descriptions are ≤ 100 characters
- Title is ≤ 40 characters
- Position coordinates are reasonable (-20 to +20)
- Connection indices reference valid items
- Metadata format is exactly
{"f": "compact", "v": "1.0"} - JSON structure matches the required format
- All required fields are present
Common Pitfalls to Avoid
- Invalid icon names: Always use exact icon IDs from the available list
- Missing descriptions: Always provide the third element in item arrays
- Incorrect metadata: Use exact format
{"f": "compact", "v": "1.0"} - Invalid connections: Ensure indices refer to existing items
- Extreme coordinates: Keep positions within reasonable bounds
- Missing views: Always include at least one view with positions
- Inconsistent arrays: Ensure positions and items arrays align
Token Optimization Tips
- Use shorter but meaningful names
- Truncate descriptions to essential info
- Use efficient coordinate values
- Minimize redundant connections
- Group related components to reduce positioning complexity
This format typically uses 70-90% fewer tokens than the full JSON format while maintaining complete functionality and visual fidelity when imported into the Isoflow application.