Documentation

Getting Started with SNowCoder

Complete setup guidance for the SNowCoder AI-powered coding assistant

Quick Start

Get SNowCoder up and running in 6 simple steps:

  1. Download and install VS Code
  2. Install SNowCoder CLI
  3. Install SNowCoder VS Code extension
  4. Create your SNowCoder account
  5. Set up ServiceNow instance access
  6. Configure automated documentation and test generation
1

Download and Install VS Code

SNowCoder requires Visual Studio Code as your development environment.

Installation Steps:

  1. Visit https://code.visualstudio.com
  2. Download VS Code for your operating system (Windows, macOS, or Linux)
  3. Run the installer and follow the installation wizard
  4. Launch VS Code to verify installation

💡 Tip: Make sure you're running VS Code version 1.85 or later for optimal compatibility with SNowCoder.

2

Install SNowCoder CLI

The SNowCoder CLI powers the AI inference and code generation capabilities.

Prerequisites:

  • Node.js 18 or later (Download Node.js)
  • At least 8GB of available RAM (16GB recommended for optimal performance)
  • 10GB of free disk space for AI models

Installation:

Option 1: Install via npm (Recommended)

npm install -g @snowcoder/cli

Option 2: Download and install manually

  1. Download the CLI from https://snowcoder.ai/downloads
  2. Extract the downloaded file to a directory of your choice
  3. Add the installation directory to your system PATH

Verify Installation:

snowcoder --version

You should see the version number displayed (e.g., "SNowCoder CLI v1.0.0")

⚠️ Important: The CLI will download AI models on first run (approximately 5-8GB). Ensure you have a stable internet connection.

3

Install SNowCoder VS Code Extension

The VS Code extension provides the user interface and integrates with the CLI for code completions.

Installation Methods:

Method 1: Install from VS Code Marketplace

  1. Open VS Code
  2. Click on the Extensions icon in the sidebar (or press Ctrl+Shift+X / Cmd+Shift+X)
  3. Search for "SNowCoder"
  4. Click "Install" on the SNowCoder extension
  5. Reload VS Code when prompted

Method 2: Install from VSIX file

  1. Download the VSIX file from https://snowcoder.ai/downloads
  2. Open VS Code
  3. Go to Extensions → More Actions (⋯) → Install from VSIX...
  4. Select the downloaded VSIX file

Configure Extension:

  1. Open VS Code Settings (Ctrl+, or Cmd+,)
  2. Search for "SNowCoder"
  3. Configure the CLI path (usually auto-detected)
  4. Set your preferred completion trigger (e.g., automatic or manual)
4

Create Your SNowCoder Account

Sign up for a SNowCoder account to access cloud-powered AI features and manage your subscription.

Account Registration:

  1. Visit https://snowcoder.ai/signup
  2. Enter your email address and create a password
  3. Verify your email address (check your inbox for verification link)
  4. Choose your subscription plan (Free, Developer, Team, or Enterprise)
  5. Complete payment setup if selecting a paid plan

Authenticate in VS Code:

  1. Open VS Code with the SNowCoder extension installed
  2. Click on the SNowCoder icon in the sidebar
  3. Click "Sign In"
  4. Enter your email and password when prompted
  5. You'll see a confirmation once authenticated

💡 Free Tier: Start with 10,000 free tokens per month. No credit card required for the free tier.

5

Set Up ServiceNow Instance Access

SNowCoder needs access to your ServiceNow instance to provide context-aware code completions and extract your codebase.

Request Read-Only Account from Admin:

  1. Contact your ServiceNow instance administrator
  2. Request a dedicated read-only account for SNowCoder integration
  3. Recommended role: snc_read_only or custom role with these permissions:
    • Read access to sys_script, sys_script_include, sys_ui_script
    • Read access to sys_db_object, sys_dictionary
    • Read access to sys_metadata tables
    • NO write, delete, or administrative permissions

Configure Instance Connection:

  1. Open VS Code and click on SNowCoder settings
  2. Go to "Instance Connection" section
  3. Enter your ServiceNow instance details:
    Instance URL: https://your-instance.service-now.com
    Username: snowcoder_readonly
    Password: [your-password]
  4. Click "Test Connection" to verify access
  5. Save the configuration

