Skip to content

Instantly share code, notes, and snippets.

@smileham
smileham / archi-seq.puml
Last active March 18, 2026 03:38
Common include for PlantUML scripts to define ArchiMate concepts
@startuml Common
' PlantUML ArchiMate Sequence Diagram template v5
' Changelog:
' v3 Updated for new PreProcessor
' v4 Function to Procedure
' v5 Added Motivation, migrated to Styles, added Structure type
' Author: Steven Mileham (steven.mileham@gmail.com)
skinparam dpi 150
skinparam useBetaStyle true
<style>
@startuml Archi Usage
!include archi-seq.puml
title Archi Print Usage
' Define Elements
$businessActor("Architect","architect")
$applicationComponent("Archi","archi")
$applicationFunction("Update\nModel","update")
$applicationFunction("Print\nView","print")
$systemSoftware("Windows\nPrint\nService","windowsPrint")
@smileham
smileham / AI-GenerateAnalysis.ajs
Last active February 21, 2026 10:47
A suite of scripts for jArchi and the Archi modelling tool to enable integration between the tool and LLM such as Gemini from Google
/*
* Generate AI Analysis (Requires AI-REST.js and Export To Markdown.ajs)
*
* Requires:
* * jArchi - https://www.archimatetool.com/blog/2018/07/02/jarchi/
* * AI-REST.js - Package to support connections to LLM (Gemini/GPT)
* * persona.json - templates for standard persona and prompts - https://gist.github.com/smileham/8cbb3116db7f0ee80bcab4f1a57d14a8#file-persona-json
* * Export to Markdown.ajs - https://gist.github.com/smileham/578bbbb88dc0ed5a1403f3b98711ec25
*
* Version 1: Gemini API
@smileham
smileham / HeatMapByPropertyvalue.ajs
Last active January 19, 2026 14:10
jArchi script to create Heatmap (set Red, Amber or Green background to element) based on the value of a given property. #jarchi
/*
* Smart HeatMap (Numeric Gradient + Discrete)
* * Version: 8.1
* * "VIBE CODED" with Gemini - it was quick, did it better than I could in the time I had, and seems to work...
* * Changes:
* - Added Multi-selection dialog for Scope (Components vs Relationships).
* - Detects if a property is Numeric.
* - If Numeric: Allows Min/Max color selection and generates a Gradient Heatmap.
* - If Text (Discrete): Uses standard specific value coloring (limited to 10 unique values).
* - Generates stepped legends for Gradients.
@smileham
smileham / Export to Markdown.ajs
Last active October 10, 2025 15:38
Export an ArchiMate diagram to Markdown format. #jarchi
/*
* Export View to Markdown
*
* Requires jArchi - https://www.archimatetool.com/blog/2018/07/02/jarchi/
*
* Markdown - https://www.markdownguide.org/
*
* Version 2: Updated to support Diagram Groups
* Version 2.1: Add check for Selected View
* Version 2.2: Change to regex, added date of export
@smileham
smileham / Meta Model and Patterns-Architecture Landscape - Baseline.md
Created September 22, 2025 15:04
Example of Markdown generated by "Export to Markdown.ajs" script - for consumption by LLM scripts
@smileham
smileham / AuditModel.ajs
Last active August 15, 2025 12:16
#jarchi Script to audit an Archi model based on a defined metamodel
/*
* AuditModel
*
* Requires jArchi - https://www.archimatetool.com/blog/2018/07/02/jarchi/
*
* Version 0.1: Audits all elements in selected view, comparing to a view called "Audit"
* Version 0.2: Bug in "Template" selection - fixed
* Version 0.3: Audits all elements in selected view, allowing a user to select from views in an "Audit" Folder
* Creates the Audit folder and a default Audit view if one is not found.
* Version 0.4: 2023-03-11 - Support for Audit on Documentation/Properties of the View,
@smileham
smileham / Import from CSV.ajs
Last active June 6, 2025 10:59
Import from CSV #jarchi
/*
* Import from CSV
*
* Requires jArchi - https://www.archimatetool.com/blog/2018/07/02/jarchi/
* Requires PapaParse - https://www.papaparse.com/
* Works with Export to CSV Script - https://gist.github.com/smileham/15c445b17a92bd6f5dc1508e573bcd8a
*
* Version 1: Import from CSV
* Version 1.1: Force character encoding to use UTF-8
* Version 2: Support for Specialization and creates "CSVImport-timestamp" view
@smileham
smileham / Export to CSV.ajs
Last active May 19, 2025 10:24
Export to CSV #jarchi
/*
* Export To CSV
*
* Requires jArchi - https://www.archimatetool.com/blog/2018/07/02/jarchi/
* Requires PapaParse - https://www.papaparse.com/
* Works with Import from CSV script - https://gist.github.com/smileham/1e57a5946235e780dee5a824f664aa3d
*
* Version 1: Export to CSV
* Version 1.1: Avoid duplicate concepts exported from diagram
* Version 1.2: Fix missing properties
@smileham
smileham / Search by Properties.ajs
Last active April 3, 2025 06:53
#jarchi Find all Archimate elements which match the properties of the selected element.
/*
* Search by Properties
*
* Requires jArchi - https://www.archimatetool.com/blog/2018/07/02/jarchi/
*
* Find all Archimate elements which match the properties of the selected element.
*
*
* Version 1: First release
* Version 2: Added layers to results