Agent skill

Fsharp

by managedcode in managedcode/dotnet-skills

Write, review, or modernize F code in .NET repositories with functional-first design, algebraic data types, pattern matching, pipelines, async workflows, project ordering, and C interop.

MITAuto-check passedDevelopment

Install Fsharp

skills CLI
$ npx skills add managedcode/dotnet-skills --skill fsharp -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install managedcode/dotnet-skills fsharp --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/managedcode/dotnet-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/catalog/Tools/FSharp/skills/fsharp .claude/skills/fsharp && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
fsharp
GitHub stars
486
Token cost
~1.9k tokens
SKILL.md length
605 words
Files
2
Skills in repo
81
Repo updated
First seen
Licence
MIT

At a glance

Write, review, or modernize F code in .NET repositories with functional-first design, algebraic data types, pattern matching, pipelines, async workflows, project ordering, and C interop.

  • Works in 5 steps: Inspect the existing .fsproj, .fs, .fsi,… → Choose the smallest F# model that… → Add or edit source files in dependency… → …
  • : F .fs/.fsproj code
  • SKILL.md covers Trigger On, Do Not Use For, Project Setup and Source Ordering, plus 7 more sections
  • Calls dotnet

What it does

Fsharp is an agent skill from managedcode/dotnet-skills. Write, review, or modernize F code in .NET repositories with functional-first design, algebraic data types, pattern matching, pipelines, async workflows, project ordering, and C interop. USE FOR: F .fs/.fsproj code; discriminated unions, records, options, results, pattern matching, computation expressions, or functional domain modeling; strongly typed AI-generated .NET code. DO NOT USE FOR: C language modernization; FSI-only exploratory scripts with no project changes. INVOKES: inspect .fsproj file order and SDK…

Its SKILL.md is about 1.9k tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file (for example `manifest.json`). Compatibility notes: Requires a .NET SDK with F support and an F project, script, or interop boundary.

It sits in Development, covering Legacy modernization and Domain-driven design. It works with C# and .NET. The repository describes itself as: Installable .NET skill catalog and CLI for Codex, Claude Code, GitHub Copilot, and Gemini. The licence is MIT.

When your agent uses it

  • : F .fs/.fsproj code
  • Discriminated unions
  • Pattern matching
  • Computation expressions

Example prompts

  • “/fsharp”

Requirements

  • Compatibility (from SKILL.md): Requires a .NET SDK with F# support and an F# project, script, or interop boundary.

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Inspect the existing .fsproj, .fs, .fsi, and .fsx files to determine compile order, public boundaries, and whether the code is F#-first or…
  2. Choose the smallest F# model that represents the invariant: records for named product data, discriminated unions for closed state, option…
  3. Add or edit source files in dependency order, then update the .fsproj compile list before consumers reference the new code.
  4. Review public API shape for .NET interop. Translate F#-specific internal models to DTOs, methods, or Try* patterns when C# callers need a…
  5. Run dotnet build, targeted tests, and any relevant dotnet fsi probes before returning the final result.

What it can do on your machine

Read from SKILL.md and the folder at commit 535dd55. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • dotnet

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • learn.microsoft.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Requires a .NET SDK with F# support and an F# project, script, or interop boundary.

    From compatibility in the SKILL.md frontmatter.

Context cost

Fsharp loads about 1.9k tokens when it runs. Until then it costs about 164 tokens; SKILL.md has 605 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~164
When it runs · the whole SKILL.md, loaded when a task matches
~1.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from managedcode/dotnet-skills at commit 535dd55, republished under its MIT licence (© managedcode). 605 words, ~1,935 tokens.

Download SKILL.mdSave it as .claude/skills/fsharp/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
fsharp
description
Write, review, or modernize F# code in .NET repositories with functional-first design, algebraic data types, pattern matching, pipelines, async workflows, project ordering, and C# interop. USE FOR: F# .fs/.fsproj code; discriminated unions, records, options, results, pattern matching, computation expressions, or functional domain modeling; strongly typed AI-generated .NET code. DO NOT USE FOR: C# language modernization; FSI-only exploratory scripts with no project changes. INVOKES: inspect .fsproj file order and SDK settings, edit F# source and project files, and run dotnet build/test or dotnet fsi validation commands when changes are made.
compatibility
Requires a .NET SDK with F# support and an F# project, script, or interop boundary.

