arnoudkooi/sn-scriptsync/snu-coding-standards
Claude Code and agent skill by arnoudkooi/sn-scriptsync
- community
Checking that the SKILL.md file is still in the repository.
ServiceNow coding standards (scoped-app restrictions, server vs client APIs, best practices) and security guidance for the sn-scriptsync workflow. Read this when writing or reviewing ServiceNow script content.
Install
npx vskill@latest install arnoudkooi/sn-scriptsync/snu-coding-standardsSKILL.md
SN ScriptSync — Coding Standards & Security
Coding standards and security practices for ServiceNow script content.
ServiceNow Coding Standards
⚠️ CRITICAL: Scoped Application API Restrictions
In scoped applications (like Service Portal widgets), certain global APIs are NOT allowed:
Key Rules:
- ✅
new GlideDateTime()- Creates current date/time automatically - ✅ Use
LocalTimemethods:getDayOfMonthLocalTime(),getMonthLocalTime(),getYearLocalTime() - ❌
gs.nowDateTime()- NOT allowed in scoped applications - ❌
gs.now()- NOT allowed in scoped applications - ❌ Non-LocalTime methods may fail:
getDayOfMonth(),getMonth(),getYear()
Service Portal Widget Client Scripts
Use Angular dependency injection, not IIFE patterns:
Available Angular services: $scope, $interval, $timeout, $http, $q, $location, spUtil, spModal
GlideRecord Best Practices
Always use setValue() and getValue() methods:
Variable Naming
Use semantic variable names with prefixes:
grUser- GlideRecord for usergrIncident- GlideRecord for incidentgaRecords- GlideAggregate- Not just
grorga
Security & Validation
The extension enforces several security measures to protect the workspace and ServiceNow instance:
Request ID Validation
- Format: Request IDs must be alphanumeric with underscores/hyphens only:
^[a-zA-Z0-9_-]+$ - Invalid examples:
../../../etc/passwd,req;rm -rf,req with spaces - Valid examples:
req_123,abc-def,test_001
Error response for invalid ID:
Workspace Boundary Enforcement
- All file operations are restricted to the VS Code workspace
- Path traversal attempts (e.g.,
../../../) are blocked - Absolute paths outside workspace are rejected
File Upload Security (upload_attachment)
When using filePath parameter:
- Paths are normalized using
path.resolve()to prevent traversal - Only files within the workspace can be uploaded
- Both relative and absolute paths are validated
Example secure paths:
ServiceNow API Access
- Browser helper tab validates instance URLs (allowed/blocked lists)
- User must explicitly approve each ServiceNow instance
- All API calls use the
safeFetch()wrapper that checks approvals
Best Practices for Agents
- ✅ Use simple, descriptive request IDs:
query_incidents_001 - ✅ Always use relative paths for file uploads:
screenshots/image.png - ✅ Check response status before processing results
- ✅ Handle errors gracefully and inform users
- ❌ Never attempt path traversal or workspace escape
- ❌ Don't use special characters in request IDs
Security violation example:
Response:
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingagentrules/skills/snu-coding-standards/SKILL.md
Popularity
- Repository stars
- 51
- Repository forks
- 36
- 7-day trend score
- 20
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/arnoudkooi/sn-scriptsync/snu-coding-standards)