Extract Current Codebase:

Once connected, extract your instance's codebase for enhanced context:

  1. Open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P)
  2. Type "SNowCoder: Extract Codebase" and press Enter
  3. Select the scopes to extract:
    • Global scope (default ServiceNow)
    • Your custom application scopes
    • Specific update sets (optional)
  4. Wait for extraction to complete (progress shown in status bar)
  5. Extracted code will be indexed for AI context

⚠️ Security Note: Credentials are stored securely in VS Code's encrypted storage. SNowCoder never sends your credentials to external servers. Instance access is only used locally for code extraction and context.

6

Configure Automated Documentation & Testing

Enable SNowCoder's powerful automation features to generate PRDs with wireframes, technical specs, and comprehensive tests for every project.

Enable Documentation Generation:

  1. Open VS Code Settings (Ctrl+, or Cmd+,)
  2. Search for "SNowCoder Documentation"
  3. Enable the following features:
    • Auto-generate PRDs: Creates Product Requirements Documents with embedded interactive wireframes
    • Architecture Diagrams: Generates UML and C4 model diagrams automatically
    • Technical Specifications: Produces detailed tech specs for every feature
    • User Stories & Tasks: Breaks down work into actionable user stories and task lists
  4. Choose your documentation template:
    • Standard: Basic documentation format (Free & Developer tiers)
    • Enterprise: Comprehensive templates with custom branding (Team tier+)

Configure Git Integration:

  1. In SNowCoder settings, navigate to "Git Integration"
  2. Enable "Auto-commit documentation"
  3. Set your preferred commit message format
  4. Choose documentation storage location (e.g., /docs, /specs)
  5. All generated documentation will be version-controlled alongside your code

Enable Test Automation:

  1. Open SNowCoder settings → "Testing"
  2. Enable automated test generation:
    • Unit Tests: Auto-generate tests for Script Includes and Business Rules
    • System Tests: Create integration tests for workflows
    • ATF Tests: Generate ServiceNow Automated Test Framework test cases
  3. Set test coverage targets (e.g., 80% minimum)
  4. Configure test file naming conventions
  5. Enable "Run tests on save" for continuous validation

Configure Approval Workflow:

SNowCoder generates everything—you just review and approve:

  1. In VS Code, generated content appears in the "SNowCoder Review" panel
  2. Review PRDs, wireframes, specs, and tests before they're committed
  3. Make inline edits or request regeneration with modified prompts
  4. Approve with one click—changes are committed to Git automatically
  5. Set approval thresholds (auto-approve minor changes, manual review for major updates)

💡 Pro Tip: Start with auto-generation enabled but approval required. Once you trust the quality, enable auto-approval for routine documentation updates to maximize productivity.

Using SNowCoder

Code Completions:

  • Start typing in any JavaScript file (.js, .jsx)
  • SNowCoder will automatically suggest completions
  • Press Tab to accept a suggestion
  • Press Esc to dismiss suggestions

SNowCoder AI Learn and Build (Chat):

  1. Click the SNowCoder chat icon in the sidebar
  2. Ask questions about ServiceNow development
  3. Request code snippets (e.g., "Create a Business Rule to update priority")
  4. Get explanations of ServiceNow concepts

Generate Code:

  • Right-click in the editor
  • Select "SNowCoder: Generate Code"
  • Describe what you want to build
  • Review and accept the generated code

Writing Effective Prompts for SNowCoder

The quality of SNowCoder's output depends on the clarity and specificity of your prompts. Well-crafted prompts lead to better code, more accurate documentation, and comprehensive test coverage.

Best Practices for ServiceNow-Specific Prompts

Include These Elements:

  • Table Name: Specify the exact ServiceNow table (e.g., incident, change_request, cmdb_ci_server)
  • Timing: When should the code run? (before/after insert/update/delete, async, display)
  • Conditions: What triggers the logic? Be specific about field values and states
  • Actions: What should happen? Field updates, API calls, notifications, etc.
  • Scope: Global or specific application scope
  • Error Handling: How should failures be handled? Logging requirements?

Complex ServiceNow Examples

❌ Vague Prompt (Bad)

