Regenerate the OrchardCore.OpenApi module's NSwag-generated C/TypeScript API clients, and verify the regeneration produces a stable (non-reshuffled) diff.
Install the "orchardcore-nswag-regenerate" agent skill from https://github.com/OrchardCMS/OrchardCore/tree/main/.agents/skills/orchardcore-nswag-regenerate into .claude/skills/orchardcore-nswag-regenerate/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "orchardcore-nswag-regenerate", 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.
Type 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.
skills CLI
$ npx skills add OrchardCMS/OrchardCore --skill orchardcore-nswag-regenerate -a codex
Project install goes to .agents/skills/; add -g for ~/.codex/skills/.
Install the "orchardcore-nswag-regenerate" agent skill from https://github.com/OrchardCMS/OrchardCore/tree/main/.agents/skills/orchardcore-nswag-regenerate into .agents/skills/orchardcore-nswag-regenerate/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "orchardcore-nswag-regenerate", 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.
skills CLI
$ npx skills add OrchardCMS/OrchardCore --skill orchardcore-nswag-regenerate -a cursor
Project install goes to .agents/skills/; add -g for ~/.cursor/skills/.
Install the "orchardcore-nswag-regenerate" agent skill from https://github.com/OrchardCMS/OrchardCore/tree/main/.agents/skills/orchardcore-nswag-regenerate into .cursor/skills/orchardcore-nswag-regenerate/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "orchardcore-nswag-regenerate", 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.
--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
skills CLI
$ npx skills add OrchardCMS/OrchardCore --skill orchardcore-nswag-regenerate -a gemini-cli
Project install goes to .agents/skills/; add -g for ~/.gemini/skills/.
Install the "orchardcore-nswag-regenerate" agent skill from https://github.com/OrchardCMS/OrchardCore/tree/main/.agents/skills/orchardcore-nswag-regenerate into .gemini/skills/orchardcore-nswag-regenerate/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "orchardcore-nswag-regenerate", 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.
Installs 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).
skills CLI
$ npx skills add OrchardCMS/OrchardCore --skill orchardcore-nswag-regenerate -a github-copilot
Project install goes to .agents/skills/; add -g for ~/.copilot/skills/.
Install the "orchardcore-nswag-regenerate" agent skill from https://github.com/OrchardCMS/OrchardCore/tree/main/.agents/skills/orchardcore-nswag-regenerate into .github/skills/orchardcore-nswag-regenerate/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "orchardcore-nswag-regenerate", 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.
skills CLI
$ npx skills add OrchardCMS/OrchardCore --skill orchardcore-nswag-regenerate -a opencode
OpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
Install the "orchardcore-nswag-regenerate" agent skill from https://github.com/OrchardCMS/OrchardCore/tree/main/.agents/skills/orchardcore-nswag-regenerate into .opencode/skills/orchardcore-nswag-regenerate/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "orchardcore-nswag-regenerate", 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.
Facts
Skill name
orchardcore-nswag-regenerate
GitHub stars
8.2k
Token cost
~2k tokens
SKILL.md length
874 words
Files
1
Skills in repo
17
Repo updated
First seen
Licence
BSD-3-Clause
At a glance
Regenerate the OrchardCore.OpenApi module's NSwag-generated C/TypeScript API clients, and verify the regeneration produces a stable (non-reshuffled) diff.
Works in 3 steps: Fetch swagger.json from a running… → Copy the .nswag config, and in the copy… → nswag run .
Asked to regenerate the NSwag client(s)
SKILL.md covers Preferred:…, Where things live, Manual procedure (fallback) and Reproducible / offline…, plus 2 more sections
Calls dotnet and yarn
What it does
Orchardcore Nswag Regenerate is an agent skill from OrchardCMS/OrchardCore. Regenerate the OrchardCore.OpenApi module's NSwag-generated C/TypeScript API clients, and verify the regeneration produces a stable (non-reshuffled) diff. Use when asked to "regenerate the NSwag client(s)", update Services/OpenApiClient.cs or .scripts/bloom/services/OpenApiClient.ts, or investigate noisy diffs from NSwag regeneration.
Its SKILL.md is about 2k 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 OpenAPI specifications. It works with OpenAPI, C# and TypeScript. The repository describes itself as: Orchard Core is an open-source modular and multi-tenant application framework built with ASP.NET Core, and a content management system (CMS) built on top of that framework. The licence is BSD-3-Clause.
When your agent uses it
Asked to regenerate the NSwag client(s)
Update Services/OpenApiClient.cs
.scripts/bloom/services/OpenApiClient.ts
Investigate noisy diffs from NSwag regeneration
Example prompts
“regenerate the NSwag client(s)”
“/orchardcore-nswag-regenerate”
Workflow steps
3 steps, taken from the first numbered list in SKILL.md.
1Fetch swagger.json from a running instance into a scratch file.
2Copy the .nswag config, and in the copy only change documentGenerator.fromDocument.url to the scratch file's path, and both generators'…
3nswag run .
What it can do on your machine
Read from SKILL.md and the folder at commit bfbe92f. 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
yarn
From the folder's file list and the shell code blocks in SKILL.md.
Network
No URLs in SKILL.md. Its commands use yarn, 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
Orchardcore Nswag Regenerate loads about 2k tokens when it runs. Until then it costs about 92 tokens; SKILL.md has 874 words of instructions outside code blocks.
Always· name and description, kept in context so the agent knows when to use it
~92
When it runs· the whole SKILL.md, loaded when a task matches
~2k
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.
Download SKILL.mdSave it as .claude/skills/orchardcore-nswag-regenerate/SKILL.md (or your agent's skills folder).
name
orchardcore-nswag-regenerate
description
Regenerate the OrchardCore.OpenApi module's NSwag-generated C#/TypeScript API clients, and verify the regeneration produces a stable (non-reshuffled) diff. Use when asked to "regenerate the NSwag client(s)", update Services/OpenApiClient.cs or .scripts/bloom/services/OpenApiClient.ts, or investigate noisy diffs from NSwag regeneration.
OrchardCore NSwag Regenerate
Regenerates the OpenApi module's NSwag-generated C#/TypeScript API clients and verifies the regeneration produces a stable, non-reshuffled diff.
Preferred: tools/OpenApiClientGenerator (automated, no browser/dev-server needed)
A console project that does the whole pipeline headlessly:
bash
dotnet run --project tools/OpenApiClientGenerator -c Release
yarn build # refreshes the Vue app's bundled JS against the new TS client
It boots the CMS in-process on an ephemeral port, uses OrchardCore.AutoSetup with
src/OrchardCore.Cms.Web/Recipes/openapi-generation-setup.recipe.json (issetuprecipe: true)
to provision the Default tenant with the same feature set as openapi-generation.recipe.json
below, fetches swagger.json, writes a scratch .nswag config pointing at that capture, and
shells out to the nswag CLI (same prerequisite as the manual path: dotnet tool install -g NSwag.ConsoleCore). Source: tools/OpenApiClientGenerator/Program.cs.
Why Default tenant specifically: OrchardCore.Tenants (and .Distributed,
.FeatureProfiles) have DefaultTenantOnly = true in their [Feature] manifest attribute —
they can only be enabled on the Default/Host shell, never a secondary tenant. A Blog-recipe
functional-test tenant cannot enable OrchardCore.Tenants, which is why this tool targets the
Default shell via AutoSetup rather than reusing the functional-test harness's tenant pattern.
This tool only regenerates the clients against whatever API surface the current source produces
— it does not add a CI drift-check gate (that was scoped out; see nswag-automation-plan.md in
git stash history for the fuller original proposal, "Part 1" of which this tool implements).
The manual procedure below still applies if you need to regenerate against a real running dev
server (e.g. to inspect swagger.json interactively) or investigate the tool's own behavior.
Where things live
Config: src/OrchardCore.Modules/OrchardCore.OpenApi/OrchardCore.OpenApi.nswag — this file already exists, do not assume it's missing. It defines both generators:
openApiToCSharpClient → outputs Services/OpenApiClient.cs (relative to the module folder)
Source document: documentGenerator.fromDocument.url points at a running instance's Swashbuckle endpoint, https://localhost:5001/swagger/v1/swagger.json. NSwag also accepts a local file path in this same field instead of a URL — useful for reproducible/offline generation (see below).
Recipe: src/OrchardCore.Modules/OrchardCore.OpenApi/Recipes/openapi-generation.recipe.json (name OpenApiGeneration) enables every feature that exposes an API endpoint: OrchardCore.Contents, OrchardCore.Queries, OrchardCore.Tenants, OrchardCore.Search.Lucene, OrchardCore.Search.Elasticsearch, OrchardCore.OpenApi. It also contains a Settings step setting OpenApiSettings.AllowAnonymousSchemaAccess: true — anonymous schema access is disabled by default (the middleware returns 401 for unauthenticated swagger.json fetches), and both NSwag paths below fetch the schema anonymously. The setup recipe used by the generator tool (openapi-generation-setup.recipe.json) has the same step. Note the Settings step replaces the whole stored OpenApiSettings object, wiping any OAuth configuration on the tenant it runs on — fine for throwaway generation tenants, worth knowing on a configured one.
It has "issetuprecipe": false, so it does not appear in the new-tenant/site-setup recipe dropdown. Run it against an already-set-up tenant instead, via Admin ▸ Configuration ▸ Recipes, click "Run" next to "OpenApi Generation", confirm the modal. (/Admin/Recipes, AdminController.Execute in OrchardCore.Recipes.)
Manual procedure (fallback)
NSwag CLI
Installed as a dotnet tool: ~/.dotnet/tools/nswag (or dotnet tool install -g NSwag.ConsoleCore if missing). Run with:
bash
nswag run src/OrchardCore.Modules/OrchardCore.OpenApi/OrchardCore.OpenApi.nswag
This requires a live server at the configured url. For a real regeneration that updates the committed files, run the actual local dev server, set it up with the OpenApiGeneration recipe, and run the command above unmodified.
Fetch swagger.json from a running instance into a scratch file.
Copy the .nswag config, and in the copy only change documentGenerator.fromDocument.url to the scratch file's path, and both generators' output to scratch paths. Do this with a small Python/jq one-liner rather than hand-editing — the config is plain JSON.
nswag run <scratch-config>.
This lets you diff two independent generations without ever touching the real generated files or needing HTTPS/dev-cert setup.
Show full SKILL.md (322 more words)Show less
Determinism: why regeneration used to reshuffle unrelated methods
Two independent root causes were found and fixed (skrypt/openapi branch):
Swashbuckle's operation order wasn't pinned. Without an explicit sort, swagger.json operations come out in whatever order ASP.NET Core's action discovery enumerates them — which depends on assembly/feature load order in OrchardCore's modular architecture, not source order. Fixed in OrchardCore.OpenApi/Startup.cs's AddSwaggerGen call:
Route path + verb is fixed at compile time and unique per operation, so this is stable regardless of load order.
A duplicate operationId across two operations.QueryApiController used to have one action handling both GET and POST on api/queries/{name} under a single [EndpointName("ApiExecuteQuery")]. OpenAPI requires operationId to be unique per operation — reusing one across two operations forced NSwag to invent a disambiguating suffix internally, and that suffix logic wasn't deterministic across runs (e.g. ApiExecuteQueryPOSTAsync vs ApiExecuteQueryPOSTPOSTAsync). Fixed by splitting into two actions with distinct names (ApiExecuteQueryGet / ApiExecuteQueryPost), delegating to a shared private method — the pattern already used by e.g. ElasticsearchApiController (ApiGetElasticsearchContent/ApiPostElasticsearchContent).
Lesson for any future controller/endpoint added to the OpenApi-exposed surface: never reuse the same [EndpointName]/operationId across two different HTTP verbs on the same route. Give each verb its own action and its own name, even if they share implementation via a private helper.
Verifying stability empirically
Boot two independently-provisioned tenants (each gets its own ShellContext and fresh feature/extension discovery — this is what actually varies, not wall-clock time), run the OpenApiGeneration recipe on each, fetch swagger.json from each, generate against both, and diff. A stable setup produces byte-identical output except for the tenant's own base-URL prefix embedded in the client's default baseUrl (an expected, real difference between distinct tenants — not a bug).
The existing functional test suite (test/OrchardCore.Tests.Functional/Tests/Cms/OpenApiTests.cs) already exercises the relevant plumbing (feature enablement, swagger.json access) if you need a template for scripting this via Playwright/CmsTestBase. Any throwaway verification test written for this should be deleted afterward — it's not meant to be a permanent part of the suite.
Orchardcore Nswag Regenerate 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.
Orchardcore Nswag Regenerate compared with similar skills
Skill
Stars
Used in
Tokens
Auto-check
Licence
Repo updated
Orchardcore Nswag Regenerate this skillOrchardCMS/OrchardCore
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)…
Turns an OpenAPI or Swagger spec into an MCP server with the mcp-use TypeScript SDK, mapping each operation to a tool, wiring auth, testing and deploying.
Regenerate the OrchardCore.OpenApi module's NSwag-generated C/TypeScript API clients, and verify the regeneration produces a stable (non-reshuffled) diff. Orchardcore Nswag Regenerate is an agent skill from OrchardCMS/OrchardCore.OpenApi module's NSwag-generated C/TypeScript API clients, and verify the regeneration produces a stable (non-reshuffled) diff.
When should I use Orchardcore Nswag Regenerate?
Orchardcore Nswag Regenerate fits situations like: asked to regenerate the NSwag client(s); update Services/OpenApiClient.cs; .scripts/bloom/services/OpenApiClient.ts; investigate noisy diffs from NSwag regeneration.
How do I install Orchardcore Nswag Regenerate in Claude Code?
Run `npx skills add OrchardCMS/OrchardCore --skill orchardcore-nswag-regenerate -a claude-code`. Or copy the skill folder (.agents/skills/orchardcore-nswag-regenerate in OrchardCMS/OrchardCore) into .claude/skills/orchardcore-nswag-regenerate in your project. Claude Code loads it when a task matches its description.
How do I install Orchardcore Nswag Regenerate in Codex?
Run `npx skills add OrchardCMS/OrchardCore --skill orchardcore-nswag-regenerate -a codex`. Or copy the skill folder (.agents/skills/orchardcore-nswag-regenerate in OrchardCMS/OrchardCore) into .agents/skills/orchardcore-nswag-regenerate in your project. Codex loads it when a task matches its description.
Can I use Orchardcore Nswag Regenerate 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 OrchardCMS/OrchardCore --skill orchardcore-nswag-regenerate -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/orchardcore-nswag-regenerate, .gemini/skills/orchardcore-nswag-regenerate, .github/skills/orchardcore-nswag-regenerate and .opencode/skills/orchardcore-nswag-regenerate in your project.
What does Orchardcore Nswag Regenerate need to run?
Going by SKILL.md and its folder, Orchardcore Nswag Regenerate needs the command-line tools its instructions call (dotnet and yarn).
Does Orchardcore Nswag Regenerate 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 Orchardcore Nswag Regenerate 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 Orchardcore Nswag Regenerate use?
Orchardcore Nswag Regenerate is published under the BSD-3-Clause licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
How many tokens does Orchardcore Nswag Regenerate use?
About 2k tokens (SKILL.md is roughly 8k 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 Orchardcore Nswag Regenerate?
Skills that share tags, products or a category with Orchardcore Nswag Regenerate: API Breaking Change Detector (github/awesome-copilot, 40k stars), OpenAPI to MCP Server (mcp-use/mcp-use, 11k stars), Api2cli (alexknowshtml/api2cli, 454 stars) and Project (samchon/nestia, 2.2k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
Who maintains Orchardcore Nswag Regenerate?
OrchardCMS (a GitHub organization) maintains it in OrchardCMS/OrchardCore, which has 8,193 GitHub stars. The repository holds 17 skills in this directory. The repository was last updated on October 10, 2026.
Source: OrchardCMS/OrchardCore on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.