swe-programming-fsharp
F# coding standards from authoritative docs/explanation/software-engineering/programming-languages/f-sharp/ documentation
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
F# coding standards from authoritative docs/explanation/software-engineering/programming-languages/f-sharp/ documentation
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
UI development skill covering design token usage, shadcn/ui + Radix composition patterns, accessibility requirements, anti-patterns catalog, and brand context for OrganicLever and OSE Platform. Auto-loads when working on TSX components, CSS, or UI design tasks.
C# coding standards from authoritative docs/explanation/software-engineering/programming-languages/c-sharp/ documentation
Go coding standards quick reference for agents authoring Go code (primarily for downstream ose-primer; ose-public itself has no active Go apps)
Rust coding standards from authoritative docs/explanation/software-engineering/programming-languages/rust/ documentation
Comprehensive guide for creating by-example tutorials - code-first learning path with 75-85 heavily annotated examples achieving 95% language coverage. Covers five-part example structure, annotation density standards (1.0-2.25 comments per code line PER EXAMPLE), self-containment rules, and multiple code blocks for comparisons. Essential for creating by-example tutorials for programming languages on educational platforms
Comprehensive guide for creating in-the-field production implementation guides - production-ready code with 20-40 guides following standard library first principle, framework integration, and enterprise patterns. Essential for creating production tutorials for programming languages on educational platforms
| name | swe-programming-fsharp |
| description | F# coding standards from authoritative docs/explanation/software-engineering/programming-languages/f-sharp/ documentation |
Progressive disclosure of F# coding standards for agents writing F# code.
Authoritative Source: docs/explanation/software-engineering/programming-languages/f-sharp/README.md
Usage: Auto-loaded for agents when writing F# code. Provides quick reference to idioms, best practices, and antipatterns.
IMPORTANT: This skill provides OSE Platform-specific style guides, not educational tutorials.
You MUST understand F# fundamentals before using these standards. Complete the AyoKoding F# learning path first:
What this skill covers: OSE Platform naming conventions, framework choices, repository-specific patterns, how to apply F# knowledge in THIS codebase.
What this skill does NOT cover: F# syntax, language fundamentals, generic patterns (those are in ayokoding-web).
See: Programming Language Documentation Separation for content separation rules.
Modules/Types/DUs: PascalCase - ZakatCalculator, MurabahaContract, PaymentResult
Functions/Values: camelCase - calculateZakat, totalAmount, validateContract
DU Cases: PascalCase - Due, BelowNisab, ValidationError
Predicate functions: isValid, hasPayments (boolean-returning functions prefixed with is/has)
// CORRECT: DU for domain states (exhaustive)
type ZakatResult =
| Due of amount: decimal
| BelowNisab
| ValidationError of message: string
// CORRECT: Exhaustive pattern matching (compiler enforced)
let handleResult result =
match result with
| Due amount -> sprintf "Zakat due: %M" amount
| BelowNisab -> "Below nisab threshold"
| ValidationError msg -> sprintf "Error: %s" msg
// CORRECT: Result type for error handling
let calculateZakat (wealth: decimal) (nisab: decimal) : Result<decimal, string> =
if wealth < 0m then
Error "Wealth cannot be negative"
elif wealth >= nisab then
Ok (wealth * 0.025m)
else
Ok 0m
// CORRECT: Computation expression for chaining
let processPayment (wealth: decimal) (nisab: decimal) =
result {
let! zakatAmount = calculateZakat wealth nisab
let! validated = validateAmount zakatAmount
return! saveZakat validated
}
// CORRECT: Use |> for readable pipelines
let totalZakat =
wealthAmounts
|> List.filter (fun w -> w >= nisabThreshold)
|> List.map (fun w -> w * 0.025m)
|> List.sum
// CORRECT: Function composition with >>
let calculateAndValidate = calculateZakat >> validateZakat
// CORRECT: Record type for value objects
type ZakatCalculation = {
Wealth: decimal
Nisab: decimal
Amount: decimal
CalculationDate: DateOnly
}
// CORRECT: Record copy expression (non-destructive update)
let updated = { calculation with Amount = newAmount }
// CORRECT: F# async computation expression
let calculateAsync wealth nisab = async {
let! nisabValue = repository.GetNisabAsync()
let result = calculateZakat wealth nisabValue
return result
}
// CORRECT: Running async
let result = calculateAsync 10000m 5000m |> Async.RunSynchronously
// CORRECT: Task interop
let taskAsync = calculateAsync 10000m 5000m |> Async.StartAsTask
// CORRECT: Fantomas-formatted code
let calculate (wealth: decimal) (nisab: decimal) =
if wealth >= nisab then
wealth * 0.025m
else
0m
// Run: dotnet fantomas . (formats all F# files)
// Pre-commit: fantomas --check . (fails if not formatted)
open Expecto
let zakatTests =
testList "ZakatCalculator" [
test "calculates 2.5% when above nisab" {
let result = calculateZakat 10000m 5000m
Expect.equal result (Ok 250m) "Should return 2.5% of wealth"
}
test "returns 0 when below nisab" {
let result = calculateZakat 1000m 5000m
Expect.equal result (Ok 0m) "Should return 0 below nisab"
}
]
[<EntryPoint>]
let main args = runTestsWithCLIArgs [] args zakatTests
open FsCheck
let zakatProperties =
testList "ZakatCalculator properties" [
testProperty "zakat is always non-negative" <| fun (wealth: decimal) ->
let nisab = 5000m
match calculateZakat (abs wealth) nisab with
| Ok amount -> amount >= 0m
| Error _ -> true
testProperty "zakat is exactly 2.5% when above nisab" <| fun (wealth: decimal) ->
wealth > 5000m ==>
(calculateZakat wealth 5000m = Ok (wealth * 0.025m))
]
Authoritative Index: docs/explanation/software-engineering/programming-languages/f-sharp/README.md