orchardcore-source-generators

orchardcore-source-generators is a skill for Claude Code, Codex from CrestApps/CrestApps.AgentSkills. It costs 189 tokens per session (1,691 once invoked), scanned A, original, MIT.

A guide to Orchard Core source generators, which create some C# code during compilation instead of at runtime. It covers generated argument types and optimisations for .NET 9 and newer.

In plain words
What is it for?
Use it when building Orchard Core shapes or display-management code that passes named arguments, especially when compile-time performance matters.
Why use it?
It helps avoid repeated reflection work and explains the rules for using generated types, anonymous arguments, and older .NET fallbacks.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when building Orchard Core shapes or display-management code that passes named arguments, especially when compile-time performance matters.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/crestapps/crestapps.agentskills/orchardcore-source-generators
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add CrestApps/CrestApps.AgentSkills --skill orchardcore-source-generators
Clone the repo
git clone --depth 1 https://github.com/CrestApps/CrestApps.AgentSkills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for orchardcore-source-generators

README.md
[![agentmods](https://agentmods.dev/badge/skills/crestapps/crestapps.agentskills/orchardcore-source-generators/github.svg)](https://agentmods.dev/skills/crestapps/crestapps.agentskills/orchardcore-source-generators)
Your own site
<a href="https://agentmods.dev/skills/crestapps/crestapps.agentskills/orchardcore-source-generators"><img src="https://agentmods.dev/badge/skills/crestapps/crestapps.agentskills/orchardcore-source-generators/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for orchardcore-source-generators

Your own site · 80×15
<a href="https://agentmods.dev/skills/crestapps/crestapps.agentskills/orchardcore-source-generators"><img src="https://agentmods.dev/badge/skills/crestapps/crestapps.agentskills/orchardcore-source-generators.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 189 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,691 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00189 $0.01691
Opus 5.5 $0.00076 $0.00676
Sonnet 5.5 $0.00038 $0.00338
Haiku 4.5 $0.00019 $0.00169

Measured 1mo ago against content hash 975d3c49e88b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

orchardcore-source-generators scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/orchardcore/skills/orchardcore-source-generators/SKILL.md · 248 lines

How it starts

The opening of the file, as written. The whole thing — 248 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Orchard Core Source Generators - Prompt Templates

Use Source Generators for Performance Optimization

You are an Orchard Core expert. Generate code using source generators, the [GenerateArguments] attribute, anonymous type interceptors, and named argument types for shapes and display management.

Guidelines

  • Use [GenerateArguments] on partial classes to generate optimized INamedEnumerable<object> implementations at compile time.
  • Generated classes extend PropertyBasedNamedEnumerable with zero-reflection property access via switch expressions.
  • Classes marked with [GenerateArguments] must be partial and have at least one public instance property with a getter.
  • For .NET 9+ projects, anonymous types passed to Arguments.From() are automatically optimized by interceptors.
  • On older .NET versions, Arguments.From() falls back to cached reflection (acceptable for infrequent usage).
  • Prefer named types with [GenerateArguments] for production code over anonymous types.
  • Source-generated argument classes support nested types, records, and inheritance.
  • All C# classes must use the sealed modifier where applicable.

Quick Start with [GenerateArguments]

using OrchardCore.DisplayManagement;

[GenerateArguments]
public sealed partial class MyShapeArguments
{
    public string Title { get; set; }
    public int Count { get; set; }
    public bool IsActive { get; set; }
}

// Usage - direct property access, no reflection
var args = new MyShapeArguments
{
    Title = "Hello",
    Count = 42,
    IsActive = true,
};

var shape = await shapeFactory.CreateAsync("MyShape", args);

What Gets Generated

The source generator produces an optimized implementation extending PropertyBasedNamedEnumerable:

// Your code:
[GenerateArguments]
public sealed partial class MyData
{
    public string Name { get; set; }
    public int Value { get; set; }
}

// Auto-generated at compile time:
public sealed partial class MyData : PropertyBasedNamedEnumerable
{
    private static readonly string[] s_propertyNames = ["Name", "Value"];

    protected override int PropertyCount => 2;

    protected override IReadOnlyList<string> PropertyNames => s_propertyNames;

    protected override object? GetPropertyValue(int index) => index switch
    {
        0 => this.Name,
        1 => this.Value,
        _ => throw new ArgumentOutOfRangeException(nameof(index))
    };
}

Read the full file on GitHub · 248 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 248 lines · 189 tokens per session scan A 975d3c49e88b

Subscribe to this mod's changes

orchardcore-source-generators is a skill published in the GitHub repository CrestApps/CrestApps.AgentSkills (13 stars, last pushed 2d ago), licensed MIT. It adds 189 tokens to every session and 1,691 once invoked, about $0.0008 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-12.

Related

Other skills, from other repositories

dotnet-debugging

Debug .NET applications using debug-mcp MCP tools — launch processes, set breakpoints, step through code, inspect variables, evaluate expressions, and analyze exceptions. Use this skill when debugging .NET/C# applications, investigating runtime behavior, diagnosing exceptions, inspecting object state, or performing…

jkolo/debug-mcp · 70 tokens

generate-code-cs

Generate the code from typespec for C#. Parameter: C# SDK repository root location .

Azure/azure-sdk-for-net · 26 tokens

author-test

Generate a test given sample. Parameters: C# SDK repository root; Package name: one of Azure.AI.Projects, Azure.AI.Projects.Agents or Azure.AI.Extensions.OpenAI; the sample to use as a starting point for the test.

Azure/azure-sdk-for-net · 68 tokens

script-execute

Compiles and executes C# code dynamically using Roslyn. Supports a full-code mode (default) and a body-only mode — see the skill body for the difference and for how to pass Unity object references as parameters.

IvanMurzak/Unity-MCP · 48 tokens

script-update-or-create

Write a .cs script file (create or overwrite) with the provided C# code. Validates syntax via Roslyn before write — invalid code is rejected with error details and the file is left untouched. Refreshes the AssetDatabase and delivers the final result via requestId after Unity finishes the triggered compilation. Use…

IvanMurzak/Unity-MCP · 80 tokens

opentelemetry-net-instrumentation

Provides guidance for implementing OpenTelemetry instrumentation in .NET codebases, covering tracing (Activities/Spans), metrics, logs, naming conventions, error handling, performance, SDK setup, resources, context propagation, and API design best practices.

Aaronontheweb/dotnet-skills · 56 tokens