nuget-trusted-publishing

nuget-trusted-publishing is a skill for Claude Code, Codex from managedcode/dotnet-skills. It costs 111 tokens per session (2,221 once invoked), scanned A, a copy of nuget-trusted-publishing, MIT.

A setup guide for publishing .NET packages to NuGet from GitHub Actions using short-lived identity tokens instead of permanent API keys. NuGet is the main public package registry for .NET libraries and tools.

In plain words
What is it for?
Use it to create or migrate a GitHub Actions workflow that securely publishes NuGet packages, dotnet tools, MCP servers, or templates.
Why use it?
It removes the need to store and rotate a long-lived publishing key, reducing the risk that a leaked key can be reused.

Skill for Claude CodeCodex

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

Good fit Use it to create or migrate a GitHub Actions workflow that securely publishes NuGet packages, dotnet tools, MCP servers, or templates.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/managedcode/dotnet-skills/nuget-trusted-publishing
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 managedcode/dotnet-skills --skill nuget-trusted-publishing
Clone the repo
git clone --depth 1 https://github.com/managedcode/dotnet-skills

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 nuget-trusted-publishing

README.md
[![agentmods](https://agentmods.dev/badge/skills/managedcode/dotnet-skills/nuget-trusted-publishing/github.svg)](https://agentmods.dev/skills/managedcode/dotnet-skills/nuget-trusted-publishing)
Your own site
<a href="https://agentmods.dev/skills/managedcode/dotnet-skills/nuget-trusted-publishing"><img src="https://agentmods.dev/badge/skills/managedcode/dotnet-skills/nuget-trusted-publishing/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 nuget-trusted-publishing

Your own site · 80×15
<a href="https://agentmods.dev/skills/managedcode/dotnet-skills/nuget-trusted-publishing"><img src="https://agentmods.dev/badge/skills/managedcode/dotnet-skills/nuget-trusted-publishing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 111 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,221 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 100% copy Near-identical to another mod 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.00111 $0.02221
Opus 5.5 $0.00044 $0.00888
Sonnet 5.5 $0.00022 $0.00444
Haiku 4.5 $0.00011 $0.00222

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

Security

Grade A, and why

nuget-trusted-publishing 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 2mo 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.

Origin

This is a copy

100% identical to nuget-trusted-publishing — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

catalog/Platform/Official-DotNet-Advanced/skills/nuget-trusted-publishing/SKILL.md · 166 lines

How it starts

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

NuGet Trusted Publishing Setup

Set up NuGet trusted publishing on a GitHub Actions repo. Replaces long-lived API keys with OIDC-based short-lived tokens — no secrets to rotate or leak.

Prerequisites

  • GitHub Actions — this skill covers GitHub Actions setup only
  • nuget.org account — the user needs access to create trusted publishing policies

When to Use This Skill

Use this skill when:

  • Setting up trusted publishing for a NuGet package
  • Migrating from secrets.NUGET_API_KEY to OIDC-based publishing
  • Asked about keyless or secure NuGet publishing
  • Creating a new NuGet publish workflow from scratch
  • Asked to "remove NuGet API key" or "use NuGet/login"
  • Setting up publishing for a dotnet tool, MCP server, or template package
  • Asked about NuGet/login@v1 or id-token: write

Safety Rules

⚠️ Bail-out rule: If any phase fails after one fix attempt on an infrastructure/auth issue, stop and ask the user. Don't loop on environment problems.

⚠️ Never delete or overwrite without confirmation: Removing API key secrets, deleting tags/releases, removing workflow steps, or changing package IDs. NuGet package IDs are permanent — mistakes can't be undone.

Process

Fast-path for greenfield repos: When the user has a simple setup (one packable project, no existing publish workflow), don't gate on multi-turn assessment. Combine phases: create the workflow immediately, include nuget.org policy guidance, local pack recommendation, and filename-matching warning all in one response. The full phased process below is for complex or migration scenarios.

Phase 1: Assess

Inspect the repo and report findings before making any changes.

  1. Find and classify packable projects — check .csproj files and Directory.Build.props (package metadata is often set repo-wide). Classify in this order (earlier matches win):
    • <PackageType>Template</PackageType> → Template
    • <PackageType>McpServer</PackageType> → MCP server (also a dotnet tool)
    • <PackAsTool>true</PackAsTool> → Dotnet tool
    • Class library (IsPackable=true or no OutputType) → Library
    • <OutputType>Exe</OutputType> with <IsPackable>true</IsPackable> → Application package (not a tool, but still publishable)
    • <OutputType>Exe</OutputType> without PackAsTool or IsPackable → Not packable by default (ask user if they intend to publish it)

Read the full file on GitHub · 166 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 2mo ago First seen · 166 lines · 111 tokens per session scan A e12a67e12399

Subscribe to this mod's changes

nuget-trusted-publishing is a skill published in the GitHub repository managedcode/dotnet-skills (527 stars, last pushed 16d ago), licensed MIT. It adds 111 tokens to every session and 2,221 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 100% identical to nuget-trusted-publishing, differing in 0 lines, and is treated as a copy.

Related

nuget-trusted-publishing compared with skills from other repositories

nuget-trusted-publishing next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
nuget-trusted-publishingmanagedcode/dotnet-skillsSkill52716d agoMITA111Claude Code, Codex
nx-ci-monitortech-leads-club/agent-skillsSkill7.2k2d agononeA74Claude Code, Codex
perf-lighthousetech-leads-club/agent-skillsSkill7.2k2d agononeA92Claude Code, Codex
gh-fix-citech-leads-club/agent-skillsSkill7.2k2d agononeA95Claude Code, Codex
nx-workspacetech-leads-club/agent-skillsSkill7.2k2d agononeA87Claude Code, Codex
pr-monitorronaknnathani/relaySkill4424d agoMITA62Claude Code, Codex
finding-filesSebastienDegodez/copilot-instructionsSkill19923d agoApache-2.0A28Claude Code, Codex