F# for .NET

Trigger On

  • the task touches .fs, .fsx, .fsi, or .fsproj files
  • domain logic benefits from records, discriminated unions, options, results, or exhaustive pattern matching
  • generated code needs a strongly typed functional model instead of nullable primitive state
  • F# code must interoperate with C# or other .NET libraries
  • the repository needs project setup, source ordering, or validation for F# code

Do Not Use For

  • C# language feature selection; use modern-csharp
  • analyzer-only, formatter-only, or CI-only work with no F# language decisions
  • one-off REPL or scripting exploration that does not affect project code; use fsi
  • non-.NET functional languages

Project Setup

Use the .NET SDK templates when adding F# projects.

bash
dotnet new classlib -lang "F#" -o src/Domain
dotnet new console -lang "F#" -o src/App
dotnet new xunit -lang "F#" -o tests/Domain.Tests
dotnet sln add src/Domain/Domain.fsproj tests/Domain.Tests/Domain.Tests.fsproj
dotnet add tests/Domain.Tests/Domain.Tests.fsproj reference src/Domain/Domain.fsproj
dotnet build

FSharp.Core is normally supplied by the F# SDK project. Add or pin it explicitly only when the repo has a package policy that requires deterministic package versions.

bash
dotnet add src/Domain/Domain.fsproj package FSharp.Core

Source Ordering

F# compiles files in the order listed in the project file. Define types and modules before files that consume them.

xml
<ItemGroup>
  <Compile Include="Domain.fs" />
  <Compile Include="Validation.fs" />
  <Compile Include="Program.fs" />
</ItemGroup>

When adding a file, update the .fsproj intentionally. Do not assume wildcard ordering.

Workflow

  1. Inspect the existing .fsproj, .fs, .fsi, and .fsx files to determine compile order, public boundaries, and whether the code is F#-first or C#-facing.
  2. Choose the smallest F# model that represents the invariant: records for named product data, discriminated unions for closed state, option for absence, and Result for expected failures.
  3. Add or edit source files in dependency order, then update the .fsproj compile list before consumers reference the new code.
  4. Review public API shape for .NET interop. Translate F#-specific internal models to DTOs, methods, or Try* patterns when C# callers need a stable surface.
  5. Run dotnet build, targeted tests, and any relevant dotnet fsi probes before returning the final result.

Current Upstream Notes

  • The August 2026 F# overview continues to emphasize functional-first programming on .NET with records, discriminated unions, pattern matching, units of measure, type providers, and interop. Keep F# guidance domain-model oriented rather than translating C# object patterns mechanically.
  • Use fsi for exploratory scripts, but move durable code into ordered .fsproj files before it becomes production behavior.

Practical Patterns

Model State With Records And Unions

Prefer a type that names every valid state over loose strings, nullable values, or parallel booleans.

fsharp
module Orders

type OrderId = private OrderId of string

module OrderId =
    let tryCreate value =
        if System.String.IsNullOrWhiteSpace value then
            Error "Order id is required."
        else
            Ok (OrderId value)

type Payment =
    | Card of last4: string
    | Wire of iban: string
    | PurchaseOrder of number: string

type Order =
    { Id: OrderId
      Customer: string
      Payment: Payment }

let describePayment payment =
    match payment with
    | Card last4 -> $"card ending {last4}"
    | Wire iban -> $"wire transfer {iban}"
    | PurchaseOrder number -> $"purchase order {number}"
Show full SKILL.md (236 more words)Show less
Compose Validation With Result

Return Result<'T,'Error> when callers must handle failure and when failures are part of the domain.

fsharp
module Pricing

type Price =
    private
    | Price of decimal

module Price =
    let tryCreate amount =
        if amount < 0m then
            Error "Price cannot be negative."
        else
            Ok (Price amount)

    let value (Price amount) = amount

type Line =
    { Sku: string
      Quantity: int
      UnitPrice: Price }

let tryCreateLine sku quantity amount =
    match Price.tryCreate amount with
    | Ok price when quantity > 0 ->
        Ok { Sku = sku; Quantity = quantity; UnitPrice = price }
    | Ok _ ->
        Error "Quantity must be positive."
    | Error message ->
        Error message
