fsharp-style

Guide idiomatic F# code with functional programming and type safety principles.

1|Updated May 5, 2026
One-click install
npx skills add https://github.com/V0v1kkk/YamlFrontMatter --skill fsharp-style
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: fsharp-style
Source: https://github.com/V0v1kkk/YamlFrontMatter/tree/main/.skills/fsharp-style
Command: npx skills add https://github.com/V0v1kkk/YamlFrontMatter --skill fsharp-style

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill provides a comprehensive guide to writing clean, functional F# code, addressing common pitfalls and promoting best practices.

Core Features & Use Cases

  • Functional Thinking: Emphasizes immutability, total functions, and pattern matching over OOP-style constructs.
  • File and Module Organization: Offers guidelines for project file ordering, module usage, and namespace considerations.
  • Single-case DU Discipline: Detailed instructions on creating single-case DUs for type safety and domain modeling.
  • Pattern Matching: Encourages the use of pattern matching over if-else structures for better code clarity.
  • Active Patterns: Introduces active patterns for parsing and validation.
  • Computation Expressions: Explains the use of computation expressions for creating custom DSLs.
  • Task vs Async: Offers guidance on when to use task and async for asynchronous programming.
  • Records and Updates: Details the use of immutable records and the with syntax for updates.
  • Error Handling: Discusses the use of Result and Option for error handling.
  • Naming Conventions: Provides a set of naming conventions for F# code.
  • Anti-patterns: Lists common anti-patterns to avoid in F# code.
  • Type Provider Authoring: Offers guidance on writing Type Providers, including the call-site style.

Quick Start

Load the fsharp-style skill to review your F# code or when considering a new feature implementation.

Frequently Asked Questions about fsharp-style

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

FAQPage Schema
How do I write idiomatic F# code and follow functional programming best practices?

Idiomatic F# code prioritizes immutability, total functions, and pattern matching over traditional OOP constructs to ensure type safety and domain modeling clarity. This guide helps developers adopt functional thinking by replacing if-else structures with pattern matching.

What is the best way to organize files and modules in an F# project?

Organizing F# projects requires strict guidelines for file ordering, module usage, and namespace considerations to maintain clear dependencies. Proper organization ensures that domain modeling remains clean and functional programming principles are applied effectively throughout the codebase.

Should I use task or async for asynchronous programming in F#?

Choosing between task and async in F# depends on specific asynchronous programming requirements and integration contexts. This guide offers targeted guidance on when to utilize each computation expression to optimize error handling and workflow execution.

How do I handle errors in F# using Result and Option types?

Error handling in F# leverages the Result and Option types to safely manage failures without exceptions, ensuring type safety. By combining these with pattern matching, developers can write robust, total functions that explicitly handle domain modeling edge cases.

When should I use single-case discriminated unions for domain modeling in F#?

Single-case discriminated unions (DUs) in F# should be used to enforce type safety and prevent primitive obsession during domain modeling. This guide details the discipline required to create them effectively for robust, functional programming.

What are common F# anti-patterns I should avoid in my code?

Common F# anti-patterns include overusing if-else structures instead of pattern matching, ignoring immutability, and mismanaging records. Avoiding these pitfalls ensures your coding style remains clean, functional, and aligned with established best practices.