agentleFS
Vanka07Vanka07/servicenow-skill/skills/servicenow/SKILL.md

servicenow

Skill1 starsChanged 8 months agoMITView on GitHub

ServiceNow platform engineering assistant. Use when the task is ServiceNow or SNOW development and architecture involving GlideRecord, Business Rules, Flow Designer, Service Portal, UI Builder, CMDB, MID Server, update sets, ServiceNow APIs, ITSM, ITOM, ITAM/SAM, FSM, SPM, SecOps, IntegrationHub, vulnerabilities, security incidents, assets, work orders, or service modeling. Do not use for non-ServiceNow JavaScript.

5 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions5 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 5

    1. iblai/financial-services-agents★ 15same name
    2. iblai/higher-education-agents★ 14same name
    3. apideck-libraries/api-skills★ 4same name
    4. Shanksg/clawskills★ 2same name
    5. ai-ecoverse/skills★ 1same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

The file

Show its rules and text

We split this skill into the rules it gives an agent

14 rules. 0 are common, 8 are distinctive, and 6 are very specific to this project.

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 8

    Distinctive

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    All generated code and recommendations should follow these rules:

    line 64
  2. Very specific:

    Use getValue() and setValue() for GlideRecord or current data access and mutation.

    line 66
  3. Distinctive:

    Never hardcode credentials, OAuth profile sys_ids, or environment-specific secrets.

    line 67
  4. Very specific:

    Use GlideAggregate for counts and aggregates.

    line 69
  5. Very specific:

    Use setLimit() on exploratory or user-facing queries unless the workflow explicitly needs the full result set.

    line 70
  6. Very specific:

    Prefer encoded queries only for static, known-safe complex filters.

    line 71
  7. Distinctive:

    Use async Business Rules, events, or scheduled jobs for heavy work.

    line 72
  8. Very specific:

    Avoid current.update() in Before Business Rules.

    line 73
  9. Very specific:

    Use async GlideAjax patterns only.

    line 74
  10. Distinctive:

    Call out required plugins, roles, cross-scope privileges, and release-specific assumptions whenever they matter.

    line 75
  11. Distinctive:

    Check for recursion, N+1 queries, unbounded queries, and unsafe auth patterns.

    line 83
  12. Distinctive:

    Verify reference-field logic uses internal values for writes and explicit display-value APIs only when needed.

    line 84
  13. Distinctive:

    Use these without loading a reference file when the request is simple and clearly matches the pattern.

    line 102
  14. Distinctive:

    Treat release behavior as instance-specific.

    line 224

“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

ServiceNow Developer Skill

ServiceNow development and architecture guidance across classic scripting, platform configuration, workflow automation, workspace UX, domain apps, and enterprise delivery practices.

Instructions

Step 1: Triage the request before writing code

Always identify:

  1. The product family or workflow domain.
  2. Whether the solution is server-side, client-side, Flow Designer, UI Builder, Service Portal, Virtual Agent, or API-driven.
  3. Whether the user is working in global scope or a scoped app.
  4. The target table, plugins, roles, and release assumptions if they affect the answer.
  5. Whether the task is read-only, transactional, or security-sensitive.

Load the minimum set of reference files that matches the task. For cross-cutting work, load 2-3 references and reconcile them before answering.

NeedReference File
Incident, Problem, Change, Knowledge, assignment, SLA, reportingreferences/itsm.md
GlideRecord, GlideAggregate, GlideSystem, GlideAjax, GlideForm, datesreferences/glide-api.md
Business Rules, Script Includes, Client Scripts, UI Policies, UI Actions, jobsreferences/scripting-patterns.md
REST API, Scripted REST, Table API, outbound REST, Import Setsreferences/rest-api.md
Flow Designer, subflows, spokes, script actions, PADreferences/flow-designer.md
Playbooks and workspace automation patternsreferences/playbooks.md
UI Builder, Now Experience, Workspace components, mobile workspacereferences/now-experience.md
ACLs, roles, scoped security, SecOps, audit/compliancereferences/security.md
Performance, indexing, caching, query tuning, client perfreferences/performance.md
ATF, instance scan, debugging, regression coveragereferences/testing.md
Catalog Items, Record Producers, Order Guides, fulfillmentreferences/service-catalog.md
Notifications, mail scripts, inbound email, SMS, pushreferences/notifications.md
Update Sets, source control, pipelines, CI/CD APIsreferences/update-sets-cicd.md
Discovery, MID Server, Event Management, Service Mapping, HLAreferences/itom.md
HRSD, CSM, lifecycle events, entitlements, portalsreferences/hrsd-csm.md
Service Portal widgets, $sp, Angular providers, themingreferences/service-portal.md
App Engine Studio, scoped apps, low-code architecturereferences/app-engine.md
Virtual Agent, NLU, topic design, handoff patternsreferences/virtual-agent.md
CMDB, Predictive Intelligence, Agent Workspace, Employee Center, upgradesreferences/advanced.md
ITAM, HAM, SAM, stockrooms, contracts, reclamationreferences/itam.md
FSM, work orders, dispatch, scheduling, mobile technician flowsreferences/fsm.md
IRM, GRC, policy/compliance, vendor risk, SecOps workflowsreferences/irm-secops.md
SPM/PPM, demand, portfolios, projects, resource plans, Agile 2.0references/spm.md
Vulnerable items, vulnerability groups, remediation and exception workflowsreferences/vulnerability-response.md
Security incidents, containment, eradication, response tasks, forensic workflowsreferences/security-incident-response.md
SAM Pro, entitlements, reclamation, normalization, publishers, software modelsreferences/sam-pro.md
CSDM, service taxonomy, ownership, CMDB governance, health modelsreferences/csdm-cmdb-governance.md
IntegrationHub, spokes, Connection & Credential Aliases, custom actions, Data Stream Actionsreferences/integrationhub.md

