# Docs

> Use when the user asks about ServiceNow platform behavior, APIs, or conventions covered by the official docs -- ACLs, GlideRecord, business rules, REST APIs, UX framework, scoped apps, security, etc. Pass a topic to search, or omit to browse product areas.

- **Type:** Skill
- **Install:** `agentstack add skill-chrisp28103-sn-toolkit-docs`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [chrisp28103](https://agentstack.voostack.com/s/chrisp28103)
- **Installs:** 0
- **Category:** [Search](https://agentstack.voostack.com/c/search)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [chrisp28103](https://github.com/chrisp28103)
- **Source:** https://github.com/chrisp28103/sn-toolkit/tree/main/sn-toolkit/skills/docs

## Install

```sh
agentstack add skill-chrisp28103-sn-toolkit-docs
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

## Usage

This skill wraps the `sn-docs` CLI which mirrors the official servicenow/servicenowdocs repo. Cache is opt-in -- the skill works in either mode. (The peek-before-read rule is stated once at Step 3.)

## Step 1 -- Check cache state (always first)

```bash
powershell.exe -NoProfile -File sn-docs.ps1 status
```

(Shorthand: a bare `sn-docs ` in Steps 2-5 below ALWAYS means `powershell.exe -NoProfile -File sn-docs.ps1 `. A `.ps1` is not directly executable from a bash block, so never run `sn-docs ...` literally -- always wrap it. Replace `sn-docs.ps1` with its full path if it is not yet on PATH.)

Branch on the `cache_present:` line in stdout:
- **`cache_present: yes`** -- use the fast path: `search` -> `peek` -> `read`, all local.
- **`cache_present: no`** -- use the fallback path: `list` for discovery via GitHub API, `peek`/`read` will auto-fetch from raw.githubusercontent.com per file. After answering, surface this one-line opt-in suggestion **at most once per session**: *"For faster offline lookup, run `/sn-toolkit:docs-setup` once to mirror the docs locally (~150 MB)."*

## Step 2 -- Discover candidate paths

**With cache:** ripgrep is fast and exhaustive.
```bash
sn-docs search "" [-Area ]
```
Returns `path:lineno:snippet` -- review the snippets to pick the right doc.

**Without cache:** narrow by area first (cheap), then peek individual files.
```bash
sn-docs list                    # see all 50 product areas
sn-docs list              # list .md files under that area
```
Common areas: `now-platform`, `api-reference`, `platform-administration`, `it-service-management`, `application-development`.

## Step 3 -- Peek before reading

```bash
sn-docs peek 
```
Returns the first 30 lines + H2 outline. **Verbatim rule (from now-sdk-explain): "Never open a full topic without first viewing the summary via peek -- this prevents wasting context space."**

If the peek looks irrelevant, go back to step 2 with a different search/path. Do NOT call `read` until peek confirms relevance.

## Step 4 -- Read full only when relevant

```bash
sn-docs read 
```
Returns the full markdown. Use the content to answer the user's question.

## Step 5 -- Cite the source

When answering, link to the GitHub source so the user can open the canonical doc.
The repo's default branch is `australia` (release family), NOT `main`:
`https://github.com/servicenow/servicenowdocs/blob/australia/`

The `peek` output's `source:` line gives you this URL pre-built -- copy it directly.

## What to search for

- **Platform APIs** -- `GlideRecord`, `GlideAjax`, `GlideForm`, `GlideUser`, `GlideSystem`
- **Security** -- `ACL`, `evaluation order`, `before query business rule`, `domain separation`
- **Server-side** -- `business rule`, `script include`, `scheduled job`, `flow designer`
- **Client-side** -- `client script`, `UI policy`, `UI action`, `catalog client script`
- **REST/integrations** -- `Table API`, `Scripted REST API`, `OAuth`, `MID Server`
- **UX framework** -- `UI Builder`, `now experience`, `workspace`, `record producer`

## If the CLI errors

- `cache_present: no` after attempting search -> instruct user to run `/sn-toolkit:docs-setup`, OR fall through to `list`/`peek`/`read` which work without the cache.
- `git: command not found` -> git is required for sync; user needs git on PATH.
- `ripgrep (rg) not found` -> rg ships with Claude Code; if missing the user's install is incomplete.
- HTTP errors during webfetch -> network/proxy issue or the path is wrong; double-check via `sn-docs list `.

## Important constraints

- The repo is updated daily via automated builds, but THIS SKILL NEVER auto-syncs. Cache refresh is user-initiated only via `/sn-toolkit:docs-sync`. Stale cache (>30 days) is reported by `sn-docs status` but never acted on -- a cache that's a few weeks old is fine for almost all platform topics.
- Output is ASCII-clean. Do not paste raw doc content into ServiceNow scripts/work-notes (it may contain non-ASCII -- per project rule #1, all SN-bound content must be ASCII).

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [chrisp28103](https://github.com/chrisp28103)
- **Source:** [chrisp28103/sn-toolkit](https://github.com/chrisp28103/sn-toolkit)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-chrisp28103-sn-toolkit-docs
- Seller: https://agentstack.voostack.com/s/chrisp28103
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