Read And Transform Data

Use pipelines for readable transformations, but stop before the pipeline hides error handling or allocation cost.

fsharp
open System.IO

let readActiveUsers path =
    File.ReadLines path
    |> Seq.skip 1
    |> Seq.choose (fun line ->
        match line.Split(',') with
        | [| id; name; "active" |] -> Some {| Id = id; Name = name |}
        | _ -> None)
    |> Seq.toList
Write A Small .NET Boundary

Make public interop APIs easy for C# callers. Hide F#-specific details behind functions, methods, or DTO records when needed.

fsharp
namespace Company.Domain

type InvoiceDto =
    { Id: string
      Total: decimal
      IsPaid: bool }

module Invoice =
    let markPaid invoice =
        { invoice with IsPaid = true }

Interop Guidance

  • Keep F# discriminated unions inside F# boundaries unless C# consumers are expected to understand their generated shape.
  • Use records or explicit classes for public cross-language DTOs.
  • Use option internally; translate to nullable annotations, Try* methods, or Result at C#-first public boundaries.
  • Avoid throwing for expected domain failures. Use exceptions for unexpected infrastructure failures.
  • Prefer task { } or Task-returning APIs at .NET interop boundaries; use Async<'T> when the code is F#-first.

Review Checklist

  • The .fsproj compile order matches dependency order.
  • All union cases are handled explicitly; wildcard branches are justified.
  • Public types have stable names and shapes for downstream .NET consumers.
  • Domain failures are modeled with option or Result, not undocumented null.
  • Pipelines remain readable and do not hide repeated enumeration of expensive sequences.
  • Tests cover at least one success and one failure path for each domain constructor or validator.

Validate

Run the narrowest relevant checks after changes:

bash
dotnet build
dotnet test
dotnet fsi scripts/check.fsx

If adding a new F# file, also inspect the project file diff to confirm the compile order is deliberate.

Sources

© managedcode, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in catalog/Tools/FSharp/skills/fsharp of managedcode/dotnet-skills.

  • SKILL.md
  • manifest.json

Open the folder on GitHubat commit 535dd55

Compare with similar skills

Fsharp next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Fsharp compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Fsharp this skillmanagedcode/dotnet-skills486—~1.9kAutomated safety check: PassMIT
Migrate Dotnet8 To Dotnet9dotnet/skills5.6k2 repos~3.9kAutomated safety check: PassMIT
Dotnet Csharpnovotnyllc/dotnet-artisan233—~1.7kAutomated safety check: PassMIT
Aspire Project V2 MigrationCommunityToolkit/Aspire629—~3.4kAutomated safety check: PassMIT
Dynamo Dotnet JanitorDynamoDS/Dynamo2k—~682Automated safety check: PassApache-2.0
Modern Csharpcodewithmukesh/dotnet-claude-kit7511 repos~1.7kAutomated safety check: PassMIT

Similar skills

  • Official

    Migrate a .NET 8 project to .NET 9 and resolve all breaking changes.

    5.6k GitHub starsUsed in 2 repos~3.9k tokens
    DevelopmentAuto-check passed
  • Dotnet Csharp

    novotnyllc/dotnet-artisan

    Baseline C skill loaded for every .NET code path. An agent skill from novotnyllc/dotnet-artisan.

    233 GitHub stars~1.7k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Aspire Project V2 Migration

    CommunityToolkit/Aspire

    WORKFLOW SKILL - Safely migrates eligible Aspire 13.6+ AppHosts from legacy ProjectResource APIs to experimental DotnetProjectResource APIs after a per-resource assessment and explicit approval of…

    629 GitHub stars~3.4k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Dynamo Dotnet Janitor

    DynamoDS/Dynamo

    Perform janitorial tasks on C/.NET code including cleanup, modernization, and tech debt remediation.

    2k GitHub stars~682 tokensUpdated today
    DevelopmentAuto-check passed
  • Modern Csharp

    codewithmukesh/dotnet-claude-kit

    Modern C language features for .NET 10 and C 14. An agent skill from codewithmukesh/dotnet-claude-kit.

    751 GitHub starsUsed in 1 repo~1.7k tokens
    DevelopmentAuto-check passed
  • Dotnet Cop

    fmflurry/settings-opencode

    Pre-merge code review for .NET 10 pull requests. An agent skill from fmflurry/settings-opencode.

    171 GitHub stars~2k tokensUpdated 2 days ago
    DevelopmentAuto-check passed

