Skip to content

Enhance mpg-sdk-migration skill for autonomous build-fix operation#56706

Merged
live1206 merged 7 commits intoAzure:mainfrom
live1206:enhance-mpg-migration-skill
Mar 5, 2026
Merged

Enhance mpg-sdk-migration skill for autonomous build-fix operation#56706
live1206 merged 7 commits intoAzure:mainfrom
live1206:enhance-mpg-migration-skill

Conversation

@live1206
Copy link
Copy Markdown
Member

@live1206 live1206 commented Mar 3, 2026

Summary

Enhances the mpg-sdk-migration Copilot skill to enable autonomous operation during the build-fix loop. Copilot can now work through build errors — including spec fixes, generator fixes, and custom code additions — without asking the user, following structured decision trees.

Changes

SKILL.md

  • Phase 8 → Autonomous Build-Fix Loop: Rewrote as a concrete algorithm with:
    • Loop protocol with entry/exit conditions and attempt counters to prevent infinite loops
    • Error classification algorithm (decision tree for root cause without asking user)
    • Priority ordering (fix high-cascade errors first: renames → accessibility → naming rules)
    • Spec fix vs SDK custom code vs generator fix decision tree
    • Batch fix strategy: collect all spec fixes → regenerate once → batch custom code → rebuild
    • Escalation criteria (when to stop and ask the user)
  • Generator Fix Workflow: RegenSdkLocal.ps1 regeneration + cleanup of stale custom code workarounds
  • Autonomous Rename Resolution Strategy: Extract old API names from api/*.cs, compare with generated names, filter out automatic renames, add only missing @@clientName decorators
  • Safety Rules: Autonomous mode permits client.tsp spec changes and custom code additions without asking; clear escalation boundaries for non-client.tsp changes
  • Discovery Phase: Added steps to snapshot old API surface, extract autorest renames, identify custom code folder convention
  • Removed duplicate fix recipes — references error-reference.md instead
  • Fixed skill name references — corrected azure-sdk-pr-reviewazure-sdk-mgmt-pr-review (4 occurrences)
  • Comprehensive auto-naming transform documentation — replaced vague "a few transforms" with structured list:
    • Model/property suffixes: UrlUri, EtagETag
      Created, DeletionDeleted, ExpirationExpire, ModificationModified)
    • Full RP prefix list (17 types: Sku, SkuName, SkuTier, SkuFamily, SkuInformation, Plan, Usage, Kind, PrivateEndpointConnection, PrivateLinkResource, etc.)
    • Resource update model naming ({Resource}Patch / {Resource}CreateOrUpdateContent)
  • Added @@alternateType decorator throughout: Phase 3 directive mapping, Phase 8 error classification/decision tree, sub-agent strategy, safety rules
  • Fixed RegenSdkLocal.ps1 syntax — added missing -Services named parameter
  • Refined ApiCompat classificationTypesMustExist can be fixed spec-side with @@clientName when the type was just renamed; only truly changed APIs need custom code shims
  • Clarified when [CodeGenType]/[CodeGenSuppress]/[CodeGenMember] are needed — plain partial classes do not need any attributes; each attribute has a specific use case

error-reference.md (342 → ~65 lines)

  • Replaced verbose per-error tutorials with concise decision tables — Copilot already knows what CS0234 means; the file now only contains migration-specific diagnosis and Azure SDK fix patterns
  • Build Error → Root Cause table mapping each error code to its mgmt-migration-specific fix
  • ApiCompat Error → Fix table
  • Generator Bug Detection checklist and fix-vs-workaround decision
  • Condensed pitfalls list with comprehensive auto-transform reference
  • Added @@alternateType for CS1729/CS1503 type mismatch errors
  • Refined ApiCompat diagnosis rules — spec-side vs custom code distinction

live1206 and others added 3 commits March 3, 2026 07:31
- Rewrite Phase 8 as Autonomous Build-Fix Loop with decision trees
  for error classification, fix selection, and batch strategy
- Add autonomous fix recipes for each error pattern (CS0234, CS0051,
  CS0246, CS0111, CS1729, AZC0030, AZC0032, CS0535, CS0115)
- Add autonomous rename resolution strategy using old API surface
- Add generator bug detection checklist and fix vs workaround decision
- Add batch fix strategy to minimize regeneration cycles
- Add SQL error tracking with attempt counters and escalation criteria
- Update safety rules: autonomous mode permits spec and custom code
  changes without asking; define clear escalation boundaries
- Enhance Discovery phase: snapshot old API, extract autorest renames,
  identify custom code folder convention
- Add ApiCompat autonomous fix recipes with code examples
- Consistent @@clientName namespace syntax across both files

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
After a generator fix is applied and code is regenerated with
RegenSdkLocal.ps1, any custom code workarounds previously added for
the same issue must be cleaned up. Stale workarounds cause CS0111
(duplicate definition) or silently override correct generated code.

Updated in SKILL.md:
- Fix Recipe: Generator Bug - explicit cleanup step with instructions
- Sub-Agent Strategy - added cleanup agent step after generator regen

Updated in error-reference.md:
- Added pitfall Azure#17 about cleaning up stale custom workarounds

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ecific logic

error-reference.md: 342→63 lines. Replaced verbose per-error tutorials with
concise decision tables mapping errors to migration-specific root causes and
Azure SDK fix patterns. Copilot already knows what CS0234 means — it only
needs the mgmt-migration-specific diagnosis (e.g., 'missing @@clientName').

SKILL.md: 660→590 lines. Removed duplicate fix recipes that were already
in error-reference.md. Kept classification algorithm, decision tree, and
generator fix workflow. Added cross-reference to error-reference.md.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@live1206 live1206 marked this pull request as ready for review March 3, 2026 08:27
Copilot AI review requested due to automatic review settings March 3, 2026 08:27
@live1206 live1206 marked this pull request as draft March 3, 2026 08:42
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

live1206 and others added 2 commits March 3, 2026 09:09
- Corrected what the mgmt emitter actually auto-handles: only Url→Uri,
  DateTime→On, Etag→ETag, and RP prefix for Sku/Plan/Usage/Kind.
  Removed false claims about Is* booleans, general acronym casing.
- Removed misleading 'filter out automatic renames' step — if the
  generator handles it, there's no error to filter.
- For all name mismatches, prefer @@clientName in spec over custom code.
- Added operation diagnosis: check HTTP path and resource/extension
  scope to distinguish generator bugs from spec updates.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Plain partial classes need no attributes for adding new members
- [CodeGenType] only when custom class name differs from spec name
- [CodeGenSuppress] only when replacing a specific generated member
- [CodeGenMember] only when custom property name differs from generated

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@live1206 live1206 marked this pull request as ready for review March 3, 2026 10:32
@live1206 live1206 requested a review from Copilot March 5, 2026 02:06
…x RegenSdkLocal syntax

- Expand auto-naming transform documentation with full RP prefix list,
  At→On suffix, word stem transforms, resource update model naming
- Add @@alternateType decorator throughout: Phase 3 directive mapping,
  Phase 8 error classification, decision tree, sub-agent strategy,
  safety rules, and error-reference.md
- Fix RegenSdkLocal.ps1 invocations to use named -Services parameter
  (lines 129/133 in iteration cycle section)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

…eferences

- ApiCompat TypesMustExist can be fixed spec-side with @@clientName when
  the type was just renamed; only truly changed APIs need custom code shims
- Fix skill name azure-sdk-pr-review → azure-sdk-mgmt-pr-review (4 refs)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@live1206 live1206 merged commit fd5d7d6 into Azure:main Mar 5, 2026
12 checks passed
@live1206 live1206 deleted the enhance-mpg-migration-skill branch March 5, 2026 05:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants