codegen

Generate code from TypeSpec definitions using the tsp-client tool.

2.6k|2.2k|Updated Dec 6, 2011
One-click install
npx skills add https://github.com/Azure/azure-sdk-for-java --skill codegen-azure
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: codegen
Source: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/ai/.workflow_docs/codegen
Command: npx skills add https://github.com/Azure/azure-sdk-for-java --skill codegen-azure

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill automates the process of generating code from TypeSpec definitions, ensuring consistency and reducing manual coding effort in Azure SDK projects.

Core Features & Use Cases

  • Code Generation: Generates client libraries from TypeSpec specifications.
  • Version Control Integration: Supports updating commit hashes for specific TypeSpec versions.
  • Workflow Automation: Streamlines the update, sync, and generation steps of the codegen process.
  • Use Case: A developer needs to update the Java client library for a new version of an Azure service. They can use this Skill to pull the latest TypeSpec definitions, sync them, and generate the updated Java code.

Quick Start

Use the codegen skill to generate code from the TypeSpec definitions in the current directory.

Frequently Asked Questions about codegen

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate Azure SDK client libraries from TypeSpec definitions?

You can generate client libraries from TypeSpec definitions by using the tsp-client tool to automate the code generation process. This Skill streamlines pulling the latest TypeSpec specifications and producing the updated code for your Azure SDK projects.

How do I update the commit hash in tsp-location.yaml before generating code?

To update the commit hash in tsp-location.yaml before generating code, use this Skill to modify the file and then execute the update, sync, or generate commands. It ensures the codegen process targets the correct specific TypeSpec version.

What is the best way to automate syncing TypeSpec definitions for Azure SDKs?

The best way to automate syncing TypeSpec definitions for Azure SDKs is using this Skill's workflow automation capabilities. It handles the update, sync, and generation steps of the codegen process, ensuring consistency and reducing manual coding effort.

How does error reporting work when generating code from TypeSpec repositories?

Error reporting for TypeSpec code generation works by constructing direct GitHub URLs for the relevant TypeSpec repositories and directories. This mechanism helps developers quickly locate and resolve issues within the TypeSpec source definitions.

Can I use the codegen Skill to generate Java client libraries from TypeSpec?

Yes, you can use this Skill to generate Java client libraries from TypeSpec specifications. It supports pulling the required TypeSpec definitions, syncing the changes, and generating the updated Java code for new Azure service versions.

Why do I need a specific commit hash for TypeSpec code generation?

You need a specific commit hash for TypeSpec code generation to ensure your Azure SDK client library matches an exact version of the service specification. Updating the tsp-location.yaml file locks the codegen process to that specific TypeSpec repository state.