ocaml-dune-migration

Migrate OCaml projects from ocamlbuild/topkg to dune configurations.

46|6|Updated Jan 28, 2026
One-click install
npx skills add https://github.com/aresbit/MateBot --skill ocaml-dune-migration
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: ocaml-dune-migration
Source: https://github.com/aresbit/MateBot/tree/main/skills/ocaml/ocaml-dune-migration
Command: npx skills add https://github.com/aresbit/MateBot --skill ocaml-dune-migration

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Migrating OCaml projects from ocamlbuild/topkg to dune modernizes builds, simplifies dependencies, and improves reproducibility.

Core Features & Use Cases

  • Guides migration by identifying ocamlbuild/topkg artifacts (_tags, *.mllib, pkg/pkg.ml, topkg) and generating dune-project and library stanzas.
  • Produces a complete migration plan including handling toplevel init files, opam metadata, tests, and documentation updates.
  • Applicable to projects aiming to adopt a modern, reproducible OCaml build workflow and reduce manual rewrite effort.

Quick Start

Run the migration guide against an OCaml project to convert _tags, .mllib, and pkg/pkg.ml references into dune equivalents. Follow the steps to create a dune-project, library stanzas, and update opam metadata, while removing ocamlbuild artifacts.

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?▼

Migrate OCaml projects from ocamlbuild to dune by parsing _tags, .mllib, and META files to generate dune-project and library stanzas. The process produces a complete migration plan covering opam metadata, tests, and documentation updates.

What is the best way to convert topkg artifacts into dune configurations?▼

Converting topkg artifacts into dune configurations involves parsing pkg/pkg.ml files to generate equivalent dune-project and library stanzas. This modernizes builds, simplifies dependencies, and improves reproducibility while removing legacy topkg files.

Can I use dune with existing opam and .mllib configurations?▼

Yes, dune migration handles existing opam and .mllib configurations by parsing them to generate dune library stanzas. The migration updates opam build-system metadata and removes legacy ocamlbuild artifacts after conversion.

How does dune handle toplevel init files during ocamlbuild migration?▼

Dune handles toplevel init files during ocamlbuild migration by including them in the generated migration plan. The process converts legacy _tags references into dune equivalents and configures toplevel init files within the new dune build workflow.

When do I need to remove ocamlbuild files after migrating to dune?▼

Remove ocamlbuild files after generating and validating dune-project, library stanzas, and test configurations. The migration plan ensures legacy ocamlbuild artifacts like _tags and .mllib are safely removed once dune equivalents are fully operational.

Does dune migration support projects with complex _tags and META dependencies?▼

Yes, dune migration supports projects with complex _tags and META dependencies by parsing these ocamlbuild artifacts to generate accurate dune configurations. It handles library stanzas and opam metadata updates for projects with intricate dependency structures.