Agent skill

Corvus Codegen

by corvus-dotnet in corvus-dotnet/Corvus.JsonSchema

Generate strongly-typed C from JSON Schema using the Roslyn source generator or the corvusjson CLI tool.

Apache-2.0Auto-check passedDevelopment

Install Corvus Codegen

skills CLI
$ npx skills add corvus-dotnet/Corvus.JsonSchema --skill corvus-codegen -a claude-code

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

GitHub CLI
$ gh skill install corvus-dotnet/Corvus.JsonSchema corvus-codegen --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/corvus-dotnet/Corvus.JsonSchema.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.github/skills/corvus-codegen .claude/skills/corvus-codegen && 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
corvus-codegen
GitHub stars
199
Token cost
~2.1k tokens
SKILL.md length
688 words
Files
1
Skills in repo
25
Repo updated
First seen
Licence
Apache-2.0

At a glance

Generate strongly-typed C from JSON Schema using the Roslyn source generator or the corvusjson CLI tool.

  • Works in 2 steps: Roslyn Source Generator (build-time) → CLI Tool (corvusjson)
  • : generating types from schemas
  • SKILL.md covers Two Code Generation Mechanisms, MSBuild Properties, Naming Heuristics and Config File, plus 4 more sections
  • Calls dotnet

What it does

Corvus Codegen is an agent skill from corvus-dotnet/Corvus.JsonSchema. Generate strongly-typed C from JSON Schema using the Roslyn source generator or the corvusjson CLI tool. Covers the JsonSchemaTypeGenerator attribute, CLI options, naming heuristics, AdditionalFiles registration, config file format, MSBuild properties, and troubleshooting generated output. USE FOR: generating types from schemas, configuring the source generator or CLI tool, understanding naming heuristics, inspecting generated output, troubleshooting generation issues. DO NOT USE FOR: modifying the generator…

Its SKILL.md is about 2.1k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Project scaffolding. It works with C#. The repository describes itself as: Support for Json Schema validation and entity generation. The licence is Apache-2.0.

When your agent uses it

  • : generating types from schemas
  • Configuring the source generator
  • Understanding naming heuristics
  • Inspecting generated output

Example prompts

  • “/corvus-codegen”

Workflow steps

2 steps, taken from the step headings in SKILL.md.

  1. Roslyn Source Generator (build-time)
  2. CLI Tool (corvusjson)

What it can do on your machine

Read from SKILL.md and the folder at commit 51cc725. 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

    No URLs in SKILL.md.

    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.

Context cost

Corvus Codegen loads about 2.1k tokens when it runs. Until then it costs about 155 tokens; SKILL.md has 688 words of instructions outside code blocks.

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

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 corvus-dotnet/Corvus.JsonSchema at commit 51cc725, republished under its Apache-2.0 licence (© corvus-dotnet). 688 words, ~2,078 tokens.

