Fp Types Ref
sickn33/agentic-awesome-skills
Quick reference for fp-ts types. An agent skill from sickn33/agentic-awesome-skills.
Replace Func< and Action< with custom delegate types when any parameter or return type is a ref struct (Span<T, ReadOnlySpan<T, etc.).
$ npx skills add corvus-dotnet/Corvus.JsonSchema --skill ref-struct-delegates -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install corvus-dotnet/Corvus.JsonSchema ref-struct-delegates --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/corvus-dotnet/Corvus.JsonSchema.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.github/skills/ref-struct-delegates .claude/skills/ref-struct-delegates && rm -rf skills-srcUse ~/.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/
Install the "ref-struct-delegates" agent skill from https://github.com/corvus-dotnet/Corvus.JsonSchema/tree/main/.github/skills/ref-struct-delegates into .claude/skills/ref-struct-delegates/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "ref-struct-delegates", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/corvus-dotnet/Corvus.JsonSchema/tree/main/.github/skills/ref-struct-delegatesType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add corvus-dotnet/Corvus.JsonSchema --skill ref-struct-delegates -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install corvus-dotnet/Corvus.JsonSchema ref-struct-delegates --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/corvus-dotnet/Corvus.JsonSchema.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.github/skills/ref-struct-delegates .agents/skills/ref-struct-delegates && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "ref-struct-delegates" agent skill from https://github.com/corvus-dotnet/Corvus.JsonSchema/tree/main/.github/skills/ref-struct-delegates into .agents/skills/ref-struct-delegates/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "ref-struct-delegates", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add corvus-dotnet/Corvus.JsonSchema --skill ref-struct-delegates -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install corvus-dotnet/Corvus.JsonSchema ref-struct-delegates --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/corvus-dotnet/Corvus.JsonSchema.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.github/skills/ref-struct-delegates .cursor/skills/ref-struct-delegates && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "ref-struct-delegates" agent skill from https://github.com/corvus-dotnet/Corvus.JsonSchema/tree/main/.github/skills/ref-struct-delegates into .cursor/skills/ref-struct-delegates/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "ref-struct-delegates", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/corvus-dotnet/Corvus.JsonSchema.git --path .github/skills/ref-struct-delegates--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add corvus-dotnet/Corvus.JsonSchema --skill ref-struct-delegates -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install corvus-dotnet/Corvus.JsonSchema ref-struct-delegates --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/corvus-dotnet/Corvus.JsonSchema.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.github/skills/ref-struct-delegates .gemini/skills/ref-struct-delegates && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "ref-struct-delegates" agent skill from https://github.com/corvus-dotnet/Corvus.JsonSchema/tree/main/.github/skills/ref-struct-delegates into .gemini/skills/ref-struct-delegates/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "ref-struct-delegates", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install corvus-dotnet/Corvus.JsonSchema ref-struct-delegatesInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add corvus-dotnet/Corvus.JsonSchema --skill ref-struct-delegates -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/corvus-dotnet/Corvus.JsonSchema.git skills-src && mkdir -p .github/skills && cp -r skills-src/.github/skills/ref-struct-delegates .github/skills/ref-struct-delegates && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "ref-struct-delegates" agent skill from https://github.com/corvus-dotnet/Corvus.JsonSchema/tree/main/.github/skills/ref-struct-delegates into .github/skills/ref-struct-delegates/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "ref-struct-delegates", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add corvus-dotnet/Corvus.JsonSchema --skill ref-struct-delegates -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install corvus-dotnet/Corvus.JsonSchema ref-struct-delegates --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/corvus-dotnet/Corvus.JsonSchema.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.github/skills/ref-struct-delegates .opencode/skills/ref-struct-delegates && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "ref-struct-delegates" agent skill from https://github.com/corvus-dotnet/Corvus.JsonSchema/tree/main/.github/skills/ref-struct-delegates into .opencode/skills/ref-struct-delegates/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "ref-struct-delegates", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
ref-struct-delegatesReplace Func< and Action< with custom delegate types when any parameter or return type is a ref struct (Span<T, ReadOnlySpan<T, etc.).
Ref Struct Delegates is an agent skill from corvus-dotnet/Corvus.JsonSchema. Replace Func< and Action< with custom delegate types when any parameter or return type is a ref struct (Span<T, ReadOnlySpan<T, etc.). Ref structs cannot appear as generic type arguments, so Func<ReadOnlySpan<byte, bool is a compile error. The fix is a named delegate. USE FOR: writing public APIs that accept callbacks involving spans, storing span-accepting lambdas in fields, wrapping IJsonPathFunction or similar interfaces with delegate-based factories. DO NOT USE FOR: APIs where all parameters are regular…
Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
The repository describes itself as: Support for Json Schema validation and entity generation. The licence is Apache-2.0.
3 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit b9e3040. It shows what the files ask for, not the result of running them.
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.
No scripts in the folder and no shell commands in SKILL.md (its code samples are csharp).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Ref Struct Delegates loads about 1.3k tokens when it runs. Until then it costs about 150 tokens; SKILL.md has 294 words of instructions outside code blocks.
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.
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.
The full file from corvus-dotnet/Corvus.JsonSchema at commit b9e3040, republished under its Apache-2.0 licence (© corvus-dotnet). 294 words, ~1,302 tokens.
.claude/skills/ref-struct-delegates/SKILL.md (or your agent's skills folder).Func<>, Action<>, and Predicate<> are generic types. C# forbids ref structs
(Span<T>, ReadOnlySpan<T>, ReadOnlyMemory<T>.Span, etc.) as generic type
arguments. This means:
// ❌ COMPILE ERROR — ReadOnlySpan<T> is a ref struct
Func<ReadOnlySpan<byte>, bool> predicate;
Action<Span<char>> writer;
Func<ReadOnlySpan<JsonPathFunctionArgument>, JsonWorkspace, JsonPathFunctionResult> evaluator;Define a named delegate type with the ref struct parameter directly:
// ✅ COMPILES — named delegates can have ref struct parameters
public delegate bool SpanPredicate(ReadOnlySpan<byte> data);
public delegate void SpanWriter(Span<char> buffer);
public delegate JsonPathFunctionResult JsonPathFunctionEvaluator(
ReadOnlySpan<JsonPathFunctionArgument> arguments,
JsonWorkspace workspace);Find every Func<> or Action<> where any type argument is a ref struct.
| Original (broken) | Replacement |
|---|---|
Func<ReadOnlySpan<T>, TResult> | delegate TResult MyDelegate(ReadOnlySpan<T> items); |
Func<ReadOnlySpan<T>, TOther, TResult> | delegate TResult MyDelegate(ReadOnlySpan<T> items, TOther other); |
Action<Span<T>> | delegate void MyDelegate(Span<T> buffer); |
Predicate<ReadOnlySpan<T>> | delegate bool MyDelegate(ReadOnlySpan<T> items); |
Fields, parameters, locals, and lambda assignments all change from the Func<>/Action<> type to the named delegate. Lambda syntax remains identical — only the declared type changes:
// Before (broken):
Func<ReadOnlySpan<byte>, int, bool> check = (span, len) => span.Length >= len;
// After (works):
public delegate bool SpanCheck(ReadOnlySpan<byte> span, int minLength);
SpanCheck check = (span, len) => span.Length >= len;When building factory methods that wrap lambdas into an interface (e.g. IJsonPathFunction),
split the API into two tiers:
Func<> with non-ref-struct projections of the data
(e.g. copy ReadOnlySpan<T> to T[] before passing to the delegate):// Nodes are copied to an array so Func<> works
public static IJsonPathFunction NodesValue(
Func<JsonElement[], JsonWorkspace, JsonElement> func)
=> new DelegateFunction(
JsonPathFunctionType.ValueType,
[JsonPathFunctionType.NodesType],
(args, ws) => JsonPathFunctionResult.FromValue(
func(args[0].Nodes.ToArray(), ws)));public delegate JsonPathFunctionResult JsonPathFunctionEvaluator(
ReadOnlySpan<JsonPathFunctionArgument> arguments,
JsonWorkspace workspace);
public static IJsonPathFunction Create(
JsonPathFunctionType returnType,
JsonPathFunctionType[] parameterTypes,
JsonPathFunctionEvaluator evaluate)
=> new DelegateFunction(returnType, parameterTypes, evaluate);This gives callers a choice: simple lambda with a small allocation (Func<T[], ...>)
or zero-allocation with the named delegate.
Named delegates are regular reference types and can be stored in fields, unlike the ref structs they accept:
private sealed class DelegateFunction : IJsonPathFunction
{
private readonly JsonPathFunctionEvaluator evaluate; // ✅ field storage works
public DelegateFunction(JsonPathFunctionEvaluator evaluate)
{
this.evaluate = evaluate;
}
public JsonPathFunctionResult Evaluate(
ReadOnlySpan<JsonPathFunctionArgument> arguments,
JsonWorkspace workspace)
=> this.evaluate(arguments, workspace);
}Name the delegate after its purpose, not its shape. Good names describe what the callback does:
| ✅ Good | ❌ Bad |
|---|---|
JsonPathFunctionEvaluator | SpanFuncDelegate |
SpanPredicate | ReadOnlySpanBoolFunc |
BufferWriter | SpanAction |
This applies to all ref struct types, not just spans:
Span<T>, ReadOnlySpan<T>ref struct types in the codebaseref struct added by .NETcorvus-buffer-and-poolingcorvus-low-alloc-data-structures© corvus-dotnet, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in .github/skills/ref-struct-delegates of corvus-dotnet/Corvus.JsonSchema.
Open the folder on GitHubat commit b9e3040
Ref Struct Delegates 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.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Ref Struct Delegates this skillcorvus-dotnet/Corvus.JsonSchema | 199 | — | ~1.3k | Automated safety check: Pass | Apache-2.0 | |
| Fp Types Refsickn33/agentic-awesome-skills | 47k | 2 repos | ~583 | Automated safety check: Pass | MIT | |
| Rust Path Typesopeninterpreter/openinterpreter | 69k | 2 repos | ~605 | Automated safety check: Pass | Apache-2.0 | |
| Python Type Safetywshobson/agents | 40k | — | ~1.4k | Automated safety check: Pass | MIT | |
| ActionsJetBrains/intellij-community | 21k | — | ~341 | Automated safety check: Pass | Custom licence | |
| Pyrefly Type Coveragepytorch/pytorch | 104k | — | ~3k | Automated safety check: Pass | Custom licence |
sickn33/agentic-awesome-skills
Quick reference for fp-ts types. An agent skill from sickn33/agentic-awesome-skills.
openinterpreter/openinterpreter
Rules for choosing Rust types for filesystem paths in new Codex code, covering protocol types, internal use and model tool arguments.
wshobson/agents
Python type safety with type hints, generics, protocols, and strict type checking.
JetBrains/intellij-community
Implement or change IntelliJ AnAction actions and registrations.
pytorch/pytorch
Migrate a file to use stricter Pyrefly type checking with annotations required for all functions, classes, and attributes.
coollabsio/coolify
Build, refactor, and troubleshoot Laravel Actions using lorisleiva/laravel-actions.
corvus-dotnet/Corvus.JsonSchema
Understand and work with the Roslyn analyzers shipped with Corvus.Text.Json.
corvus-dotnet/Corvus.JsonSchema
Run, interpret, and maintain BenchmarkDotNet benchmarks for JSON Schema validation and query languages.
corvus-dotnet/Corvus.JsonSchema
Test Corvus.JsonSchema against the JSON Schema Test Suite using Bowtie, the cross-implementation meta-validator.
corvus-dotnet/Corvus.JsonSchema
Write allocation-efficient buffer code in Corvus.JsonSchema using the codebase's established three-tier pooling pattern: stackalloc → ArrayPool → ThreadStatic caches.
corvus-dotnet/Corvus.JsonSchema
Eliminate hand-rolled POCO record<-document string seams — types/paths that materialize a managed string (or List<string/Dictionary) between a bytes SOURCE (a parsed UTF-8 body, a DB column, a…
corvus-dotnet/Corvus.JsonSchema
Generate strongly-typed C from JSON Schema using the Roslyn source generator or the corvusjson CLI tool.
Replace Func< and Action< with custom delegate types when any parameter or return type is a ref struct (Span<T, ReadOnlySpan<T, etc.). JsonSchema.).
Ref Struct Delegates fits situations like: : writing public APIs that accept callbacks involving spans; storing span-accepting lambdas in fields; wrapping IJsonPathFunction; similar interfaces with delegate-based factories.
Run `npx skills add corvus-dotnet/Corvus.JsonSchema --skill ref-struct-delegates -a claude-code`. Or copy the skill folder (.github/skills/ref-struct-delegates in corvus-dotnet/Corvus.JsonSchema) into .claude/skills/ref-struct-delegates in your project. Claude Code loads it when a task matches its description.
Run `npx skills add corvus-dotnet/Corvus.JsonSchema --skill ref-struct-delegates -a codex`. Or copy the skill folder (.github/skills/ref-struct-delegates in corvus-dotnet/Corvus.JsonSchema) into .agents/skills/ref-struct-delegates in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add corvus-dotnet/Corvus.JsonSchema --skill ref-struct-delegates -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/ref-struct-delegates, .gemini/skills/ref-struct-delegates, .github/skills/ref-struct-delegates and .opencode/skills/ref-struct-delegates in your project.
SKILL.md names no scripts, command-line tools or credentials: Ref Struct Delegates is instructions for the agent only.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
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.
Ref Struct Delegates is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.3k tokens (SKILL.md is roughly 5.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Ref Struct Delegates: Fp Types Ref (sickn33/agentic-awesome-skills, 47k stars), Rust Path Types (openinterpreter/openinterpreter, 69k stars), Python Type Safety (wshobson/agents, 40k stars) and Actions (JetBrains/intellij-community, 21k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
corvus-dotnet (a GitHub organization) maintains it in corvus-dotnet/Corvus.JsonSchema, which has 199 GitHub stars. The repository holds 26 skills in this directory. The repository was last updated on October 8, 2026.
Source: corvus-dotnet/Corvus.JsonSchema on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.