sndev.io / docs

Setting Up Claude

Use AI to generate manifests and tests

The sn CLI is designed to work with AI assistants. Instead of manually writing TypeScript manifests, you describe what you want and Claude generates the manifest for you — checking schemas, handling $ref chains, and including tests.
The typical workflow: describe your goal to Claude → Claude generates a manifest → you review it → run sn executesn validatesn test. Claude handles the complex parts; you stay in control of what gets deployed.
Add a CLAUDE.md to your project root with context about your instance, naming conventions, and which scope to use. This helps Claude generate accurate manifests on the first try.

Tasks

1

Install Claude Code if you haven't already.

curl -fsSL https://claude.ai/install.sh | bash
2

Create a CLAUDE.md file in your project root to give Claude context about the sn CLI.

cat > CLAUDE.md << 'EOF'
# My ServiceNow Project

Use the sn CLI to build ServiceNow artifacts.
Run `sn ops` to see available skills.
Run `sn ops <skill> <op>` for input schemas.
All operations must be idempotent (use upsert).
EOF
3

Ask Claude to generate a manifest. Describe what you want in plain English.

Create a business rule on the incident table that sets priority to 4 when no priority is specified
I'll create a manifest for that. Let me check the schema first...
$ sn ops business-rule create
Here's the manifest:
✓ Created manifest.ts
- 1 step: business-rule > create
- Table: incident
- Trigger: before insert
Run `sn execute manifest.ts` to deploy it.

Track Complete!

You've finished all levels in Getting Started.

← Back to home