g1joshi/agent-skills/ocaml
Claude Code and agent skill by g1joshi/agent-skills
- community
Checking that the SKILL.md file is still in the repository.
Expert OCaml functional programming assistance covering algebraic data types, pattern matching, modules, and Dune. Use when developing static analysis tools, compilers, theorem provers, or high-assurance software.
Install
npx vskill@latest install g1joshi/agent-skills/ocamlSKILL.md
OCaml
OCaml v5 brings Multicore support to the language, removing the Global Interpreter Lock (GIL). It combines functional safety with imperative speed.
When to Use
- High-Performance Static Functional Programming: Writing safe, algebraic, strongly-typed systems running at near-C execution speeds.
- Financial Trading Platforms (Jane Street): Building mission-critical quantitative trading infrastructure and order books.
- Static Analysis & Formal Verification Tools: Authoring compilers, linters, and verification suites (Coq, Flow, Infer).
- Multicore Parallelism (OCaml 5): Leveraging OCaml 5's native multicore concurrency, domains, and effect handlers.
Quick Start
Core Concepts
Hindley-Milner Type Inference & Pattern Matching
Infers static types globally without requiring verbose type annotations:
Module System (Signatures & Functors)
Powerful structural module system supporting parameterized modules (Functors):
OCaml 5 Effect Handlers & Multicore Domains
Native CPU domain parallelism and structured non-blocking effects:
Common Patterns
Modular Architecture with Functors
Problem: Writing generic container algorithms independent of concrete key comparison logic.
Solution: Use OCaml Functors (modules parameterized by modules):
Best Practices
Do:
- Use Dune as Standard Build System: Build, test, and manage projects exclusively using
dune buildanddune runtest. - Adopt OCaml 5+: Utilize modern Multicore OCaml with concurrent Domain execution.
- Leverage Jane Street Base & Core: Enhance the standard library using battle-tested
BaseandCore. - Enforce Exhaustive Pattern Matching: Address all compiler warnings (
-w +A) regarding unhandled pattern cases.
Don't:
- Use polymorphic equality (
=) carelessly: Polymorphic equality can crash at runtime on functional closures; use typed comparators. - Rely on unhandled exceptions for control flow: Represent failure explicitly using
Result.torOption.t. - Mutate state across Domains without synchronization: Use atomic variables (
Atomic.t) when sharing memory between threads.
Troubleshooting
| Error | Cause | Solution | |
|---|---|---|---|
Error: This expression has type ... but an expression was expected of type ... | Type mismatch in expression. | Check function argument order; OCaml does not perform implicit casts. | |
Warning 8 [partial-match]: this pattern-matching is not exhaustive | Pattern matching missing one or more cases. | Add missing match cases to ensure all possibilities are handled. | |
Error: Unbound module ... | Module not installed or missing in Dune libraries stanza. | Add library dependency to dune file and run dune build. |
References
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/languages/ocaml/SKILL.md
Popularity
- Repository stars
- 7
- 7-day trend score
- 10
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 26 Mar 2026, 8 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Grok Build (Cursor)
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/g1joshi/agent-skills/ocaml)