Agent skill

Code Generation

by Nethereum in Nethereum/Nethereum

Generate typed C contract services, DTOs, Unity requests, MUD tables, and Blazor pages from Solidity ABI using Nethereum code generation.

MITAuto-check passedBackend & APIs

Install Code Generation

skills CLI
$ npx skills add Nethereum/Nethereum --skill code-generation -a claude-code

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

GitHub CLI
$ gh skill install Nethereum/Nethereum code-generation --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/Nethereum/Nethereum.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/nethereum-skills/skills/code-generation .claude/skills/code-generation && 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
code-generation
GitHub stars
2.3k
Token cost
~1.6k tokens
SKILL.md length
246 words
Files
1
Skills in repo
71
Repo updated
First seen
Licence
MIT

At a glance

Generate typed C contract services, DTOs, Unity requests, MUD tables, and Blazor pages from Solidity ABI using Nethereum code generation.

  • The user asks about generating C from Solidity
  • SKILL.md covers Workflow: Solidity → Forge →…, CLI Tool, Configuration File… and Generated Output, plus 6 more sections
  • Calls dotnet and npm
  • ABI code generation

What it does

Code Generation is an agent skill from Nethereum/Nethereum. Generate typed C contract services, DTOs, Unity requests, MUD tables, and Blazor pages from Solidity ABI using Nethereum code generation. Use this skill when the user asks about generating C from Solidity, ABI code generation, Foundry/Forge integration, nethereum-gen.multisettings, contract service generation, Unity contract requests, MUD table generation, or Blazor contract pages.

Its SKILL.md is about 1.6k 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 Backend & APIs, covering Smart contracts. It works with C#, Solidity and Blazor. The repository describes itself as: Ethereum .Net cross platform integration library. The licence is MIT.

When your agent uses it

  • The user asks about generating C from Solidity
  • ABI code generation
  • Foundry/Forge integration
  • Nethereum-gen.multisettings

Example prompts

  • “/code-generation”

Requirements

  • Node.js

What it can do on your machine

Read from SKILL.md and the folder at commit 229f278. 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
    • npm

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

  • Network

    No URLs in SKILL.md. Its commands use npm, which can reach the network depending on how they are called.

    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

Code Generation loads about 1.6k tokens when it runs. Until then it costs about 101 tokens; SKILL.md has 246 words of instructions outside code blocks.

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

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 Nethereum/Nethereum at commit 229f278, republished under its MIT licence (© Nethereum). 246 words, ~1,606 tokens.

