tsp-naming-collision

tsp-naming-collision is a skill for Claude Code, Codex from Azure/azure-sdk-for-java. It costs 56 tokens per session (1,673 once invoked), scanned A, original, MIT.

A fix for Java client code generated from TypeSpec when a request parameter gets an unwanted numeric ending such as “1” because two generated types have the same name.

In plain words
What is it for?
Use it when generated Java methods or classes have numeric suffixes after a TypeSpec model is spread into an operation’s parameters.
Why use it?
It removes confusing names like “createAgentRequest1” and the matching implementation-class name caused by that naming conflict.

Skill for Claude CodeCodex

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

About the project

Azure SDK for Java is a collection of Java libraries that let applications connect to and manage Azure services. Java developers use its client libraries to consume services and its management libraries to configure Azure resources. The catalogue add-ons support development with these libraries.

Azure/azure-sdk-for-java · 2,566 stars · on GitHub

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.

agentmods
npx agentmods add skills/azure/azure-sdk-for-java/tsp-naming-collision
Any agent
npx skills add Azure/azure-sdk-for-java --skill tsp-naming-collision
Clone the repo
git clone --depth 1 https://github.com/Azure/azure-sdk-for-java

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 tsp-naming-collision

README.md
[![agentmods](https://agentmods.dev/badge/skills/azure/azure-sdk-for-java/tsp-naming-collision.svg)](https://agentmods.dev/skills/azure/azure-sdk-for-java/tsp-naming-collision)
Your own site
<a href="https://agentmods.dev/skills/azure/azure-sdk-for-java/tsp-naming-collision"><img src="https://agentmods.dev/badge/skills/azure/azure-sdk-for-java/tsp-naming-collision.svg" alt="Measured on agentmods" height="20"></a>
Per session 56 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,673 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00056 $0.01673
Opus 5 $0.00028 $0.00837
Sonnet 5 $0.00011 $0.00335
Haiku 4.5 $0.00006 $0.00167

Measured 6d ago against content hash f867785c1f6f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

tsp-naming-collision 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 6d 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.

sdk/ai/.workflow_docs/tsp-naming-collision/SKILL.md · 146 lines

How it starts

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

Fix TypeSpec Naming Collisions in Java Codegen

Fix parameter and implementation-model names that end with a numeric suffix (e.g. createAgentRequest1) in generated Java client code. This happens when a TypeSpec named model collides with the synthetic body type the Java codegen creates for an operation that spreads that model.

Root Cause

When a TypeSpec route spreads a named model into an operation's parameters (via ...ModelName), the Java codegen creates a synthetic body type to hold the body properties. It names this type {OperationName}Request (PascalCase of the operation name + Request). If a TypeSpec model already has that exact name, the codegen resolves the collision by appending 1.

Example collision:

  • TypeSpec model: CreateAgentRequest
  • Operation: createAgent spreads ...CreateAgentRequest
  • Codegen synthetic body: wants name CreateAgentRequest → collision → CreateAgentRequest1
  • Result: parameter createAgentRequest1, implementation class CreateAgentRequest1.java

Why aliases don't collide: TypeSpec alias declarations don't occupy a name in the type namespace, so there is no collision. If the upstream spec used alias CreateAgentRequest = { ... } instead of model CreateAgentRequest { ... }, no fix would be needed.

Preconditions

  • You must be in the directory that contains tsp-location.yaml.
  • The TypeSpec must already be synced locally into TempTypeSpecFiles/. If not, run tsp-client sync first.
  • Identify the client.tsp file inside TempTypeSpecFiles/ (usually under a subdirectory like sdk-agents/). This is the customization file where fixes are applied.

Important: TempTypeSpecFiles is volatile

TempTypeSpecFiles/ is regenerated on every tsp-client sync or tsp-client update. Changes made only in TempTypeSpecFiles/ will be lost. Always apply the same edits to the corresponding client.tsp in a local checkout of Azure/azure-rest-api-specs (if available) so the changes can be committed to a PR.

Read the full file on GitHub · 146 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. 6d ago First seen · 146 lines · 56 tokens per session scan A f867785c1f6f

Subscribe to this mod's changes

tsp-naming-collision is a skill published in the GitHub repository Azure/azure-sdk-for-java (2,566 stars, last pushed yesterday), licensed MIT. It adds 56 tokens to every session and 1,673 once invoked, about $0.0003 per session on Opus 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-08-30.

Related

Other skills, from other repositories

azure-ai-vision-imageanalysis-java

Build image analysis applications with Azure AI Vision SDK for Java. Use when implementing image captioning, OCR text extraction, object detection, tagging, or smart cropping.

microsoft/skills · 40 tokens

dpg-migration

Migration logic for Azure SDK for .NET data-plane libraries migrating from AutoRest/Swagger to TypeSpec-based generation. Uses MCP tools from the generator-agent server for automated deterministic fixes.

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

csharp-azure-spector-coverage-gaps

Discovers and implements gaps in Spector test coverage for the Azure C# HTTP client emitter. Use when asked to find missing Spector scenarios, add Spector test coverage, or implement a specific Spector spec for the Azure C# emitter. Can also compare coverage between the Azure dashboard and the Standard (TypeSpec core)…

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

mitigate-breaking-changes

Patterns and techniques for mitigating breaking changes in Azure management-plane SDKs. Covers SDK-side customizations (partial classes, CodeGenType, CodeGenSuppress) and TypeSpec decorator customizations (clientName, access, markAsPageable, alternateType, hierarchyBuilding).

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

translate-a-sample

Translate the Azure SDK sample from python to C# and generate markdownn file for the sample. Parameters: C# SDK repository root; python SDK repository root; Package name: one of Azure.AI.Projects, Azure.AI.Projects.Agents or Azure.AI.Extensions.OpenAI; The name of sample file in Python SDK repository.

Azure/azure-sdk-for-net · 90 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