-
Notifications
You must be signed in to change notification settings - Fork 241
Add customization workflow to generate-sdk-locally skill #14821
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
samvaity
merged 3 commits into
main
from
savaity/add-customization-to-generate-sdk-skill
Apr 1, 2026
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 76 additions & 0 deletions
76
.github/skills/generate-sdk-locally/references/customization-workflow.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| # TypeSpec Customization Workflow | ||
|
|
||
| The customization workflow is an AI-assisted process that applies TypeSpec decorators and code repairs to ensure SDK functionality. It uses a two-phase approach: **Phase A** applies `client.tsp` decorators (~80% of issues), **Phase B** applies code-level repairs when builds still fail (~10%), and the remaining ~10% receive manual guidance. | ||
|
|
||
| ## Entry Points | ||
|
|
||
| The customization tool (`azure-sdk-mcp:azsdk_customized_code_update`) can be triggered from multiple sources: | ||
|
|
||
| | Entry Point | Description | Example | | ||
| |-------------|-------------|---------| | ||
| | **Build failures** | Compilation errors, analyzer violations, linting failures after SDK generation | `error CS0246: The type or namespace name 'FooModel' could not be found` | | ||
| | **Breaking changes** | Output from breaking changes analysis tools detecting renamed/removed properties, changed types | `Breaking changes detected: FooOptions.timeout property type changed from int to Duration` | | ||
| | **User prompts** | Natural language requests to modify SDK behavior | "Rename FooClient to BarClient for .NET" | | ||
| | **API review feedback** | Feedback from APIView or PR comments on SDK naming/structure | "Model name doesn't follow .NET casing conventions" | | ||
| | **.NET analyzer errors** | AZC0030 (naming violations), AZC0012 (generic type names), etc. | `AZC0030: Model name ends with 'Parameters'` | | ||
| | **Customization drift** | Existing customization code references renamed/removed TypeSpec entities | `cannot find symbol: method getField(String)` | | ||
| | **Duplicate field conflicts** | TypeSpec adds a property that already exists in manual customization code | `variable operationId is already defined in class AnalyzeOperationDetails` | | ||
|
|
||
| ## When to Use | ||
|
|
||
| - Build fails after `azure-sdk-mcp:azsdk_package_build_code` with compilation errors | ||
| - Type name conflicts with reserved keywords or existing types | ||
| - Breaking changes from spec updates (renamed/removed properties, changed types) | ||
| - API surface changes that require `client.tsp` customizations | ||
| - .NET analyzer violations (AZC0030, AZC0012, etc.) | ||
| - Renaming clients, models, or operations for specific language SDKs | ||
| - Hiding internal operations from public SDK APIs | ||
| - Restructuring client architecture (e.g., creating subclients) | ||
| - Customization files reference entities that no longer exist after TypeSpec regeneration | ||
| - Duplicate fields between generated code and manual customization code | ||
|
|
||
| ## Customization Steps | ||
|
|
||
| 1. **Capture context** — Collect the build error output, user request, or API review feedback. | ||
| 2. **Apply customization** — Run `azure-sdk-mcp:azsdk_customized_code_update` with the error/request context. The tool handles the full workflow internally: | ||
| - Classifies the request (TypeSpec fix, code patch, or manual guidance) | ||
| - Applies `client.tsp` decorators (Phase A) | ||
| - Regenerates the SDK automatically | ||
|
samvaity marked this conversation as resolved.
|
||
| - Builds to validate | ||
| - If build still fails and customization files exist, applies code patches (Phase B) | ||
|
ronniegeraghty marked this conversation as resolved.
|
||
| - Regenerates again (Java) and rebuilds | ||
| 3. **Validate** — Run `azure-sdk-mcp:azsdk_package_run_check` and `azure-sdk-mcp:azsdk_package_run_tests` to verify no regressions. | ||
| 4. **Review changes** — The tool leaves all changes uncommitted. Review with `git status`/`git diff` across both repos. | ||
|
|
||
| ## Common Scenarios | ||
|
|
||
| | Scenario | Phase | Customization | | ||
| |----------|-------|--------------| | ||
| | Type name conflict with reserved keyword | A | Rename via `@@clientName` in `client.tsp` | | ||
| | Property renamed in new API version | A | Add `@@clientName` to preserve backward compatibility | | ||
| | .NET analyzer error (AZC0030, AZC0012) | A | Apply scoped `@@clientName` decorators to fix naming violations | | ||
| | Hide internal operation from SDK | A | Apply `@@access` decorator with language scope | | ||
| | Create subclient architecture | A | Use `@client` and `@clientInitialization` decorators | | ||
| | API review naming feedback | A | Apply scoped `@@clientName` for specific language | | ||
| | Duplicate field from customization conflict | B | Remove duplicate `addField()` from customization class | | ||
| | Customization references renamed property | B | Update references in `_patch.py`, `*Customization.java`, or partial classes | | ||
| | Feature request with no TypeSpec solution | Manual | Tool provides guidance to create customization infrastructure | | ||
|
|
||
| ## Two-Phase Workflow | ||
|
|
||
| **Phase A — TypeSpec Customizations:** | ||
| Apply `client.tsp` decorators (e.g., `@@clientName`, `@@access`, `@client`), regenerate SDK, validate build. Handles ~80% of issues. | ||
|
|
||
| **Phase B — Code Customizations:** | ||
| Activates automatically when Phase A build fails AND customization files exist (Java: `*Customization.java`, Python: `*_patch.py`, .NET: partial classes). Applies mechanical code repairs: duplicate removal, reference updates, import fixes. Handles ~10% of issues. | ||
|
|
||
| **Manual Guidance:** | ||
| When neither phase resolves the issue, or no customization files exist, the tool returns structured guidance for manual implementation. | ||
|
|
||
| ## Retry Logic | ||
|
|
||
| The tool handles retries internally with a two-pass classification approach: | ||
| 1. First pass: classify feedback → apply TypeSpec fixes → regenerate → build | ||
| 2. Second pass: re-classify remaining items with build error context → apply code patches → rebuild | ||
| 3. If the tool response indicates build still failing, you can re-run `azure-sdk-mcp:azsdk_customized_code_update` with the updated error output | ||
| 4. Max 2 attempts per phase (4 total iterations within the tool) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
.github/skills/generate-sdk-locally/tasks/analyzer-errors.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| id: sdk-local-analyzer-errors-001 | ||
| name: Fix .NET Analyzer Errors via Customization | ||
| description: | | ||
| Test that the skill triggers customization when .NET build fails | ||
| with analyzer errors like AZC0030 (naming violations) or AZC0012 | ||
| (generic type names). | ||
| tags: | ||
| - customization | ||
| - analyzer | ||
| - dotnet | ||
| inputs: | ||
| prompt: "The .NET SDK build is failing with analyzer errors: AZC0030 says the model name ends with 'Parameters' and AZC0012 says type name 'Tasks' is too generic. Can you fix these?" | ||
| expected: | ||
| output_contains: | ||
| - "customiz" | ||
| - "clientName" | ||
| output_excludes: | ||
| - "cannot help" | ||
| outcomes: | ||
| - type: tool_called | ||
| tool_name: azsdk_customized_code_update | ||
| behavior: | ||
| max_tool_calls: 10 | ||
|
samvaity marked this conversation as resolved.
|
||
| max_response_time_ms: 60000 | ||
26 changes: 26 additions & 0 deletions
26
.github/skills/generate-sdk-locally/tasks/breaking-changes.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| id: sdk-local-breaking-changes-001 | ||
| name: Resolve Breaking Changes After Spec Update | ||
| description: | | ||
| Test that the skill triggers customization when breaking changes | ||
| are detected after a TypeSpec specification update — properties | ||
| renamed, types changed, or customization code drifts. | ||
| tags: | ||
| - customization | ||
| - breaking-changes | ||
| - full-workflow | ||
| inputs: | ||
| prompt: "After regenerating the Java SDK, the build is failing because the service team renamed 'displayName' to 'name' in the TypeSpec. Our customization class still references getField('displayName') and it can't find the symbol. Can you fix this?" | ||
| expected: | ||
| output_contains: | ||
| - "customiz" | ||
| - "TypeSpec" | ||
| output_excludes: | ||
| - "cannot help" | ||
| outcomes: | ||
| - type: tool_called | ||
| tool_name: azsdk_customized_code_update | ||
| - type: tool_called | ||
| tool_name: azsdk_package_build_code | ||
| behavior: | ||
|
samvaity marked this conversation as resolved.
|
||
| max_tool_calls: 12 | ||
| max_response_time_ms: 120000 | ||
26 changes: 26 additions & 0 deletions
26
.github/skills/generate-sdk-locally/tasks/customization-workflow.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| id: sdk-local-customization-001 | ||
| name: Duplicate Field Conflict After TypeSpec Addition | ||
| description: | | ||
| Test that the skill triggers TypeSpec customization when SDK build | ||
| fails because TypeSpec now generates a field that already exists | ||
| in manual customization code, causing a duplicate field error. | ||
| tags: | ||
| - customization | ||
| - error-handling | ||
| - full-workflow | ||
| inputs: | ||
| prompt: "The Java SDK build is failing after regeneration. The error says 'variable operationId is already defined in class AnalyzeOperationDetails'. It looks like the service team added operationId to the TypeSpec, but our DocumentIntelligenceCustomizations.java already injects that field manually. Can you fix this?" | ||
| expected: | ||
| output_contains: | ||
| - "customiz" | ||
| - "duplicate" | ||
| output_excludes: | ||
| - "cannot help" | ||
| outcomes: | ||
| - type: tool_called | ||
| tool_name: azsdk_customized_code_update | ||
| - type: tool_called | ||
| tool_name: azsdk_package_build_code | ||
| behavior: | ||
|
samvaity marked this conversation as resolved.
|
||
| max_tool_calls: 12 | ||
| max_response_time_ms: 120000 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
.github/skills/generate-sdk-locally/tasks/hide-operation.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| id: sdk-local-hide-operation-001 | ||
| name: Hide Internal Operation from SDK | ||
| description: | | ||
| Test that the skill triggers customization when user requests | ||
| hiding an internal operation from a specific language SDK. | ||
| tags: | ||
| - customization | ||
| - user-prompt | ||
| - access-control | ||
| inputs: | ||
| prompt: "Remove the get_create_project_status polling operation from the Python SDK public API. It's an internal operation that shouldn't be exposed to users." | ||
| expected: | ||
| output_contains: | ||
| - "access" | ||
| - "client.tsp" | ||
| output_excludes: | ||
| - "cannot help" | ||
| outcomes: | ||
| - type: tool_called | ||
| tool_name: azsdk_customized_code_update | ||
| behavior: | ||
| max_tool_calls: 10 | ||
| max_response_time_ms: 60000 |
23 changes: 23 additions & 0 deletions
23
.github/skills/generate-sdk-locally/tasks/rename-client.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| id: sdk-local-rename-client-001 | ||
| name: Rename SDK Client via TypeSpec Customization | ||
| description: | | ||
| Test that the skill triggers TypeSpec customization when user | ||
| requests renaming a client or model for a specific language SDK. | ||
| tags: | ||
| - customization | ||
| - user-prompt | ||
| - typespec | ||
| inputs: | ||
| prompt: "Rename the AIProjectConnectionEntraIDCredential model to use 'Id' instead of 'ID' in the .NET SDK. This was flagged in API review." | ||
|
samvaity marked this conversation as resolved.
|
||
| expected: | ||
| output_contains: | ||
| - "clientName" | ||
| - "client.tsp" | ||
| output_excludes: | ||
| - "cannot help" | ||
| outcomes: | ||
| - type: tool_called | ||
| tool_name: azsdk_customized_code_update | ||
| behavior: | ||
| max_tool_calls: 10 | ||
| max_response_time_ms: 60000 | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.