Download SKILL.mdSave it as .claude/skills/code-generation/SKILL.md (or your agent's skills folder).
name
code-generation
description
Generate typed C# contract services, DTOs, Unity requests, MUD tables, and Blazor pages from Solidity ABI using Nethereum code generation. Use this skill when the user asks about generating C# from Solidity, ABI code generation, Foundry/Forge integration, nethereum-gen.multisettings, contract service generation, Unity contract requests, MUD table generation, or Blazor contract pages.
user-invocable
true

Nethereum Code Generation

Workflow: Solidity → Forge → C# Bindings

Solidity source → forge build → JSON artifacts (out/) → Nethereum Generator → C# services + DTOs

CLI Tool

bash
dotnet tool install -g Nethereum.Generator.Console
Generate from ABI
bash
Nethereum.Generator.Console generate from-abi \
  -abi ./MyContract.abi -bin ./MyContract.bin \
  -o ./Generated -ns MyProject.Contracts -cn MyContract
Generate from Forge Output (Primary Workflow)
bash
forge build
Nethereum.Generator.Console generate from-config \
  -cfg .nethereum-gen.multisettings -r .

Or use the script:

powershell
.\scripts\generate-csharp-from-forge.ps1 -Build

Configuration File (.nethereum-gen.multisettings)

Multi-contract config with shared types and struct references:

json
[
  {
    "paths": ["out/EntryPoint.sol/EntryPoint.json"],
    "generatorConfigs": [
      {
        "baseNamespace": "MyProject.AccountAbstraction",
        "basePath": "../src/MyProject.AccountAbstraction",
        "codeGenLang": 0,
        "generatorType": "ContractDefinition",
        "referencedTypesNamespaces": ["MyProject.Structs"],
        "structReferencedTypes": ["PackedUserOperation"]
      }
    ]
  },
  {
    "paths": [
      "out/NethereumAccount.sol/NethereumAccount.json",
      "out/NethereumAccountFactory.sol/NethereumAccountFactory.json"
    ],
    "generatorConfigs": [
      {
        "baseNamespace": "MyProject.Contracts.Core",
        "basePath": "../src/MyProject/Contracts/Core",
        "codeGenLang": 0,
        "generatorType": "ContractDefinition",
        "referencedTypesNamespaces": ["MyProject.Structs"],
        "structReferencedTypes": ["PackedUserOperation"]
      }
    ]
  }
]
Config Options
FieldDescription
pathsForge JSON artifact paths
baseNamespaceC# namespace
basePathOutput directory
codeGenLang0=C#, 1=VB, 3=F#
generatorTypeContractDefinition, UnityRequest, MudTables, MudExtendedService, BlazorPageService, NetStandardLibrary
sharedTypesNamespaceNamespace for shared events/errors/structs
sharedTypes["events", "errors", "structs", "functions"]
referencedTypesNamespacesImport existing struct types instead of regenerating
structReferencedTypesSpecific struct names to import
mudNamespaceMUD world namespace

Generated Output

MyContract/
├── ContractDefinition/
│   └── MyContractDefinition.gen.cs    # Deployment + all DTOs
└── MyContractService.gen.cs           # Service with typed methods
Generated Service (partial — extend without modifying .gen.cs)
csharp
var service = await MyContractService.DeployContractAndGetServiceAsync(web3, deployment);

// Query (two overloads: raw params or typed message)
var balance = await service.BalanceOfQueryAsync(ownerAddress);
var balance = await service.BalanceOfQueryAsync(
    new BalanceOfFunction { Owner = ownerAddress }, blockParameter);

// Transact
var receipt = await service.TransferRequestAndWaitForReceiptAsync(
    new TransferFunction { To = recipient, Value = amount });

// Events
var events = await service.GetTransferEvent()
    .CreateFilterInput(fromBlock, toBlock)
    .GetAllChangesAsync();

Generator Types

TypeOutputUse Case
ContractDefinitionService + all DTOsStandard .NET
UnityRequestCoroutine-based requestsUnity engine
MudTablesTable schemas from mud.config.tsMUD World
MudExtendedServiceExtended MUD serviceMUD systems
BlazorPageServiceRazor componentBlazor apps
NetStandardLibraryComplete .csprojStandalone packages

Multiple types per contract:

json
{
  "paths": ["out/ERC20.sol/Standard_Token.json"],
  "generatorConfigs": [
    { "generatorType": "ContractDefinition", ... },
    { "generatorType": "UnityRequest", ... },
    { "generatorType": "BlazorPageService", ... }
  ]
}

Shared Types

For shared events/errors/structs across contracts:

json
{
  "sharedTypesNamespace": "MyProject.SharedTypes",
  "sharedTypes": ["events", "errors", "structs"]
}

For referencing existing structs from another project:

json
{
  "referencedTypesNamespaces": ["MyProject.AccountAbstraction.Structs"],
  "structReferencedTypes": ["PackedUserOperation"]
}

MUD Generation

Tables from mud.config.ts:

json
{ "generatorType": "MudTables", "mudNamespace": "MyWorld" }

Systems (both definition + extended service):

json
[
  { "generatorType": "ContractDefinition", "mudNamespace": "MyWorld" },
  { "generatorType": "MudExtendedService", "mudNamespace": "MyWorld" }
]

Node.js API

bash
npm install nethereum-codegen
javascript
var codegen = require('nethereum-codegen');
codegen.generateAllClasses(abi, bytecode, "ERC20", "MyProject", "SharedTypes", ["events"], "./out", 0);
codegen.generateFilesFromConfigJsonFile("./config.json", "./contracts");
codegen.generateUnityRequests(abi, bytecode, "ERC20", "MyProject", "SharedTypes", ["events"], "./out");
codegen.generateMudTables(mudJson, "MyProject.Tables", "Tables", "./out", 0, "MyWorld");
codegen.generateBlazorPageService(abi, "ERC20", "MyProject", "./out", "SharedTypes", 0);

MSBuild Integration

bash
dotnet add package Nethereum.Autogen.ContractApi

Place .abi + .bin in project → code generated on dotnet build.

Key Rules

  • Generated files use .gen.cs suffix — never edit them manually
  • All classes are partial — extend in separate files
  • Use referencedTypesNamespaces when structs are shared across contracts
  • Use sharedTypes when events/errors repeat across contracts in the same generation run
  • The config file is the source of truth for how Solidity maps to C# namespaces
  • VS Code Solidity extension handles compilation + generation in one step for single contracts

© Nethereum, MIT. 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 plugins/nethereum-skills/skills/code-generation of Nethereum/Nethereum.

Open the folder on GitHubat commit 229f278

Compare with similar skills

Code Generation 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.

Code Generation compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Code Generation this skillNethereum/Nethereum2.3k—~1.6kAutomated safety check: PassMIT
Fizz Convertpashov/skills1.2k2 repos~3.7kAutomated safety check: PassMIT
Feynman Auditor0xiehnnkta/nemesis-auditor2441 repos~11kAutomated safety check: PassMIT
Smart Contract Auditgreatpie/smart-contract-audit-skill101—~1.1kAutomated safety check: PassNone
RadarAuditware/radar154—~2.1kAutomated safety check: PassGPL-3.0
Solidity AuditorGabson0x/bountyforge443—~3.7kAutomated safety check: PassNone

Similar skills

  • Fizz Convert

    pashov/skills

    Convert English-language properties in PROPERTIES.md (produced by the Fizz skill) into Solidity assertions inside the existing fuzz harness, then flip their checkboxes.

    1.2k GitHub starsUsed in 2 repos~3.7k tokens
    Backend & APIsAuto-check passed
  • Feynman Auditor

    0xiehnnkta/nemesis-auditor

    Deep business logic bug finder using the Feynman technique. An agent skill from 0xiehnnkta/nemesis-auditor.

    244 GitHub starsUsed in 1 repo~11k tokens
    Backend & APIsAuto-check passed
  • Smart Contract Audit

    greatpie/smart-contract-audit-skill

    Script-backed, out-of-box auditing workflow for Solidity/EVM repositories based on EVMbench detect/patch/exploit methodology.

    101 GitHub stars~1.1k tokensUpdated 7 mo ago
    Backend & APIsAuto-check passed
  • Radar

    Auditware/radar

    Use radar for smart contract security analysis, AST generation, and detection template development.

    154 GitHub stars~2.1k tokensUpdated 1 mo ago
    Backend & APIsAuto-check passed
  • Solidity Auditor

    Gabson0x/bountyforge

    Security audit of Solidity code while you develop. An agent skill from Gabson0x/bountyforge.

    443 GitHub stars~3.7k tokensUpdated 20 days ago
    Backend & APIsAuto-check passed
  • Add Explorer

    lidofinance/diffyscan

    Adds or repairs Diffyscan explorer API routing and response adapters for a new host, chain or payload format.

    142 GitHub stars~1k tokensUpdated yesterday
    Backend & APIsAuto-check passed

More from Nethereum/Nethereum

All 71 skills in this repo
  • Aa Batching Paymasters

    Nethereum/Nethereum

    Help users batch multiple calls into a single UserOperation and sponsor gas with paymasters using Nethereum Account Abstraction.

    2.3k GitHub stars~1.5k tokensUpdated 2 days ago
    Auto-check passed
  • Aa Bundler

    Nethereum/Nethereum

    Help users run an ERC-4337 bundler using Nethereum — set up in-process or standalone bundlers with mempool, validation, reputation, and JSON-RPC server.

    2.3k GitHub stars~1.2k tokensUpdated 2 days ago
    Auto-check passed
  • Abi Encoding

    Nethereum/Nethereum

    Encode and decode Ethereum ABI data with Nethereum. An agent skill from Nethereum/Nethereum.

    2.3k GitHub stars~1.3k tokensUpdated 2 days ago
    Auto-check passed
  • Abi Retrieval

    Nethereum/Nethereum

    Fetch contract ABIs from Sourcify, Etherscan, and 4Byte Directory using the composite ABIInfoStorage pattern (.NET/C).

    2.3k GitHub stars~1.5k tokensUpdated 2 days ago
    Auto-check passed
  • Account Abstraction

    Nethereum/Nethereum

    Help users implement ERC-4337 Account Abstraction with Nethereum — send UserOperations, use smart accounts, route contract calls through a bundler, enable gasless transactions, or work with AA in…

    2.3k GitHub stars~1.7k tokensUpdated 2 days ago
    Auto-check passed
  • Address Utils

    Nethereum/Nethereum

    Validate and format Ethereum addresses with Nethereum. An agent skill from Nethereum/Nethereum.

    2.3k GitHub stars~1.2k tokensUpdated 2 days ago
    Auto-check passed

Categories

Questions about Code Generation

What does Code Generation do?

Generate typed C contract services, DTOs, Unity requests, MUD tables, and Blazor pages from Solidity ABI using Nethereum code generation. Code Generation is an agent skill from Nethereum/Nethereum. Generate typed C contract services, DTOs, Unity requests, MUD tables, and Blazor pages from Solidity ABI using Nethereum code generation.

When should I use Code Generation?

Code Generation fits situations like: the user asks about generating C from Solidity; ABI code generation; foundry/Forge integration; nethereum-gen.multisettings.

How do I install Code Generation in Claude Code?

Run `npx skills add Nethereum/Nethereum --skill code-generation -a claude-code`. Or copy the skill folder (plugins/nethereum-skills/skills/code-generation in Nethereum/Nethereum) into .claude/skills/code-generation in your project. Claude Code loads it when a task matches its description.

How do I install Code Generation in Codex?

Run `npx skills add Nethereum/Nethereum --skill code-generation -a codex`. Or copy the skill folder (plugins/nethereum-skills/skills/code-generation in Nethereum/Nethereum) into .agents/skills/code-generation in your project. Codex loads it when a task matches its description.

Can I use Code Generation 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 Nethereum/Nethereum --skill code-generation -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/code-generation, .gemini/skills/code-generation, .github/skills/code-generation and .opencode/skills/code-generation in your project.

What does Code Generation need to run?

Going by SKILL.md and its folder, Code Generation needs the command-line tools its instructions call (dotnet and npm). Our summary lists: Node.js.

Does Code Generation access the network?

SKILL.md contains no URLs. Its commands use npm, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Code Generation 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 Code Generation use?

Code Generation 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 Code Generation use?

About 1.6k tokens (SKILL.md is roughly 6.4k 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 Code Generation?

Skills that share tags, products or a category with Code Generation: Fizz Convert (pashov/skills, 1.2k stars), Feynman Auditor (0xiehnnkta/nemesis-auditor, 244 stars), Smart Contract Audit (greatpie/smart-contract-audit-skill, 101 stars) and Radar (Auditware/radar, 154 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Code Generation?

Nethereum (a GitHub organization) maintains it in Nethereum/Nethereum, which has 2,260 GitHub stars. The repository holds 71 skills in this directory. The repository was last updated on October 5, 2026.

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