fsharp-backend

Implement F# backend endpoints with Giraffe and Fable.Remoting.

1|Updated Nov 26, 2025
One-click install
npx skills add https://github.com/heimeshoff/Cinemarco --skill fsharp-backend
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: fsharp-backend
Source: https://github.com/heimeshoff/Cinemarco/tree/main/.claude/skills/fsharp-backend
Command: npx skills add https://github.com/heimeshoff/Cinemarco --skill fsharp-backend

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a structured blueprint for implementing a robust F# backend using a clean separation of concerns: Validation, Domain, Persistence, and API. It helps you avoid IO leaks in the domain layer and ensures deterministic scaffolding for backend endpoints.

Core Features & Use Cases

  • Layered Architecture: API → Validation → Domain (pure) → Persistence.
  • Code Scaffolding: Creates modules like Validation.fs, Domain.fs, Persistence.fs, Api.fs under src/Server/.
  • Use Case: Quickly add a new API endpoint or implement business rules with safe, testable domain code.

Quick Start

Use the fsharp-backend skill to scaffold the backend layers under src/Server for a new API.

Frequently Asked Questions about fsharp-backend

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

FAQPage Schema
How do I implement a layered backend architecture in F#?

A layered backend architecture separates concerns into Validation, Domain, Persistence, and API layers. This approach isolates pure business logic from I/O operations, making code testable and deterministic. F# with Giraffe and Fable.Remoting scaffolds these layers automatically under src/Server.

How do I add API endpoints with input validation in F#?

Use Giraffe and Fable.Remoting to define endpoints that enforce validation at the API boundary. The Skill scaffolds Validation.fs to handle input checks before passing data to pure domain logic, preventing invalid state from entering your application.

Can I separate domain logic from database I/O in F# backends?

Yes. The layered architecture enforces I/O separation by keeping domain logic pure and isolated in Domain.fs, while Persistence.fs handles all database operations. This prevents I/O leaks and ensures your business rules remain testable without database dependencies.

What's the best way to structure an F# backend project?

Organize your src/Server directory with modules for Validation.fs, Domain.fs, Persistence.fs, and Api.fs. This clean separation ensures validation runs first, domain logic stays pure, persistence handles data access, and API endpoints orchestrate the flow safely.

Does Giraffe work with Fable.Remoting for building APIs?

Yes. Giraffe handles HTTP routing and request processing while Fable.Remoting provides type-safe communication. Together they enable robust, structured API development with automatic scaffolding for endpoints under the layered architecture.

Why should I enforce pure domain logic separate from I/O?

Pure domain logic is deterministic, testable, and free of side effects. Separating it into Domain.fs prevents database or network calls from corrupting business rules, making bugs easier to isolate and tests faster to run without external dependencies.