snu-coding-standards

Enforce ServiceNow coding standards and secure API usage in sn-scriptsync.

53|38|Updated Dec 17, 2018
One-click install
npx skills add https://github.com/arnoudkooi/sn-scriptsync --skill snu-coding-standards
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: snu-coding-standards
Source: https://github.com/arnoudkooi/sn-scriptsync/tree/main/agentrules/skills/snu-coding-standards
Command: npx skills add https://github.com/arnoudkooi/sn-scriptsync --skill snu-coding-standards

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Enforces coding standards and security best practices for ServiceNow script content within the sn-scriptsync workflow.

Core Features & Use Cases

  • Enforces scoped-app API restrictions and best practices for client and server code.
  • Service Portal Widget Client Scripts: Angular DI and proper patterns to avoid digest issues.
  • GlideRecord Best Practices: Use setValue/getValue and avoid direct property access.
  • Variable Naming: Semantic prefixes for GlideRecord and GlideAggregate variables.
  • Security & Validation: Guidelines for safe operations, input validation, and workspace boundaries.

Quick Start

Review and apply the snu-coding-standards guidelines when authoring or reviewing ServiceNow scripts.

Frequently Asked Questions about snu-coding-standards

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What are the best practices for using GlideRecord in ServiceNow scripts?

GlideRecord best practices require using the getValue and setValue methods instead of direct property access to ensure secure ServiceNow script operations. This approach enforces coding standards and prevents improper API usage within scoped applications.

How do I write secure ServiceNow Service Portal widget client scripts?

Secure ServiceNow Service Portal widget client scripts require applying Angular dependency injection and proper patterns to avoid digest issues. Following these coding standards prevents unexpected behavior and ensures safe client-side execution.

Does sn-scriptsync enforce coding standards for scoped applications?

Yes, coding standards are enforced for scoped applications within the sn-scriptsync workflow by restricting improper API usage and applying security governance across code assets. This ensures scoped app restrictions and safe operations are met.

How do I name GlideRecord and GlideAggregate variables in ServiceNow?

GlideRecord and GlideAggregate variables in ServiceNow scripts should use semantic prefixes to maintain clarity and governance across code assets. This naming convention is part of the enforced coding standards for safe script content.

What are the limitations of mixing client and server APIs in ServiceNow scripts?

Mixing client and server APIs in ServiceNow scripts is restricted by coding standards to prevent improper API usage and security vulnerabilities. You must follow scoped app boundaries and specific server versus client guidelines to avoid invalid operations.