More from managedcode/dotnet-skills

All 81 skills in this repo
  • Analyzer Config

    managedcode/dotnet-skills

    Use a repo-root .editorconfig to configure free .NET analyzer and style rules.

    486 GitHub stars~1.3k tokensUpdated today
    Auto-check passed
  • Archunitnet

    managedcode/dotnet-skills

    Use the open-source free ArchUnitNET library for architecture rules in .NET tests.

    486 GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Aspire

    managedcode/dotnet-skills

    Build, upgrade, and operate Aspire 13.5.x C or TypeScript application hosts with the current CLI, AppHost, ServiceDefaults, integrations, dashboard, testing, MCP, and deployment patterns for…

    486 GitHub stars~3.6k tokensUpdated today
    Auto-check passed
  • Aspnet Core

    managedcode/dotnet-skills

    Build, debug, modernize, or review ASP.NET Core applications with correct hosting, middleware, security, configuration, logging, and deployment patterns on current .NET.

    486 GitHub stars~2.1k tokensUpdated today
    Auto-check passed
  • Asynkron Profiler

    managedcode/dotnet-skills

    Use the open-source free Asynkron.Profiler dotnet tool for CLI-first CPU, allocation, exception, contention, and heap profiling of .NET commands or existing trace artifacts.

    486 GitHub stars~1.7k tokensUpdated today
    Auto-check passed
  • Azure Functions

    managedcode/dotnet-skills

    Build, review, or migrate Azure Functions in .NET with correct execution model, isolated worker setup, bindings, DI, and Durable Functions patterns.

    486 GitHub stars~2.6k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Fsharp

What does Fsharp do?

Write, review, or modernize F code in .NET repositories with functional-first design, algebraic data types, pattern matching, pipelines, async workflows, project ordering, and C interop. Fsharp is an agent skill from managedcode/dotnet-skills.NET repositories with functional-first design, algebraic data types, pattern matching, pipelines, async workflows, project ordering, and C interop.

When should I use Fsharp?

Fsharp fits situations like: : F .fs/.fsproj code; discriminated unions; pattern matching; computation expressions.

How do I install Fsharp in Claude Code?

Run `npx skills add managedcode/dotnet-skills --skill fsharp -a claude-code`. Or copy the skill folder (catalog/Tools/FSharp/skills/fsharp in managedcode/dotnet-skills) into .claude/skills/fsharp in your project. Claude Code loads it when a task matches its description.

How do I install Fsharp in Codex?

Run `npx skills add managedcode/dotnet-skills --skill fsharp -a codex`. Or copy the skill folder (catalog/Tools/FSharp/skills/fsharp in managedcode/dotnet-skills) into .agents/skills/fsharp in your project. Codex loads it when a task matches its description.

Can I use Fsharp in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add managedcode/dotnet-skills --skill fsharp -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/fsharp, .gemini/skills/fsharp, .github/skills/fsharp and .opencode/skills/fsharp in your project.

What does Fsharp need to run?

Going by SKILL.md and its folder, Fsharp needs the command-line tools its instructions call (dotnet). Compatibility (from SKILL.md): Requires a .NET SDK with F# support and an F# project, script, or interop boundary..

Does Fsharp access the network?

SKILL.md names 1 domain. As links in the text: learn.microsoft.com. This is read from the text; nothing was executed.

Is Fsharp safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Fsharp use?

Fsharp is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Fsharp use?

About 1.9k tokens (SKILL.md is roughly 7.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Fsharp?

Skills that share tags, products or a category with Fsharp: Migrate Dotnet8 To Dotnet9 (dotnet/skills, 5.6k stars), Dotnet Csharp (novotnyllc/dotnet-artisan, 233 stars), Aspire Project V2 Migration (CommunityToolkit/Aspire, 629 stars) and Dynamo Dotnet Janitor (DynamoDS/Dynamo, 2k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Fsharp?

managedcode (a GitHub organization) maintains it in managedcode/dotnet-skills, which has 486 GitHub stars. The repository holds 81 skills in this directory. The repository was last updated on October 7, 2026.

Source: managedcode/dotnet-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.