A lightweight, powerful meta-prompting & context engineering system
for ServiceNow development with Claude AI
Installation β’ Quickstart β’ How It Works β’ File Reference β’ Examples β’ Customization β’ Contributing
You ask Claude to write a ServiceNow Business Rule. You get back generic JavaScript that:
- β Uses
let/const(Rhino engine doesn't fully support ES6) - β Calls
GlideRecordon the client side (synchronous, insecure) - β Hardcodes sys_ids that break across instances
- β Skips input validation, error handling, and logging
- β Ignores scoped application boundaries
- β Has no idea what
current.setAbortAction(true)does
SNow-Claude fixes this. Paste our context files into Claude and get production-grade ServiceNow code β every time.
SNow-Claude is a collection of composable markdown files β no dependencies, no tooling, no npm install. Just copy β paste β build.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β SYSTEM.md β
β The Brain β Expert Persona, β
β Coding Standards, Quality Gates β
βββββββββββββββ¬ββββββββββββββ¬βββββββββββββββ¬βββββββββββββββ€
β contexts/ β specs/ β prompts/ β knowledge/ β
β β β β β
β 13 deep β 9 fill-in β 4 role β 5 reference β
β knowledge β spec β modes β documents β
β modules β templates β β β
β β β β β
β Load per β Spec β β /architect β API patterns β
β task β production β /developer β Anti-patternsβ
β β code β /reviewer β Naming β
β β β /debugger β Scoping β
βββββββββββββββ΄ββββββββββββββ΄βββββββββββββββ΄βββββββββββββββ
| Without SNow-Claude | With SNow-Claude |
|---|---|
| Generic JavaScript | Platform-aware scoped app code |
| No naming conventions | <Table> - <When> <Description> everywhere |
| Hardcoded sys_ids | gs.getProperty() + system properties |
| Missing error handling | try/catch + structured logging with source IDs |
| No input validation | gs.nil() checks, type validation, GlideRecordSecure |
| No naming conventions | <Table> - <Action> <Description> everywhere |
| Silent about bad practices | 25-point quality gate with pass/fail report |
β Without SNow-Claude β What Claude typically generates
// "Create a business rule that sets priority based on VIP caller"
var gr = new GlideRecord('sys_user');
gr.addQuery('sys_id', current.caller_id);
gr.query();
if (gr.next()) {
if (gr.vip == 'true') {
current.priority = 1;
}
}Problems: No timing specified, no operation guard, uses dot-notation instead of getValue(), no logging, no error handling, no null checks, no naming convention, no scope awareness.
β With SNow-Claude β Production-grade output
/**
* Business Rule: Incident - Before Set VIP Priority
* Table: incident | When: before | Insert: true, Update: true
* Condition: caller_id changes
*
* @description Automatically elevates priority for VIP callers.
* Delegates lookup to avoid unnecessary queries on non-VIP callers.
*/
(function executeRule(current, previous) {
var LOG_PREFIX = '[Incident - Before Set VIP Priority]';
// Only process when caller changes
if (!current.caller_id.changes()) {
return;
}
var callerId = current.getValue('caller_id');
if (gs.nil(callerId)) {
return;
}
var grCaller = new GlideRecord('sys_user');
if (grCaller.get(callerId)) {
if (grCaller.getValue('vip') === 'true') {
current.setValue('priority', '1');
current.setValue('urgency', '1');
gs.info(LOG_PREFIX + ' VIP caller detected, priority elevated for: ' +
current.getValue('number'));
}
} else {
gs.warn(LOG_PREFIX + ' Caller not found: ' + callerId);
}
})(current, previous);Includes: Proper naming, JSDoc, IIFE wrapper, change detection, null checks, getValue(), structured logging, graceful handling of missing caller.
- A Claude account (free or Pro) at claude.ai β or access via Claude API / Claude Desktop
- That's it. No npm, no pip, no build tools. SNow-Claude is just markdown files.
git clone https://github.com/Hawks6/SNow-Claude.git
cd SNow-Claude- Click the green
<> Codebutton at the top of this GitHub page - Select Download ZIP
- Extract the ZIP to any folder on your machine
After cloning or extracting, you'll have this folder structure:
snow-claude/
βββ SYSTEM.md β π§ The brain β start here
βββ QUICKSTART.md β β‘ 5-minute guide
βββ README.md β π You're reading it
βββ LICENSE β π MIT License
β
βββ contexts/ β π Knowledge modules (load per task)
β βββ _base.md β Always needed (core platform)
β βββ business-rules.md β Business Rule patterns
β βββ script-includes.md β Script Include patterns
β βββ client-scripts.md β Client Scripts & UI Policies
β βββ gliderecord.md β GlideRecord / GlideAggregate
β βββ flow-designer.md β Flow Designer & IntegrationHub
β βββ service-portal.md β Service Portal widgets
β βββ now-experience.md β UI Builder / Now Experience
β βββ rest-api.md β Scripted REST APIs
β βββ atf.md β Automated Test Framework
β βββ security.md β ACLs, roles, data policies
β βββ performance.md β Query optimization
β βββ update-sets.md β Update set management
β
βββ specs/ β π Fill-in-the-blank spec templates
β βββ _spec-guide.md β How specs work
β βββ business-rule.spec.md
β βββ script-include.spec.md
β βββ client-script.spec.md
β βββ rest-endpoint.spec.md
β βββ widget.spec.md
β βββ flow.spec.md
β βββ integration.spec.md
β βββ scoped-app.spec.md
β
βββ prompts/ β π Role-based meta-prompts
β βββ architect.md β Design & architecture mode
β βββ developer.md β Code generation mode
β βββ reviewer.md β Code review mode
β βββ debugger.md β Debugging mode
β
βββ knowledge/ β π Reference material
βββ api-patterns.md β 15 most-used API patterns
βββ anti-patterns.md β Common mistakes & fixes
βββ naming-conventions.md β Naming standards
βββ scoping-rules.md β Cross-scope access rules
βββ table-reference.md β Key system tables
π‘ Tip: You don't need all 34 files for every task. Most of the time you'll use
SYSTEM.md+ 1-2 context modules. Think of it as a toolbox β grab what you need.
Clone or download the repo (see Installation above).
Claude Projects let you attach files as persistent knowledge. Every conversation in the project automatically has access to your SNow-Claude context.
-
Go to claude.ai and click "Create Project"
-
Name it something like
ServiceNow Development -
Click "Add project knowledge" and upload these files from your cloned repo:
Always upload:
SYSTEM.mdcontexts/_base.md
Upload based on your daily work (pick 3-4 to start):
contexts/business-rules.mdcontexts/script-includes.mdcontexts/gliderecord.mdcontexts/client-scripts.md
Highly recommended reference material:
knowledge/anti-patterns.mdknowledge/naming-conventions.md
Optional (Based on your workflow):
prompts/story-analyzer.md(If you frequently map agile stories to technical designs)specs/user-story.spec.md(If you want Claude to know the exact format required for stories)
-
Start a new conversation inside the project
-
Ask Claude to build something β it already has full ServiceNow expertise loaded
π‘ You can always add more files later. Working on REST APIs next week? Upload
contexts/rest-api.mdto the project.
For one-off tasks or if you don't have Claude Pro:
- Open
SYSTEM.mdin a text editor - Select all and copy (Ctrl+A β Ctrl+C)
- Paste into a new Claude conversation as your first message
- Open the relevant context module (e.g.,
contexts/business-rules.md) - Copy and paste that too, right after
- Now ask Claude to build your ServiceNow artifact
π Step 1 β Paste: SYSTEM.md
π Step 2 β Paste: contexts/business-rules.md
π Step 3 β Your request:
"Create a before Business Rule on incident that validates resolution
requirements when state changes to Resolved:
- Resolution code is filled
- Close notes are at least 20 chars
- P1 incidents must have a linked problem"
Claude will generate the complete Business Rule with naming conventions, quality gate results, and deployment notes.
For structured, repeatable code generation:
- Open a spec template from
specs/(e.g.,business-rule.spec.md) - Fill in the
<placeholder>fields with your requirements - Paste the filled spec into your Claude conversation (after SYSTEM.md + context)
- Claude generates production-ready code matching your exact specification
Paste a role prompt from prompts/ to change Claude's behavior:
| File to Paste | What Changes |
|---|---|
prompts/architect.md |
Claude evaluates design options before coding |
prompts/story-analyzer.md |
Claude acts as an architect to map user stories to technical designs |
prompts/developer.md |
Claude generates code from specs with full output format |
prompts/reviewer.md |
Claude reviews your existing code for issues |
prompts/debugger.md |
Claude systematically diagnoses your ServiceNow problems |
SNow-Claude is built on three core ideas:
Don't dump 50KB of context into every conversation. Load only what you need:
Building a Business Rule? β Load business-rules.md
Need GlideRecord queries? β Add gliderecord.md
Worried about performance? β Add performance.md
Modules can be combined freely. They're designed to complement, not conflict.
Fill in a structured spec template β get production-ready code:
artifact_type: Business Rule
table: incident
name: Incident - Before Validate Resolution
when: before
operation: update
condition: state changes to 6 (Resolved)
scope: x_acme_itsm_ext
description: |
Validate that resolution requirements are met before allowing
an incident to move to Resolved state.
criteria:
- Blocks if resolution_code is empty
- Blocks if close_notes < 20 characters
- Blocks P1 resolution without linked problem
- Shows specific error messages per validation failure
- Admin users bypass all checksClaude reads the spec, applies all context modules, runs quality gates, and delivers deployable code.
Switch Claude's behavior mode for different stages of work:
| Command | Mode | Best For |
|---|---|---|
/architect |
ποΈ Architect | "Should I use a Flow or a Business Rule?" |
/developer |
π» Developer | "Build this Script Include from spec" |
/reviewer |
π Reviewer | "Review this code for anti-patterns" |
/debugger |
π Debugger | "My Business Rule isn't firing" |
| File | What It Does |
|---|---|
SYSTEM.md |
The brain. Expert persona, coding standards, 25-point quality gate, response format. Always load this first. |
QUICKSTART.md |
5-minute setup guide with examples |
Composable knowledge modules. Load per task.
| Module | Lines | Load When You're Working On |
|---|---|---|
_base.md |
~350 | Always β core platform APIs, scoped app model, table hierarchy |
business-rules.md |
~300 | Business Rules β timing, patterns, anti-patterns, performance |
script-includes.md |
~160 | Script Includes β prototype pattern, GlideAjax, cross-scope |
client-scripts.md |
~150 | Client Scripts, UI Policies, catalog scripts |
gliderecord.md |
~180 | GlideRecord, GlideAggregate, GlideRecordSecure |
flow-designer.md |
~100 | Flows, Subflows, Actions, IntegrationHub |
service-portal.md |
~120 | Service Portal widgets (AngularJS) |
now-experience.md |
~100 | UI Builder / Now Experience components |
rest-api.md |
~130 | Scripted REST APIs, outbound integrations |
atf.md |
~90 | Automated Test Framework |
security.md |
~100 | ACLs, roles, data policies, GlideRecordSecure |
performance.md |
~100 | Query optimization, caching, batch processing |
update-sets.md |
~70 | Update set management, deployment order |
Fill-in-the-blank YAML templates. Complete one β paste it with SYSTEM.md + context β get code.
| Template | Generates |
|---|---|
business-rule.spec.md |
Business Rule with full configuration |
script-include.spec.md |
Script Include class with methods |
client-script.spec.md |
Client Script with GlideAjax calls |
user-story.spec.md |
Agile user story definition for the /story skill |
rest-endpoint.spec.md |
Scripted REST API with resources |
widget.spec.md |
Service Portal widget (server + client + HTML) |
flow.spec.md |
Flow Designer flow with steps |
integration.spec.md |
External system integration |
scoped-app.spec.md |
Full scoped application architecture |
_spec-guide.md |
How spec-driven development works |
Paste one of these to change Claude's mode of operation.
| Role | File | Behavior |
|---|---|---|
| ποΈ Architect | architect.md |
Evaluates design alternatives, produces ADRs, plans app structure |
| π Story Analyzer | story-analyzer.md |
Parses agile user stories into technical solution maps |
| π» Developer | developer.md |
Spec-to-code pipeline, complete output with config + tests |
| π Reviewer | reviewer.md |
Systematic code review with severity ratings (π΄π π‘π’) |
| π Debugger | debugger.md |
Root cause analysis, platform diagnostic tools, resolution steps |
Reference material. Upload to Claude Projects for always-on access.
| File | Contents |
|---|---|
api-patterns.md |
15 most-used ServiceNow API patterns (copy-paste ready) |
anti-patterns.md |
15+ common mistakes with severity ratings and fixes |
naming-conventions.md |
Naming standards for every artifact type |
scoping-rules.md |
Cross-scope access rules, Application Access matrix |
table-reference.md |
Key system tables, Task hierarchy, CMDB structure |
π SYSTEM.md + contexts/script-includes.md + contexts/gliderecord.md
"Create a Script Include called IncidentEscalationUtils in scope x_acme_itsm
that provides methods to:
1. Check if an incident has been stale for N days (configurable via property)
2. Escalate stale incidents by bumping priority and adding a work note
3. Get a count of all stale incidents per assignment group"
π SYSTEM.md + prompts/reviewer.md + contexts/business-rules.md
"Review this Business Rule for issues:
(function executeRule(current, previous) {
var gr = new GlideRecord('sys_user');
gr.addQuery('sys_id', current.caller_id);
gr.query();
if (gr.next()) {
if (gr.vip == true) {
current.priority = 1;
current.update();
}
}
})(current, previous);"
Claude will return a severity-rated issue table with specific fixes for every problem found.
π SYSTEM.md + prompts/debugger.md + contexts/flow-designer.md
"My Flow isn't triggering when a Change Request moves to 'Implement' state.
The flow was working last week. We deployed an update set yesterday.
Flow name: ITSM - Change State Implement Approval Flow"
π SYSTEM.md + prompts/architect.md
"We need to automate the approval process for Change Requests over $10,000.
Should we use a Business Rule with Script Include, Flow Designer,
or a combination? We're on the Washington DC release with IntegrationHub."
π SYSTEM.md + prompts/story-analyzer.md
"As an ITIL Manager, I want to automatically close stale incident tasks
after 30 days of inactivity, so that my metrics are accurate."
Claude will output a Technical Solution Map detailing the exact ServiceNow artifacts needed (e.g., Scheduled Job, Business Rule), required context files, and acceptance criteria. It will then hand off execution to the /developer role to generate the final code.
Edit SYSTEM.md Section 5 (Code Standards) to match your organization:
// Change the vendor prefix
x_acme_ β x_yourcompany_
// Add custom naming rules
// Modify JSDoc requirements
// Adjust quality gate thresholdsCreate a new file in contexts/ for your specific domain:
# Context Module: HR Service Delivery
> **Module:** `hrsd.md`
> **Load when:** Building HRSD customizations
> **Depends on:** `_base.md`
---
## Key Tables
- sn_hr_core_case (HR Case)
- sn_hr_core_task (HR Task)
...
## Common Patterns
...
## Anti-Patterns
...Copy any template from specs/ and add fields specific to your artifact type β catalog items, record producers, transform maps, etc.
SNow-Claude is designed around these ideas:
-
Composable, not monolithic β Load 3KB of context, not 50KB. Your Claude context window stays efficient.
-
Convention over configuration β Sensible defaults for naming, logging, error handling. Override only what you need.
-
Spec-driven, not prompt-dependent β Structured specs produce consistent output regardless of how you phrase your request.
-
Quality gates built-in β Every code generation runs a 25-point mental checklist covering security, performance, maintainability, upgrade safety, and testability.
-
Zero dependencies β Pure markdown. Works with Claude.ai, Claude API, Claude Desktop, or any interface that accepts text.
Contributions are welcome! Here's how you can help:
- Create
contexts/your-module.mdfollowing the existing format - Include: key concepts, patterns, anti-patterns, and decision guides
- Reference
_base.mdas a dependency - Submit a PR with a usage example
- Found a missing API pattern? Add it
- Discovered a new anti-pattern? Document it
- Have a better code example? Replace the old one
- Create templates for artifact types not yet covered (e.g., Transform Maps, Record Producers, Notifications)
- Follow the YAML structure in existing templates
- If Claude generates incorrect code using SNow-Claude, open an issue with:
- Which modules were loaded
- What you asked for
- What Claude generated (the bad part)
- What the correct output should be
| Platform | Supported |
|---|---|
| Claude.ai (Web) | β |
| Claude Projects | β (Recommended) |
| Claude Desktop App | β |
| Claude API | β |
| Other LLMs |
| ServiceNow Release | Supported |
|---|---|
| Washington DC | β |
| Xanadu | β |
| Vancouver | β (minor API differences) |
| Utah and earlier |
MIT License β use it, modify it, share it. See LICENSE for details.
Stop prompting. Start engineering.
Built for ServiceNow developers who want Claude to write platform code the right way, every time.