Skip to content

Instantly share code, notes, and snippets.

@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 / AI-GenerateAnalysis.ajs
Last active November 21, 2025 11:48
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 / sfdd.ps1
Last active November 12, 2024 10:16
Powershell script to create a Salesforce Data Dictionary in CSV/Excel or JSON formats
# usage sfdd ALIAS
# Needs ImportExcel Module installed
# Needs sf cli installed
# v1. First release
# v2. Included Record Types
# v3. Added PUML
# v4. Add Ignore list (Json format {"ignoreObjects":["Object","Object2"],"ignorePackages":["package1"]})
# v5. Added support for BigER
# v6. Tinkering with Google Data Catalog
@smileham
smileham / GetInstalledPackages.ajs
Created November 28, 2023 16:06
GetInstalledPackages
/*
* Get Installed Packages via Salesforce CLI
*
* Please ensure you have first authenticated against your Salesforce sandbox and have defined an Alias
* No Warranty is provided for this script.
*
* This script if a Proof of Concept to create Application Components based on Installed Packages in a SF sandbox
*
* Running this script will then:
* * Create new Managed Packages folder
@smileham
smileham / DescribeSObjects.ajs
Last active November 28, 2023 15:58
DescribeSObjects.ajs #jarchi #salesforcecli #salesforce #sfdx
/*
* Describe sObjects in view via Salesforce CLI
*
* Please ensure you have first authenticated against your Salesforce sandbox and have defined an Alias
* No Warranty is provided for this script.
*
* This script if a Proof of Concept to populate the detail of selected sObjects created via the GetSObjects script
*
* Once the model has been populated with Salesforce sObjects, create a new view using the sObjects you
* wish further detail on.
@smileham
smileham / GetSObjects.ajs
Last active November 28, 2023 15:58
GetSObjects.ajs #jarchi #salesforcecli #salesforce #sfdx
/*
* Get sObjects via Salesforce CLI
*
* Please ensure you have first authenticated against your Salesforce sandbox and have defined an Alias
* No Warranty is provided for this script.
*
* Script calls the Salesfoce CLI for a given alias and retrieves all sObject records, these are created
* as "Data Objects", set with a specialization of sObject and stored in a folder.
*
* A second script can then populate the detail of selected sObjects (DescribeSObjects)
@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 / HeatMapByPropertyvalue.ajs
Last active November 5, 2025 11:29
jArchi script to create Heatmap (set Red, Amber or Green background to element) based on the value of a given property. #jarchi
/*
* HeatMap by Property Value
*
* Requires jArchi - https://www.archimatetool.com/blog/2018/07/02/jarchi/
*
* Version 1: Set colour to red, amber or green based on value of given property.
* Version 2: Pull out all Properties used in Elements in view, present all possible values of that Property to assign RAG colours
* Version 3: Error handling and key generation
* Version 4: Updated for dynamic colour selection and support for more than 3 colours
* Version 5: If there are less than 5 values, buttons are used instead of the menu.
@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 / archi-seq.puml
Last active December 4, 2020 16:49
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 ([email protected])
skinparam dpi 150
skinparam useBetaStyle true
<style>