Sn Scripting logo

Sn Scripting

Community
guilhermebatista-gbs
sn-scripting

Generates GlideRecord queries, Script Include classes, and client scripts for ServiceNow scripting. Use for Business Rules, Scheduled Jobs, server-side Script Includes, and client-side g_form/g_user scripts — including the script bodies inside Fluent SDK metadata definitions. Metadata definition itself belongs to sn-sdk-fluent.

Overview

Publisherguilhermebatista-gbs
Repositoryservicenow-architect
Skill namesn-scripting
Stars
26
Forks
14
Bundled files
8
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 8 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by guilhermebatista-gbs on GitHub. Read the source before you install it.

Installation

Install the Sn Scripting AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/guilhermebatista-gbs/servicenow-architect/tree/main/sn-scripting
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/guilhermebatista-gbs/servicenow-architect.git /tmp/servicenow-architect
mkdir -p .claude/skills
cp -r /tmp/servicenow-architect/sn-scripting .claude/skills/sn-scripting
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Sn Scripting in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Sn Scripting on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Sn Scripting is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

ServiceNow Legacy Scripting

ServiceNow legacy scripting uses the GlideRecord API for server-side data access, Script Include classes for reusable server-side logic, Business Rules for server-side automation, and g_form/g_user/g_list for client-side form manipulation. All APIs are described in the reference files below.

References

Read these files when you need them — do not pre-load all references at session start. Paths are relative to the skill root (the directory containing this file).

FileWhen to Read
references/gliderecord.mdGenerating or reviewing GlideRecord queries, CRUD operations, or addQuery/getValue patterns
references/server-side.mdGenerating Script Includes, Business Rules, or using GlideSystem (gs.*) logging
references/client-side.mdGenerating Client Scripts using g_form, g_user, or g_list; or any client-side form manipulation
references/gotchas.mdBefore generating or reviewing any ServiceNow script — check for hallucination traps

Scripts

ScriptWhen to use
scripts/validate-script.shWhen validating a ServiceNow script file for common issues before deploying

Examples

Use these as structural templates — only read the example that matches your target type, do not pre-load all examples:

FileDemonstrates
assets/examples/gliderecord-crud.jsComplete GlideRecord CREATE, READ (single and multi), UPDATE, DELETE with correct getValue() usage
assets/examples/script-include-class.jsScript Include using Class.create() pattern with initialize(), utility methods, and type property
assets/examples/client-script-gform.jsClient Script onLoad/onChange handlers using g_form.getValue(), g_form.setMandatory(), g_user.hasRole()

Hard Rules

  1. In a Fluent SDK project, know which layer you're on. If the workspace contains now.config.json, .now.ts files, or imports from @servicenow/sdk/core, the developer is working in a Fluent SDK application. Two different layers apply:

    • Metadata definition (creating tables, ACLs, Business Rules, Script Includes as objects) → that is Fluent's job. Redirect to ../sn-sdk-fluent/ (read its main file) instead of writing GlideRecord "setup scripts" or standalone legacy artifacts.
    • Script bodies (the logic inside a script property, a Now.include() file, or src/server/ modules) → that is exactly this sub-skill. Those bodies are standard Glide server-side JS — apply this file's rules and references to them.
  2. GlideRecord is server-side only — never generate GlideRecord in a Client Script. Use GlideAjax.

  3. Always call query() before next() — while(gr.next()) without gr.query() never executes.

  4. Use getValue() in loops — gr.field_name returns a pointer; gr.getValue('field_name') returns the string value.

  5. Never invent method names — no gr.getField(), gr.setQuery(), gr.addOrder(). Prefer the methods documented in references/gliderecord.md; it is a curated subset, not the whole platform API. If a real, commonly used method isn't listed (check the official ServiceNow API docs), you may use it — say explicitly that it's outside the local reference and worth verifying. What is never acceptable is guessing a plausible-sounding name.

Behavior by Task Type

Generating

  1. Check for Fluent SDK signals first (Hard Rule 1) — if detected, decide the layer: metadata definition goes to ../sn-sdk-fluent/; script bodies stay here.
  2. Identify the script context: server-side (Business Rule, Script Include) or client-side (Client Script).
  3. For server-side: read references/gliderecord.md for CRUD patterns, references/server-side.md for Script Include structure and Business Rule context variables.
  4. For client-side: read references/client-side.md for g_form/g_user/g_list APIs. Never generate GlideRecord in a client script (Hard Rule 2).
  5. Use example files in assets/examples/ as working templates.

Reviewing

  1. Check Hard Rules 3 and 4: query() before next(), getValue() in loops.
  2. Verify no GlideRecord in client-side code (Hard Rule 2).
  3. Verify no invented methods — compare against references/gliderecord.md documented API (Hard Rule 5).
  4. Run scripts/validate-script.sh <file> to check for GlideRecord in client scripts, bare setAbortAction, and g_form misuse.

Explaining

  1. Route the developer to the relevant reference file for detailed method documentation.
  2. For Fluent SDK metadata questions, read the main file in ../sn-sdk-fluent/.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Sn Scripting AI skill do?

Generates GlideRecord queries, Script Include classes, and client scripts for ServiceNow scripting. Use for Business Rules, Scheduled Jobs, server-side Script Includes, and client-side g_form/g_user scripts — including the script bodies inside Fluent SDK metadata definitions. Metadata definition itself belongs to sn-sdk-fluent.

Why use Sn Scripting on TypingMind?

Because you install it once and use it with any model. Sn Scripting is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Sn Scripting in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/guilhermebatista-gbs/servicenow-architect/tree/main/sn-scripting. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Sn Scripting?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Sn Scripting?

As many as you like. As long as a model supports skills, you can use Sn Scripting with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Sn Scripting AI skill free?

Yes. It is published on GitHub by guilhermebatista-gbs under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