Step 2: Apply ServiceNow platform standards

All generated code and recommendations should follow these rules:

  1. Use getValue() and setValue() for GlideRecord or current data access and mutation. GlideElement methods like changes(), changesTo(), nil(), and setDisplayValue() are acceptable when needed.
  2. Never hardcode credentials, OAuth profile sys_ids, or environment-specific secrets. Prefer REST Message records, Connection & Credential Aliases, and system properties.
  3. In scoped apps, treat GlideRecord.get() as a boolean-returning operation and always check the result before reading fields.
  4. Use GlideAggregate for counts and aggregates; do not call addAggregate() on GlideRecord.
  5. Use setLimit() on exploratory or user-facing queries unless the workflow explicitly needs the full result set.
  6. Prefer encoded queries only for static, known-safe complex filters. If any part comes from user input, sanitize it or use discrete addQuery() calls.
  7. Use async Business Rules, events, or scheduled jobs for heavy work. Do not block the transaction with slow integrations.
  8. Avoid current.update() in Before Business Rules. If you must update from an After rule or UI Action, explain the recursion risk and use setWorkflow(false) deliberately.
  9. Use async GlideAjax patterns only; never use getXMLWait().
  10. Call out required plugins, roles, cross-scope privileges, and release-specific assumptions whenever they matter.
  11. For Vulnerability Response, Security Incident Response, SAM Pro, and IntegrationHub, favor data-driven workflows and named configuration records over scripted constants.

Step 3: Validate before you return anything

Before responding:

  • Confirm the code matches the correct execution context.
  • Check for recursion, N+1 queries, unbounded queries, and unsafe auth patterns.
  • Verify reference-field logic uses internal values for writes and explicit display-value APIs only when needed.
  • Include deployment notes if the change depends on plugins, update sets, app repo, or CI/CD.
  • Include a test path: ATF, background script smoke test, Flow execution test, or manual validation steps.

Common gotchas

  • gr.field returns a GlideElement, not a plain string. Use getValue() unless you specifically need GlideElement behavior.
  • g_form, g_user, and g_list are client APIs only.
  • getRowCount() is not a cheap count.
  • addEncodedQuery(userInput) is an injection risk.
  • Business Rules on sys_dictionary or sys_db_object can destabilize an instance.
  • Querying by display value such as assignment_group.name is sometimes useful for examples, but sys_id-based queries are safer and faster in production code.
  • Record Producers and inbound actions should usually populate current and let the platform handle persistence rather than forcing extra updates.
  • CSDM guidance should preserve layer boundaries and ownership semantics rather than inventing custom service hierarchies.
  • IntegrationHub solutions should specify connection aliases, credential ownership, retries, and rate-limit behavior.

Fast patterns

Use these without loading a reference file when the request is simple and clearly matches the pattern.

Safe GlideRecord query

var gr = new GlideRecord('incident');
gr.addActiveQuery();
gr.addQuery('priority', '1');
gr.setLimit(50);
gr.query();

while (gr.next()) {
    gs.info(gr.getValue('number') + ' ' + gr.getValue('short_description'));
}

Scoped-safe single-record lookup

var user = new GlideRecord('sys_user');
if (!user.get(userSysId)) {
    gs.addErrorMessage('User not found');
    return;
}

gs.info(user.getValue('email'));

CLI Helper

# Generate queries
python3 skills/servicenow/scripts/snow_helper.py query "find active incidents assigned to me"
python3 skills/servicenow/scripts/snow_helper.py query "find all work orders in state Dispatch Pending"

