/shotscript-fix /shotscript-migrate /shotscript-explain Install
No gradual migration path — unless you use Claude. Rules like no-class and no-throw require architectural rewrites, not search-and-replace. /shotscript-migrate handles the rewrite, including updating every call site.
/shotscript-fix

Runs the linter against your source files, reads every flagged file, and rewrites violations in-place. Re-runs until zero violations remain. Pass a glob to target specific files, or omit it to let the command infer from package.json.

1. Run linter Executes npx shotscript 'src/**/*.ts' and parses the output — one violation per line in file:line:col [rule] message format.
2. Fix per rule Applies the correct rewrite for each rule — interfacetype, T[]readonly T[], throwreturn [null, err], and all others. Never introduces new violations while fixing.
3. Verify Re-runs the linter after each file. Repeats until the output is clean.

Best for: day-to-day use when you wrote something that triggered a rule and want it fixed without looking up the correct form.

/shotscript-migrate [glob]

Staged migration for an existing TypeScript codebase. Audits violations first, then works through them in two phases — mechanical fixes before structural rewrites — to avoid cascading breakage.

Phase 1 — Audit Counts violations per rule, categorises them as mechanical or structural, and confirms with you before making any changes.
Phase 2 — Mechanical Fixes safe, local rewrites first: interfacetype, optional properties → | null, T[]readonly T[], letconst, =====, enumas const, and more.
Phase 3 — Structural Tackles changes that cascade across call sites: arrow functions → named function declarations, classes → plain types + functions, throw/tryResult tuple returns with toResult/safeFetch from shotscript/std. Updates every call site.
Phase 4 — Verify Final linter pass. Zero violations is the target before finishing.

Best for: onboarding an existing TypeScript project to ShotScript. The structural phase handles the rewrites that would otherwise require days of manual work.

/shotscript-explain [rule]

Explains any ShotScript rule or violation. Pass a rule name or paste a full violation line from the linter output — the command returns what's banned, why, and a before/after example.

Input A rule name (e.g. no-arrow-functions), or a pasted violation line (e.g. src/api.ts:12:5 [no-throw] Use return instead of throw.)
Output What's banned — the specific construct with an example. Why — the design principle in one sentence. The fix — a before/after code pair showing the ShotScript-compliant form.

Best for: onboarding new team members to the dialect, or quickly looking up the correct form for an unfamiliar rule.


Install
Install with AI — paste into Claude Code, Cursor, or any AI assistant
Add ShotScriptSkills to this project: run npm install --save-dev shotscript, then run npx shotscript init to write the ShotScript coding guide to AGENTS.md in the project root (merge into existing AGENTS.md if one is present) and install the /shotscript-fix, /shotscript-migrate, and /shotscript-explain slash commands. Full ShotScript setup →
Manual setup
$ npx shotscript commands

Use npx shotscript init on first setup — writes AGENTS.md and installs the slash commands. Use npx shotscript commands to update just the slash commands after a package upgrade. Requires Claude Code.