target-authoring

target-authoring is a skill for Claude Code, Codex from managedcode/dotnet-skills. It costs 160 tokens per session (1,516 once invoked), scanned A, a copy of target-authoring, MIT.

A guide to writing custom MSBuild targets, which are named steps in the .NET build process. It explains how custom steps should connect to standard build, rebuild, and clean operations.

In plain words
What is it for?
Use it when creating or repairing custom targets in files such as `Directory.Build.targets`, including targets that extend compile or build operations.
Why use it?
It helps prevent custom targets from replacing standard build behavior or breaking the chain of dependent steps.

Skill for Claude CodeCodex

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

Good fit Use it when creating or repairing custom targets in files such as Directory.Build.targets, including targets that extend compile or build operations.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/managedcode/dotnet-skills/target-authoring
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 target-authoring
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 target-authoring

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/managedcode/dotnet-skills/target-authoring"><img src="https://agentmods.dev/badge/skills/managedcode/dotnet-skills/target-authoring.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 160 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,516 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.00160 $0.01516
Opus 5.5 $0.00064 $0.00606
Sonnet 5.5 $0.00032 $0.00303
Haiku 4.5 $0.00016 $0.00152

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

Security

Grade A, and why

target-authoring 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 target-authoring — 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/Tools/Official-DotNet-MSBuild/skills/target-authoring/SKILL.md · 162 lines

How it starts

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

Custom Target Authoring Patterns

Canonical patterns from Microsoft.Common.CurrentVersion.targets in the MSBuild repository.

The Three-Level Target Chain

Every major entry point (Build, Rebuild, Clean) delegates to a property listing its dependencies, which chains through Before → Core → After:

<PropertyGroup>
  <BuildDependsOn>
    BeforeBuild;
    CoreBuild;
    AfterBuild
  </BuildDependsOn>
</PropertyGroup>

<Target Name="Build"
    Condition=" '$(_InvalidConfigurationWarning)' != 'true' "
    DependsOnTargets="$(BuildDependsOn)"
    Returns="@(TargetPathWithTargetPlatformMoniker)" />

<!-- Empty extensibility targets — users override these -->
<Target Name="BeforeBuild" />
<Target Name="AfterBuild" />

CoreBuild delegates to $(CoreBuildDependsOn) and includes error handlers:

<Target Name="CoreBuild" DependsOnTargets="$(CoreBuildDependsOn)">
  <OnError ExecuteTargets="_TimeStampAfterCompile;PostBuildEvent"
      Condition="'$(RunPostBuildEvent)' == 'Always'" />
  <OnError ExecuteTargets="_CleanRecordFileWrites" />
</Target>

Rules

  • Delegate to a property (DependsOnTargets="$(MyTargetDependsOn)"), not hardcoded targets.
  • OnError goes inside the orchestrating target to ensure cleanup runs even on failure.
  • Empty Before/After targets are extensibility points. Users override them; SDKs never put logic in them.

Chain Extension — Append, Never Overwrite

When adding a custom target to an existing chain, append to the DependsOn property:

<!-- GOOD: Append to existing chain -->
<PropertyGroup>
  <CompileDependsOn>$(CompileDependsOn);MyCodeGenTarget</CompileDependsOn>
</PropertyGroup>

<!-- BAD: Overwrites the entire chain, dropping SDK targets -->
<PropertyGroup>
  <CompileDependsOn>MyCodeGenTarget</CompileDependsOn>
</PropertyGroup>

DependsOnTargets vs BeforeTargets vs AfterTargets

Mechanism Defined in Best for
DependsOnTargets The target that needs deps Target explicitly requires others
BeforeTargets The injecting target Insert before a target you don't own
AfterTargets The injecting target Insert after a target you don't own

Read the full file on GitHub · 162 lines

Files

What ships with it

1 file 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 · 162 lines · 160 tokens per session scan A e39b9ad0bfe6

Subscribe to this mod's changes

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

Related

target-authoring compared with skills from other repositories

target-authoring next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
target-authoringmanagedcode/dotnet-skillsSkill52716d agoMITA160Claude Code, Codex
cs0618-hunterjoslat/maf-doctorSkill1414d agoMITA85Claude Code, Codex
nuget-diff-analyzerjoslat/maf-doctorSkill1414d agoMITA56Claude Code, Codex
agents-sdk-dotnet-debuggingmicrosoft/AgentsSkill1.1k5d agoMITA136Claude Code
roslyn-codelensMarcelRoozekrans/roslyn-codelens-mcpSkill78todayMITA104Claude Code
clean-architecture-dotnetSebastienDegodez/copilot-instructionsSkill19923d agoApache-2.0A50Claude Code, Codex
creating-dotnet-mcp-serversSebastienDegodez/copilot-instructionsSkill19923d agoApache-2.0A43Claude Code, Codex