# Generate templates
python3 skills/servicenow/scripts/snow_helper.py template business-rule --table incident --when before --insert --update
python3 skills/servicenow/scripts/snow_helper.py template scripted-rest-api --table incident
python3 skills/servicenow/scripts/snow_helper.py template flow-script-action --table incident
python3 skills/servicenow/scripts/snow_helper.py template atf-server-test --table incident
python3 skills/servicenow/scripts/snow_helper.py template integrationhub-action --table incident

# Lint a script
python3 skills/servicenow/scripts/snow_helper.py lint < myscript.js

# Validate the skill package and bundled references
python3 skills/servicenow/scripts/snow_helper.py validate-skill skills/servicenow

Examples

Example 1: ITSM query

User says: "Write a query to find all P1 incidents opened this week"

Actions: Load references/glide-api.md and references/itsm.md, generate a safe query, and check for limits and boolean get() usage.

Example 2: Scripted REST

User says: "Create a REST endpoint that returns user details by employee number"

Actions: Load references/rest-api.md, return a Scripted REST resource with 400/404 handling, note required ACLs, and include a test call.

Example 3: ITAM lifecycle

User says: "How do I reclaim laptops from terminated employees and update stockroom state?"

Actions: Load references/itam.md and references/flow-designer.md, propose a reclamation flow, asset-state transitions, and HAM role assumptions.

Example 4: FSM dispatch

User says: "Build a flow to auto-assign field work orders by territory and skills"

Actions: Load references/fsm.md and references/flow-designer.md, design dispatch logic, scheduling constraints, and technician/mobile validation.

Example 5: SecOps / IRM

User says: "Create a Vulnerability Response integration that opens exceptions only for approved compensating controls"

Actions: Load references/irm-secops.md, references/security.md, and references/rest-api.md, then return data model, approval logic, and audit requirements.

Example 6: SPM

User says: "Model demand intake and project creation with resource plans"

Actions: Load references/spm.md plus references/app-engine.md or references/flow-designer.md, then return table/process guidance and portfolio governance notes.

Example 7: Vulnerability Response

User says: "Build triage logic for vulnerable items that routes exceptions to security governance"

Actions: Load references/vulnerability-response.md, references/irm-secops.md, and references/integrationhub.md, then return routing logic, exception controls, and audit requirements.

Example 8: Security Incident Response

User says: "Create a security incident workflow for containment and forensic handoff"

Actions: Load references/security-incident-response.md, references/flow-designer.md, and references/security.md, then return lifecycle design, task model, and escalation rules.

Example 9: SAM Pro

User says: "Reconcile software entitlements against installs and flag reclaim candidates"

Actions: Load references/sam-pro.md and references/itam.md, then return normalization assumptions, compliance logic, and reclamation workflow.

Example 10: CSDM / CMDB governance

User says: "Model business applications and services using CSDM and clean up ownership gaps"

Actions: Load references/csdm-cmdb-governance.md and references/advanced.md, then return class mapping, governance steps, and validation queries.

Example 11: IntegrationHub

User says: "Create a custom spoke action that streams paginated records from an external API"

Actions: Load references/integrationhub.md and references/rest-api.md, then return the action contract, credential strategy, pagination handling, and retry notes.

Troubleshooting

ErrorCauseSolution
"Record not found" in Scripted RESTgr.get() result not checkedUse if (!gr.get(id)) { ... } before reading fields
Flow script count logic failsaddAggregate() called on GlideRecordReplace with GlideAggregate
REST call works in dev onlyAuth or endpoint details hardcoded in scriptMove auth and endpoint configuration into REST Message records or properties
Record Producer saves duplicate changesScript mutates current and then calls current.update()Set values on current and let the producer persist the record
Workspace component fails in scoped appMissing cross-scope access or wrong data resourceVerify scope privileges and UI Builder data-resource config
Query is slow in productionMissing index or querying by display valueMove to sys_id/internal values, add indexes where justified, and limit record scans
Vulnerability automation keeps misrouting recordsGrouping logic ignores state, source, or exception postureUse vulnerability-grouping rules, explicit exception states, and table-driven routing
Security incident process stallsNo clear transition between containment, eradication, and recoveryModel phase ownership explicitly and create response tasks per phase
IntegrationHub action works manually but fails in flowMissing connection alias or action outputs are underspecifiedValidate alias binding, outputs, and error contracts in the action definition

Release Notes

Treat release behavior as instance-specific. If a feature depends on family release or plugin state, say so explicitly and ask which release the customer is on.

Recent family names often referenced in examples:

  • Zurich
  • Xanadu
  • Washington DC

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.