mcpbeat Sign in

Regenerate From Typespec Agent Skill

Regenerate the @azure/ai-projects client from the latest TypeSpec commit on Azure/azure-rest-api-specs. Use when refreshing emitted code, bumping the pinned tsp-location commit, running tsp-client update, or pulling in upstream Foundry spec changes. Handles the rename dance between tsp-location.saved.yaml and tsp-location.yaml, and captures upstream commit descriptions for post-merge validation.

3k tokens
context cost
the whole folder, loaded on every use
2
files
ships runnable scripts
0
copies elsewhere
how many repositories repackaged it
2294
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/Azure/azure-sdk-for-js --skill regenerate-from-typespec

What comes with it

3 948 bytes besides the instruction
scripts/update-tsp-commit.ps1

The instruction itself

12 sections, as written by the author

Regenerate ai-projects from TypeSpec

When to Use

  • You need to pull the newest TypeSpec changes from Azure/azure-rest-api-specs into this package.
  • The pinned commit in tsp-location.saved.yaml is stale and you want to re-emit the generated client.
  • Someone asks to "regen from TypeSpec", "bump the spec commit", "run tsp-client update", or similar.

Inputs

| Name | Default | Description |

|------|---------|-------------|

| branch | feature/foundry-release | Branch on Azure/azure-rest-api-specs to read the latest commit from. |

| commit | _(none)_ | Optional explicit commit SHA. If provided, skip the git ls-remote lookup. |

| commitDescriptionsPath | temp/typespec-commit-descriptions.md | File to write upstream commit subjects and bodies for the old-exclusive/new-inclusive TypeSpec range. |

Prerequisites

  • git on PATH.
  • npm on PATH.
  • The package dev dependency @azure-tools/typespec-client-generator-cli (provides tsp-client) must be installed. From the repository root, run pnpm install first if dependencies are not already installed.
  • Clean working tree under sdk/ai/ai-projects/. dev-tool customization apply does a 3-way merge against the committed generated/ baseline; running it on a tree with uncommitted changes from a prior failed regen produces silently-incorrect output (e.g. new model types from upstream do not get propagated into src/). Verify with git status -- sdk/ai/ai-projects/ and revert any leftover changes before proceeding.

Procedure

Run from the package root: sdk/ai/ai-projects/.

Step 1: Capture the current and target commits

Before mutating tsp-location.saved.yaml, capture the currently pinned commit and resolve the target commit. Then fetch enough Azure/azure-rest-api-specs history to write the commit subjects and bodies from the commit after the current hash through the target hash, inclusive. Use this artifact later to verify that the SDK code after emitter merge adheres to the upstream change descriptions.

$currentCommit = (Select-String -Path tsp-location.saved.yaml -Pattern '^commit:\s*(\S+)' | ForEach-Object { $_.Matches[0].Groups[1].Value })
$targetCommit = ./.github/skills/regenerate-from-typespec/scripts/update-tsp-commit.ps1 -ResolveOnly -Branch feature/foundry-release
$commitDescriptionsPath = 'temp/typespec-commit-descriptions.md'

$specRepo = Join-Path $env:TEMP 'azure-rest-api-specs-foundry'
if (-not (Test-Path $specRepo)) {
	git clone --filter=blob:none --no-checkout https://github.com/Azure/azure-rest-api-specs.git $specRepo
}
git -C $specRepo fetch --filter=blob:none --no-tags origin feature/foundry-release

New-Item -ItemType Directory -Force (Split-Path $commitDescriptionsPath) | Out-Null
git -C $specRepo log --reverse --format='commit %H%nsubject: %s%n%n%b%n---' "$currentCommit..$targetCommit" > $commitDescriptionsPath
if (-not (Get-Content $commitDescriptionsPath -Raw).Trim()) {
	throw "No upstream commit descriptions found for range $currentCommit..$targetCommit"
}

With an explicit commit, set $targetCommit = '<40-char-sha>' instead of using -ResolveOnly. If git log returns no commits, stop and verify that $currentCommit is an ancestor of $targetCommit on the selected TypeSpec branch; do not proceed with an empty commit-description artifact unless the user explicitly confirms the hashes are intentionally identical.

Step 2: Apply the target commit

Invoke the bundled script. It (a) resolves the latest commit hash for branch (or accepts an explicit -Commit), (b) renames tsp-location.saved.yamltsp-location.yaml, and (c) rewrites the commit: field in place.

./.github/skills/regenerate-from-typespec/scripts/update-tsp-commit.ps1 -Branch feature/foundry-release
# or, with an explicit commit:
./.github/skills/regenerate-from-typespec/scripts/update-tsp-commit.ps1 -Commit <40-char-sha>

