Sn Scriptingのロゴ

Sn Scripting

コミュニティ
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.

概要

公開者guilhermebatista-gbs
リポジトリservicenow-architect
スキル名sn-scripting
スター
26
フォーク
14
同梱ファイル
8
ライセンスMIT
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 8個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    guilhermebatista-gbsがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Sn Scripting」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/guilhermebatista-gbs/servicenow-architect/tree/main/sn-scripting
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

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
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでSn Scriptingを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にSn Scriptingを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Sn Scriptingは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

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/.

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「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.

TypingMindでSn Scriptingを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Sn Scriptingはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにSn Scriptingをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/guilhermebatista-gbs/servicenow-architect/tree/main/sn-scriptingを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Sn Scriptingを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Sn Scriptingで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもSn Scriptingを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Sn Scripting」は無料ですか?

はい。guilhermebatista-gbsがMITライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