ocaml-dune-migration

Migrate OCaml builds from ocamlbuild/topkg to dune.

35|9|Updated Dec 25, 2025
One-click install
npx skills add https://github.com/avsm/ocaml-claude-marketplace --skill ocaml-dune-migration-avsm
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ocaml-dune-migration
Source: https://github.com/avsm/ocaml-claude-marketplace/tree/main/plugins/ocaml-dev/skills/ocaml-dune-migration
Command: npx skills add https://github.com/avsm/ocaml-claude-marketplace --skill ocaml-dune-migration-avsm

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Migrates OCaml builds from legacy ocamlbuild/topkg environments to the modern dune-based workflow, simplifying project migrations and reducing maintenance burden.

Core Features & Use Cases

  • Automates migration of build configurations (_tags, *.mllib, pkg.ml, and META) to corresponding dune stanzas and project structure.
  • Generates a dune-project and per-library library blocks, including handling optional dependencies and toplevel init files.
  • Provides guidance for updating opam metadata and related tooling to align with dune-based builds, ensuring smooth CI and package publishing.

Quick Start

Run the migration workflow to convert an OCaml project from ocamlbuild/topkg to dune.

Frequently Asked Questions about ocaml-dune-migration

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate an OCaml project from ocamlbuild to dune?

Migrating from ocamlbuild to dune involves converting _tags, .mllib, and pkg.ml files into dune-project and per-library dune stanzas. This workflow automates configuration translation, handles optional dependencies, and updates opam metadata for CI and package publishing.

What does topkg to dune migration require for OCaml builds?

Migrating topkg to dune requires translating topkg metadata and pkg.ml files into dune-project configurations and library blocks. The process updates opam files and test configurations to align with dune-based builds, reducing legacy maintenance burden.

Can I automatically generate dune stanzas from existing _tags and META files?

Yes, you can automatically generate dune stanzas from existing _tags and META files. The migration workflow translates legacy ocamlbuild configurations into per-library dune stanzas, including handling optional dependencies and toplevel init files.

How do I handle optional dependencies when migrating to dune?

Handling optional dependencies when migrating to dune is managed within generated per-library dune stanzas. The migration process translates existing topkg and ocamlbuild configurations, ensuring optional dependencies and test configurations are correctly structured.

Does dune migration update opam files for OCaml libraries?

Yes, dune migration updates opam files for OCaml libraries. The workflow provides guidance for updating opam metadata and related tooling to align with dune-based builds, ensuring smooth CI integration and package publishing.