See scripts/update-tsp-commit.ps1.

Step 3: Run the emitter

npm run generate:client

This runs tsp-client update -d && npm run format && dev-tool customization apply. The emitter writes directly into generated/ and src/ — there is no incoming/ snapshot. The next skill (apply-post-emitter-edits) inspects the resulting working-tree diff via git diff rather than a separate staging directory.

Step 4: Restore the saved-yaml filename

This MUST run whether Step 3 succeeded or failed.

./.github/skills/regenerate-from-typespec/scripts/update-tsp-commit.ps1 -RestoreOnly

The script wraps Step 2's edits in a try/finally when invoked normally, but if you ran the emitter in a separate shell, call it again with -RestoreOnly to put tsp-location.yaml back to tsp-location.saved.yaml.

Step 5: Verify

  • tsp-location.saved.yaml exists, tsp-location.yaml does not.
  • The commit: line in tsp-location.saved.yaml matches the resolved hash.
  • temp/typespec-commit-descriptions.md exists and contains the upstream commit descriptions for $currentCommit..$targetCommit.
  • git status shows changes under generated/ and/or src/ from the regen.
  • Review the commit descriptions against the emitted diff before and after post-emitter merging; any SDK behavior, API shape, samples, or tests added during follow-up work should trace back to those upstream descriptions or be called out as an intentional local workaround.

Hand-off

Once this skill completes, hand off to the apply-post-emitter-edits skill to merge the emitted output into src/. Include temp/typespec-commit-descriptions.md in that hand-off so the post-merge SDK diff can be checked against the upstream TypeSpec commit descriptions.

Notes

  • This skill never commits. It only edits tsp-location.saved.yaml, writes temp/typespec-commit-descriptions.md, and runs the emitter.
  • The branch default is feature/foundry-release. Override only when explicitly asked.
  • The emitter writes directly into generated/ and src/. Leave those changes in the working tree (do not stash, revert, or stage them) so apply-post-emitter-edits can inspect them via git diff.

Other skills for the same job

different authors, same section of the catalogue
Modal
by christophacham
×3

Run Python code in the cloud with serverless containers, GPUs, and autoscaling. Use when deploying ML models, running batch processing jobs, scheduling compute-intensive tasks, or serving APIs that require GPU acceleration or dynamic scaling.

17k tokens
Github Workflow Automation
by ComeOnOliver
×3

Advanced GitHub Actions workflow automation with AI swarm coordination, intelligent CI/CD pipelines, and comprehensive repository management

9k tokens
Gcloud
by Dicklesworthstone
×2

Google Cloud Platform CLI - manage GCP resources including Compute Engine, Cloud Run, GKE, Cloud Functions, Storage, BigQuery, and more.

2k tokens
Backend Architect
by ComeOnOliver
×2

Expert backend architect specializing in scalable API design, microservices architecture, and distributed systems. Masters REST/GraphQL/gRPC APIs, event-driven architectures, service mesh patterns, and modern backend frameworks. Handles service boundary definition, inter-service communication, resilience patterns, and observability. Use PROACTIVELY when creating new backend services or APIs.

7k tokens
Modal
by ComeOnOliver
×2

Run Python code in the cloud with serverless containers, GPUs, and autoscaling. Use when deploying ML models, running batch processing jobs, scheduling compute-intensive tasks, or serving APIs that require GPU acceleration or dynamic scaling.

37k tokens
Aspire
by github
vendor ×1

Aspire skill covering the Aspire CLI, AppHost orchestration, service discovery, integrations, MCP server, VS Code extension, Dev Containers, GitHub Codespaces, templates, dashboard, and deployment. Use when the user asks to create, run, debug, configure, deploy, or troubleshoot an Aspire distributed application.

21k tokens
Bigquery Pipeline Audit
by github
vendor ×1

Audits Python + BigQuery pipelines for cost safety, idempotency, and production readiness. Returns a structured report with exact patch locations.

1k tokens
Msstore CLI
by github
vendor ×1

Microsoft Store Developer CLI (msstore) for publishing Windows applications to the Microsoft Store. Use when asked to configure Store credentials, list Store apps, check submission status, publish submissions, manage package flights, set up CI/CD for Store publishing, or integrate with Partner Center. Supports Windows App SDK/WinUI, UWP, .NET MAUI, Flutter, Electron, React Native, and PWA applications.

4k tokens

How to use it

Copy the folder

Take azure/regenerate-from-typespec from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.

Install what it needs

The instructions reference npm. Without those the skill loads but fails at the first command.