
Rescript Lsp
- 1 repo stars
- Updated June 18, 2026
- illusionalsagacity/claude-plugins
Rescript Language Server Plugin - Auto-formats ReScript files after Write/Edit operations
About
rescript-lsp is a Claude Code skill in the AI & Agent Building category. Rescript Language Server Plugin - Auto-formats ReScript files after Write/Edit operations
- rescript-lsp
- AI & Agent Building
- AI-coding skill
Rescript Lsp by the numbers
- Data as of Jul 7, 2026 (Skillselion catalog sync)
/plugin marketplace add illusionalsagacity/claude-plugins/plugin install rescript-lsp@illusionalsagacity-claude-pluginsAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| repo stars | ★ 1 |
|---|---|
| Last updated | June 18, 2026 |
| Repository | illusionalsagacity/claude-plugins ↗ |
What it does
Rescript Language Server Plugin - Auto-formats ReScript files after Write/Edit operations
README.md
Claude Plugins
rescript-lsp
A Claude Code plugin to hook up the Rescript LSP, run the formatter on changes, and make some Rescript-specific code skills available.
Installation
See the Claude Code plugin marketplace documentation
You can also clone this repo locally and install it that way, so you can edit the plugin to add your own stuff
Requirements
@rescript/langugage-serverjqxargsnpx
rescript-bindings-writer agent
A Claude Code agent for creating, verifying, updating, or extending ReScript bindings for JavaScript/TypeScript libraries.
Phase 1: Context Gathering
Before writing any code, the agent gathers critical context:
Task Type - One of:
create- New bindings from scratchverify- Check existing bindings against TypeScript APIupdate- Update bindings for a new library versionextend- Add bindings to an existing set
Required Information:
- Library name/version (from package.json)
- APIs needed (specific list, "core API", or "all")
- ReScript version (v11+ enables
@unboxed,@tag, uncurried default) - Use context: library (published package) vs application (internal)
For existing bindings (verify/update/extend): Analyze patterns - module structure, props approach, variant style, naming conventions
Phase 2: Task-Specific Workflows
Verify: Systematic comparison of ALL ReScript bindings against TypeScript .d.ts files. Uses a checklist, reports missing/mismatched/deprecated props per component, produces prioritized findings.
Create: Full binding creation process:
- Research - Examine TS types, understand JS runtime behavior
- Write - Use appropriate binding attributes (
@module,@send,@get, etc.) - Verify - Compile examples, examine generated JS, compare against library docs
- Iterate - Revise until JS output matches expected usage
Type Fidelity Verification
The agent explicitly handles TypeScript patterns that change return types (like builder patterns with withDefault). When TypeScript uses conditional types, mapped types, or overloads that cannot be represented in ReScript, the agent:
- Identifies the limitation explicitly
- Explains why ReScript can't express it
- Presents options to the user (e.g., "all fields nullable" vs "user defines custom types")
- Documents the trade-off in the bindings
Output Format
Every binding includes:
- The
.resbinding code - Example usage demonstrating each binding
- Expected JavaScript output for verification
- Type fidelity report (what's fully represented vs approximated)
- Caveats and limitations
The key philosophy: never silently simplify - if TypeScript types can't be fully represented, report back with options and let the user decide on trade-offs.
rescript-coding-conventions skill
Coding conventions and type design guidance for writing idiomatic ReScript.
Type Design
- Model states as variants, not booleans - Combine multiple
boolflags into a single variant that represents the entire state, preventing invalid combinations (e.g.,Loading | Loaded('data) | Closedinstead of{isOpen: bool, isLoading: bool}) - Use the compiler to enforce business rules - Create opaque types with
make/parse functions for validated data (e.g.,SocialSecurityNumber.twithfromString: string => result<t, error>) - Opaque type aliases - When a type wraps a primitive but shouldn't be interchangeable with other primitives, make it opaque in the
.resiinterface
Module Organization
- Submodules for related types - Define closely-tied types as submodules (e.g.,
Task.Priority.t) @unboxedvariants with@as- Compile variant constructors directly to string values, eliminatingtoString/fromStringboilerplate- Comparison at the right level - If an ID type has equality, the entity type should too
Style
- Prefer pattern matching over
if/elseor ternaries - Prefer functional composition (
Array.map,Option.map,Result.map) over mutable refs and imperative loops - Use punning for React props and record fields
- Choose the most semantic function (e.g.,
Array.someoverArray.forEachwith a mutable ref) - Flatten nested
switchexpressions where practical
rescript-workflow skill
A phased development workflow that uses %todo to work with the compiler instead of against it.
ReScript's compiler halts until the program type-checks. Without a strategy, you end up stuck in a non-compiling state, reactively chasing type errors. The solution: sketch structure with %todo before implementing. This keeps code compiling while you work out the shape.
Phases
- Interface Design - Add type signatures to
.resifiles first - Implementation Skeletons - Write
let fn: type = %todo("description")placeholders - Write Tests - Complete tests against skeletons (they'll fail at runtime, that's fine)
- Implementation - Replace
%todowith working code - Verification - Run
rescript --warn-error +110to ensure no%todoremains
Refactoring
Same approach - sketch new helpers with %todo, wire up the callers (compiles because signatures exist), then fill in implementations one at a time. The compiler becomes an ally showing you what's left to implement, not a blocker preventing progress.