Imported from goswinr/Euclid.Kontur (
AGENTS.md). Install upstream withnpx skills add goswinr/Euclid.Kontur. Copyright stays with the author.
Notes for coding agents
Euclid.Kontur is an F# library. It targets .NET (net6.0 and net472) and also compiles to
JavaScript and TypeScript with Fable, so everything has to stay Fable compatible.
Read DESIGN.md first: it holds the reviewed design, the pipeline and the reasons behind every decision.
Conventions
- Follow the coding standards of the Euclid repository: PascalCase types and members, camelCase functions,
4 spaces, XML docstrings on every public member, errors through
Euclid.EuclidErrors.fail. - Hot paths use raw
float[]andint[]with a separate count, neverResizeArray, tuples or struct records. Fable compiles raw numeric arrays to typed arrays. - Index those arrays with
Arr.get arr iandArr.set arr i vfromSrc/Arr.fs, never witharr.[i]. Fable compilesarr.[i]into a bounds checked library call that dominated the profile under Node, see DESIGN.md section 6.ResizeArrayindexing outside the hot paths keeps the plain indexer. - No
int64,BigInteger,Span,stackalloc,ArrayPoolorArray.Sort(keys, items). They are not available on Fable . - Visitor callbacks are
inlinemembers with[<InlineIfLambda>]parameters. State a visitor needs lives in fields, not in capturedlet mutablelocals. - Tests use Scriptorium (Quill for the DSL, Nib for the assertions) and run unchanged on .NET and on Node:
dotnet run --project ./Test/Test.fsprojcd Test && npm install && npm test
Cloud sessions
In cloud containers the .NET SDK is not preinstalled. .claude/hooks/session-start.sh installs it
asynchronously, so dotnet may not be on PATH in the first minute. Wait and retry.
CHANGELOG.md must not use wrapped bullets
Src/Euclid.Kontur.fsproj derives the package version from CHANGELOG.md with Ionide.KeepAChangelog.Tasks 0.3.3.
Its parser throws on a bullet that wraps onto an indented continuation line, and that failure aborts the
whole build. Keep one bullet on one line, however long, and use nested - sub-bullets for structure.