be-ocaml

Implement OCaml backend services with Dream, Dune, and Alcotest.

Updated Mar 7, 2026
One-click install
npx skills add https://github.com/MassimilianoPili/agent-framework --skill be-ocaml
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: be-ocaml
Source: https://github.com/MassimilianoPili/agent-framework/tree/main/.claude/agents/be-ocaml
Command: npx skills add https://github.com/MassimilianoPili/agent-framework --skill be-ocaml

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill automates the implementation of backend HTTP APIs, business logic, and data access using idiomatic OCaml, adhering to contract-first principles and leveraging frameworks like Dream and the Dune build system.

Core Features & Use Cases

  • Backend API Implementation: Develops robust HTTP endpoints using the Dream framework.
  • Data Modeling & Access: Implements type-safe data structures and database interactions with Caqti.
  • Testing & Build Automation: Integrates Alcotest for testing and Dune for building and managing the OCaml project.
  • Use Case: Implement a RESTful API for user management, including CRUD operations, with proper error handling and type safety.

Quick Start

Use the be-ocaml skill to implement a new user creation endpoint following the provided OpenAPI contract.

Frequently Asked Questions about be-ocaml

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

FAQPage Schema
How do I implement a backend HTTP API in OCaml using the Dream framework?

To implement a backend HTTP API in OCaml using the Dream framework, you define Dream handlers for HTTP endpoints and type-safe data structures. This approach follows contract-first principles to generate robust and maintainable code for business logic and data access.

What is the best way to structure an OCaml backend project with Dune?

The best way to structure an OCaml backend project with Dune is to configure the Dune build system to manage your project components and integrate Alcotest test suites. This ensures automated building and testing of your functional programming patterns and type-safe data models.

How do I perform type-safe database interactions in OCaml?

Type-safe database interactions in OCaml are performed using Caqti for data access layers. By combining Caqti with functional programming patterns, you ensure type-safe data modeling and robust database interactions within your Dream framework HTTP API.

Does the be-ocaml approach support contract-first API development?

Yes, the be-ocaml approach supports contract-first API development by adhering to OCaml conventions and using provided OpenAPI contracts. It implements RESTful API endpoints, including CRUD operations, with proper error handling and type safety based on the contract.

Can I use Alcotest to test OCaml backend services built with Dream?

Yes, you can use Alcotest to test OCaml backend services built with Dream. Integrating Alcotest test suites with the Dune build system allows you to verify your business logic and HTTP API endpoints, ensuring your functional programming patterns remain robust.

When do I need to use Caqti and Dune for OCaml API development?

You need to use Caqti and Dune for OCaml API development when implementing data access layers and managing build automation for HTTP APIs. Dune builds the project while Caqti handles database interactions, ensuring type-safe data modeling and maintainable code.