Download SKILL.mdSave it as .claude/skills/corvus-codegen/SKILL.md (or your agent's skills folder).
name
corvus-codegen
description
Generate strongly-typed C# from JSON Schema using the Roslyn source generator or the corvusjson CLI tool. Covers the JsonSchemaTypeGenerator attribute, CLI options, naming heuristics, AdditionalFiles registration, config file format, MSBuild properties, and troubleshooting generated output. USE FOR: generating types from schemas, configuring the source generator or CLI tool, understanding naming heuristics, inspecting generated output, troubleshooting generation issues. DO NOT USE FOR: modifying the generator internals (use corvus-keywords-and-validation), running benchmarks (use corvus-benchmarks).

Code Generation from JSON Schema

Two Code Generation Mechanisms

1. Roslyn Source Generator (build-time)

Add the source generator NuGet package and annotate a partial struct:

csharp
[JsonSchemaTypeGenerator("Schemas/person.json")]
public readonly partial struct Person;

Attribute (defined in IncrementalSourceGenerator.cs):

  • Constructor: JsonSchemaTypeGeneratorAttribute(string location, bool rebaseToRootPath = false)
  • Property: EmitEvaluator (bool) — also emit a standalone schema evaluator
  • Must be applied to a partial struct (not class)

All referenced schema files must be registered as <AdditionalFiles>:

xml
<ItemGroup>
  <AdditionalFiles Include="Schemas\**\*.json" />
</ItemGroup>
2. CLI Tool (corvusjson)
powershell
# Install the CLI tool
dotnet tool install --global Corvus.Json.Cli

# Generate types
corvusjson jsonschema <schema-path> `
  --rootNamespace MyApp.Models `
  --outputRootTypeName PersonSchema `
  --outputPath Generated/ `
  --engine V5

The command is corvusjson jsonschema (registered in CliAppFactory.cs).

Key CLI options (defined in src/Corvus.Json.Cli.Core/GenerateCommand.cs):

  • --rootNamespace — C# namespace for generated types
  • --outputRootTypeName — name of the root generated type
  • --outputPath — output directory
  • --engine — V4 or V5 (default: V5 for corvusjson, V4 for legacy generatejsonschematypes)
  • --assertFormat — whether format validation asserts globally (default: true). Takes a value: --assertFormat false gives annotation-only output where the vocabulary treats format as an annotation (e.g. 2020-12)
  • --formatMode — format assertion mode overrides as comma-separated entries (mode ∈ assert/disable/warning). format=mode targets one format (e.g. date-time=disable,time=warning); a bare mode (equivalently *=mode) sets the default for all formats across every draft — --formatMode disable is the way to get annotation-only output for draft-04/06/07 (whose vocabulary asserts format, so --assertFormat false alone doesn't). Repeatable; a per-format override beats the * default, --assertFormat, and the vocabulary. warning (string formats only) validates but always succeeds, emitting a WARNING annotation on mismatch
  • --codeGenerationMode — TypeGeneration, SchemaEvaluationOnly, or Both
  • --nativeEnums — native C# enum emission (V5 engine only, default All): StringEnums emits a nested KnownValues enum for pure string-enum schemas; FlagsObjects emits a nested [Flags] enum for objects whose declared properties are all boolean; All emits both; None emits neither

IMPORTANT: Never invent option names. Verify against GenerateCommand.cs.

Legacy CLI

The generatejsonschematypes command (package: Corvus.Json.CodeGenerator) still works as a shim but defaults to the V4 engine.

MSBuild Properties

All read from the source generator (IncrementalSourceGenerator.cs lines 111-196):

PropertyEffectDefault
CorvusTextJsonFallbackVocabularyDefault vocabulary for schemas without $schemaDraft202012
CorvusTextJsonOptionalAsNullableSet to NullOrUndefined to treat optional as nullableoff
CorvusTextJsonAddExplicitUsingsAdd explicit using directivestrue
CorvusTextJsonUseImplicitOperatorStringGenerate implicit string conversion operatorstrue
CorvusTextJsonUseOptionalNameHeuristicsEnable optional naming heuristicstrue
CorvusTextJsonNativeEnumsNative C# enum emission: None, StringEnums, FlagsObjects, AllAll
CorvusTextJsonAlwaysAssertFormatAssert format validationtrue
CorvusTextJsonFormatModePer-format mode overrides as ;/,-separated format=mode pairs (assert/disable/warning)—
CorvusTextJsonDefaultAccessibilityPublic or InternalPublic
CorvusTextJsonDisabledNamingHeuristicsSemicolon-separated list of heuristics to disable—
EmitCompilerGeneratedFilesWrite generated .g.cs to obj/ for inspectionfalse
CorvusTextJsonSuppressAnalyzerDiagnosticsInGeneratedCodePackage build asset: analyzer diagnostics in the generator's output are not reported (compiler diagnostics unaffected; analyzers still execute)true
Show full SKILL.md (292 more words)Show less

Naming Heuristics

The generator uses 15 heuristics (priorities 1–11000) to derive C# type names from JSON Schema. Key ones:

  1. title — uses the schema's title keyword
  2. $anchor / $id — uses the fragment or filename
  3. Property name — derives from the parent property name
  4. $ref path — derives from the $ref URI path/fragment

Collisions are resolved by appending a type-kind suffix: Object, Array, String, Number, Boolean.

Optional heuristics can be disabled via CorvusTextJsonDisabledNamingHeuristics.

Config File

For complex generation scenarios, use a config file (corvusjson config):

json
{
  "typesToGenerate": [
    {
      "schemaFile": "schemas/main.json",
      "rootTypeName": "MainType"
    }
  ],
  "additionalFiles": [
    { "canonicalUri": "https://example.com/shared.json", "contentPath": "schemas/shared.json" }
  ],
  "namedTypes": [
    { "reference": "#/definitions/Foo", "dotnetTypeName": "FooType", "dotnetNamespace": "MyApp.Sub" }
  ],
  "namespaces": {
    "https://example.com/schemas/": "MyApp.ExternalModels"
  }
}

Inspecting Generated Output

powershell
# Enable generated file emission in the .csproj
<PropertyGroup>
  <EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
</PropertyGroup>

# After building, find generated files at:
# obj\{Config}\{TFM}\generated\Corvus.Text.Json.SourceGenerator\

Common Pitfalls

  • Missing <AdditionalFiles>: Referenced schemas not in <AdditionalFiles> are invisible to the source generator.
  • Stale generated files: After schema changes, clean and rebuild. Old generated files may cause compilation errors.
  • No glob <Compile> items: This repo requires every .cs file to be explicitly listed in the .csproj. CLI-generated output directories need corresponding <Compile Include="..." /> entries.

Analyzers and generated code

  • Analyzers that opt out of generated code never run on the generator's trees (they end in .g.cs and start with // <auto-generated/>). The few that opt in (CA2252, CA1418, CA1420, CA1421, RS rules) are configured away in this repository by analyzers/generated-code.globalconfig plus the generated region of .editorconfig; see the corvus-build-and-test skill and update-generated-code-analyzer-config.ps1.
  • The source generator package ships build/Corvus.Text.Json.SourceGenerator.targets and Corvus.Text.Json.SourceGenerator.GeneratedCode.editorconfig: the targets copy the config next to the consumer's generator output paths and pass it as an EditorConfigFiles item, hiding analyzer diagnostics there (reporting only, never execution, never compiler diagnostics). Opt out with CorvusTextJsonSuppressAnalyzerDiagnosticsInGeneratedCode=false. In-repository consumers reference the generator by project, so they do not receive it.
  • Consumer-facing documentation: docs/SourceGenerator.md (section "Analyzers and generated code") and docs/CodeGenerator.md ("Analyzers and the generated folder").

Cross-References

  • For the keyword/vocabulary system that drives generation, see corvus-keywords-and-validation
  • For evaluator-only generation, see corvus-standalone-evaluator
  • For building and testing generated code, see corvus-build-and-test

© 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

Files

Just SKILL.md in .github/skills/corvus-codegen of corvus-dotnet/Corvus.JsonSchema.

Open the folder on GitHubat commit 51cc725

Compare with similar skills

Corvus Codegen 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.

Corvus Codegen compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Corvus Codegen this skillcorvus-dotnet/Corvus.JsonSchema199—~2.1kAutomated safety check: PassApache-2.0
Dynamo Webview Component ScaffoldDynamoDS/Dynamo2k—~991Automated safety check: PassApache-2.0
Template Discoverydotnet/skills5.6k1 repos~3.1kAutomated safety check: PassMIT
Core API Changelibnativeapi/nativeapi157—~2.5kAutomated safety check: PassMIT
Scaffoldingdotnet/efcore15k—~165Automated safety check: PassMIT
API Breaking Change Detectorgithub/awesome-copilot40k—~1.7kAutomated safety check: PassMIT

Similar skills

  • Scaffolds a new Dynamo package repo that hosts a view extension with a WebView2-embedded React frontend.

    2k GitHub stars~991 tokensUpdated today
    DevelopmentAuto-check passed
  • Template Discovery

    dotnet/skills

    Official

    Helps find, inspect, and compare (at a high level) .NET project templates.

    5.6k GitHub starsUsed in 1 repo~3.1k tokens
    DevelopmentAuto-check passed
  • Core API Change

    libnativeapi/nativeapi

    Carry a change to the C++ public API in core/ all the way downstream — design check, header edit, six platform implementations, C ABI + Rust/Dart/C/JS/Python regeneration, per-binding verification…

    157 GitHub stars~2.5k tokensUpdated today
    MobileAuto-check passed
  • Scaffolding

    dotnet/efcore

    Official

    Implementation details for EF Core scaffolding (reverse engineering).

    15k GitHub stars~165 tokensUpdated yesterday
    SecurityAuto-check passed
  • API Breaking Change Detector

    github/awesome-copilot

    Official

    Cross-references C Web API controllers/DTOs against their TypeScript/JavaScript consumers (React, Angular, Vue, Svelte, Node.js, or hand-written/auto-generated HTTP clients like Fetch, Axios, NSwag)…

    40k GitHub stars~1.7k tokensUpdated today
    Backend & APIsAuto-check passed
  • Nx Generate

    nomcopter/react-mosaic

    Generate code using nx generators. An agent skill from nomcopter/react-mosaic.

    4.8k GitHub starsUsed in 6 repos~1.9k tokens
    DevelopmentAuto-check passed

More from corvus-dotnet/Corvus.JsonSchema

All 25 skills in this repo
  • Corvus Analyzers

    corvus-dotnet/Corvus.JsonSchema

    Understand and work with the Roslyn analyzers shipped with Corvus.Text.Json.

    199 GitHub stars~876 tokensUpdated today
    Auto-check passed
  • Corvus Benchmarks

    corvus-dotnet/Corvus.JsonSchema

    Run, interpret, and maintain BenchmarkDotNet benchmarks for JSON Schema validation and query languages.

    199 GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Corvus Bowtie Testing

    corvus-dotnet/Corvus.JsonSchema

    Test Corvus.JsonSchema against the JSON Schema Test Suite using Bowtie, the cross-implementation meta-validator.

    199 GitHub stars~1.4k tokensUpdated today
    Auto-check passed
  • Corvus Buffer And Pooling

    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.

    199 GitHub stars~2.9k tokensUpdated today
    Auto-check passed
  • Corvus Bytes To Bytes

    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…

    199 GitHub stars~3k tokensUpdated today
    Auto-check passed
  • Corvus Ctj Handler Implementation

    corvus-dotnet/Corvus.JsonSchema

    Implement OpenAPI server handlers using Corvus.Text.Json generated types.

    199 GitHub stars~4.4k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Corvus Codegen

What does Corvus Codegen do?

Generate strongly-typed C from JSON Schema using the Roslyn source generator or the corvusjson CLI tool. JsonSchema. Generate strongly-typed C from JSON Schema using the Roslyn source generator or the corvusjson CLI tool.

When should I use Corvus Codegen?

Corvus Codegen fits situations like: : generating types from schemas; configuring the source generator; understanding naming heuristics; inspecting generated output.

How do I install Corvus Codegen in Claude Code?

Run `npx skills add corvus-dotnet/Corvus.JsonSchema --skill corvus-codegen -a claude-code`. Or copy the skill folder (.github/skills/corvus-codegen in corvus-dotnet/Corvus.JsonSchema) into .claude/skills/corvus-codegen in your project. Claude Code loads it when a task matches its description.

How do I install Corvus Codegen in Codex?

Run `npx skills add corvus-dotnet/Corvus.JsonSchema --skill corvus-codegen -a codex`. Or copy the skill folder (.github/skills/corvus-codegen in corvus-dotnet/Corvus.JsonSchema) into .agents/skills/corvus-codegen in your project. Codex loads it when a task matches its description.

Can I use Corvus Codegen 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 corvus-dotnet/Corvus.JsonSchema --skill corvus-codegen -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/corvus-codegen, .gemini/skills/corvus-codegen, .github/skills/corvus-codegen and .opencode/skills/corvus-codegen in your project.

What does Corvus Codegen need to run?

Going by SKILL.md and its folder, Corvus Codegen needs the command-line tools its instructions call (dotnet).

Does Corvus Codegen access the network?

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.

Is Corvus Codegen 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 Corvus Codegen use?

Corvus Codegen 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.

How many tokens does Corvus Codegen use?

About 2.1k tokens (SKILL.md is roughly 8.3k 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 Corvus Codegen?

Skills that share tags, products or a category with Corvus Codegen: Dynamo Webview Component Scaffold (DynamoDS/Dynamo, 2k stars), Template Discovery (dotnet/skills, 5.6k stars), Core API Change (libnativeapi/nativeapi, 157 stars) and Scaffolding (dotnet/efcore, 15k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Corvus Codegen?

corvus-dotnet (a GitHub organization) maintains it in corvus-dotnet/Corvus.JsonSchema, which has 199 GitHub stars. The repository holds 25 skills in this directory. The repository was last updated on October 7, 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.