| name | test-studio-script-runner |
| description | Explains the dev/test-studio Script Runner tool. Use when adding, editing, running, or documenting scripts in dev/test-studio/src/script-runner, or when the user mentions the Scripts tool, Studio runner scripts, script variables, or browser-side Sanity Studio scripts. |
Test Studio Script Runner
Use this skill when working with the Scripts tool in dev/test-studio.
Key Files
- Tool plugin:
dev/test-studio/src/script-runner/index.tsx
- Runner UI:
dev/test-studio/src/script-runner/ScriptRunnerTool.tsx
- Script registry:
dev/test-studio/src/script-runner/registry.ts
- Script contract:
dev/test-studio/src/script-runner/types.ts
- Script modules:
dev/test-studio/src/script-runner/scripts/*/index.ts
- Agent-facing docs:
dev/test-studio/src/script-runner/README.md
Read README.md and types.ts before changing the runner or adding scripts.
What The Tool Does
The runner is a Sanity Studio custom tool registered in the home workspace.
- Home route:
<studio>/home/scripts
- Script route:
<studio>/home/scripts/<script-name>
Scripts are browser-side TypeScript modules discovered at build time with Vite import.meta.glob.
They run inside Sanity Studio with the logged-in user's permissions and receive the Studio client.
Adding A Script
Add a folder under dev/test-studio/src/script-runner/scripts/. The folder name should match the
script name. Put the registered entrypoint in index.ts; any helper files can live beside it.