"Create a Business Rule to assign incidents automatically"

✅ Specific Prompt (Good)

"Create a before insert Business Rule on the incident table that automatically assigns incidents to assignment groups based on the following logic:

- If category is 'Hardware' and subcategory is 'Server', assign to 'Server Support' group
- If category is 'Software' and subcategory contains 'SAP', assign to 'SAP Support' group
- If category is 'Network' and priority is 1 or 2, assign to 'Network Escalation' group, otherwise 'Network L1'
- If urgency is 1 and impact is 1 (P1 incident), also set assignment group manager as additional assignee
- Log a warning message if no matching assignment group is found
- Only run for new incidents (insert), not updates
- Add comprehensive error handling with try-catch and log failures to system log"

❌ Vague Prompt (Bad)

"Script Include to get user data"

✅ Specific Prompt (Good)

"Create a Script Include named 'UserDataUtil' in global scope with the following methods:

1. getActiveUsersByDepartment(department_sys_id) - Returns array of active user objects with fields: sys_id, name, email, phone, manager
2. getUserWithRoles(user_sys_id) - Returns user object with nested array of all assigned roles (including inherited)
3. bulkDeactivateUsers(user_sys_ids_array) - Deactivates multiple users, sends notification to their managers, creates audit log entry

Requirements:
- Use GlideRecord with proper query optimization (addActiveQuery, setLimit where appropriate)
- Include proper ACL checks before returning sensitive data
- Add input validation for all parameters
- Return null for invalid inputs with gs.error() logging
- Make it callable from server-side scripts only (not client-callable)
- Add JSDoc comments for all methods
- Follow ServiceNow best practices (avoid dot-walking in queries)"

❌ Vague Prompt (Bad)

"Client Script for incident form validation"

✅ Specific Prompt (Good)

"Create an onSubmit Client Script on the incident table with the following validation logic:

Prevent form submission if:
- Priority is 1 or 2 AND short_description is less than 20 characters (show error: 'High priority incidents require detailed description')
- Assignment group is empty AND state is not 'New' (show error: 'Assignment group required before changing state')
- Category is 'Hardware' AND configuration item (cmdb_ci) field is empty (show error: 'CI required for hardware incidents')
- Caller is VIP (vip field = true) AND assigned_to is empty when state moves to 'In Progress'

Additional requirements:
- Use g_form.addErrorMessage() to display validation errors
- Return false to prevent submission, true to allow
- Check if form is in insert vs update mode using g_form.isNewRecord()
- Only apply VIP check on state change, not on initial save
- Add console logging for debugging (with proper null checks)"

Pro Tip: Let SNowCoder Optimize Your Prompts

Even if you're not sure how to structure a perfect prompt, SNowCoder can help! Here's the workflow:

  1. Start with your initial prompt — Write what you want in your own words, even if it's rough or incomplete
  2. Ask SNowCoder to optimize it — Use this exact command:
    "Please rewrite this prompt to be more specific and optimized for accurate code generation. Ask me clarifying questions until you're 95% clear on the requirements: [paste your prompt here]"
  3. Answer SNowCoder's questions — It will ask about table names, conditions, error handling, scope, etc.
  4. Get the optimized prompt — SNowCoder will provide a detailed, well-structured prompt
  5. Use the improved prompt — Submit the SNowCoder-optimized prompt for code generation

🎯 Result: Better prompts = Better code

This collaborative approach ensures SNowCoder has all the context it needs to generate production-ready ServiceNow code, comprehensive tests, and accurate documentation.

Automated Documentation Workflow

SNowCoder automates the entire documentation lifecycle, from requirements gathering to version control. Here's how it works:

1. PRD Generation with Wireframes

Provide SNowCoder with high-level requirements, and it generates a complete Product Requirements Document including:

  • Executive Summary: Problem statement, goals, and success criteria
  • Interactive Wireframes: Embedded UI mockups you can use immediately or tweak in your design tool
  • Functional Requirements: Detailed feature descriptions and user flows
  • Non-Functional Requirements: Performance, security, and compliance requirements
  • Acceptance Criteria: Testable conditions for completion
Command: SNowCoder: Generate PRD from Requirements

