From sn-toolkit
Compare any set of ServiceNow records across two instances (e.g. DEV vs PROD) via a JSON spec. Use when the user asks "what's different between DEV and PROD for X", wants a pre-go-live discrepancy audit, or needs to verify parity for groups, roles, ACLs, scripts, or any other table.
How this command is triggered — by the user, by Claude, or both
Slash command
/sn-toolkit:comparesonnetThis command is limited to the following tools:
The summary Claude sees in its command listing — used to decide when to auto-load this command
$ARGUMENTS should be the path to a JSON comparison spec. If omitted, ask the user. ## What this does Runs `sn-compare.ps1` against a JSON spec describing what to compare. The spec lists one or more (table, fields, match_key, query) entries. The script queries both instances via REST, builds a three-way set diff (A-only / B-only / both-with-field-diffs), and writes a markdown report to the path declared in `spec.output`. ## Spec format - `match_key` can be a string (single field) or an array (composite). Matching uses `display_value`, so logical equivalence is preserved across instance...
$ARGUMENTS should be the path to a JSON comparison spec. If omitted, ask the user.
Runs sn-compare.ps1 against a JSON spec describing what to compare. The spec lists one or more (table, fields, match_key, query) entries. The script queries both instances via REST, builds a three-way set diff (A-only / B-only / both-with-field-diffs), and writes a markdown report to the path declared in spec.output.
{
"instance_a": "dev",
"instance_b": "prod",
"output": "docs/context/<filename>.md",
"specs": [
{
"label": "human-readable label",
"table": "sys_user_group",
"fields": ["name", "description", "manager", "active", "sys_domain.name"],
"match_key": "name",
"query": "active=true"
},
{
"label": "Group->Role grants",
"table": "sys_group_has_role",
"fields": ["group", "role", "inherited"],
"match_key": ["group", "role"],
"query": "group.sys_domain.name=global"
}
]
}
match_key can be a string (single field) or an array (composite). Matching uses display_value, so logical equivalence is preserved across instances even when sys_ids differ.query is a standard sysparm_query string. Empty / omitted = no filter.**WARNING** line in the report.Resolve the spec path from $ARGUMENTS. If empty, ask the user "Path to the comparison spec?"
Validate the spec exists and is valid JSON:
Test-Path '<SPEC_PATH>'
Get-Content '<SPEC_PATH>' -Raw | ConvertFrom-Json | Out-Null
sn-credentials.ps1 -Action store -Instance dev|prod -Username "..."); the script fails fast otherwise.& sn-compare.ps1 -SpecPath '<SPEC_PATH>'
Read the produced report (path from spec.output) and surface a tight summary to the user:
**WARNING** lines (truncation, etc.)Recommend next steps based on what the diff shows:
table=sys_script_include, match_key=name, query=sys_scope.scope=<your_scope>, fields=name,api_name,active,access,scripttable=sys_script, match_key=name, same scope filter, fields=name,collection,when,order,active,scripttable=sys_security_acl, match_key=[operation,name], query=name=<table_name>, fields=operation,name,roles,script,activex_<scope>_<table>, match_key=number (or whatever your business key is)sys_domain.name in the query or leave broad and let the report tell you who lives where.npx claudepluginhub chrisp28103/sn-toolkit --plugin sn-toolkit/compareCompares two skills head-to-head across quality dimensions, reporting which is better in each category. Accepts two arguments: <skill-a> and <skill-b>.
/compareCompares current screenshots against baselines to detect visual regressions via pixel diff with threshold, generates diff images, summary table with pass/fail status, and report.
/compareCompares multiple ML experiment runs side-by-side from tracking store, analyzes parameter sensitivity, generates visualizations, identifies best configuration, and recommends next experiments.
/compareSide-by-side comparison of N items (drugs, genes, diseases, variants, trials) with domain-appropriate columns, aligned data, and per-cell source citations in a structured table.
/compareCompares two or more stocks side by side using key metrics, valuation, growth, profitability, and recent performance data. Outputs a comparison table and analysis summary.
/compareDiffs two ComfyUI workflows from files, names, history, or IDs to show added/removed nodes and changed inputs/connections.