rescript-manifesto
Type-safe ReScript patterns for sound type systems. Auto-triggers when working with ReScript (.res) files or discussing ReScript/ReasonML architecture. Enforces phantom types, branded IDs, state machines, domain primitives, exhaustive matching, and parse-don't-validate patterns. Use for any ReScript code generation, review, or refactoring.
Best use case
rescript-manifesto is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Type-safe ReScript patterns for sound type systems. Auto-triggers when working with ReScript (.res) files or discussing ReScript/ReasonML architecture. Enforces phantom types, branded IDs, state machines, domain primitives, exhaustive matching, and parse-don't-validate patterns. Use for any ReScript code generation, review, or refactoring.
Teams using rescript-manifesto should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/rescript-manifesto/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How rescript-manifesto Compares
| Feature / Agent | rescript-manifesto | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Type-safe ReScript patterns for sound type systems. Auto-triggers when working with ReScript (.res) files or discussing ReScript/ReasonML architecture. Enforces phantom types, branded IDs, state machines, domain primitives, exhaustive matching, and parse-don't-validate patterns. Use for any ReScript code generation, review, or refactoring.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# ReScript Sound Type Manifesto
Apply these principles when generating or reviewing ReScript code.
## Core Rules
### 1. Domain-Typed Primitives
Never use raw `string`, `int`, `float` for domain concepts:
```rescript
// ❌ BAD
let userId: int = 123
let email: string = "test@example.com"
// ✅ GOOD
type userId = UserId(int)
type email = Email(string)
```
### 2. Make Impossible States Impossible
Use variants instead of multiple booleans/options:
```rescript
// ❌ BAD
type request = {isLoading: bool, data: option<t>, error: option<e>}
// ✅ GOOD
type request<'data, 'error> =
| Idle
| Loading
| Success('data)
| Failed('error)
```
### 3. No Default Values
Never conflate "unknown" with valid values:
```rescript
// ❌ BAD: 0 for unknown
let balance = 0.0
// ✅ GOOD: Explicit optionality
let balance: option<Money.t> = None
```
### 4. Parse, Don't Validate
Transform untyped data to typed data once, at boundaries:
```rescript
// ❌ BAD: Validate repeatedly
if isValidEmail(str) { sendEmail(str) }
// ✅ GOOD: Parse once
switch Email.make(str) {
| Ok(email) => sendEmail(email) // email is Email.t, guaranteed valid
| Error(e) => handleError(e)
}
```
### 5. Exhaustive Matching
Never use wildcards (`_`) for domain variants:
```rescript
// ❌ BAD: Hides future bugs
switch status {
| Active => "active"
| _ => "other"
}
// ✅ GOOD: Compiler catches new variants
switch status {
| Active => "active"
| Pending => "pending"
| Cancelled => "cancelled"
}
```
### 6. Errors as Values
Use `result<'a, 'e>` not exceptions:
```rescript
// ❌ BAD
let divide = (a, b) => if b == 0 { raise(DivByZero) } else { a / b }
// ✅ GOOD
let divide = (a, b): result<int, [#DivByZero]> =>
b == 0 ? Error(#DivByZero) : Ok(a / b)
```
### 7. Shared Types Across Boundaries
Backend and frontend share domain types from a common package. Types are contracts.
## Opaque Types Pattern
When validation needed at construction:
```rescript
module Email: {
type t
let make: string => result<t, [#InvalidFormat]>
let toString: t => string
} = {
type t = string
let make = s => s->String.includes("@") ? Ok(s) : Error(#InvalidFormat)
let toString = t => t
}
```
## State Machine Pattern
Model states as types, transitions as functions:
```rescript
type pending = {orderId: orderId}
type paid = {orderId: orderId, paidAt: timestamp}
type shipped = {orderId: orderId, paidAt: timestamp, shippedAt: timestamp}
let pay: pending => paid
let ship: paid => shipped // Can ONLY ship paid orders
```
## Quick Checklist
Before writing any type:
| Check | If Yes |
|-------|--------|
| Using raw `string`/`int`/`float`? | Wrap in domain type |
| 2+ related booleans? | Convert to variant |
| 2+ related options? | Convert to variant |
| Using 0, "", [] as placeholder? | Use `option` or loading variant |
| Type exists in both FE and BE? | Move to shared package |
## Full Reference
For detailed patterns, examples, and philosophy: see [references/MANIFESTO.md](references/MANIFESTO.md)Related Skills
bgo
Automates the complete Blender build-go workflow, from building and packaging your extension/add-on to removing old versions, installing, enabling, and launching Blender for quick testing and iteration.
self-subagent
Orchestrate parallel sub-tasks by spawning non-interactive instances of your own CLI as subagents. Use when you need to parallelize work across multiple files, run independent investigations simultaneously, or delegate heavy multi-step tasks. Works with ANY AI coding CLI agent (Amp, Claude Code, Codex, Cursor, OpenCode, aider, Cline, Roo, goose, Windsurf, Copilot CLI, pi, etc.). Triggers on "run in parallel", "subagent", "delegate", "fan out", "concurrent tasks", or any complex task that benefits from parallel execution.
self-improving-ai
Understanding and using StickerNest's self-improving AI system. Use when the user asks about AI self-improvement, prompt versioning, reflection loops, AI evaluation, auto-tuning prompts, or the AI judge system. Covers AIReflectionService, stores, and the improvement loop.
second-brain
Personal intelligence system for capturing thoughts, managing knowledge, and surfacing insights. Use when user wants to capture an idea, task, or note during conversation; query their knowledge base; check their inbox; review digests; or update task status. Triggers include "remember this," "add a task," "what did I say about," "show my inbox," or "mark complete."
searching-message-history
Search Telegram conversation history and stored links. Use when finding past messages, what someone said, or links shared in chats.
screpcombiningexpression
Combine scTCR/BCR repertoire data with scRNA-seq expression data using `scRepertoire::combineExpression()`. This process integrates immune receptor information (CDR3 sequences, V(D)J genes, clonotypes) into a Seurat object's metadata, enabling clonotype-aware gene expression analysis.
scrapegraph-ai-automation
Automate Scrapegraph AI tasks via Rube MCP (Composio). Always search tools first for current schemas.
scientific-schematics
Create publication-quality scientific diagrams using Nano Banana Pro AI with smart iterative refinement. Uses Gemini 3 Pro for quality review. Only regenerates if quality is below threshold for your document type. Specialized in neural network architectures, system diagrams, flowcharts, biological pathways, and complex scientific visualizations.
scientific-papers-to-dataset
Build structured datasets from academic papers. Use when the user wants to extract structured data from scientific literature, traverse citation graphs, search OpenAlex for papers, or create datasets from PDFs for research purposes.
scholarag
Build PRISMA 2020-compliant systematic literature review systems with RAG-powered analysis in VS Code. Use when researcher needs automated paper retrieval (Semantic Scholar, OpenAlex, arXiv), AI-assisted PRISMA screening (50% or 90% threshold), vector database creation (ChromaDB), or research conversation interface. Supports knowledge_repository (comprehensive, 15K+ papers, teaching/exploration) and systematic_review (publication-quality, 50-300 papers, meta-analysis) modes. Conversation-first workflow with 7 stages.
savestate
Time Machine for AI. Encrypted backup, restore, and cross-platform migration for your agent's memory and identity. Supports OpenClaw, ChatGPT, Claude, Gemini, and more. AES-256-GCM encryption with user-controlled keys.
sarvam-ai-skills
Guide for building AI applications with Sarvam AI APIs for Indian languages. Use when working with speech-to-text transcription, text-to-speech synthesis, text translation, chat completion, or document intelligence. Covers models saarika:v2.5, saaras:v2.5/v3, bulbul:v3, mayura:v1, sarvam-translate:v1, sarvam-m, and sarvam-vision for 11-23 Indian languages. Trigger when user asks about Indian language AI, STT, TTS, translation, multilingual chatbots, voice assistants, or document processing.