2. Architecture Diagram Creation

SNowCoder analyzes your ServiceNow instance and generates architecture diagrams automatically:

  • UML Diagrams: Class, sequence, and component diagrams
  • C4 Model: Context, container, component, and code views
  • Data Flow Diagrams: How data moves through your application
  • Integration Maps: External system connections and APIs

Diagrams are generated in multiple formats (PNG, SVG, PlantUML) and stored in your Git repository.

3. Technical Specifications

Detailed technical specs are auto-generated covering:

  • Table schemas and field definitions
  • Business Rules and Script Includes logic
  • UI Policy and Client Script requirements
  • Workflow and Flow Designer specifications
  • Integration endpoints and data mappings

4. User Stories & Work Breakdown

SNowCoder breaks down PRDs into actionable user stories with:

  • Story title, description, and acceptance criteria
  • Story points and effort estimates
  • Task breakdowns for each story
  • Dependencies and blockers identified
  • Export to Jira, Azure DevOps, or CSV

5. Git Workflow & Version Control

All documentation is automatically committed to your repository:

  • Documentation stored in /docs folder
  • Meaningful commit messages auto-generated
  • Full version history tracked in Git
  • Branch-based documentation workflows supported
  • Pull request integration for doc reviews

Automated Testing Features

SNowCoder generates comprehensive test suites alongside your code, ensuring quality and confidence in every deployment.

Unit Test Generation

For every Script Include or Business Rule you write, SNowCoder automatically creates:

  • Test Suites: Organized test files matching your code structure
  • Happy Path Tests: Validate expected behavior with typical inputs
  • Edge Case Tests: Test boundary conditions and unusual inputs
  • Error Handling Tests: Ensure proper error handling and logging
  • Mock Data: Auto-generated test data and ServiceNow record mocks

Coverage Target: Achieve 80%+ code coverage automatically

System Test Creation

Integration tests validate end-to-end workflows:

  • Multi-step workflow validation
  • Cross-table integration testing
  • Business process verification
  • Data transformation testing
  • API endpoint integration tests

ServiceNow ATF Test Automation

Generate Automated Test Framework (ATF) tests ready to run in your ServiceNow instance:

  • UI Tests: Form interactions, list views, and workflows
  • Server-Side Tests: Business Rules, Script Includes, and scheduled jobs
  • Integration Tests: REST API calls and external integrations
  • Regression Suites: Full test suites for upgrade validation

Auto-Deploy: Tests can be automatically deployed to your ServiceNow instance

Test Execution & Reporting

Run tests and get instant feedback:

  • Run tests locally in VS Code
  • Execute ATF tests directly in ServiceNow
  • Detailed test reports with pass/fail status
  • Code coverage metrics and visualization
  • Integration with CI/CD pipelines (Jenkins, GitHub Actions)

Troubleshooting

Issue: Completions not appearing

  • Verify CLI is running: snowcoder status
  • Check VS Code Output panel → SNowCoder for errors
  • Restart VS Code
  • Reinstall the extension if issue persists

Issue: Instance connection failed

  • Verify instance URL is correct (include https://)
  • Check username and password
  • Ensure account has read permissions
  • Check if IP whitelisting is required on your instance

Issue: High CPU/Memory usage

  • Enable local-only mode for reduced resource usage
  • Reduce context window size in settings
  • Close other resource-intensive applications

Issue: Documentation not generating

  • Verify "Auto-generate documentation" is enabled in settings
  • Check that you have a valid subscription tier (Free tier has limitations)
  • Ensure Git repository is initialized in your workspace
  • Check VS Code Output panel → SNowCoder → Documentation for errors

Issue: Test generation fails

  • Verify test generation is enabled in SNowCoder settings → Testing
  • Ensure your code follows ServiceNow naming conventions
  • Check that test file paths are writable
  • Review error logs in SNowCoder Output panel

Issue: Git integration not working

  • Ensure Git is installed and accessible from command line
  • Verify repository is initialized (git init)
  • Check Git credentials are configured
  • Review commit permissions for the /docs directory

Need more help? Contact our support team at [email protected]

You're All Set! 🎉

Start building amazing ServiceNow applications with AI-powered assistance